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!E8E8E scripts.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from io import BytesIO import logging import os import re import struct import sys from .compat import sysconfig, detect_encoding, ZipFile from .resources import finder from .util import (FileOperator, get_export_entry, convert_path, get_executable, get_platform, in_venv) logger = logging.getLogger(__name__) _DEFAULT_MANIFEST = ''' '''.strip() # check if Python is called on the first line with this expression FIRST_LINE_RE = re.compile(b'^#!.*pythonw?[0-9.]*([ \t].*)?$') SCRIPT_TEMPLATE = r'''# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) ''' def enquote_executable(executable): if ' ' in executable: # make sure we quote only the executable in case of env # for example /usr/bin/env "/dir with spaces/bin/jython" # instead of "/usr/bin/env /dir with spaces/bin/jython" # otherwise whole if executable.startswith('/usr/bin/env '): env, _executable = executable.split(' ', 1) if ' ' in _executable and not _executable.startswith('"'): executable = '%s "%s"' % (env, _executable) else: if not executable.startswith('"'): executable = '"%s"' % executable return executable # Keep the old name around (for now), as there is at least one project using it! _enquote_executable = enquote_executable class ScriptMaker(object): """ A class to copy or create scripts from source scripts or callable specifications. """ script_template = SCRIPT_TEMPLATE executable = None # for shebangs def __init__(self, source_dir, target_dir, add_launchers=True, dry_run=False, fileop=None): self.source_dir = source_dir self.target_dir = target_dir self.add_launchers = add_launchers self.force = False self.clobber = False # It only makes sense to set mode bits on POSIX. self.set_mode = (os.name == 'posix') or (os.name == 'java' and os._name == 'posix') self.variants = set(('', 'X.Y')) self._fileop = fileop or FileOperator(dry_run) self._is_nt = os.name == 'nt' or ( os.name == 'java' and os._name == 'nt') self.version_info = sys.version_info def _get_alternate_executable(self, executable, options): if options.get('gui', False) and self._is_nt: # pragma: no cover dn, fn = os.path.split(executable) fn = fn.replace('python', 'pythonw') executable = os.path.join(dn, fn) return executable if sys.platform.startswith('java'): # pragma: no cover def _is_shell(self, executable): """ Determine if the specified executable is a script (contains a #! line) """ try: with open(executable) as fp: return fp.read(2) == '#!' except (OSError, IOError): logger.warning('Failed to open %s', executable) return False def _fix_jython_executable(self, executable): if self._is_shell(executable): # Workaround for Jython is not needed on Linux systems. import java if java.lang.System.getProperty('os.name') == 'Linux': return executable elif executable.lower().endswith('jython.exe'): # Use wrapper exe for Jython on Windows return executable return '/usr/bin/env %s' % executable def _build_shebang(self, executable, post_interp): """ Build a shebang line. In the simple case (on Windows, or a shebang line which is not too long or contains spaces) use a simple formulation for the shebang. Otherwise, use /bin/sh as the executable, with a contrived shebang which allows the script to run either under Python or sh, using suitable quoting. Thanks to Harald Nordgren for his input. See also: http://www.in-ulm.de/~mascheck/various/shebang/#length https://hg.mozilla.org/mozilla-central/file/tip/mach """ if os.name != 'posix': simple_shebang = True else: # Add 3 for '#!' prefix and newline suffix. shebang_length = len(executable) + len(post_interp) + 3 if sys.platform == 'darwin': max_shebang_length = 512 else: max_shebang_length = 127 simple_shebang = ((b' ' not in executable) and (shebang_length <= max_shebang_length)) if simple_shebang: result = b'#!' + executable + post_interp + b'\n' else: result = b'#!/bin/sh\n' result += b"'''exec' " + executable + post_interp + b' "$0" "$@"\n' result += b"' '''" return result def _get_shebang(self, encoding, post_interp=b'', options=None): enquote = True if self.executable: executable = self.executable enquote = False # assume this will be taken care of elif not sysconfig.is_python_build(): executable = get_executable() elif in_venv(): # pragma: no cover executable = os.path.join(sysconfig.get_path('scripts'), 'python%s' % sysconfig.get_config_var('EXE')) else: # pragma: no cover executable = os.path.join( sysconfig.get_config_var('BINDIR'), 'python%s%s' % (sysconfig.get_config_var('VERSION'), sysconfig.get_config_var('EXE'))) if not os.path.isfile(executable): # for Python builds from source on Windows, no Python executables with # a version suffix are created, so we use python.exe executable = os.path.join(sysconfig.get_config_var('BINDIR'), 'python%s' % (sysconfig.get_config_var('EXE'))) if options: executable = self._get_alternate_executable(executable, options) if sys.platform.startswith('java'): # pragma: no cover executable = self._fix_jython_executable(executable) # Normalise case for Windows - COMMENTED OUT # executable = os.path.normcase(executable) # N.B. The normalising operation above has been commented out: See # issue #124. Although paths in Windows are generally case-insensitive, # they aren't always. For example, a path containing a ẞ (which is a # LATIN CAPITAL LETTER SHARP S - U+1E9E) is normcased to ß (which is a # LATIN SMALL LETTER SHARP S' - U+00DF). The two are not considered by # Windows as equivalent in path names. # If the user didn't specify an executable, it may be necessary to # cater for executable paths with spaces (not uncommon on Windows) if enquote: executable = enquote_executable(executable) # Issue #51: don't use fsencode, since we later try to # check that the shebang is decodable using utf-8. executable = executable.encode('utf-8') # in case of IronPython, play safe and enable frames support if (sys.platform == 'cli' and '-X:Frames' not in post_interp and '-X:FullFrames' not in post_interp): # pragma: no cover post_interp += b' -X:Frames' shebang = self._build_shebang(executable, post_interp) # 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: # pragma: no cover raise ValueError( 'The shebang (%r) is not decodable from utf-8' % 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. if encoding != 'utf-8': try: shebang.decode(encoding) except UnicodeDecodeError: # pragma: no cover raise ValueError( 'The shebang (%r) is not decodable ' 'from the script encoding (%r)' % (shebang, encoding)) return shebang def _get_script_text(self, entry): return self.script_template % dict(module=entry.prefix, import_name=entry.suffix.split('.')[0], func=entry.suffix) manifest = _DEFAULT_MANIFEST def get_manifest(self, exename): base = os.path.basename(exename) return self.manifest % base def _write_script(self, names, shebang, script_bytes, filenames, ext): use_launcher = self.add_launchers and self._is_nt linesep = os.linesep.encode('utf-8') if not shebang.endswith(linesep): shebang += linesep if not use_launcher: script_bytes = shebang + script_bytes else: # pragma: no cover if ext == 'py': launcher = self._get_launcher('t') else: launcher = self._get_launcher('w') stream = BytesIO() with ZipFile(stream, 'w') as zf: zf.writestr('__main__.py', script_bytes) zip_data = stream.getvalue() script_bytes = launcher + shebang + zip_data for name in names: outname = os.path.join(self.target_dir, name) if use_launcher: # pragma: no cover n, e = os.path.splitext(outname) if e.startswith('.py'): outname = n outname = '%s.exe' % outname try: self._fileop.write_binary_file(outname, script_bytes) except Exception: # Failed writing an executable - it might be in use. logger.warning('Failed to write executable - trying to ' 'use .deleteme logic') dfname = '%s.deleteme' % outname if os.path.exists(dfname): os.remove(dfname) # Not allowed to fail here os.rename(outname, dfname) # nor here self._fileop.write_binary_file(outname, script_bytes) logger.debug('Able to replace executable using ' '.deleteme logic') try: os.remove(dfname) except Exception: pass # still in use - ignore error else: if self._is_nt and not outname.endswith('.' + ext): # pragma: no cover outname = '%s.%s' % (outname, ext) if os.path.exists(outname) and not self.clobber: logger.warning('Skipping existing file %s', outname) continue self._fileop.write_binary_file(outname, script_bytes) if self.set_mode: self._fileop.set_executable_mode([outname]) filenames.append(outname) variant_separator = '-' def get_script_filenames(self, name): result = set() if '' in self.variants: result.add(name) if 'X' in self.variants: result.add('%s%s' % (name, self.version_info[0])) if 'X.Y' in self.variants: result.add('%s%s%s.%s' % (name, self.variant_separator, self.version_info[0], self.version_info[1])) return result def _make_script(self, entry, filenames, options=None): post_interp = b'' if options: args = options.get('interpreter_args', []) if args: args = ' %s' % ' '.join(args) post_interp = args.encode('utf-8') shebang = self._get_shebang('utf-8', post_interp, options=options) script = self._get_script_text(entry).encode('utf-8') scriptnames = self.get_script_filenames(entry.name) if options and options.get('gui', False): ext = 'pyw' else: ext = 'py' self._write_script(scriptnames, shebang, script, filenames, ext) def _copy_script(self, script, filenames): adjust = False script = os.path.join(self.source_dir, convert_path(script)) outname = os.path.join(self.target_dir, os.path.basename(script)) if not self.force and not self._fileop.newer(script, outname): logger.debug('not copying %s (up-to-date)', script) return # 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 IOError: # pragma: no cover if not self.dry_run: raise f = None else: first_line = f.readline() if not first_line: # pragma: no cover logger.warning('%s is an empty file (skipping)', script) return match = FIRST_LINE_RE.match(first_line.replace(b'\r\n', b'\n')) if match: adjust = True post_interp = match.group(1) or b'' if not adjust: if f: f.close() self._fileop.copy_file(script, outname) if self.set_mode: self._fileop.set_executable_mode([outname]) filenames.append(outname) else: logger.info('copying and adjusting %s -> %s', script, self.target_dir) if not self._fileop.dry_run: encoding, lines = detect_encoding(f.readline) f.seek(0) shebang = self._get_shebang(encoding, post_interp) if b'pythonw' in first_line: # pragma: no cover ext = 'pyw' else: ext = 'py' n = os.path.basename(outname) self._write_script([n], shebang, f.read(), filenames, ext) if f: f.close() @property def dry_run(self): return self._fileop.dry_run @dry_run.setter def dry_run(self, value): self._fileop.dry_run = value if os.name == 'nt' or (os.name == 'java' and os._name == 'nt'): # pragma: no cover # Executable launcher support. # Launchers are from https://bitbucket.org/vinay.sajip/simple_launcher/ def _get_launcher(self, kind): if struct.calcsize('P') == 8: # 64-bit bits = '64' else: bits = '32' platform_suffix = '-arm' if get_platform() == 'win-arm64' else '' name = '%s%s%s.exe' % (kind, bits, platform_suffix) # Issue 31: don't hardcode an absolute package name, but # determine it relative to the current package distlib_package = __name__.rsplit('.', 1)[0] resource = finder(distlib_package).find(name) if not resource: msg = ('Unable to find resource %s in package %s' % (name, distlib_package)) raise ValueError(msg) return resource.bytes # Public API follows def make(self, specification, options=None): """ Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. """ filenames = [] entry = get_export_entry(specification) if entry is None: self._copy_script(specification, filenames) else: self._make_script(entry, filenames, options=options) return filenames def make_multiple(self, specifications, options=None): """ Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, """ filenames = [] for specification in specifications: filenames.extend(self.make(specification, options)) return filenames PK!x5g99 manifest.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2013 Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. """ import fnmatch import logging import os import re import sys from . import DistlibException from .compat import fsdecode from .util import convert_path __all__ = ['Manifest'] logger = logging.getLogger(__name__) # a \ followed by some spaces + EOL _COLLAPSE_PATTERN = re.compile('\\\\w*\n', re.M) _COMMENTED_LINE = re.compile('#.*?(?=\n)|\n(?=$)', re.M | re.S) # # Due to the different results returned by fnmatch.translate, we need # to do slightly different processing for Python 2.7 and 3.2 ... this needed # to be brought in for Python 3.6 onwards. # _PYTHON_VERSION = sys.version_info[:2] class Manifest(object): """A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. """ def __init__(self, base=None): """ Initialise an instance. :param base: The base directory to explore under. """ self.base = os.path.abspath(os.path.normpath(base or os.getcwd())) self.prefix = self.base + os.sep self.allfiles = None self.files = set() # # Public API # def findall(self): """Find all files under the base and set ``allfiles`` to the absolute pathnames of files found. """ from stat import S_ISREG, S_ISDIR, S_ISLNK self.allfiles = allfiles = [] root = self.base stack = [root] pop = stack.pop push = stack.append while stack: root = pop() names = os.listdir(root) for name in names: fullname = os.path.join(root, name) # Avoid excess stat calls -- just one will do, thank you! stat = os.stat(fullname) mode = stat.st_mode if S_ISREG(mode): allfiles.append(fsdecode(fullname)) elif S_ISDIR(mode) and not S_ISLNK(mode): push(fullname) def add(self, item): """ Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. """ if not item.startswith(self.prefix): item = os.path.join(self.base, item) self.files.add(os.path.normpath(item)) def add_many(self, items): """ Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. """ for item in items: self.add(item) def sorted(self, wantdirs=False): """ Return sorted files in directory order """ def add_dir(dirs, d): dirs.add(d) logger.debug('add_dir added %s', d) if d != self.base: parent, _ = os.path.split(d) assert parent not in ('', '/') add_dir(dirs, parent) result = set(self.files) # make a copy! if wantdirs: dirs = set() for f in result: add_dir(dirs, os.path.dirname(f)) result |= dirs return [os.path.join(*path_tuple) for path_tuple in sorted(os.path.split(path) for path in result)] def clear(self): """Clear all collected files.""" self.files = set() self.allfiles = [] def process_directive(self, directive): """ Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands """ # 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 (dirpattern). action, patterns, thedir, dirpattern = self._parse_directive(directive) # 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': for pattern in patterns: if not self._include_pattern(pattern, anchor=True): logger.warning('no files found matching %r', pattern) elif action == 'exclude': for pattern in patterns: found = self._exclude_pattern(pattern, anchor=True) #if not found: # logger.warning('no previously-included files ' # 'found matching %r', pattern) elif action == 'global-include': for pattern in patterns: if not self._include_pattern(pattern, anchor=False): logger.warning('no files found matching %r ' 'anywhere in distribution', pattern) elif action == 'global-exclude': for pattern in patterns: found = self._exclude_pattern(pattern, anchor=False) #if not found: # logger.warning('no previously-included files ' # 'matching %r found anywhere in ' # 'distribution', pattern) elif action == 'recursive-include': for pattern in patterns: if not self._include_pattern(pattern, prefix=thedir): logger.warning('no files found matching %r ' 'under directory %r', pattern, thedir) elif action == 'recursive-exclude': for pattern in patterns: found = self._exclude_pattern(pattern, prefix=thedir) #if not found: # logger.warning('no previously-included files ' # 'matching %r found under directory %r', # pattern, thedir) elif action == 'graft': if not self._include_pattern(None, prefix=dirpattern): logger.warning('no directories found matching %r', dirpattern) elif action == 'prune': if not self._exclude_pattern(None, prefix=dirpattern): logger.warning('no previously-included directories found ' 'matching %r', dirpattern) else: # pragma: no cover # This should never happen, as it should be caught in # _parse_template_line raise DistlibException( 'invalid action %r' % action) # # Private API # def _parse_directive(self, directive): """ Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns """ words = directive.split() if len(words) == 1 and words[0] not in ('include', 'exclude', 'global-include', 'global-exclude', 'recursive-include', 'recursive-exclude', 'graft', 'prune'): # no action given, let's use the default 'include' words.insert(0, 'include') action = words[0] patterns = thedir = dir_pattern = None if action in ('include', 'exclude', 'global-include', 'global-exclude'): if len(words) < 2: raise DistlibException( '%r expects ...' % action) patterns = [convert_path(word) for word in words[1:]] elif action in ('recursive-include', 'recursive-exclude'): if len(words) < 3: raise DistlibException( '%r expects ...' % action) thedir = convert_path(words[1]) patterns = [convert_path(word) for word in words[2:]] elif action in ('graft', 'prune'): if len(words) != 2: raise DistlibException( '%r expects a single ' % action) dir_pattern = convert_path(words[1]) else: raise DistlibException('unknown action %r' % action) return action, patterns, thedir, dir_pattern def _include_pattern(self, pattern, anchor=True, prefix=None, is_regex=False): """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. """ # XXX docstring lying about what the special chars are? found = False pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex) # delayed loading of allfiles list if self.allfiles is None: self.findall() for name in self.allfiles: if pattern_re.search(name): self.files.add(name) found = True return found def _exclude_pattern(self, pattern, anchor=True, prefix=None, is_regex=False): """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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions """ found = False pattern_re = self._translate_pattern(pattern, anchor, prefix, is_regex) for f in list(self.files): if pattern_re.search(f): self.files.remove(f) found = True return found def _translate_pattern(self, pattern, anchor=True, prefix=None, is_regex=False): """Translate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). """ if is_regex: if isinstance(pattern, str): return re.compile(pattern) else: return pattern if _PYTHON_VERSION > (3, 2): # ditch start and end characters start, _, end = self._glob_to_re('_').partition('_') if pattern: pattern_re = self._glob_to_re(pattern) if _PYTHON_VERSION > (3, 2): assert pattern_re.startswith(start) and pattern_re.endswith(end) else: pattern_re = '' base = re.escape(os.path.join(self.base, '')) if prefix is not None: # ditch end of pattern character if _PYTHON_VERSION <= (3, 2): empty_pattern = self._glob_to_re('') prefix_re = self._glob_to_re(prefix)[:-len(empty_pattern)] else: prefix_re = self._glob_to_re(prefix) assert prefix_re.startswith(start) and prefix_re.endswith(end) prefix_re = prefix_re[len(start): len(prefix_re) - len(end)] sep = os.sep if os.sep == '\\': sep = r'\\' if _PYTHON_VERSION <= (3, 2): pattern_re = '^' + base + sep.join((prefix_re, '.*' + pattern_re)) else: pattern_re = pattern_re[len(start): len(pattern_re) - len(end)] pattern_re = r'%s%s%s%s.*%s%s' % (start, base, prefix_re, sep, pattern_re, end) else: # no prefix -- respect anchor flag if anchor: if _PYTHON_VERSION <= (3, 2): pattern_re = '^' + base + pattern_re else: pattern_re = r'%s%s%s' % (start, base, pattern_re[len(start):]) return re.compile(pattern_re) def _glob_to_re(self, 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'((?Gddde?Z@Gddde@ZAGddde@ZBGddde?ZCGddde@ZDGddde@ZEGdd d e@ZFGd!d"d"e@ZGGd#d$d$e@ZHeHeFeDd%d&d'd(d)ZIeIjJZJGd*d+d+e?ZKdS)-N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)MetadataMetadataInvalidError)cached_property ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.org/pypicCs>|dur t}t|dd}z|W|dS|d0dS)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. N@timeoutclose) DEFAULT_INDEXr list_packages)urlclientr,/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/locators.pyget_all_distribution_names)s  r.c@s$eZdZdZddZeZZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c Csd}dD]}||vr||}q"q|dur.dSt|}|jdkrnt||}t|drf|||n|||<t||||||S)N)locationurireplace_header)rschemer get_full_urlhasattrr3BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersnewurlkeyurlpartsr,r,r-r8@s   zRedirectHandler.http_error_302N)__name__ __module__ __qualname____doc__r8http_error_301http_error_303http_error_307r,r,r,r-r/7sr/c@seZdZdZdZdZdZdZedZd)dd Z d d Z d d Z ddZ ddZ ddZee eZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd*d'd(ZdS)+LocatorzG A base class for locators - things that locate distributions. )z.tar.gzz.tar.bz2z.tarz.zipz.tgzz.tbz)z.eggz.exe.whl)z.pdfN)rJdefaultcCs,i|_||_tt|_d|_t|_dS)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher4r r/openermatcherr Queueerrors)r9r4r,r,r-__init__fs  zLocator.__init__cCsTg}|jsPz|jd}||Wn|jjyBYqYn0|jq|S)z8 Return any errors which have occurred. F)rPemptygetappendEmpty task_done)r9resulter,r,r- get_errorsys    zLocator.get_errorscCs |dS)z> Clear any errors which may have been logged. N)rYr9r,r,r- clear_errorsszLocator.clear_errorscCs|jdSN)rLclearrZr,r,r- clear_cacheszLocator.clear_cachecCs|jSr\_schemerZr,r,r- _get_schemeszLocator._get_schemecCs ||_dSr\r_)r9valuer,r,r- _set_schemeszLocator._set_schemecCs tddS)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. Please implement in the subclassNNotImplementedError)r9namer,r,r- _get_projects zLocator._get_projectcCs tddS)J Return all the distribution names known to this locator. rdNrerZr,r,r-get_distribution_namesszLocator.get_distribution_namescCsL|jdur||}n2||jvr,|j|}n|||}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N)rLrhr[)r9rgrWr,r,r- get_projects      zLocator.get_projectcCs^t|}t|j}d}|d}||j}|rBtt||j}|j dkd|j v||||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. TrJhttpszpypi.org) r posixpathbasenamepathendswithdownloadable_extensionsr#r" wheel_tagsr4netloc)r9r*trn compatibleis_wheelZis_downloadabler,r,r- score_urls   zLocator.score_urlcCsR|}|rN||}||}||kr(|}||kr@td||ntd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rwloggerdebug)r9url1url2rWs1s2r,r,r- prefer_urls   zLocator.prefer_urlcCs t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r9filename project_namer,r,r-rszLocator.split_filenamec Cs dd}d}t|\}}}}} } | dr.same_projectNzegg=z %s: version hint in fragment: %r)NN/rJzWheel not compatible: %sTr2z, cSs"g|]}dt|ddqS).N)joinlist).0vr,r,r- z8Locator.convert_url_to_download_info..)rgversionrr*python-versionzinvalid path for wheel: %szNot downloadable: %sz No match for project/version: %s)rgrrr*r %s_digest)rlower startswithrxry HASHER_HASHmatchgroupsrpr"r#rrrgrrrrpyver Exceptionwarningrqrmrnlenr)r9r*rrrWr4rsroparamsqueryfragmalgodigestZorigpathwheelincluderXrextrtrgrrr,r,r-convert_url_to_download_infosv      $       z$Locator.convert_url_to_download_infocCshd}d|vr6|d}dD]}||vr|||f}q6q|sddD]$}d|}||vr>|||f}qdq>|S)z Get a digest from a dictionary by looking at a "digests" dictionary or keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. Ndigests)sha256md5rr,)r9inforWrrr@r,r,r- _get_digest1s  zLocator._get_digestc Cs|d}|d}||vr,||}|j}nt|||jd}|j}|||_}|d}||d|<|j|dkr||j||_|d|t  |||_ |||<dS)z Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. rgrr4r*rurlsN) popmetadatarr4rr source_urlr~ setdefaultsetaddlocator) r9rWrrgrdistmdrr*r,r,r-_update_version_dataHs   zLocator._update_version_dataFc Csd}t|}|dur td|t|j}||j|_}td|t|j | |j }t |dkrg}|j } |D]X} | dvrqxz(|| sn|s| | js|| Wqxtytd|| Yqx0qxt |dkrt||jd}|rtd ||d } || }|rv|jr$|j|_|d i| t|_i} |d i} |jD]}|| vrR| || |<qR| |_d|_|S) a Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)rrrzerror matching %s with %rr)r@zsorted list: %srrr)rrr r4rN requirementrxrytyperBrkrgrZ version_classr is_prereleaserTrrsortedr@extrasrSr download_urlsr)r9r prereleasesrWrr4rNversionsslistZvclskrdsdr*r,r,r-locate_sP           zLocator.locate)rK)F)rBrCrDrEsource_extensionsbinary_extensionsexcluded_extensionsrrrqrQrYr[r^rarcpropertyr4rhrjrkrwr~rrrrrr,r,r,r-rIVs.   JrIcs0eZdZdZfddZddZddZZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c s.tt|jfi|||_t|dd|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. r$r%N)superrrQbase_urlrr+r9r*kwargs __class__r,r-rQszPyPIRPCLocator.__init__cCst|jSri)rr+r)rZr,r,r-rjsz%PyPIRPCLocator.get_distribution_namesc Csiid}|j|d}|D]}|j||}|j||}t|jd}|d|_|d|_|d|_ |dg|_ |d|_ t |}|r|d } | d |_ || |_||_|||<|D]:} | d } || } |d |t| | |d | <qq|S) NrTrrgrlicensekeywordssummaryrr*rr)r+Zpackage_releasesZ release_urlsZ release_datarr4rgrrSrrrrrrrrrrr) r9rgrWrrrdatarrrr*rr,r,r-rhs0         zPyPIRPCLocator._get_projectrBrCrDrErQrjrh __classcell__r,r,rr-rs rcs0eZdZdZfddZddZddZZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c s$tt|jfi|t||_dSr\)rrrQrrrrr,r-rQszPyPIJSONLocator.__init__cCs tddSrizNot available from this locatorNrerZr,r,r-rjsz&PyPIJSONLocator.get_distribution_namesc Cs iid}t|jdt|}z|j|}|}t|}t |j d}|d}|d|_ |d|_ | d|_| dg|_| d |_t|}||_|d } |||j <|d D]T} | d }|j||| |j|<|d |j t||| |d |<q|d D]\} } | |j kr4qt |j d} |j | _ | | _ t| }||_||| <| D]T} | d }|j||| |j|<|d | t||| |d |<qhqWnBty}z(|jt|td|WYd}~n d}~00|S)Nrz%s/jsonrrrgrrrrrr*rZreleaseszJSON fetch failed: %s) rrr rMopenreaddecodejsonloadsrr4rgrrSrrrrrrrrrrritemsrrPputrrx exception)r9rgrWr*resprrrrrrrinfosZomdodistrXr,r,r-rhsT                "zPyPIJSONLocator._get_projectrr,r,rr-rs rc@s`eZdZdZedejejBejBZ edejejBZ ddZ edejZ e ddZd S) Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)cCs4||_||_|_|j|j}|r0|d|_dS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr*_basesearchgroup)r9rr*rr,r,r-rQ s  z Page.__init__z[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsdd}t}|j|jD]}|d}|dpX|dpX|dpX|dpX|dpX|d }|d pp|d pp|d }t|j|}t|}|j d d|}| ||fqt |dddd}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs,t|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r*r4rsrorrrr,r,r-clean4s zPage.links..cleanr2Zrel1Zrel2Zrel3Zrel4Zrel5Zrel6rzr{Zurl3cSsdt|dS)Nz%%%2xr)ordr)rr,r,r-BrzPage.links..cSs|dS)Nrr,)rtr,r,r-rFrT)r@reverse) r_hreffinditerr groupdictrrr _clean_resubrr)r9rrWrrrelr*r,r,r-links-s$  z Page.linksN)rBrCrDrErecompileISXrrrQrrrr,r,r,r-rs rcseZdZdZejdddddZdfdd Zd d Zd d Z ddZ e de j ZddZddZddZddZddZe dZddZZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. cCstjt|dS)N)fileobj)gzipGzipFilerrbr,r,r-rTrzSimpleScrapingLocator.cCs|Sr\r,rr,r,r-rUr)deflaternoneN c sptt|jfi|t||_||_i|_t|_t |_ t|_ d|_ ||_t|_t|_d|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FN)rrrQrrr& _page_cacher_seenr rO _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplockplatform_check)r9r*r&rrrr,r-rQXs     zSimpleScrapingLocator.__init__cCsFg|_t|jD]0}tj|jd}|d||j|qdS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsrangerrThread_fetch setDaemonstartrT)r9irtr,r,r-_prepare_threadsss  z&SimpleScrapingLocator._prepare_threadscCs6|jD]}|jdq|jD] }|qg|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)r rrr)r9rtr,r,r- _wait_threadss    z#SimpleScrapingLocator._wait_threadsc Csiid}|j||_||_t|jdt|}|j|j| z.t d||j ||j W|n |0|`Wdn1s0Y|S)Nrz%s/z Queueing %s)rrWrrrr rr]rrrxryrrrr)r9rgrWr*r,r,r-rhs      "z"SimpleScrapingLocator._get_projectz<\b(linux_(i\d86|x86_64|arm\w+)|win(32|_amd64)|macosx_?\d+)\bcCs |j|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r9r*r,r,r-_is_platform_dependentsz,SimpleScrapingLocator._is_platform_dependentcCsn|jr||rd}n|||j}td|||rj|j||j|Wdn1s`0Y|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s) rrrrrxryrrrW)r9r*rr,r,r-_process_downloads ,z'SimpleScrapingLocator._process_downloadc Cst|\}}}}}}||j|j|jr2d}n||jrJ||jsJd}nd||js\d}nR|dvrjd}nD|dvrxd}n6||rd}n&| ddd} | dkrd}nd}t d |||||S) z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. F)Zhomepagedownload)httprlftp:rr localhostTz#should_queue: %s (%s) from %s -> %s) rrprrrrrrrsplitrrxry) r9linkZreferrerrr4rsro_rWhostr,r,r- _should_queues.    z#SimpleScrapingLocator._should_queuec Cs|j}zz|r||}|dur4WW|jq|jD]h\}}||jvr:zB|j|||s||||rt d|||j |Wq:t yYq:0q:Wn4t y}z|j t|WYd}~n d}~00W|jn |j0|sqqdS)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)rrSget_pagerVrrrrrrxryrrrrPr)r9r*pagerrrXr,r,r-r s0         (zSimpleScrapingLocator._fetchc Cs|t|\}}}}}}|dkr:tjt|r:tt|d}||jvr`|j|}t d||n| ddd}d}||j vrt d||nt |d d id }zzt d ||j j||jd } t d|| } | dd} t| r| } | } | d}|r"|j|}|| } d}t| }|r@|d}z| |} Wntyl| d} Yn0t| | }||j| <Wnty}z&|jdkrtd||WYd}~nd}~0t y*}zNtd|||j!|j "|Wdn1s 0YWYd}~nz Fetching %sr%z Fetched %sz Content-Typer2zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosroisdirrrrrrxryrrrrMrr&rrSHTML_CONTENT_TYPErgeturlrdecodersCHARSETrrr UnicodeErrorrrr<rrrrr)r9r*r4rsrorrWrr:rr> content_typeZ final_urlrencodingdecoderrrXr,r,r-r sZ              "@&zSimpleScrapingLocator.get_pagez]*>([^<]+)= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. Z cantreplaceFT) reqtsrr\rrr frozensetrZrrW) r9r]otherproblemsZrlist unmatchedrYrNrWr,r,r-try_to_replaces$       zDependencyFinder.try_to_replaceFcCsi|_i|_i|_i|_t|p g}d|vrF|d|tgdO}t|trf|}}t d|n4|j j ||d}}|durt d|t d|d|_ t}t|g}t|g}|r|}|j} | |jvr||n"|j| } | |kr||| ||j|jB} |j} t} |r^||vr^d D]*}d |}||vr2| t|d |O} q2| | B| B}|D].}||}|sDt d ||j j ||d}|dur|s|j j |dd}|durt d ||d|fn^|j|j}}||f|jvr|||||| vrD||vrD||t d|j|D]R}|j} | |jvrv|j|t|n"|j| } | |krH||| |qHqnqt|j}|D]&}||v|_|jrt d|jqt d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:)z:test:z:build:z:dev:zpassed %s as requirement)rNzUnable to locate %rz located %sT)testbuilddevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %rZ unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)rUrSrRr_rrXrDrrxryrrr requestedrr@rWrdZ run_requiresZ meta_requiresZbuild_requiresgetattrr^rrZname_and_versionrvaluesZbuild_time_dependency)r9rZ meta_extrasrrrrbtodoZ install_distsrgraZireqtsZsreqtsZereqtsr@rXZ all_reqtsr providersr]nrrVrSr,r,r-finds                            zDependencyFinder.find)N)NF) rBrCrDrErQrWrZr\r^rdrnr,r,r,r-rP*s (rP)N)Lriorrloggingr$rmrr ImportErrorZdummy_threadingr/r2rcompatrrrrr r r r r rr7rrrrZdatabaserrrrrrutilrrrrrrrrrr r!rr"r# getLoggerrBrxrrrr)r&r(r.r/objectrIrrrrr1r<rCrGrQrrPr,r,r,r-s\    @(    G0E:zA&[PK!=mZmZmZmZmZmZmZm#Z#ddl?m&Z&mZm%Z%m Z m!Z!m)Z)m*Z*m+Z+m,Z,m-Z-erdd l?m.Z.ddl@m(Z(m'Z'm"Z"ddlAmBZ/ddl?mCZ$ddlDmBZ0ddl2Z2ddlEm3Z3ddlFmGZ4eHZ5ddl6m:Z:e8Z8zddlmIZImJZJWn6eyGdddeKZJdbddZLddZIYn0zddl mMZNWn$eyGdddeOZNYn0zdd lmPZPWn*ey<ejQejRBdfd!d"ZPYn0dd#lSmTZUeVeUd$r\eUZTn,dd%lSmWZXGd&d'd'eXZWGd(d)d)eUZTzdd*lYmZZZWneyd+d,ZZYn0z ddl[Z[Wn eydd-lm[Z[Yn0ze\Z\Wn(e]ydd.l^m_Z_d/d0Z\Yn0zej`Z`ejaZaWnFebylecpBd1Zdedd2krTd3Zend4Zed5d6Z`d7d8ZaYn0zdd9lfmgZgWnFeydd:lhmiZimjZjddlZekd;Zldd?ZgYn0zdd@lnmoZoWn eydd@lpmoZoYn0ejddAdBkre3jqZqn ddClnmqZqzddDlrmsZsWn`eyddElrmtZtzddFlumvZwWney|dcdHdIZwYn0GdJdKdKetZsYn0zddLlxmyZyWnDeyzddLlzmyZyWneydddMdNZyYn0Yn0zddOlrm{Z{Wney~zddPl|m}Z~Wn ey:ddPlm}Z~Yn0zddQlmZmZmZWneyhYn0GdRdSdSeZ{Yn0zddTlmZmZWnteyekdUejZdVdWZGdXdYdYeZdedZd[ZGd\d]d]eZGd^d_d_eZGd`dadaeOZYn0dS)f)absolute_importN)StringIO)FileType)shutil)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCst|tr|d}t|S)Nutf-8) isinstanceunicodeencode_quote)sr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/compat.pyrs  r) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalse) TextIOWrapper)rr r rrr r r) rr rrrr r!r"r#r$)rrr) filterfalse)match_hostnameCertificateErrorc@s eZdZdS)r,N)__name__ __module__ __qualname__rrrrr,`sr,c Csg}|s dS|d}|d|dd}}|d}||krNtdt||sb||kS|dkrv|dn>|d s|d r|t|n|t| d d |D]}|t|qt d d |dtj } | |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) dnhostnameZ max_wildcardsZpatspartsZleftmost remainder wildcardsfragpatrrr_dnsname_matchds*    rFcCs|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. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDsubjectAltNamerDNSNsubject commonNamerz&hostname %r doesn't match either of %s, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrFr6lenr,r<mapr4)certr@dnsnamessankeyvaluesubrrrr+s2         r+)SimpleNamespacec@seZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|j|dSN__dict__update)selfkwargsrrr__init__szContainer.__init__N)r-r.r/__doc__r^rrrrrWsrW)whichc s"dd}tjr&||r"SdS|dur>tjdtj}|sFdS|tj}tj dkrtj |vrt| dtj tjddtj}t fd d |Drg}q‡fd d |D}ng}t }|D]P}tj|}||vr|||D](} tj|| } || |r| SqqdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cSs&tj|o$t||o$tj| SrX)ospathexistsaccessisdir)fnmoderrr _access_checks zwhich.._access_checkNPATHwin32rPATHEXTc3s |]}|VqdSrX)r5endswith.0extcmdrr zwhich..csg|] }|qSrrrnrqrr rtzwhich..)rarbdirnameenvironrMdefpathr2pathsepsysplatformcurdirinsertanysetnormcaseaddr<) rrrgrbrhpathextfilesseendirnormdirthefilenamerrqrr`s8         r`)ZipFile __enter__) ZipExtFilec@s$eZdZddZddZddZdS)rcCs|j|jdSrXrY)r\baserrrr^szZipExtFile.__init__cCs|SrXrr\rrrrszZipExtFile.__enter__cGs |dSrXcloser\exc_inforrr__exit__szZipExtFile.__exit__N)r-r.r/r^rrrrrrrsrc@s$eZdZddZddZddZdS)rcCs|SrXrrrrrr$szZipFile.__enter__cGs |dSrXrrrrrr'szZipFile.__exit__cOs tj|g|Ri|}t|SrX) BaseZipFileopenr)r\argsr]rrrrr+sz ZipFile.openN)r-r.r/rrrrrrrr#sr)python_implementationcCs0dtjvrdStjdkrdStjdr,dSdS)z6Return a string identifying the Python implementation.PyPyjavaJython IronPythonCPython)rzversionrarr7rrrrr2s   r) sysconfig)CallablecCs t|tSrX)rr)objrrrcallableFsrrmbcsstrictsurrogateescapecCs:t|tr|St|tr$|ttStdt|jdSNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper-filenamerrrfsencodeZs   rcCs:t|tr|St|tr$|ttStdt|jdSr) rrrdecoderrrrr-rrrrfsdecodecs   r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|dddd}|dks*|dr.dS|dvs@|drDd S|S) z(Imitates get_normal_name in tokenizer.c.N _-rzutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)r5r:r7)orig_encencrrr_get_normal_nametsrcsz jjWnty"dYn0dd}d}fdd}fdd}|}|trnd|d d}d }|sz|gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFrcs"zWStyYdS0dS)Nrt) StopIterationr)readlinerr read_or_stops z%detect_encoding..read_or_stopcsz|d}Wn2ty@d}dur4d|}t|Yn0t|}|sTdSt|d}z t|}Wn8tydurd|}n d|}t|Yn0r|j dkrԈdurd}n d}t||d 7}|S) Nrz'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr)line line_stringmsgmatchesencodingcodec) bom_foundrrr find_cookies8         z$detect_encoding..find_cookieTrz utf-8-sig)__self__rAttributeErrorr7r)rrdefaultrrfirstsecondr)rrrrrs4    &     r)r9)r)unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtfdd}td|_td|_td|_tdi|_|S)Nc sLt|tf}|vrS|z|}W|n |0|SrX)id get_identrdiscard)r\rSresult) fillvalue repr_running user_functionrrwrappers  z=_recursive_repr..decorating_function..wrapperr.r_r-__annotations__)rgetattrr.r_r-r)rrr)rrrdecorating_functions   z,_recursive_repr..decorating_functionr)rrrrr_recursive_reprs rc@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|p ig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)r\rrrrr^szChainMap.__init__cCs t|dSrX)KeyErrorr\rSrrr __missing__szChainMap.__missing__c Cs8|jD]&}z||WSty*Yq0q||SrX)rrr)r\rSmappingrrr __getitem__s   zChainMap.__getitem__NcCs||vr||S|SrXrr\rSrrrrrM'sz ChainMap.getcCsttj|jSrX)rNrunionrrrrr__len__*szChainMap.__len__cCsttj|jSrX)iterrrrrrrr__iter__-szChainMap.__iter__cstfdd|jDS)Nc3s|]}|vVqdSrXr)romrSrrrs1rtz(ChainMap.__contains__..r~rrrrr __contains__0szChainMap.__contains__cCs t|jSrXrrrrr__bool__3szChainMap.__bool__cCsd|dtt|jS)Nz{0.__class__.__name__}({1})rK)rr<rOr4rrrrr__repr__6szChainMap.__repr__cGs|tj|g|RS)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr;szChainMap.fromkeyscCs&|j|jdg|jddRS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopyrrrrr@sz ChainMap.copycCs|jig|jRS)z;New ChainMap with a new dict followed by all previous maps.rrrrrr new_childFszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rNrrrrrparentsJszChainMap.parentscCs||jd|<dS)Nr)r)r\rSrTrrr __setitem__OszChainMap.__setitem__cCs6z|jd|=Wn ty0td|Yn0dS)Nr(Key not found in the first mapping: {!r})rrrrrrr __delitem__Rs zChainMap.__delitem__cCs0z|jdWSty*tdYn0dS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)rpopitemrrrrrrXs zChainMap.popitemcGs@z|jdj|g|RWSty:td|Yn0dS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rrN)rpoprr)r\rSrrrrr_s z ChainMap.popcCs|jddS)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrrrrrfszChainMap.clear)N)r-r.r/r_r^rrrMrrrrrr classmethodrr__copy__rpropertyrrrrrrrrrrrs.     r)cache_from_sourcecCs0|dsJ|durd}|r$d}nd}||S)Nz.pyTco)rm)rbdebug_overridesuffixrrrrpsr) OrderedDict)r)KeysView ValuesView ItemsViewc@seZdZdZddZejfddZejfddZdd Zd d Z d d Z d6ddZ ddZ ddZ ddZddZddZddZddZeZeZefdd Zd7d"d#Zd8d$d%Zd&d'Zd(d)Zed9d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S):r z)Dictionary that remembers insertion ordercOspt|dkrtdt|z |jWn4tyZg|_}||dg|dd<i|_Yn0|j|i|dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. rz$expected at most 1 arguments, got %dN)rNr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)r\rkwdsrootrrrr^s     zOrderedDict.__init__cCsF||vr6|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rr)r\rSrTZ dict_setitemrlastrrrrs  zOrderedDict.__setitem__cCs0||||j|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rr)r\rSZ dict_delitem link_prev link_nextrrrrs zOrderedDict.__delitem__ccs.|j}|d}||ur*|dV|d}qdS)zod.__iter__() <==> iter(od)rrNrr\rcurrrrrrs  zOrderedDict.__iter__ccs.|j}|d}||ur*|dV|d}qdS)z#od.__reversed__() <==> reversed(od)rrNrrrrr __reversed__s  zOrderedDict.__reversed__cCsbz@|jD]}|dd=q |j}||dg|dd<|jWntyRYn0t|dS)z.od.clear() -> None. Remove all items from od.N)r itervaluesrrrr)r\noderrrrrs  zOrderedDict.clearTcCs||s td|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=t||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrrr)rrrrr)r\rrlinkrrrSrTrrrrs   zOrderedDict.popitemcCst|S)zod.keys() -> list of keys in od)rrrrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|] }|qSrrrorSrrrrurtz&OrderedDict.values..rrrrrvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrrr!rrrrurtz%OrderedDict.items..rrrrritemsszOrderedDict.itemscCst|S)z0od.iterkeys() -> an iterator over the keys in od)rrrrriterkeysszOrderedDict.iterkeysccs|D]}||VqdS)z2od.itervalues -> an iterator over the values in odNrr\krrrrszOrderedDict.itervaluesccs|D]}|||fVqdS)z=od.iteritems -> an iterator over the (key, value) items in odNrr%rrr iteritemsszOrderedDict.iteritemscOst|dkr tdt|fn |s,td|d}d}t|dkrL|d}t|trn|D]}||||<qZn None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v rz8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrrr N)rNrrrhasattrr r#)rrr\otherrSrTrrrr[ s(       zOrderedDict.updatecCs0||vr||}||=|S||jur,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)r\rSrrrrrr,s zOrderedDict.popNcCs||vr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odrrrrr setdefault9szOrderedDict.setdefaultcCsn|si}t|tf}||vr"dSd||<z6|sFd|jjfW||=Sd|jj|fW||=S||=0dS)zod.__repr__() <==> repr(od)rrz%s()z%s(%r)N)r _get_identrr-r#)r\ _repr_runningZcall_keyrrrr@szOrderedDict.__repr__csXfddD}t}ttD]}||dq(|rLj|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrrror&rrrruPrtz*OrderedDict.__reduce__..N)varsrr rr)r\r# inst_dictr&rrr __reduce__Ns zOrderedDict.__reduce__cCs ||S)z!od.copy() -> a shallow copy of od)rrrrrrXszOrderedDict.copycCs|}|D] }|||<q |S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrTdrSrrrr\s zOrderedDict.fromkeyscCs6t|tr*t|t|ko(||kSt||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rr rNr#r__eq__r\r)rrrr3gs  zOrderedDict.__eq__cCs ||k SrXrr4rrr__ne__pszOrderedDict.__ne__cCst|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)rrrrrviewkeysuszOrderedDict.viewkeyscCst|S)z an object providing a view on od's values)rrrrr viewvaluesyszOrderedDict.viewvaluescCst|S)zBod.viewitems() -> a set-like object providing a view on od's items)rrrrr viewitems}szOrderedDict.viewitems)T)N)N)N)"r-r.r/r_r^rrrrrrrr r"r#r$rr'r[robjectr*rr+rr1rrrr3r5r6r7r8rrrrr s:         r )BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCst|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr>rL)rrrrrr;s  r;c@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsJt||}|j|}||urF|||<t|tttfvrF||_||_ |SrX) rr configuratorconvertrr=ConvertingListConvertingTupleparentrSr\rSrTrrrrrs   zConvertingDict.__getitem__NcCsLt|||}|j|}||urH|||<t|tttfvrH||_||_ |SrX) rrMr>r?rr=r@rArBrSr\rSrrTrrrrrMs  zConvertingDict.get)N)r-r.r/r_rrMrrrrr=s r=cCsDt|||}|j|}||ur@t|tttfvr@||_||_ |SrX) rrr>r?rr=r@rArBrSrDrrrrs  rc@s"eZdZdZddZdddZdS) r@zA converting list wrapper.cCsJt||}|j|}||urF|||<t|tttfvrF||_||_ |SrX) rrr>r?rr=r@rArBrSrCrrrrs   zConvertingList.__getitem__cCs<t||}|j|}||ur8t|tttfvr8||_|SrX) rrr>r?rr=r@rArB)r\idxrTrrrrrs   zConvertingList.popN)rE)r-r.r/r_rrrrrrr@s r@c@seZdZdZddZdS)rAzA converting tuple wrapper.cCsBt||}|j|}||ur>t|tttfvr>||_||_ |SrX) tuplerr>r?rr=r@rArBrSrCrrrrs   zConvertingTuple.__getitem__N)r-r.r/r_rrrrrrAsrAc@seZdZdZedZedZedZedZ edZ ddd Z e e Zd d Zd d ZddZddZddZddZddZdS)r:zQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)rpcfgcCst||_||j_dSrX)r=configr>)r\rKrrrr^s zBaseConfigurator.__init__c Cs|d}|d}z\||}|D]F}|d|7}zt||}Wq$tyh||t||}Yq$0q$|WStytdd\}}td||f}|||_ |_ |Yn0dS)zl Resolve strings to objects using standard import and attribute syntax. r0rrNzCannot resolve %r: %s) r2rimporterrr ImportErrorrzrrL __cause__ __traceback__) r\rrusedfoundrDetbvrrrresolves"       zBaseConfigurator.resolvecCs ||S)z*Default converter for the ext:// protocol.)rUr\rTrrrrHszBaseConfigurator.ext_convertcCs|}|j|}|dur&td|n||d}|j|d}|r|j|}|rn||d}nb|j|}|r|d}|j|s||}n0zt |}||}Wnt y||}Yn0|r||d}qHtd||fqH|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr>rLendrKgroups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)r\rTrestrr2rFnrrrrIs4        zBaseConfigurator.cfg_convertcCst|ts$t|tr$t|}||_nt|tsHt|trHt|}||_nzt|tslt|trlt|}||_nVt|tr|j |}|r| }|d}|j |d}|r|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr )rr=rr>r@rrArG string_typesCONVERT_PATTERNr> groupdictvalue_convertersrMr)r\rTrr2r` converterr rrrr?4s,    zBaseConfigurator.convertcsrd}t|s||}dd}tfddD}|fi|}|rn|D]\}}t|||qX|S)z1Configure an object with a user-supplied factory.z()r0Ncs g|]}t|r||fqSr)r;r.rKrrruWrtz5BaseConfigurator.configure_custom..)rrrUrr#setattr)r\rKr propsr]rrrTrrfrconfigure_customPs   z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrrGrVrrras_tuple^s zBaseConfigurator.as_tupleN)r-r.r/r_r8r;rbrWrZr[r\rd staticmethod __import__rLr^rUrHrIr?rirjrrrrr:s"     "r:)r)r)N)N) __future__rrar8rzsslrM version_infor basestringrarrtypesr file_type __builtin__builtins ConfigParser configparserZ _backportrrr r r r urllibr rrrrrrrurllib2rrrrr r!r"r#r$r%httplib xmlrpclibQueuequeuer&htmlentitydefs raw_input itertoolsr'filterr(r*iostrr) urllib.parseurllib.request urllib.error http.clientclientrequest xmlrpc.client html.parser html.entitiesentitiesinputr+r,rLrFrVrWr9r`F_OKX_OKzipfilerrr(rZBaseZipExtFiler{rrr NameErrorcollections.abcrrrrgetfilesystemencodingrrtokenizercodecsrrr;rrhtmlr9cgir collectionsrrreprlibrrimportlib.utilrimpr threadrr, dummy_thread_abcollrrrrlogging.configr:r;Ir<r=rrr@rGrArrrrs(       $,     (0        2+A              [   b w  PK!Lhh#__pycache__/metadata.cpython-39.pycnu[a ReŘ@sdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZeeZGd d d e ZGd dde ZGddde ZGddde ZgdZdZ dZ!e"dZ#e"dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+e*dZ,d Z-e.Z/e/0e%e/0e&e/0e(e/0e*e/0e,e"d!Z1d"d#Z2d$d%Z3d&d'e/DZ4d(d'e45DZ6d)Z7d*Z8d+Z9d,Z:d-Z;d.ZZ?e"d0Z@d;d2d3ZAGd4d5d5e>ZBd6ZCd7ZDd8ZEGd9d:d:e>ZFdS)Attempt to read or write metadata fields that are conflictual.Nrrrrrr src@seZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.Nrrrrrr$src@seZdZdZdS)MetadataInvalidErrorzA metadata value is invalidNrrrrrr(sr)MetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONutf-81.1z \| ) Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicense)r r!r"r#Supported-Platformr$r%r&r'r(r)r* Classifier Download-URL ObsoletesProvidesRequires)r.r/r0r,r-)r r!r"r#r+r$r%r&r'r(r) MaintainerMaintainer-emailr*r,r-Obsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-External)r5r6r7r3r8r1r2r4)r r!r"r#r+r$r%r&r'r(r)r1r2r*r,r-r3r4r5r6r7r8Private-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extra)r9r=r:r;r<)Description-Content-Typer0r/r.)r>z"extra\s*==\s*("([^"]+)"|'([^']+)')cCsZ|dkr tS|dkrtS|dkr$tS|dvrBttddtDS|dkrNtSt|dS)N1.0r1.2)1.32.1css|]}|tvr|VqdSN) _345_FIELDS).0frrr zz%_version2fieldlist..2.0) _241_FIELDS _314_FIELDSrDtuple _566_FIELDS _426_FIELDSr)versionrrr_version2fieldlistqsrPc Cs:dd}g}|D]"\}}|gddfvr,q||qgd}|D]}|tvrnd|vrn|dtd||tvrd|vr|dtd ||tvrd |vr|d td ||tvrd |vr|d td ||tvrd|vr|dkr|dtd||t vrDd|vrD|dtd|qDt |dkrR|dSt |dkrttd|t dd|vo||t }d |vo||t }d|vo||t}d|vo||t} t|t|t|t| dkrt d|s|s|s| st|vrtS|r"dS|r,d S|r6dSdS)z5Detect the best version depending on the fields used.cSs|D]}||vrdSqdS)NTFr)keysmarkersmarkerrrr _has_markersz"_best_version.._has_markerUNKNOWNN)r?rr@rArIrBr?zRemoved 1.0 due to %srzRemoved 1.1 due to %sr@zRemoved 1.2 due to %srAzRemoved 1.3 due to %srBr%zRemoved 2.1 due to %srIzRemoved 2.0 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.0/2.1 fields)itemsappendrJremoveloggerdebugrKrDrMrNlenr _314_MARKERS _345_MARKERS _566_MARKERS _426_MARKERSintr) fieldsrTrQkeyvalueZpossible_versionsZis_1_1Zis_1_2Zis_2_1Zis_2_0rrr _best_versions`              & rdcCsi|]}|dd|qS)-_)lowerreplace)rEnamerrr srjcCsi|]\}}||qSrr)rEattrfieldrrrrjrH)r6r3r5)r7)r")r#r,r.r0r/r3r5r6r8r4r+r;r=r<)r4)r&)r(r1r$r%z[^A-Za-z0-9.]+FcCs0|r$td|}td|dd}d||fS)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.re .z%s-%s) _FILESAFEsubrh)rirOZ for_filenamerrr_get_name_and_versions rqc@s eZdZdZd?ddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZd@ddZddZdd Zd!d"Zd#d$ZdAd%d&ZdBd'd(ZdCd)d*Zd+d,Zefd-d.ZdDd/d0ZdEd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!dS)FLegacyMetadataaoThe legacy metadata of a release. Supports versions 1.0, 1.1, 1.2, 2.0 and 1.3/2.1 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcCsz|||gddkrtdi|_g|_d|_||_|durH||n.|dur\||n|durv||| dS)N'path, fileobj and mapping are exclusive) count TypeError_fieldsZrequires_filesZ _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingryrrr__init__s   zLegacyMetadata.__init__cCst|j|jd<dSNr )rdrxr~rrrr} sz#LegacyMetadata.set_metadata_versioncCs|d||fdS)Nz%s: %s )write)r~rrircrrr _write_field szLegacyMetadata._write_fieldcCs ||SrC)getr~rirrr __getitem__szLegacyMetadata.__getitem__cCs |||SrC)set)r~rircrrr __setitem__szLegacyMetadata.__setitem__cCs6||}z |j|=Wnty0t|Yn0dSrC) _convert_namerxKeyError)r~ri field_namerrr __delitem__s    zLegacyMetadata.__delitem__cCs||jvp|||jvSrC)rxrrrrr __contains__s zLegacyMetadata.__contains__cCs(|tvr |S|dd}t||S)Nrerf) _ALL_FIELDSrhrg _ATTR2FIELDrrrrrr!szLegacyMetadata._convert_namecCs|tvs|tvrgSdS)NrU) _LISTFIELDS_ELEMENTSFIELDrrrr_default_value'szLegacyMetadata._default_valuecCs&|jdvrtd|Std|SdS)Nr?r )metadata_version_LINE_PREFIX_PRE_1_2rp_LINE_PREFIX_1_2r~rcrrr_remove_line_prefix,s  z"LegacyMetadata._remove_line_prefixcCs|tvr||St|dSrC)rAttributeErrorrrrr __getattr__2szLegacyMetadata.__getattr__FcCst|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.r!r")rq)r~Zfilesaferrr get_fullname=szLegacyMetadata.get_fullnamecCs||}|tvS)z+return True if name is a valid metadata key)rrrrrris_fieldCs zLegacyMetadata.is_fieldcCs||}|tvSrC)rrrrrris_multi_fieldHs zLegacyMetadata.is_multi_fieldcCs6tj|ddd}z||W|n |0dS)z*Read the metadata values from a file path.rrencodingN)codecsopenr{close)r~filepathfprrrrzLs zLegacyMetadata.readcCst|}|d|jd<tD]p}||vr(q|tvrf||}|tvrX|durXdd|D}|||q||}|dur|dkr|||q|}|r|n|d|d<dS)z,Read the metadata values from a file object.zmetadata-versionr NcSsg|]}t|dqS,)rLsplitrErcrrr arHz,LegacyMetadata.read_file..rUr%)rrxrrget_all_LISTTUPLEFIELDSr get_payload)r~Zfileobmsgrlvaluesrcbodyrrrr{Ts zLegacyMetadata.read_filecCs8tj|ddd}z|||W|n |0dS)z&Write the metadata fields to filepath.wrrN)rr write_filer)r~r skip_unknownrrrrrpszLegacyMetadata.writecCs|t|dD]}||}|r8|dgdgfvr8q|tvrV|||d|q|tvr|dkr|jdvr~|dd}n |dd}|g}|t vrd d |D}|D]}||||qqd S) z0Write the PKG-INFO format data to a file object.r rUrr%rrrz |cSsg|]}d|qSrjoinrrrrrrHz-LegacyMetadata.write_file..N) r}rPrrrrrrrhr)r~ fileobjectrrlrrcrrrrxs$   zLegacyMetadata.write_filec svfdd}|sn@t|dr:|D]}||||q$n|D]\}}|||q>|rr|D]\}}|||q^dS)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs"|tvr|r||dSrC)rrr)rbrcrrr_sets z#LegacyMetadata.update.._setrQN)hasattrrQrV)r~otherkwargsrkvrrrr|s     zLegacyMetadata.updatecCsh||}|tvs|dkrNt|ttfsNt|trHdd|dD}qzg}n,|tvrzt|ttfszt|trv|g}ng}t t j r<|d}t |j }|tvr|dur|D](}||ddstd |||qnb|tvr |dur ||s.rr!N;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r%)rr isinstancelistrLrrrrY isEnabledForloggingWARNINGr ry_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrrx)r~rirc project_nameryrrrrrsJ           zLegacyMetadata.setcCs||}||jvr*|tur&||}|S|tvr@|j|}|S|tvr|j|}|dur^gSg}|D].}|tvr~||qf||d|dfqf|S|tvr|j|}t |t r| dS|j|S)zGet a metadata field.Nrrr) rrx_MISSINGrrrrrWrrrr)r~rirsrcresvalrrrrs.         zLegacyMetadata.getc s|gg}}dD]}||vr||q|rP|gkrPdd|}t|dD]}||vrT||qT|ddkr||fSt|jfdd}t|ftjft j ffD]@\}}|D]2} | | d } | d ur|| s|d | | fqq||fS) zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are provided)r!r"zmissing required metadata: %s, )r'r(r r@cs(|D]}|ddsdSqdS)NrrFT)rr)rcrryrrare_valid_constraintssz3LegacyMetadata.check..are_valid_constraintsNzWrong value for '%s': %s) r}rWrrr ryrrrrrr) r~strictmissingwarningsrkrrra controllerrlrcrrrchecks8         zLegacyMetadata.checkcCsh|t|d}i}|D]F}|r.||jvrt|}|dkrL||||<qdd||D||<q|S)aReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). This is as per https://www.python.org/dev/peps/pep-0566/#id17. r project_urlcSsg|]}d|qSrr)rEurrrr5rHz)LegacyMetadata.todict..)r}rPrx _FIELD2ATTR)r~Z skip_missingradatarrbrrrtodict"s zLegacyMetadata.todictcCs8|ddkr$dD]}||vr||=q|d|7<dS)Nr r)r.r0r/r6r)r~ requirementsrlrrradd_requirements9s  zLegacyMetadata.add_requirementscCstt|dSr)rrPrrrrrQDszLegacyMetadata.keysccs|D] }|VqdSrCrQ)r~rbrrr__iter__Gs zLegacyMetadata.__iter__csfddDS)Ncsg|] }|qSrrrErbrrrrLrHz)LegacyMetadata.values..rrrrrrKszLegacyMetadata.valuescsfddDS)Ncsg|]}||fqSrrrrrrrOrHz(LegacyMetadata.items..rrrrrrVNszLegacyMetadata.itemscCsd|jj|j|jfS)Nz <%s %s %s>) __class__rrirOrrrr__repr__Qs zLegacyMetadata.__repr__)NNNrs)F)F)F)N)F)F)"rrrrrr}rrrrrrrrrrrrrzr{rrr|rrrrrrrQrrrVrrrrrrrs@      ,  ,  rrz pydist.jsonz metadata.jsonMETADATAc@seZdZdZedZedejZe Z edZ dZ de Zdddd Zd Zd Zedfedfe dfe dfd Zd ZdHddZedZdefZdefZdefdefeeedefeeeedefddd Z[[ddZdIddZddZed d!Z ed"d#Z!e!j"d$d#Z!dJd%d&Z#ed'd(Z$ed)d*Z%e%j"d+d*Z%d,d-Z&d.d/Z'd0d1Z(d2d3Z)d4d5d6d7d8d9d:d;dd?Z+dKdBdCZ,dDdEZ-dFdGZ.dS)Lrz The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z .{1,2047}rIz distlib (%s)r)legacy)rirOsummaryzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)rrirOr)_legacy_dataryNrscCs@|||gddkrtdd|_d|_||_|durxz|||||_Wn(tytt||d|_|Yn0nd}|rt |d}| }Wdq1s0Yn |r| }|dur|j |j d|_nbt |ts|d}zt||_||j|Wn.ty:tt||d|_|Yn0dS)Nrtru)rryrbr generatorr)rry)rvrwrrry_validate_mappingrrrvalidaterrzMETADATA_VERSION GENERATORrr decodejsonloads ValueErrorr)r~rrrryrrFrrrrs@    (    zMetadata.__init__)rirOlicensekeywordsrr6r;r=r,)r-N)r N) run_requiresbuild_requires dev_requiresZ test_requires meta_requiresextrasmodules namespacesexportscommands classifiers source_urlrc CsXt|d}t|d}||vr||\}}|jr^|durP|durHdn|}n |j|}n|durjdn|}|dvr|j||}nt}|}|jd} | r |dkr| d|}nP|dkr| d} | r| ||}n,| d } | s|jd } | r | ||}||urT|}n:||vr2t||}n"|jrH|j|}n |j|}|S) N common_keys mapped_keysrrrrr extensionsrpython.commandsrpython.detailspython.exports)object__getattribute__rrr) r~rbcommonmappedlkmakerresultrcsentineldrrrr sD            zMetadata.__getattribute__cCsH||jvrD|j|\}}|p |j|vrD||}|sDtd||fdS)Nz.'%s' is an invalid value for the '%s' property)SYNTAX_VALIDATORSrymatchr)r~rbrcrypattern exclusionsmrrr_validate_values  zMetadata._validate_valuecCs*|||t|d}t|d}||vr||\}}|jrV|durJt||j|<nf|dvrj||j|<nR|jdi}|dkr||d<n2|dkr|di}|||<n|d i}|||<nh||vrt|||nP|d krt|t r| }|r| }ng}|jr||j|<n ||j|<dS) Nrrrrrr rr r r) rr r rNotImplementedErrorr setdefault __setattr__rrrr)r~rbrcrrrrfrrrrrs<               zMetadata.__setattr__cCst|j|jdSNT)rqrirOrrrrname_and_version%szMetadata.name_and_versioncCsF|jr|jd}n|jdg}d|j|jf}||vrB|||S)Nr5providesz%s (%s))rrrrirOrW)r~rsrrrr )s  zMetadata.providescCs |jr||jd<n ||jd<dS)Nr5r )rrrrrrr 4s c Cs|jr |}ng}t|pg|j}|D]d}d|vr>d|vr>d}n8d|vrLd}n|d|v}|rv|d}|rvt||}|r$||dq$dD]F}d|} | |vr|| |jd|g}||j|||dq|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrequires)builddevtestz:%s:z %s_requires)renv) rr rrr extendrXrget_requirements) r~reqtsrr(rrincluderSrberrrr*;s2      zMetadata.get_requirementscCs|jr|S|jSrC)r _from_legacyrrrrr dictionaryeszMetadata.dictionarycCs|jr tnt|j|jSdSrC)rrr rDEPENDENCY_KEYSrrrr dependencieskszMetadata.dependenciescCs|jr tn |j|dSrC)rrrr|rrrrr1rsc Cs|d|jkrtg}|jD]"\}}||vr$||vr$||q$|rbdd|}t||D]\}}||||qjdS)NrzMissing metadata items: %sr) rrrMANDATORY_KEYSrVrWrrr) r~rryrrbrrrrrrrrys zMetadata._validate_mappingcCsB|jr.|jd\}}|s|r>td||n||j|jdS)NTz#Metadata: missing: %s, warnings: %s)rrrYrrrry)r~rrrrrrszMetadata.validatecCs(|jr|jdSt|j|j}|SdSr)rrr r INDEX_KEYS)r~rrrrrs zMetadata.todictc Cs|jr |jrJ|j|jd}|jd}dD]*}||vr.|dkrHd}n|}||||<q.|dg}|dgkrtg}||d<d }|D]*\}}||vr||rd ||ig||<q|j|d <i}i} |S) NrT)rirOrr description classifierr5rr&r))Z requires_distr)Zsetup_requires_distrr$r )rrrrrrr ) r~rZlmdrnkkwrQokauthor maintainerrrrr.s.     zMetadata._from_legacyr!r"r*r$r%r'r(r)r-) rirO)rr rrr4)rpython.projectZ project_urlsZHome)rr<contactsrri)rr<r=remailr)rr rc Csdd}|jr|jrJt}|j}|jD]t\}}t|tsV||vr||||<q.|}d}|D]2}z ||}Wqbttfyd}YqYqb0qb|r.|||<q.||j |j } ||j |j } |j rt|j |d<t| |d<t| |d<|S)NcSst}|D]|}|d}|d}|d}|D]V}|sF|sF||q.d}|rVd|}|rp|rld||f}n|}|d||fq.q |S)Nr"r#r$r6z extra == "%s"z (%s) and %sr)rraddr)entriesr+r-r"r(ZrlistrrSrrrprocess_entriess"   z,Metadata._to_legacy..process_entriesTFr=r6r;)rrrrLEGACY_MAPPINGrVrrLr IndexErrorrrrrrsorted) r~rArZnmdr7r9rfoundrZr1Zr2rrr _to_legacys2     zMetadata._to_legacyFTcCs||gddkrtd||r`|jr4|j}n|}|rP|j||dq|j||dnr|jrp|}n|j}|rt j ||ddddnBt |dd$}t j ||ddddWdn1s0YdS) Nrz)Exactly one of path and fileobj is needed)rTrt) ensure_asciiindent sort_keysrr) rvrrrrFrrr.rrdumprr)r~rrrrZ legacy_mdrrFrrrrs*   zMetadata.writecCs|jr|j|nr|jdg}d}|D]}d|vr*d|vr*|}qHq*|durfd|i}|d|n t|dt|B}t||d<dS)Nrr#r"r$r)rrrrinsertrrD)r~rralwaysentryZrsetrrrr szMetadata.add_requirementscCs*|jpd}|jpd}d|jj|j||fS)Nz (no name)z no versionz<%s %s %s (%s)>)rirOrrr)r~rirOrrrrs   zMetadata.__repr__)NNNrs)N)NN)NNFT)/rrrrrecompileZMETADATA_VERSION_MATCHERIZ NAME_MATCHERrZVERSION_MATCHERZSUMMARY_MATCHERrrrr2r3r0r __slots__rrrrZ none_listdictZ none_dictrr rrpropertyrr setterr*r/r1rrrr.rBrFrrrrrrrr[s   -+ '    *     2 r)F)Gr __future__rrr>rrrrNr6rrcompatrrr rRr utilr r rOr r getLoggerrrYrrrr__all__rrrOrrrJrKr\rDr]rNr_rMr^rrr|ZEXTRA_RErPrdrrVrrrrrrrrr rrorqrrZMETADATA_FILENAMEZWHEEL_METADATA_FILENAMEZLEGACY_METADATA_FILENAMErrrrrsx             I  jPK!wGjGj __pycache__/wheel.cpython-39.pycnu[a Re@sddlmZddlZddlZddlZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlmZmZm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,dd l-m.Z.m/Z/e 0e1Z2da3e4ed r8d Z5n*ej67d rLdZ5nej6dkr^dZ5ndZ5e8dZ9e9sdej:ddZ9de9Z;e5e9Ze8dZ?e?re?7dre?=dd@ddZ?nddZAeAZ?[Ae Bde jCe jDBZEe Bde jCe jDBZFe BdZGe Bd ZHd!ZId"ZJe jKd#krHd$d%ZLnd&d%ZLGd'd(d(eMZNeNZOGd)d*d*eMZPd+d,ZQd-d.ZReRZS[Rd1d/d0ZTdS)2)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir get_platform)NormalizedVersionUnsupportedVersionErrorpypy_version_infoppjavajycliipcppy_version_nodotz%s%spy-_.SOABIzcpython-cCsRdtg}tdr|dtdr0|dtddkrH|dd |S) Nr#Py_DEBUGd WITH_PYMALLOCmPy_UNICODE_SIZEu) VER_SUFFIXrget_config_varappendjoin)partsr8/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/wheel.py _derive_abi<s     r:zz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/cCs|SNr8or8r8r9^r?cCs|tjdS)Nr;)replaceossepr=r8r8r9r?`r@c@s6eZdZddZddZddZd dd Zd d ZdS) MountercCsi|_i|_dSr<) impure_wheelslibsselfr8r8r9__init__dszMounter.__init__cCs||j|<|j|dSr<)rErFupdate)rHpathname extensionsr8r8r9addhs z Mounter.addcCs0|j|}|D]\}}||jvr|j|=qdSr<)rEpoprF)rHrKrLkvr8r8r9removels   zMounter.removeNcCs||jvr|}nd}|Sr<)rF)rHfullnamepathresultr8r8r9 find_modulers zMounter.find_modulecCsj|tjvrtj|}nP||jvr,td|t||j|}||_|dd}t|dkrf|d|_ |S)Nzunable to find extension for %sr)rr) sysmodulesrF ImportErrorimpZ load_dynamic __loader__rsplitlen __package__)rHrRrTr7r8r8r9 load_moduleys       zMounter.load_module)N)__name__ __module__ __qualname__rIrMrQrUr^r8r8r8r9rDcs  rDc@seZdZdZdZdZd4ddZedd Zed d Z ed d Z e ddZ ddZ e ddZddZd5ddZddZddZddZd6ddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd7d,d-Zd.d/Zd0d1Zd8d2d3ZdS)9Wheelz@ Class to build and install from Wheel files (PEP 427). )rrsha256NFcCs8||_||_d|_tg|_dg|_dg|_t|_ |durRd|_ d|_ |j |_ nt|}|r|d}|d|_ |dd d |_ |d |_|j |_ ntj|\}}t|}|std ||rtj||_ ||_ |d}|d|_ |d|_ |d |_|d d|_|dd|_|dd|_dS)zB Initialise an instance using a (valid) filename. r2noneanyNdummyz0.1nmZvnr(r'ZbnzInvalid name or filename: %rr&r)Zbiar)signZ should_verifybuildverPYVERpyverabiarchrBgetcwddirnamenameversionfilename _filenameNAME_VERSION_REmatch groupdictrArSsplit FILENAME_RErabspath)rHrsriverifyr.inforpr8r8r9rIsD            zWheel.__init__cCs^|jrd|j}nd}d|j}d|j}d|j}|jdd}d|j|||||fS)zJ Build and return a filename from the various components. r'r2r)r(z%s-%s%s-%s-%s-%s.whl)rjr6rlrmrnrrrArq)rHrjrlrmrnrrr8r8r9rss     zWheel.filenamecCstj|j|j}tj|Sr<)rBrSr6rprsisfile)rHrSr8r8r9existssz Wheel.existsccs4|jD](}|jD]}|jD]}|||fVqqqdSr<)rlrmrn)rHrlrmrnr8r8r9tagss   z Wheel.tagsc Cs4tj|j|j}d|j|jf}d|}td}t |d}| |}|d dd}t dd |D}t tg} d} | D]z} zbt|| } || 8} || }t|d } | rWdWqWdn1s0YWq|tyYq|0q|| std d | Wdn1s&0Y| S) N%s-%s %s.dist-infoutf-8r Wheel-Versionr)rcSsg|] }t|qSr8int.0ir8r8r9 r@z"Wheel.metadata..)fileobjz8Invalid wheel, because metadata is missing: looked in %sz, )rBrSr6rprsrqrrcodecs getreaderrget_wheel_metadatarxtuplerr posixpathopenr KeyError ValueError)rHrKname_verinfo_dirwrapperzfwheel_metadatawv file_versionfnsrTfnmetadata_filenamebfwfr8r8r9metadatas2      4 &zWheel.metadatacCsld|j|jf}d|}t|d}||&}td|}t|}Wdn1sZ0Yt|S)NrrWHEELr) rqrrrr6rrrrdict)rHrrrrrrmessager8r8r9rs  &zWheel.get_wheel_metadatacCsJtj|j|j}t|d}||}Wdn1s<0Y|S)Nr)rBrSr6rprsrr)rHrKrrTr8r8r9r|s (z Wheel.infoc Cst|}|r||}|d|||d}}d|vrBt}nt}t|}|rfd|d}nd}||}||}nT|d}|d} |dks|| krd} n|||dd krd } nd} t| |}|S) Nspythonw r@  rr%s ) SHEBANG_RErvendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) rHdatar.rshebangZdata_after_shebangZshebang_pythonargsZcrlfZtermr8r8r9process_shebangs,       zWheel.process_shebangcCsf|dur|j}ztt|}Wnty:td|Yn0||}t|d d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64urlsafe_b64encoderstripdecode)rHrrhasherrTr8r8r9get_hash%s  zWheel.get_hashcCsjt|}ttj||}||ddft|$}|D]}||q8Wdn1s\0YdS)Nr2)listto_posixrBrSrelpathr5rwriterow)rHrecords record_pathbasepwriterrowr8r8r9 write_record0s  zWheel.write_recordc Csg}|\}}tt|j}|D]d\}} t| d} | } Wdn1sL0Yd|| } tj| } | || | fqtj |d} | || |t tj |d}| || fdS)Nrbz%s=%sRECORD) rrrrreadrrBrSgetsizer5r6rr)rHr|libdir archive_pathsrdistinforraprfrrsizer8r8r9 write_records8s   & zWheel.write_recordscCsZt|dtj8}|D]"\}}td|||||qWdn1sL0YdS)NwzWrote %s to %s in wheel)rzipfile ZIP_DEFLATEDloggerdebugwrite)rHrKrrrrr8r8r9 build_zipHs zWheel.build_zipc" s|dur i}ttfdddd}|dkrFd}tg}tg}tg}nd}tg}d g}d g}|d ||_|d ||_|d ||_ |} d|j |j f} d| } d| } g} dD] }|vrq|}t j |rt |D]\}}}|D]}tt j ||}t j ||}tt j | ||}| ||f|dkr|dst|d}|}Wdn1st0Y||}t|d}||Wdq1s0Yqqq| }d}t |D]\}}}||kr:t|D]8\}}t|}|drt j ||}||=q,q|s:Jd|D]H}t|drVq>t j ||}tt j ||}| ||fq>qt |}|D]B}|dvrtt j ||}tt j | |}| ||fqd|p|jdtd|g}|jD] \}}}|d|||fqt j |d}t|d }|d |Wdn1sd0Ytt j | d}| ||fd!d"} t| | d#} | || f| | t j |j!|j"}!|#|!| |!S)$z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Ncs|vSr<r8r=pathsr8r9r?Vr@zWheel.build..)purelibplatlibrrfalsetruerdrerlrmrnr%s.datar)rheadersscriptsr.exerwb .dist-infoz(.dist-info directory expected, not found)z.pycz.pyo)r INSTALLERZSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %sz Tag: %s-%s-%srr cSs*|d}|d}d|vr"|d7}||fS)Nrr;ri')count)trnr8r8r9sorters  zWheel.build..sorter)key)$rr IMPVERABIARCHrkgetrlrmrnrqrrrBrSisdirwalkr r6rrr5endswithrrrr enumeratelistdir wheel_versionrrsortedrrprsr)"rHrrrZlibkeyis_pureZ default_pyverZ default_abiZ default_archrrdata_dirrrrrSrootdirsfilesrrrprrrrrdnrrlrmrnrrKr8rr9buildNs   (  0      0  z Wheel.buildcCs |dS)zl Determine whether an archive entry should be skipped when verifying or installing. )r;z /RECORD.jws)r)rHarcnamer8r8r9 skip_entryszWheel.skip_entrycC Ksx|j}|d}|dd}|dd}tj|j|j}d|j|jf} d| } d| } t | t } t | d} t | d }t d }t |d }||  }||}t|}Wd n1s0Y|d dd}tdd|D}||jkr|r||j||ddkr(|d}n|d}i}||X}t|d,}|D]}|d}|||<qPWd n1s~0YWd n1s0Yt | d}t | d}t | dd}t|d}d|_tj } g}!t}"|"|_d |_zFz |D],}#|#j}$t|$tr,|$}%n |$d }%| |%rFq||%}|drxt!|#j"|dkrxt#d|%|dr|ddd\}&}'||$}|$}(Wd n1s0Y|%|(|&\})}*|*|'krt#d|$|r|%&||frt'(d |%q|%&|o,|%)d! }+|%&|rd|%d"d\})},}-tj||,t*|-}.n$|%| |fvrvqtj|t*|%}.|+s||$}|+||.Wd n1s0Ytjd#krt,|.|#j-d$?d%@|!.|.|s\|dr\t|.d&>}|$}(|%|(|&\})}/|/|*kr|6d:i}?|>s|?r|dd}@tj>|@st?d;|@|_|>@D]*\}:}<|5C||}|r|!.||5D|!|d?||5WWtEF|"Wd St0y8t'Gd@|HYn0WtEF|"n tEF|"0Wd n1sj0Yd S)Aa~ Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. If kwarg ``bytecode_hashed_invalidation`` is True, written bytecode will try to use file-hash based invalidation (PEP-552) on supported interpreter versions (CPython 2.7+). The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. warnerlib_onlyFZbytecode_hashed_invalidationrrrrrrrNrr)rcSsg|] }t|qSr8rrr8r8r9rr@z!Wheel.install..zRoot-Is-Purelibrrrstreamrr2r)dry_runTr%size mismatch for %s=digest mismatch for %szlib_only: skipping %srr;posixirzdigest mismatch on write for %sz.py)hashed_invalidationzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txt)consoleguiz %s_scriptszwrap_%sz%s:%sz [%s],zAUnable to read legacy script metadata, so cannot generate scriptsrLzpython.commandsz8Unable to read JSON metadata, so cannot generate scriptsZ wrap_consoleZwrap_guizValid script path not specifiedz%s = %srlibprefixzinstallation failed.)Ir rrBrSr6rprsrqrrrrrrrrrrxrrrrrecordrVdont_write_bytecodetempfilemkdtemp source_dir target_dirinfolist isinstancer rrstr file_sizerrr startswithrrrr copy_streamchmod external_attrr5 byte_compile Exceptionwarningbasenamemakeset_executable_modeextendr|rvaluesrsuffixflagsjsonloadrritemsr rZwrite_shared_locationsZwrite_installed_filesshutilrmtree exceptionrollback)CrHrmakerkwargsr rrZbc_hashed_invalidationrKrrr metadata_namewheel_metadata_name record_namerrbwfrrrrrrrreaderrrZdata_pfxZinfo_pfxZ script_pfxfileopZbcZoutfilesworkdirzinfor u_arcnamekindvaluerr(rZ is_scriptwhereroutfileZ newdigestZpycrZworknamer filenamesdistcommandsepZepdatarrOr,rPsconsole_scripts gui_scriptsZ script_dirscriptoptionsr8r8r9installs\        &    L        (      ,    & ,       (  .              z Wheel.installcCs8tdur4tjttddtjdd}t|atS)Nz dylib-cachez%s.%sr%) cacherBrSr6rr rV version_infor)rHrr8r8r9_get_dylib_caches zWheel._get_dylib_cachec Cstj|j|j}d|j|jf}d|}t|d}t d}g}t |d.}z| |}||} t | } |} | |} tj| j| } tj| st| | D]\}}tj| t|}tj|sd}n6t|j}tj|}||}tj|j}||k}|r(||| |||fqWdn1sN0YWntynYn0Wdn1s0Y|S)NrrZ EXTENSIONSrrT)rBrSr6rprsrqrrrrrrrr0r1rR prefix_to_dirrrmakedirsr2rr~statst_mtimedatetime fromtimestampgetinfo date_timeextractr5r)rHrKrrrrrTrrrrLrPrZ cache_baserqrdestr[Z file_timer|Z wheel_timer8r8r9_get_extensionss>             4&zWheel._get_extensionscCst|S)zM Determine if a wheel is compatible with the running system. ) is_compatiblerGr8r8r9r^szWheel.is_compatiblecCsdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr8rGr8r8r9 is_mountableszWheel.is_mountablecCstjtj|j|j}|s2d|}t||sJd|}t||t jvrbt d|nN|rtt j |nt j d||}|rtt jvrt j tt||dS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)rBrSrzr6rprsr^rr_rVrrr5insertr]_hook meta_pathrM)rHr5rKmsgrLr8r8r9mounts"   z Wheel.mountcCsrtjtj|j|j}|tjvr2td|n.r rr;..invalid entry in wheel: %rr%r r r)rBrSr6rprsrqrrrrrrrrrrxrrrrr rrrr r!rr)rHrKrrrr9r:r;rrr<rrrrrrr=rrr@rrArBrCrr(rr8r8r9r{s\     &  J       ( z Wheel.verifyc Ksdd}dd}tj|j|j}d|j|jf}d|}t|d} t} t |d} i} | D]h} | j}t |t r|}n | d }|| krqhd |vrtd || | | tj| t|}|| |<qhWd n1s0Y|| |\}}|| fi|}|r|| |\}}|r<||kr<||||d urftjd d| d\}}t|n*tj|std|tj||j}t| }tj| |}||f}||| |||||d urt||Wd n1s0Y|S)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. cSsHd}}d|tf}||vr$d|}||vr@||}t|dj}||fS)Nz%s/%sz %s/PKG-INFOrS)rr rr)path_maprrrrSrr8r8r9 get_version`s  z!Wheel.update..get_versioncSsd}z|t|}|d}|dkr*d|}nTdd||dddD}|dd7<d |d|dd d |Df}Wntytd |Yn0|rt|d }||_| t }|j ||dtd||dS)Nr'rz%s+1cSsg|] }t|qSr8r)rrJr8r8r9rrr@z8Wheel.update..update_version..rr)rz%s+%scss|]}t|VqdSr<)r rr8r8r9 ur@z7Wheel.update..update_version..z0Cannot update non-compliant (PEP-440) version %rrh)rSlegacyzVersion updated from %r to %r) rrrxr6rrrr rrrrr)rrrSupdatedrPrr7Zmdrlr8r8r9update_versionjs.         z$Wheel.update..update_versionrrrrrrfrgNz.whlz wheel-update-)r.rdirzNot a directory: %r)rBrSr6rprsrqrrrrrrrr rrr[rrmkstempcloserrr2rrr3copyfile)rHmodifierdest_dirr8rjrnrKrrr;r?rrir@rrArSZoriginal_versionr(modifiedcurrent_versionfdnewpathrrr|r8r8r9rJOs\        (        ,z Wheel.update)NFF)N)NN)F)N)r_r`ra__doc__rrrIpropertyrsr~rrrrr|rrrrrrrrOrRr]r^r_rdrer{rJr8r8r8r9rbs@ )        tn "  8rbcCsZddl}|}g}|ddkrV|ddD]}||rFt|ndq.t|}|S)Nrglibcrr))platformlibc_verrxr5isdigitrr)r|verrTrJr8r8r9_get_glibc_versions rc Cshtg}td}ttjddddD]}|d|t|gq$g}tD]*\}}}| drN|| dddqN| t dkr| dt |dg}tg}tjd krtd t}|r|\} }}} t|}| g} | d vr| d | d vr | d| dvr | d| dvr4| d| dvrH| d|dkr| D]*} d| ||| f} | tkrV|| qV|d8}qH|D]}|D]} |dt|df|| f|dkrtj dr| dd} t}t|dkr|dkr$|dt|df|d| f|dkrP|dt|df|d| f|dkr||dt|df|d| f|dt|df|d|d|d| ffqqt|D]L\}}|dt|fddf|dkr|dt|dfddfqt|D]L\}}|dd |fddf|dkr|dd |dfddfqt|S)!zG Return (pyver, abi, arch) tuples compatible with this Python. rrrr2z.abir)r%rddarwinz(\w+)_(\d+)_(\d+)_(\w+)$)i386ppcfat)rrx86_64Zfat3)ppc64rfat64)rrintel)rrrrr universalz %s_%s_%s_%slinuxZlinux_)r%z manylinux1_%s)r% zmanylinux2010_%s)r%zmanylinux2014_%szmanylinux_%s_%s_%srer&)r3rangerVrQr5r6r rYZ get_suffixesr"rxsortrr`rr|rervrr IMP_PREFIXrArr\rset)versionsmajorminorabisr.r(rTarchesr.rqrnmatchesrvrJrmr7rrrr8r8r9compatible_tagss                        " "rcCs\t|tst|}d}|dur"t}|D]0\}}}||jvr&||jvr&||jvr&d}qXq&|S)NFT)rrbCOMPATIBLE_TAGSrlrmrn)wheelrrTrrmrnr8r8r9r^s r^)N)U __future__rrrrWemailrrrYr0loggingrBrrr3rVrrr2rrcompatrrr r r Zdatabaser rr rrrutilrrrrrrrrrrrrrr getLoggerr_rrPhasattrrr|r"r4r3rQrkrrArrrxr:compile IGNORECASEVERBOSEryrurrrrrCrobjectrDrarbrrrr^r8r8r8r9s   0             #1 PPK!z#__pycache__/database.cpython-39.pycnu[a Res@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z gd Z!e"e#Z$d Z%d Z&d eddde%dfZ'dZ(Gddde)Z*Gddde)Z+Gddde)Z,Gddde,Z-Gddde-Z.Gddde-Z/e.Z0e/Z1Gdd d e)Z2d*d"d#Z3d$d%Z4d&d'Z5d(d)Z6dS)+zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter) DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.json INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc@s(eZdZdZddZddZddZdS) _CachezL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generatedselfr$/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/database.py__init__1sz_Cache.__init__cCs|j|jd|_dS)zC Clear the cache, setting it to its initial state. FN)rclearr r!r"r$r$r%r'9s  z _Cache.clearcCs2|j|jvr.||j|j<|j|jg|dS)z` Add a distribution to the cache. :param dist: The distribution to add. N)r r setdefaultkeyappendr#distr$r$r%addAs  z _Cache.addN)__name__ __module__ __qualname____doc__r&r'r-r$r$r$r%r-src@seZdZdZdddZddZdd ZeeeZd d Z d d Z ddZ e ddZ ddZddZdddZddZdddZdS)rzU Represents a set of distributions installed on a path (typically sys.path). NFcCsD|durtj}||_d|_||_t|_t|_d|_td|_ dS)a Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. NTdefault) sysr _include_dist _include_eggr_cache _cache_egg_cache_enabledr_scheme)r#r Z include_eggr$r$r%r&Os zDistributionPath.__init__cCs|jSNr8r"r$r$r%_get_cache_enabledcsz#DistributionPath._get_cache_enabledcCs ||_dSr:r;)r#valuer$r$r%_set_cache_enabledfsz#DistributionPath._set_cache_enabledcCs|j|jdS)z, Clears the internal cache. N)r6r'r7r"r$r$r% clear_cacheks zDistributionPath.clear_cachec csZt}|jD]F}t|}|dur&q |d}|r |js||jjD] }|Vq0|jrZ|jjD] }|VqNdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r8r^r`r6r valuesr5r7r+r$r$r%get_distributionss   z"DistributionPath.get_distributionscCsd}|}|js4|D]}|j|kr|}q|qnH|||jjvrZ|jj|d}n"|jr|||jjvr||jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr8r^r)r`r6rr5r7)r#rresultr,r$r$r%get_distributions    z!DistributionPath.get_distributionc csd}|durHz|jd||f}Wn"tyFtd||fYn0|D]p}t|dsltd|qP|j}|D]H}t |\}}|dur||kr|VqPqv||krv| |rv|VqPqvqPdS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string N%s (%s)zinvalid name or version: %r, %rprovideszNo "provides": %s) r9matcher ValueErrorrrhhasattrrUrVrmrmatch) r#rrernr,providedpp_namep_verr$r$r%provides_distributions*     z&DistributionPath.provides_distributioncCs(||}|durtd|||S)z5 Return the path to a resource file. Nzno distribution named %r found)rk LookupErrorget_resource_path)r#r relative_pathr,r$r$r% get_file_path!s  zDistributionPath.get_file_pathccsX|D]J}|j}||vr||}|dur>||vrR||Vq|D] }|VqFqdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)rhexportsrg)r#categoryrr,r[dvr$r$r%get_exported_entries*s   z%DistributionPath.get_exported_entries)NF)N)N)r.r/r0r1r&r<r>propertyZ cache_enabledr?r^r` classmethodrfrhrkrvrzrr$r$r$r%rKs  ,  ) rc@seZdZdZdZdZddZeddZeZ eddZ ed d Z d d Z ed dZ eddZeddZeddZeddZddZddZddZddZdS) rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. FcCsL||_|j|_|j|_|j|_d|_d|_d|_d|_t |_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) rErrir)relocatordigestextrascontextrIZ download_urlsdigests)r#rEr$r$r%r&Os zDistribution.__init__cCs|jjS)zH The source archive download URL for this distribution. )rE source_urlr"r$r$r%r`szDistribution.source_urlcCsd|j|jfS)zX A utility property which displays the name and version in parentheses. rlrrer"r$r$r%name_and_versioniszDistribution.name_and_versioncCs.|jj}d|j|jf}||vr*|||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. rl)rErmrrer*)r#plistsr$r$r%rmps  zDistribution.providescCs8|j}td|t||}t|j||j|jdS)Nz%Getting requirements from metadata %r)rrF) rErUrVZtodictgetattrrIget_requirementsrr)r#Zreq_attrmdZreqtsr$r$r%_get_requirements|s   zDistribution._get_requirementscCs |dS)N run_requiresrr"r$r$r%rszDistribution.run_requirescCs |dS)N meta_requiresrr"r$r$r%rszDistribution.meta_requirescCs |dS)Nbuild_requiresrr"r$r$r%rszDistribution.build_requirescCs |dS)N test_requiresrr"r$r$r%rszDistribution.test_requirescCs |dS)N dev_requiresrr"r$r$r%rszDistribution.dev_requiresc Cst|}t|jj}z||j}Wn4tyXtd|| d}||}Yn0|j }d}|j D]B}t |\}} ||krqjz| | }WqWqjtyYqj0qj|S)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. +could not read version %r - using name onlyrF)r rrErDrn requirementrrUwarningsplitr)rmrrq) r#reqr[rDrnrrjrsrtrur$r$r%matches_requirements,         z Distribution.matches_requirementcCs(|jrd|j}nd}d|j|j|fS)zC Return a textual representation of this instance, z [%s]r@z)rrre)r#suffixr$r$r%__repr__s zDistribution.__repr__cCs>t|t|urd}n$|j|jko8|j|jko8|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typerrer)r#otherrjr$r$r%__eq__s   zDistribution.__eq__cCst|jt|jt|jS)zH Compute hash in a way which matches the equality test. )hashrrerr"r$r$r%__hash__szDistribution.__hash__N)r.r/r0r1Zbuild_time_dependency requestedr&rr download_urlrrmrrrrrrrrrrr$r$r$r%r=s4        " rcs0eZdZdZdZdfdd ZdddZZS) rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncs tt||||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr&r dist_path)r#rEr rF __class__r$r%r&s z"BaseInstalledDistribution.__init__cCsd|dur|j}|dur"tj}d}ntt|}d|j}||}t|dd}d||fS)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str Nr@z%s==ascii%s%s) hasherhashlibmd5rrbase64urlsafe_b64encoderstripdecode)r#datarprefixrr$r$r%get_hashs   z"BaseInstalledDistribution.get_hash)N)N)r.r/r0r1rr&r __classcell__r$r$rr%rsrcseZdZdZdZd'fdd ZddZdd Zd d Ze d d Z ddZ ddZ ddZ ddZd(ddZddZe ddZd)ddZdd Zd!d"Zd#d$Zd%d&ZejZZS)*ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). sha256Nc s~g|_t||_}|dur*td||rP|jrP||jjvrP|jj|j}n|dur| t }|durt| t }|dur| t }|durtdt |ft |}t|dd}Wdn1s0Ytt|||||r|jr|j|| d}|du|_tj|d}tj|rzt|d}|d} Wdn1sf0Y| |_dS) Nzfinder unavailable for %szno %s found in %srArBr top_level.txtrbutf-8)modulesrrJrZror8r6r rErKr r r rRrSrTr rrr&r-rosrQexistsopenreadr splitlines) r#r rErFrZr[r]rsfrrr$r%r&s8    *    .zInstalledDistribution.__init__cCsd|j|j|jfS)Nz#rrer r"r$r$r%r=s zInstalledDistribution.__repr__cCsd|j|jfSNz%s %srr"r$r$r%__str__AszInstalledDistribution.__str__c Csg}|d}t|z}t|dP}|D]:}ddtt|dD}||\}}} |||| fq.Wdn1s~0YWdn1s0Y|S)a" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). rr]cSsg|]}dqSr:r$).0ir$r$r% Sz6InstalledDistribution._get_records..N)get_distinfo_resourcerRrSrTrrangelenr*) r#resultsr[r]Z record_readerrowmissingr checksumsizer$r$r% _get_recordsDs  Nz"InstalledDistribution._get_recordscCsi}|t}|r|}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )rEXPORTS_FILENAMEr)r#rjr[r$r$r%r{[s  zInstalledDistribution.exportscCsLi}|t}|rHt|}t|}Wdn1s>0Y|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. N)rrrRrSrTr)r#rjr[r]r$r$r%ris  &z"InstalledDistribution.read_exportscCsB|t}t|d}t||Wdn1s40YdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_filerrr)r#r{rfrr$r$r%rxs  z#InstalledDistribution.write_exportsc Cs|d}t|t}t|dJ}|D]4\}}||kr*|WdWdSq*Wdn1st0YWdn1s0Ytd|dS)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. rrNz3no resource file with relative path %r is installed)rrRrSrTrKeyError)r#ryr[r]Zresources_readerrelative destinationr$r$r%rxs   bz'InstalledDistribution.get_resource_pathccs|D] }|VqdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r#rjr$r$r%list_installed_filess z*InstalledDistribution.list_installed_filesFc CsRtj|d}tj|j}||}tj|d}|d}td||rRdSt|}|D]}tj |sz| drd} } nHdtj |} t |d} | | } Wdn1s0Y||s|r||rtj||}||| | fq`||rtj||}||ddfWdn1sD0Y|S)z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. r@r creating %sNz.pycz.pyoz%dr)rr rQdirname startswithrrUinforisdirrNgetsizerrrrelpathwriterow) r#pathsrdry_runbaseZbase_under_prefix record_pathwriterr hash_valuerfpr$r$r%write_installed_filess0      , 0z+InstalledDistribution.write_installed_filesc Cs0g}tj|j}|d}|D]\}}}tj|sJtj||}||krTq$tj|st||dddfq$tj |r$t tj |}|r||kr||d||fq$|r$d|vr| ddd}nd }t |d <} || |} | |kr ||d || fWd q$1s 0Yq$|S)  Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rrTFr=rrNrr)rr rrrisabsrQrr*isfilestrrrrrr) r# mismatchesrrr rrZ actual_sizerrZ actual_hashr$r$r%check_installed_filess.        4z+InstalledDistribution.check_installed_filescCsi}tj|jd}tj|rtj|ddd}|}Wdn1sR0Y|D]8}|dd\}}|dkr| |g |q`|||<q`|S) a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rr[rencodingNrr namespace) rr rQrcodecsrrrrr(r*)r#rj shared_pathrlinesliner)r=r$r$r%shared_locationss * z&InstalledDistribution.shared_locationsc Cstj|jd}td||r$dSg}dD].}||}tj||r,|d||fq,|ddD]}|d|qhtj |d d d  }| d |Wdn1s0Y|S) aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rrN)rlibheadersscriptsrz%s=%srr$z namespace=%srrr ) rr rQrUrrr*getrrwrite) r#rrrrr)r nsrr$r$r%write_shared_locationss  .z,InstalledDistribution.write_shared_locationscCsF|tvrtd||jft|j}|dur.set_name_and_version) r rr8r7rErre _get_metadatar-rrr&)r#r rFr rErr$r%r&bs   zEggInfoDistribution.__init__csd}ddfdd}d}}|drtj|rtj|d}tj|d}t|dd }tj|d } tj|d }|| }nnt|} t| d  d } t| dd}z,| d} | d d}| d}Wnt yd}Yn0nf|drNtj|r@tj|d } || }tj|d}tj|d }t|dd }n t d||rj| ||dur|durtj|rt|d} |  d}Wdn1s0Y|sg}n|}||_|S)NcSsg}|}|D]}|}|dr6td|qt|}|sPtd|q|jr`td|jst||j qd dd|jD}|d|j |fq|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedz, css|]}d|VqdS)rNr$)rcr$r$r% rzQEggInfoDistribution._get_metadata..parse_requires_data..rl) rstriprrUrr r constraintsr*rrQ)rreqsrrr[Zconsr$r$r%parse_requires_datazs(   z>EggInfoDistribution._get_metadata..parse_requires_datacsZg}z>t|dd}|}Wdn1s60YWntyTYn0|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. r[rN)rrrIOError)req_pathrrrr$r%parse_requires_paths. z>EggInfoDistribution._get_metadata..parse_requires_pathrHzEGG-INFOzPKG-INFOrA)r rDz requires.txtrzEGG-INFO/PKG-INFOutf8rBzEGG-INFO/requires.txtzEGG-INFO/top_level.txtrrGz,path must end with .egg-info or .egg, got %rr)rNrr rrQr zipimport zipimporterrget_datarrrZadd_requirementsrrrrr)r#r requiresrZtl_pathZtl_datars meta_pathrErZzipfrCrrr$rr%rwsX              .z!EggInfoDistribution._get_metadatacCsd|j|j|jfS)Nz!rr"r$r$r%rs zEggInfoDistribution.__repr__cCsd|j|jfSrrr"r$r$r%rszEggInfoDistribution.__str__cCs`g}tj|jd}tj|r\|D]2\}}}||kr._md5cSs t|jSr:)rstatst_size)r r$r$r%_sizesz7EggInfoDistribution.list_installed_files.._sizer r[rrzNon-existent file: %srN) rr rQrrrrnormpathrUrrNrr*)r#r$r'rrjrrrsr$r$r%rs"     8z(EggInfoDistribution.list_installed_filesFccstj|jd}tj|rd}tj|dddj}|D]T}|}|dkrPd}q6|s6tjtj|j|}||jr6|r|Vq6|Vq6Wdn1s0YdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths r Tr[rrz./FN) rr rQrrrrr(r)r#absoluterskiprrrsr$r$r%r s   z'EggInfoDistribution.list_distinfo_filescCst|to|j|jkSr:)r_rr r r$r$r%r.s  zEggInfoDistribution.__eq__)N)F)r.r/r0r1rrr&rrrrrr rr rrr$r$rr%rYsZ& rc@s^eZdZdZddZddZdddZd d Zd d ZdddZ dddZ ddZ ddZ dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dSr:)adjacency_list reverse_listrr"r$r$r%r&IszDependencyGraph.__init__cCsg|j|<g|j|<dS)zAdd the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` N)r,r-)r# distributionr$r$r%add_distributionNs z DependencyGraph.add_distributionNcCs6|j|||f||j|vr2|j||dS)aAdd an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` N)r,r*r-)r#xylabelr$r$r%add_edgeXs zDependencyGraph.add_edgecCs&td|||j|g|dS)a Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` z %s missing %rN)rUrVrr(r*)r#r.rr$r$r% add_missinggszDependencyGraph.add_missingcCsd|j|jfSrrr+r$r$r% _repr_distrszDependencyGraph._repr_distrcCs||g}|j|D]h\}}||}|dur|d|j|jfq>q|st|dkr|d|d|d|D]}|d |j|d q|d |d dS) a9Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` zdigraph dependencies { rNz"%s" -> "%s" [label="%s"] z "%s" -> "%s" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rz} )rr,itemsrr*r)r#rZskip_disconnected disconnectedr,adjsrr2r$r$r%to_dots(          zDependencyGraph.to_dotcsg}i}|jD]\}}|dd||<qgt|ddD]\}}|sD|||=qDshq|D]\}}fdd|D||<qptdddD|q,|t|fS)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. Ncs g|]\}}|vr||fqSr$r$)rr}r[ to_remover$r%rrz4DependencyGraph.topological_sort..zMoving to result: %scSsg|]}d|j|jfqS)rlr)rr}r$r$r%rr)r,r;listr*rUrVr7keys)r#rjalistkr~r$r?r%topological_sorts$   z DependencyGraph.topological_sortcCs2g}|jD]\}}|||qd|S)zRepresentation of the graphr)r,r;r*r6rQ)r#r9r,r=r$r$r%rszDependencyGraph.__repr__)N)r)T) r.r/r0r1r&r/r3r4r5r6r>rErr$r$r$r%r+9s   r+r2c CsRt|}t}i}|D]L}|||jD]6}t|\}}td|||||g||fq*q|D]}|j |j B|j B|j B}|D]} z| | } Wn4tytd| | d}| |} Yn0| j}d} ||vr:||D]L\}} z| |} Wntyd} Yn0| r||| | d} q:q| s||| qqh|S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %srrFT)rr+r/rmrrUrVr(r*rrrrrnrrrr)rqr3r4)distsrDgraphrrr,rsrrerrrnmatchedproviderrqr$r$r% make_graphsN        rJcCsv||vrtd|jt|}|g}|j|}|rh|}|||j|D]}||vrN||qNq.|d|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested 1given distribution %r is not a member of the listr)rrrJr-popr*)rFr,rGdeptodor}succr$r$r%get_dependent_distss   rPcCsn||vrtd|jt|}g}|j|}|rj|d}|||j|D]}||vrP||qPq,|S)zRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested rKr)rrrJr,rLr*)rFr,rGrrNr}predr$r$r%get_required_distss   rRcKs8|dd}tfi|}||_||_|p,d|_t|S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summary)rLr rrerSr)rrekwargsrSrr$r$r% make_dist2s   rU)r2)7r1 __future__rrrrRrloggingrrPr3rr@rrcompatrrerrrEr r r r utilr rrrrrr__all__ getLoggerr.rUrZCOMMANDS_FILENAMErrOr rrrrrrrWrXr+rJrPrRrUr$r$r$r%sT  $ s7J] 6PK!UGw__pycache__/util.cpython-39.pycnu[a Re@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZz ddlZWneydZYn0ddlZddlZddlZddlZddlZz ddlZWneyddlZYn0ddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e 1e2Z3e 4dZ5e 4dZ6e 4d Z7e 4d Z8e 4d Z9e 4d Z:e 4d Z;e 4dZddZ?ddZ@ddZAdddZBddZCddZDdd ZEejFd!d"ZGejFd#d$ZHejFdd&d'ZIGd(d)d)eJZKd*d+ZLGd,d-d-eJZMd.d/ZNGd0d1d1eJZOe 4d2e jPZQd3d4ZRdd5d6ZSd7d8ZTd9d:ZUd;d<ZVd=d>ZWd?d@ZXe 4dAe jYZZe 4dBZ[ddCdDZ\e 4dEZ]dFdGZ^dHdIZ_dJdKZ`dLZadMdNZbdOdPZcGdQdRdReJZdGdSdTdTeJZeGdUdVdVeJZfdWZgddYdZZhd[d\Zid]ZjGd^d_d_eJZke 4d`Zle 4daZme 4dbZndcddZdedfZoerddglmpZqmrZrmsZsGdhdidie$jtZtGdjdkdkeqZpGdldmdmepe'ZuejvddnZwewdokrGdpdqdqe$jxZxerGdrdsdse$jyZyGdtdudue%jzZzer>Gdvdwdwe%j{Z{Gdxdydye%j|Z|dzd{Z}Gd|d}d}eJZ~Gd~dde~ZGddde~ZGddde(ZGdddeJZddZGdddeJZddZddZddZddddZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cs6ddfddfddfdd|S) ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). cSs.t|}|r,|d}||d}n|s:tdn|d}|dvrVtd|d|d}|dd}|g}|r|d|krqqt|d|kr|||dd}qtt|}|std|||d||d}qtd|}td|||d|}|dd }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqoqpartssr-/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/util.py marker_varAs:               z parse_marker..marker_varcs|rR|ddkrR|dd\}}|ddkr@td||dd}nZ|\}}|rt|}|srq|d}||d}|\}}|||d}q^|}||fS)Nr(r)unterminated parenthesis: %soplhsrhs)r%r MARKER_OPrrr)r&r(r5r'r4r6)markerr/r-r. marker_expres       z!parse_marker..marker_exprcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Nandr3)ANDrrr&r5r'r6)r9r-r. marker_andxs   z parse_marker..marker_andcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Norr3)ORrrr<)r=r-r.r8s   zparse_marker..markerr-) marker_stringr-)r8r=r9r/r. parse_marker8s $ rAcCs0|}|r|drdSt|}|s4td||d}||d}d}}}}|r:|ddkr:|dd}|dkrtd||d|} ||dd}g}| r0t| }|std | | |d| |d} | sq0| dd krtd | | dd} q|s:d}|r|dd kr|dd}t |}|sztd ||d}t |} | j r| j std|||d}ndd} |ddkr| |\}}n|dd}|dkrtd||d|} ||dd}t| r@| | \}} nXt| }|s\td| |d} | |d} | rtd| d| fg}|r|ddkrtd||dd}t|\}}|r|ddkrtd||s|}nd|ddd|Df}t||||||dS)z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %scSst|}d}|rg}|d}||d}t|}|sLtd||d}|||f||d}|r|ddkrq|dd}|sqt|}|std|q|sd}||fS)z| Return a list of operator, version tuples if any are specified, else None. Nrzinvalid version: %srErinvalid constraint: %s) COMPARE_OPrrrVERSION_IDENTIFIERr r"r%) ver_remainingr'versionsr4vr-r-r. get_versionss.      z'parse_requirement..get_versionsr0r1r2rGz~=;zinvalid requirement: %szunexpected trailing data: %s%s %s, cSsg|] }d|qS)rOr-).0conr-r-r. z%parse_requirement..)nameextras constraintsr8url requirement)strip startswithrrr rrfindr%r" NON_SPACErschemenetlocrHrIrAr$r)reqr&r'distnamerV mark_exprrKuriir,trM_rLrsr-r-r.parse_requirements                           rhcCsdd}i}|D]\}}}tj||}t|D]p}tj||} t| D]T} ||| } |durn|| dqJ||| } |tjjdd} | d| || <qJq0q|S)z%Find destinations for resources filescSsD|tjjd}|tjjd}||s.J|t|ddSN/)r!ospathsepr[lenr%)rootrlr-r-r. get_rel_pathsz)get_resources_dests..get_rel_pathNrj)rkrlr$rpopr!rmrstrip)resources_rootrulesrp destinationsbasesuffixdestprefixabs_baseabs_globabs_path resource_filerel_pathrel_destr-r-r.get_resources_destss    rcCs(ttdrd}ntjttdtjk}|S)N real_prefixT base_prefix)hasattrsysrygetattrr(r-r-r.in_venv(s rcCstj}t|tst|}|SN)r executable isinstancerrrr-r-r.get_executable2s  rcCsN|}t|}|}|s|r|}|r|d}||vr6qJ|rd|||f}q|S)Nrz %c: %s %s)r lower)prompt allowed_chars error_promptdefaultpr,cr-r-r.proceedDs rcCs8t|tr|}i}|D]}||vr||||<q|Sr)rrsplit)dkeysr(keyr-r-r.extract_by_keyTs rcCsvtjddkrtd|}|}t|}zlt|}|ddd}|D]B\}}|D]0\}}d||f}t |} | dusJ| ||<q`qP|WSt y| ddYn0dd } t } z| | |Wn:t jy|t|}t|}| | |Yn0i}| D]R} i|| <}| | D]4\} }d| |f}t |} | dusbJ| || <q8q|S) Nrutf-8 extensionszpython.exportsexportsz%s = %scSs$t|dr||n ||dS)N read_file)rrreadfp)cpstreamr-r-r. read_streamqs  z!read_exports..read_stream)r version_infocodecs getreaderreadr jsonloaditemsget_export_entry Exceptionseekr ConfigParserMissingSectionHeaderErrorclosetextwrapdedentsections)rdatajdatar(groupentrieskrLr,entryrrrrUvaluer-r-r. read_exports]sD         rcCstjddkrtd|}t}|D]l\}}|||D]P}|j dur\|j }nd|j |j f}|j rd|d |j f}| ||j|qFq,||dS)Nrrrz%s:%sz%s [%s]rP)rrr getwriterrrr add_sectionvaluesrwryflagsr$setrUwrite)rrrrrLrr,r-r-r. write_exportss   rc cs.t}z|VWt|n t|0dSr)tempfilemkdtemprrmtree)tdr-r-r.tempdirsrc cs8t}zt|dVWt|n t|0dSr)rkgetcwdchdir)rcwdr-r-r.rs  rc cs8t}zt|dVWt|n t|0dSr)socketgetdefaulttimeoutsetdefaulttimeout)secondsctor-r-r.socket_timeouts  rc@seZdZddZdddZdS)cached_propertycCs ||_dSr)func)selfrr-r-r.__init__szcached_property.__init__NcCs,|dur |S||}t||jj||Sr)robject __setattr____name__)robjclsrr-r-r.__get__s  zcached_property.__get__)N)r __module__ __qualname__rrr-r-r-r.rsrcCs~tjdkr|S|s|S|ddkr.td||ddkrFtd||d}tj|vrh|tjqP|srtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put 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. rjrzpath '%s' cannot be absolutezpath '%s' cannot end with '/')rkrm ValueErrorrcurdirremoverlr$)pathnamepathsr-r-r. convert_paths       rc@seZdZd$ddZddZddZdd Zd%d d Zd&ddZddZ ddZ ddZ ddZ ddZ d'ddZddZddZd d!Zd"d#Zd S)( FileOperatorFcCs||_t|_|dSr)dry_runrensured _init_record)rrr-r-r.rszFileOperator.__init__cCsd|_t|_t|_dSNF)recordr files_written dirs_createdrr-r-r.rszFileOperator._init_recordcCs|jr|j|dSr)rradd)rrlr-r-r.record_as_writtenszFileOperator.record_as_writtencCsHtj|s tdtj|tj|s0dSt|jt|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)rkrlexistsrabspathstatst_mtime)rsourcetargetr-r-r.newers   zFileOperator.newerTcCs|tj|td|||jsd}|rdtj|rDd|}n tj|rdtj |sdd|}|rtt |dt ||| |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirrkrldirnameloggerinforislinkrisfilerrcopyfiler)rinfileoutfilecheckmsgr-r-r. copy_files    zFileOperator.copy_fileNcCstj|rJ|tj|td|||js~|durJt|d}nt j|d|d}zt ||W| n | 0| |dS)NzCopying stream %s to %swbwencoding)rkrlisdirrrrrropenrr copyfileobjrr)rinstreamrr outstreamr-r-r. copy_streams zFileOperator.copy_streamcCsp|tj||jsbtj|r.t|t|d}||Wdn1sX0Y| |dS)Nr) rrkrlrrrrrrr)rrlrfr-r-r.write_binary_file's   (zFileOperator.write_binary_filecCs||||dSr)r encode)rrlrrr-r-r.write_text_file0szFileOperator.write_text_filecCsntjdkstjdkrjtjdkrj|D]F}|jr:td|q"t|j|B|@}td||t||q"dS)Nposixjavazchanging mode of %szchanging mode of %s to %o) rkrU_namerrrrst_modechmod)rbitsmaskfilesr moder-r-r.set_mode3szFileOperator.set_modecCs|dd|S)Nimi)r)r,r r-r-r.?rTzFileOperator.cCs|tj|}||jvrxtj|sx|j|tj|\}}||t d||j sft ||j rx|j |dS)Nz Creating %s)rkrlrrrrrrrrrmkdirrr)rrlrr r-r-r.rAs    zFileOperator.ensure_dirc Cst|| }td|||js|s0|||rX|s:d}n||sHJ|t|d}i}|rvttdrvtj j |d<tj |||dfi|| ||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT) r rrrrr[rnr py_compiler CHECKED_HASHcompiler) rrloptimizeforceryhashed_invalidationdpathdiagpathcompile_kwargsr-r-r. byte_compileMs   zFileOperator.byte_compilecCstj|rtj|r^tj|s^td||js@t ||j r||j vr|j |nPtj|rpd}nd}td|||jst ||j r||j vr|j |dS)NzRemoving directory tree at %slinkfilezRemoving %s %s)rkrlrrrrdebugrrrrrrr)rrlr,r-r-r.ensure_removed^s"       zFileOperator.ensure_removedcCsDd}|s@tj|r$t|tj}q@tj|}||kr:q@|}q|Sr)rkrlraccessW_OKr)rrlr(parentr-r-r. is_writabless  zFileOperator.is_writablecCs"|js J|j|jf}||S)zV Commit recorded changes, turn off recording, return changes. )rrrr)rr(r-r-r.commits  zFileOperator.commitcCs|jst|jD]}tj|rt|qt|jdd}|D]F}t |}|rz|dgks^Jtj ||d}t |t |q>| dS)NT)reverse __pycache__r) rlistrrkrlrrsortedrlistdirr$rmdirr)rr dirsrflistsdr-r-r.rollbacks     zFileOperator.rollback)F)T)N)FFNF)rrrrrrrrr r rrset_executable_moderr&r*r.r/r9r-r-r-r.rs         rcCs^|tjvrtj|}nt|}|dur,|}n.|d}t||d}|D]}t||}qJ|S)N.r)rmodules __import__rrrq) module_name dotted_pathmodr(r+rr-r-r.resolves    rAc@s6eZdZddZeddZddZddZej Z d S) ExportEntrycCs||_||_||_||_dSrrUryrwr)rrUryrwrr-r-r.rszExportEntry.__init__cCst|j|jSr)rAryrwrr-r-r.rszExportEntry.valuecCsd|j|j|j|jfS)NzrCrr-r-r.__repr__s zExportEntry.__repr__cCsDt|tsd}n0|j|jko>|j|jko>|j|jko>|j|jk}|Sr)rrBrUryrwr)rotherr(r-r-r.__eq__s     zExportEntry.__eq__N) rrrrrrrDrFr__hash__r-r-r-r.rBs   rBz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cst|}|s0d}d|vs"d|vrtd|n|}|d}|d}|d}|dkrf|d}}n"|dkrztd||d\}}|d } | durd|vsd|vrtd|g} nd d | d D} t|||| }|S) NrCrDzInvalid specification '%s'rUcallable:rrrcSsg|] }|qSr-rZ)rQr r-r-r.rSrTz$get_export_entry..rE)ENTRY_REsearchr groupdictcountrrB) specificationr'r(rrUrlcolonsryrwrr-r-r.rs8   rcCs|dur d}tjdkr.dtjvr.tjd}n tjd}tj|rft|tj}|st d|n:zt |d}Wn&t yt j d |dd d }Yn0|st }t d |tj||S) a Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. Nz.distlibnt LOCALAPPDATAz $localappdata~z(Directory exists but is not writable: %sTzUnable to create %s)exc_infoFz#Default location unusable, using %s)rkrUenvironrl expandvars expanduserrr+r,rwarningmakedirsOSErrorrrr$)rwr(usabler-r-r.get_cache_bases&      r\cCsBtjtj|\}}|r(|dd}|tjd}||dS)a Convert an absolute path to a directory name for use in a cache. The algorithm used is: #. On Windows, any ``':'`` in the drive is replaced with ``'---'``. #. Any occurrence of ``os.sep`` is replaced with ``'--'``. #. ``'.cache'`` is appended. rIz---z--z.cache)rkrl splitdriverr!rm)rlrrr-r-r.path_to_cache_dirs  r^cCs|ds|dS|Sri)endswith)r,r-r-r. ensure_slash$s r`cCs`d}}d|vr>|dd\}}d|vr.|}n|dd\}}|rJt|}|rVt|}|||fS)NrFrrI)rsplitrr)r_usernamepasswordryr-r-r.parse_credentials*srdcCstd}t||S)N)rkumaskrr-r-r.get_process_umask9s  rgcCs<d}d}t|D]\}}t|tsd}q,q|dus8J|S)NTF) enumeraterr)seqr(rdr,r-r-r.is_string_sequence>s  rjz3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|dd}t|}|r@|d}|d|}|rt|t|dkrtt |d|}|r| }|d|||dd|f}|durt |}|r|d|d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\br) rr!PYTHON_VERSIONrLrstartrnrerescaperPROJECT_NAME_AND_VERSION)filename project_namer(pyverr'nr-r-r.split_filenameMs"   rvz-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCs:t|}|std||}|d|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'rUver)NAME_VERSION_RErrrMrZr)rr'rr-r-r.parse_name_and_versionis  rycCst}t|pg}t|pg}d|vr8|d||O}|D]x}|dkrT||q<|dr|dd}||vrtd|||vr||q<||vrtd|||q<|S)N*rlrzundeclared extra: %s)rrrr[rrX) requested availabler(runwantedr-r-r. get_extrasxs&        rc Csi}zNt|}|}|d}|ds8td|ntd|}t |}Wn2t y}zt d||WYd}~n d}~00|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %srz&Failed to get external data for %s: %s) r rgetr[rr)rrrrr exception)rXr(respheadersctreaderer-r-r._get_external_datas  $rz'https://www.red-dove.com/pypi/projects/cCs*d|d|f}tt|}t|}|S)Nz%s/%s/project.jsonrupperr _external_data_base_urlr)rUrXr(r-r-r.get_project_datas rcCs(d|d||f}tt|}t|S)Nz%s/%s/package-%s.jsonrr)rUversionrXr-r-r.get_package_datas rc@s(eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsPtj|st|t|jd@dkr6td|tjtj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rkrlrrYrrrrXrnormpathrv)rrvr-r-r.rs    zCache.__init__cCst|S)zN Converts a resource prefix to a directory name in the cache. )r^)rryr-r-r. prefix_to_dirszCache.prefix_to_dirc Csg}t|jD]p}tj|j|}z>tj|s>tj|rJt|ntj|r`t |Wqt y~| |Yq0q|S)z" Clear the cache. ) rkr4rvrlr$rrrrrrrr")r not_removedfnr-r-r.clears   z Cache.clearN)rrr__doc__rrrr-r-r-r.rsrc@s:eZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dSr) _subscribersrr-r-r.rszEventMixin.__init__TcCsD|j}||vrt|g||<n"||}|r6||n ||dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)rrr" appendleft)revent subscriberr"subssqr-r-r.rs  zEventMixin.addcCs,|j}||vrtd||||dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)rrr)rrrrr-r-r.rs zEventMixin.removecCst|j|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. r-)iterrr)rrr-r-r.get_subscribersszEventMixin.get_subscribersc Ospg}||D]J}z||g|Ri|}Wn tyLtdd}Yn0||qtd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)rrrrr"r))rrargskwargsr(rrr-r-r.publish s     zEventMixin.publishN)T) rrrrrrrrrr-r-r-r.rs   rc@s^eZdZddZddZdddZdd Zd d Zd d ZddZ e ddZ e ddZ dS) SequencercCsi|_i|_t|_dSr)_preds_succsr_nodesrr-r-r.r(szSequencer.__init__cCs|j|dSr)rrrnoder-r-r.add_node-szSequencer.add_nodeFcCs||jvr|j||rt|j|dD]}|||q,t|j|dD]}|||qPt|jD]\}}|sp|j|=qpt|jD]\}}|s|j|=qdS)Nr-)rrrrrrr2r)rredgesrr,rrLr-r-r. remove_node0s   zSequencer.remove_nodecCs<||ks J|j|t||j|t|dSr)r setdefaultrrr)rpredsuccr-r-r.r@s z Sequencer.addcCs||ks Jz|j|}|j|}WntyBtd|Yn0z||||Wn"ty~td||fYn0dS)Nz%r not a successor of anythingz%r not a successor of %r)rrKeyErrorrr)rrrpredssuccsr-r-r.rEs     zSequencer.removecCs||jvp||jvp||jvSr)rrr)rstepr-r-r.is_stepRszSequencer.is_stepcCs||std|g}g}t}|||r|d}||vrb||kr||||q.|||||j|d}| |q.t |S)Nz Unknown: %rrr-) rrrr"rqrrrrextendreversed)rfinalr(todoseenrrr-r-r. get_stepsVs"         zSequencer.get_stepscsRdggiig|jfddD]}|vr8|q8S)Nrcsd|<d|<dd7<|z |}WntyTg}Yn0|D]J}|vr|t|||<qZ|vrZt|||<qZ||krg}}||||krqqt|}|dS)Nrr)r"rminrqtuple)r successors successorconnected_component componentgraphindex index_counterlowlinksr(stack strongconnectr-r.rzs*        z3Sequencer.strong_connections..strongconnect)rrr-rr.strong_connectionsos" zSequencer.strong_connectionscCsfdg}|jD]*}|j|}|D]}|d||fqq |jD]}|d|q>|dd|S)Nz digraph G {z %s -> %s;z %s;} )rr"rr$)rr(rrrrr-r-r.dots    z Sequencer.dotN)F) rrrrrrrrrrpropertyrrr-r-r-r.r's   2r).tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc sZfdd}tjtd}|dur|dr>d}nH|drRd}d}n4|drfd }d }n |d rzd }d }n td|z|dkrt|d }|r|}|D] }||qn*t ||}|r| }|D] }||q|dkr*t j ddkr*| D]"} t| jts| jd| _q|W|rV|n|rT|0dS)NcsRt|ts|d}tjtj|}|rB|tjkrNt d|dS)Nrzpath outside destination: %r) rrdecoderkrlrr$r[rmr)rlrdest_dirplenr-r. check_paths   zunarchive..check_path)rrzip)rrtgzzr:gz)rrtbzzr:bz2rtarr}zUnknown format for %rrrr)rkrlrrnr_rrnamelisttarfilergetnamesrr getmembersrrUrr extractallr) archive_filenamerformatrrarchivernamesrUtarinfor-rr. unarchivesL             rc Cst}t|}t|dd}t|D]H\}}}|D]8}tj||}||d} tj| |} ||| q4q&Wdn1s0Y|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOrnrrkwalkrlr$r) directoryr(dlenzfror6rrUfullrelrxr-r-r.zip_dirs  .r)rKMGTPc@sreZdZdZdddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressUNKNOWNrdcCs<|dus||ksJ||_|_||_d|_d|_d|_dS)NrF)rcurmaxstartedelapseddone)rminvalmaxvalr-r-r.rs  zProgress.__init__cCsV|j|ksJ|jdus&||jks&J||_t}|jdurF||_n ||j|_dSr)rrrtimerr)rcurvalnowr-r-r.update s zProgress.updatecCs |dks J||j|dSNr)rr)rincrr-r-r. increments zProgress.incrementcCs||j|Sr)rrrr-r-r.rns zProgress.startcCs |jdur||jd|_dS)NT)rrrrr-r-r.stops  z Progress.stopcCs|jdur|jS|jSr)runknownrr-r-r.maximum!szProgress.maximumcCsD|jr d}n4|jdurd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rrrr)rr(rLr-r-r. percentage%s zProgress.percentagecCs:|dkr|jdus|j|jkr$d}ntdt|}|S)Nrz??:??:??z%H:%M:%S)rrrrstrftimegmtime)rdurationr(r-r-r.format_duration0szProgress.format_durationcCs|jrd}|j}n^d}|jdur&d}nJ|jdks<|j|jkrBd}n.t|j|j}||j|j}|d|j}d|||fS)NDonezETA rrrz%s: %s)rrrrrfloatr )rryrer-r-r.ETA9s z Progress.ETAcCsL|jdkrd}n|j|j|j}tD]}|dkr6q@|d}q&d||fS)Nrgig@@z%d %sB/s)rrrUNITS)rr(unitr-r-r.speedLs  zProgress.speedN)rr)rrrrrrrrnrrrrr rrr-r-r-r.rs      rz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<t|rd}t||t|r4d}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrLr_CHECK_MISMATCH_SET_iglob) path_globrr-r-r.ras    rc cst|d}t|dkrht|dks,J||\}}}|dD]$}td|||fD] }|VqXq@nd|vrt|D] }|Vqxn~|dd\}}|dkrd}|dkrd}n|d}|d }t|D]4\}}} tj |}ttj ||D] } | VqqdS) NrrrErz**r;rzrj\) RICH_GLOBrrnrr$ std_iglobr%rkrrlr) rrich_path_globryrrwitemrlradicaldirrrr-r-r.rls*         r) HTTPSHandlermatch_hostnameCertificateErrorc@seZdZdZdZddZdS)HTTPSConnectionNTcCs^t|j|jf|j}t|ddr0||_|tt dsp|j rHt j }nt j }t j ||j|j|t j|j d|_nt t j}tt dr|jt jO_|jr||j|ji}|j rt j |_|j|j dtt ddr|j|d<|j |fi||_|j rZ|jrZz$t|j|jtd |jWn.tyX|jtj|jYn0dS) N _tunnel_hostF SSLContext) cert_reqs ssl_versionca_certs OP_NO_SSLv2)cafileHAS_SNIserver_hostnamezHost verified: %s) rcreate_connectionhostporttimeoutrsock_tunnelrsslr& CERT_REQUIRED CERT_NONE wrap_socketkey_file cert_filePROTOCOL_SSLv23r#optionsr'load_cert_chain verify_modeload_verify_locations check_domainr getpeercertrr)r shutdown SHUT_RDWRr)rr/r$contextrr-r-r.connectsB        zHTTPSConnection.connect)rrrr&r<rAr-r-r-r.r!sr!c@s&eZdZd ddZddZddZdS) rTcCst|||_||_dSr)BaseHTTPSHandlerrr&r<)rr&r<r-r-r.rs zHTTPSHandler.__init__cOs(t|i|}|jr$|j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )r!r&r<)rrrr(r-r-r. _conn_makers zHTTPSHandler._conn_makerc CsZz||j|WStyT}z,dt|jvr>td|jnWYd}~n d}~00dS)Nzcertificate verify failedz*Unable to verify server certificate for %s)do_openrCrstrreasonr r,)rr`rr-r-r. https_openszHTTPSHandler.https_openN)T)rrrrrCrGr-r-r-r.rs rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rr`r-r-r. http_openszHTTPSOnlyHandler.http_openN)rrrrIr-r-r-r.rHsrHrJc@seZdZdddZdS)HTTPrNcKs*|dkr d}||j||fi|dSr_setupZ_connection_classrr,r-rr-r-r.rsz HTTP.__init__)rNrrrrr-r-r-r.rMsrMc@seZdZdddZdS)HTTPSrNcKs*|dkr d}||j||fi|dSrrNrPr-r-r.rszHTTPS.__init__)rNrQr-r-r-r.rRsrRc@seZdZdddZddZdS) TransportrcCs||_tj||dSr)r.rrSrrr. use_datetimer-r-r.rszTransport.__init__cCs`||\}}}tdkr(t||jd}n4|jr<||jdkrR||_|t|f|_|jd}|S)NrK)r.rr) get_host_info _ver_inforMr. _connection_extra_headersrHTTPConnection)rr,hehx509r(r-r-r.make_connections zTransport.make_connectionN)rrrrrr^r-r-r-r.rSs rSc@seZdZdddZddZdS) SafeTransportrcCs||_tj||dSr)r.rr`rrTr-r-r.rszSafeTransport.__init__cCs||\}}}|si}|j|d<tdkr>t|dfi|}n>|jrR||jdkrr||_|tj|dfi|f|_|jd}|S)Nr.rKrr)rVr.rWrRrXrYrr!)rr,r[r\rr(r-r-r.r^s   zSafeTransport.make_connectionN)rr_r-r-r-r.r`s r`c@seZdZddZdS) ServerProxycKsx|dd|_}|dur^t|d}|dd}|dkr@t}nt}|||d|d<}||_tjj ||fi|dS)Nr.rrUhttps)rU transport) rqr.rrr`rSrcrrar)rrcrr.r^rUtclsrer-r-r.r&s  zServerProxy.__init__NrQr-r-r-r.ra%sracKs:tjddkr|d7}nd|d<d|d<t||fi|S)Nrrbrnewlinerr)rrr)rrrr-r-r. _csv_open;s  rgc@s4eZdZedededdZddZddZd S) CSVBaserE"r) delimiter quotecharlineterminatorcCs|Srr-rr-r-r. __enter__MszCSVBase.__enter__cGs|jdSr)rr)rrTr-r-r.__exit__PszCSVBase.__exit__N)rrrrEdefaultsrmrnr-r-r-r.rhFs rhc@s(eZdZddZddZddZeZdS) CSVReadercKs`d|vr4|d}tjddkr,td|}||_nt|dd|_tj|jfi|j|_dS)Nrrrrrlr}) rrrrrrgcsvrro)rrrr-r-r.rUszCSVReader.__init__cCs|Srr-rr-r-r.__iter__`szCSVReader.__iter__cCsFt|j}tjddkrBt|D] \}}t|ts |d||<q |SNrrr)nextrrrrhrrr)rr(rdrr-r-r.rtcs   zCSVReader.nextN)rrrrrrrt__next__r-r-r-r.rpTs rpc@seZdZddZddZdS) CSVWritercKs(t|d|_tj|jfi|j|_dS)Nr)rgrrqwriterro)rrrr-r-r.rns zCSVWriter.__init__cCsNtjddkr>g}|D]"}t|tr.|d}||q|}|j|dSrs)rrrrr r"rwwriterow)rrowr}rr-r-r.rxrs   zCSVWriter.writerowN)rrrrrxr-r-r-r.rvmsrvcsHeZdZeejZded<d fdd ZddZdd Zd d Z Z S) Configurator inc_convertincNcs"tt|||pt|_dSr)superrzrrkrrv)rconfigrv __class__r-r.rszConfigurator.__init__c sfddd}t|s*|}dd}dd}|r\tfdd|D}fd dD}t|}||i|}|r|D]\}} t||| q|S) Ncsvt|ttfr*t|fdd|D}nHt|trhd|vrH|}qri}|D]}||||<qPn |}|S)Ncsg|] }|qSr-r-)rQrdconvertr-r.rSrTzBConfigurator.configure_custom..convert..())rr2rtypedictconfigure_customr)or(r)rrr-r.rs   z.Configurator.configure_custom..convertrr;z[]r-csg|] }|qSr-r-)rQrrr-r.rSrTz1Configurator.configure_custom..cs$g|]}t|r||fqSr-)r)rQr)r~rr-r.rSrT)rqrHrArrrsetattr) rr~rpropsrrrr(rurLr-)r~rrr.rs    zConfigurator.configure_customcCs4|j|}t|tr0d|vr0|||j|<}|S)Nr)r~rrr)rrr(r-r-r. __getitem__s zConfigurator.__getitem__cCsZtj|stj|j|}tj|ddd}t|}Wdn1sL0Y|S)z*Default converter for the inc:// protocol.r}rrN) rkrlisabsr$rvrrrr)rrr r(r-r-r.r{s  (zConfigurator.inc_convert)N) rrrrrvalue_convertersrrrr{ __classcell__r-r-rr.rzs  rzc@s*eZdZdZd ddZddZdd ZdS) SubprocessMixinzC Mixin for running subprocesses and capturing their output FNcCs||_||_dSr)verboseprogress)rrrr-r-r.rszSubprocessMixin.__init__cCsj|j}|j}|}|sq^|dur.|||q |s@tjdntj|dtjq |dS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nr;r) rrreadlinerstderrrrflushr)rrr@rrr,r-r-r.rs  zSubprocessMixin.readercKstj|ftjtjd|}tj|j|jdfd}|tj|j|jdfd}|| | | |j dur| ddn|j rt jd|S)N)stdoutrr)rrrzdone.mainzdone. ) subprocessPopenPIPE threadingThreadrrrnrwaitr$rrrr)rcmdrrt1t2r-r-r. run_commands"   zSubprocessMixin.run_command)FN)rrrrrrrr-r-r-r.rs rcCstdd|S)z,Normalize a python package name a la PEP 503z[-_.]+rl)rosubr)rUr-r-r.normalize_namesrc@s.eZdZdZdZd ddZddZdd ZdS) PyPIRCFilezhttps://upload.pypi.org/legacy/pypiNcCs.|durtjtjdd}||_||_dS)NrSz.pypirc)rkrlr$rWrrrX)rrrXr-r-r.rszPyPIRCFile.__init__c Csi}tj|jr||jp|j}t}||j| }d|vr*| dd}dd| dD}|gkr~d|vr|dg}n|D]}d|i}| |d|d<d |jfd |j fd fD].\}} | ||r| ||||<q| ||<q|dkr ||jdfvr |j|d <q|d|kr|d |kri}qnRd |vr|d }| |d rT| |d }n|j}| |d| |d |||j d}|S)N distutilsz index-serverscSs g|]}|dkr|qS)rrJ)rQserverr-r-r.rS s z#PyPIRCFile.read..rrrrb repositoryrealm)rcNz server-loginrc)rbrcrrr)rkrlrrrrXDEFAULT_REPOSITORYrRawConfigParserrrrr DEFAULT_REALM has_option) rr(rr~r index_servers_serversrrrr-r-r.rsX               zPyPIRCFile.readcCst}|j}|||ds,|d|dd||dd|t|d}||Wdn1sr0YdS)Nrrbrcr) rrrrr has_sectionrrrr)rrbrcr~rr r-r-r.r9s    zPyPIRCFile.update)NN)rrrrrrrrr-r-r-r.rs  :rcCst|jdS)zG Read the PyPI access configuration as supported by distutils. )rX)rrXrrr-r-r. _load_pypircEsrcCst|j|jdSr)rrrbrcrr-r-r. _store_pypircKsrc CstjdkrFdtjvrdSdtjvr.dSdtjvr@dStjSdtjvrZtjdStjd ksnttd sttjSt\}}}}}| d d }| d d d d}|dddkrd||fS|dddkr(|ddkrd}dt |dd|ddf}ddd}|d|tj 7}n|dddkrLdd 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'. rQamd64 win-amd64z(arm) win-arm32z(arm64)z win-arm64_PYTHON_HOST_PLATFORMrunamerjrrkrfrlNlinuxz%s-%ssunosr5solarisz%d.%srrJ32bit64bit)ilz.%saix) aix_platformrLcygwinz[\d.]+darwinz%s-%s-%s)rkrUrrrplatformrUrrr!intmaxsize _aix_supportrrorASCIIrr _osx_supportdistutils.sysconfigget_platform_osx sysconfigget_config_vars) osnamer,releasermachinebitnessrrel_rer'rrr-r-r.get_host_platformSsN          rwin32rr)x86x64armcCs2tjdkrtStjd}|tvr*tSt|S)NrQVSCMD_ARG_TGT_ARCH)rkrUrrUr_TARGET_TO_PLAT)cross_compilation_targetr-r-r. get_platforms   r)NN)r)N)N)NT)r collectionsr contextlibrqglobrrrrloggingrkrrorr1 ImportErrorrrrrrrZdummy_threadingrrrcompatrrrr r r r r rrrrrrrrrrrrr getLoggerrrrrrIrHr7r?r;r]r#rArhrrrrrrrcontextmanagerrrrrrrrrArBVERBOSErKrr\r^r`rdrgrjIrqrmrvrxryrrrrrrrrARCHIVE_EXTENSIONSrrrrrrrrrrBrr r!rHrrWrMrRrSr`rargrhrprvrzrrrrrrrrr-r-r-r.s        \         Y}   /   8 )    ,H  6]    +)   7.QRPK!.CC __pycache__/index.cpython-39.pycnu[a ReQ@sddlZddlZddlZddlZddlZddlZzddlmZWney^ddl mZYn0ddl m Z ddl m Z mZmZmZmZmZddlmZmZeeZdZdZGd d d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)zip_dir ServerProxyzhttps://pypi.org/pypipypic@seZdZdZdZd*ddZddZdd Zd d Zd d Z ddZ ddZ d+ddZ d,ddZ d-ddZd.ddZddZd/ddZd0d d!Zd1d"d#Zd$d%Zd&d'Zd2d(d)ZdS)3 PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc Cs|pt|_|t|j\}}}}}}|s<|s<|s<|dvrJtd|jd|_d|_d|_d|_t t j dZ}dD]D} z,t j | dg||d} | dkr| |_WqWqttyYqt0qtWdn1s0YdS) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. )httphttpszinvalid repository: %sNw)gpgZgpg2z --versionstdoutstderrr) DEFAULT_INDEXurlread_configurationrrpassword_handler ssl_verifierrgpg_homeopenosdevnull subprocess check_callOSError) selfrschemenetlocpathparamsqueryfragZsinksrcr+/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/index.py__init__$s(    zPackageIndex.__init__cCsddlm}|S)zs Get the distutils command for interacting with PyPI configurations. :return: the command. r)_get_pypirc_command)utilr.)r"cmdr+r+r,r.As z PackageIndex._get_pypirc_commandcCsNddlm}||}|d|_|d|_|dd|_|d|j|_dS) z Read the PyPI access configuration as supported by distutils. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. r) _load_pypircusernamepasswordrealmr repositoryN)r/r1getr2r3r4r)r"r1cfgr+r+r,rIs    zPackageIndex.read_configurationcCs |ddlm}||dS)z Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. r) _store_pypircN)check_credentialsr/r8)r"r8r+r+r,save_configurationVs zPackageIndex.save_configurationcCs\|jdus|jdurtdt}t|j\}}}}}}||j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r2r3rrrr add_passwordr4rr)r"Zpm_r$r+r+r,r9_s zPackageIndex.check_credentialscCs\|||}d|d<||g}||}d|d<||g}||S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. verify:actionsubmit)r9validatetodictencode_requestitems send_request)r"metadatadrequestresponser+r+r,registerks  zPackageIndex.registercCsF|}|sq:|d}||td||fq|dS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. utf-8z%s: %sN)readlinedecoderstripappendloggerdebugclose)r"namestreamZoutbufr)r+r+r,_readers  zPackageIndex._readerc Cs|jdddg}|dur|j}|r.|d|g|durD|gdt}tj|tj|d}|dd d |d ||gt d d |||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. --status-fd2--no-ttyN --homedir)z--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--output invoking: %s ) rrextendtempfilemkdtemprr%joinbasenamerOrP)r"filenamesigner sign_passwordkeystorer0tdZsfr+r+r,get_sign_commands zPackageIndex.get_sign_commandc Cstjtjd}|dur tj|d<g}g}tj|fi|}t|jd|j|fd}|t|jd|j|fd}||dur|j ||j | | | |j ||fS)a Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. rNstdinr)targetargsr)rPIPEPopenrrTrstartrrgwriterQwaitr_ returncode) r"r0Z input_datakwargsrrpt1t2r+r+r, run_commands&    zPackageIndex.run_commandc CsD|||||\}}|||d\}}} |dkr@td||S)aR Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. rJrz&sign command failed with error code %s)rfrtencoder) r"rarbrcrdr0sig_filer*rrr+r+r, sign_files  zPackageIndex.sign_filesdistsourcec CsR|tj|s td|||}d} |rZ|jsJt dn| ||||} t |d} | } Wdn1s0Yt | } t | } |dd||| | ddtj|| fg}| r8t | d} | }Wdn1s0Y|d tj| |fttj| |||}||S) a Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. z not found: %sNz)no signing program available - not signedrbZ file_upload1)r>Zprotocol_versionfiletype pyversion md5_digest sha256_digestcontentZ gpg_signature)r9rr%existsrr@rArrOwarningrwrreadhashlibmd5 hexdigestsha256updater`rNshutilrmtreedirnamerBrCrD)r"rErarbrcr|r}rdrFrvfZ file_datar~rfilesZsig_datarGr+r+r, upload_filesD     & (zPackageIndex.upload_filec Cs|tj|s td|tj|d}tj|sFtd|||j|j }}t | }dd|fd|fg}d||fg}| ||} | | S)a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r)r>Z doc_uploadrRversionr)r9rr%isdirrr_rr@rRrr getvaluerBrD) r"rEZdoc_dirfnrRrzip_datafieldsrrGr+r+r,upload_documentation!s         z!PackageIndex.upload_documentationcCsT|jdddg}|dur|j}|r.|d|g|d||gtdd||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. rUrVrWNrXz--verifyrZr[)rrr\rOrPr_)r"signature_filename data_filenamerdr0r+r+r,get_verify_command=szPackageIndex.get_verify_commandcCsH|jstd||||}||\}}}|dvr@td||dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailable)rrz(verify command failed with error code %sr)rrrrt)r"rrrdr0r*rrr+r+r,verify_signatureUszPackageIndex.verify_signaturec Cs|durd}tdn6t|ttfr0|\}}nd}tt|}td|t|d}|t |}z| } d} d} d} d} d | vrt | d } |r|| | | | | }|sq| t |7} |||r||| d 7} |r|| | | qW|n |0Wdn1s 0Y| dkrN| | krNtd | | f|r|}||krztd ||||ftd|dS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrzDigest specified: %swbi rzcontent-lengthzContent-Lengthrz1retrieval incomplete: got only %d out of %d bytesz.%s digest mismatch for %s: expected %s, got %szDigest verified: %s)rOrP isinstancelisttuplegetattrrrrDrinfointrlenrmrrQrr)r"rdestfiledigest reporthookZdigesterZhasherZdfpZsfpheaders blocksizesizerblocknumblockactualr+r+r, download_filens\          4 zPackageIndex.download_filecCs:g}|jr||j|jr(||jt|}||S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrNrr r)r"reqhandlersopenerr+r+r,rDs  zPackageIndex.send_requestc Csg}|j}|D]L\}}t|ttfs*|g}|D]*}|d|d|dd|dfq.q|D].\}} } |d|d|| fdd| fq`|d|ddfd|} d|} | tt| d} t |j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"rJz8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrr\rur_strrrr)r"rrpartsrkvaluesvkeyravaluebodyctrr+r+r,rBsD     zPackageIndex.encode_requestcCsNt|trd|i}t|jdd}z|||p.dW|dS|d0dS)NrRg@)timeoutandrQ)rr r rsearch)r"ZtermsoperatorZ rpc_proxyr+r+r,rs  zPackageIndex.search)N)N)N)N)NNrxryN)N)N)NN)N)__name__ __module__ __qualname____doc__rr-r.rr:r9rIrTrfrtrwrrrrrrDrBrr+r+r+r,rs2      #  9   M+r)rloggingrrrr] threadingr ImportErrorZdummy_threadingrcompatrrrrr r r/r r getLoggerrrOr DEFAULT_REALMobjectrr+r+r+r,s     PK!hdOO"__pycache__/version.cpython-39.pycnu[a Re[ @sZdZddlZddlZddlmZddlmZgdZee Z Gddde Z Gd d d e ZGd d d e Zed ZddZeZGdddeZddZGdddeZeddfeddfeddfeddfeddfeddfed d!fed"d#fed$d%fed&d'ff Zed(dfed)dfed*d!fed d!fed+dffZed,Zd-d.Zd/d0Zed1ejZd2d2d3d2d4ddd5Zd6d7ZGd8d9d9eZ Gd:d;d;eZ!edZ#d?d@Z$GdAdBdBeZ%GdCdDdDeZ&GdEdFdFe Z'e'eeee'ee!dGdHe'e$e&edIZ(e(dJe(dK<dLdMZ)dS)Nz~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesparse_requirement)NormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemec@seZdZdZdS)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/version.pyr sr c@sxeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZeddZdS)VersioncCs@||_}|||_}t|ts,Jt|dksTzMatcher.cCs||kSr(rr=rrrrAUrBcCs||kp||kSr(rr=rrrrAVrBcCs||kp||kSr(rr=rrrrAWrBcCs||kSr(rr=rrrrAXrBcCs||kSr(rr=rrrrAYrBcCs||kp||kSr(rr=rrrrA[rBcCs||kSr(rr=rrrrA\rB)<><=>======~=!=cCst|Sr(rr"rrrraszMatcher.parse_requirementcCs|jdurtd||_}||}|s:td||j|_|j|_g}|jr|jD]d\}}| dr|dvrtd||ddd}}||n||d}}| |||fq^t ||_ dS) NzPlease specify a version classz Not valid: %rz.*)rGrJz#'.*' not allowed for %r constraintsTF) version_class ValueErrorrrrnamelowerkey constraintsendswithappendrr)rrrZclistopZvnprefixrrrrds*      zMatcher.__init__cCsxt|tr||}|jD]X\}}}|j|}t|trDt||}|s`d||jjf}t |||||sdSqdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z%r not implemented for %sFT) rrrLr _operatorsgetgetattrr6rr!)rversionoperator constraintrVfmsgrrrmatchs       z Matcher.matchcCs6d}t|jdkr2|jdddvr2|jdd}|S)Nrr)rGrH)rr)rresultrrr exact_versions zMatcher.exact_versioncCs0t|t|ks|j|jkr,td||fdS)Nzcannot compare %s and %s)r#rNr$r%rrrr'szMatcher._check_compatiblecCs"|||j|jko |j|jkSr()r'rPrr%rrrr*s zMatcher.__eq__cCs || Sr(r+r%rrrr,szMatcher.__ne__cCst|jt|jSr()r2rPrr3rrrr4szMatcher.__hash__cCsd|jj|jfS)Nz%s(%r)r5r3rrrr7szMatcher.__repr__cCs|jSr(r8r3rrrr9szMatcher.__str__)rrrrLrWrrr_r;rar'r*r,r4r7r9rrrrr<Os* r<zk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c Cs|}t|}|s"td||}tdd|ddD}t|dkrl|ddkrl|dd}qF|dszd}nt|ddd}|dd }|d d }|d d }|d}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkrd}n|dt|df}|dur2d}nHg} |dD]0} | r\dt| f} nd| f} | | q@t| }|s|s|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %scss|]}t|VqdSr(int.0r>rrr rBz_pep_440_key..r.r )NNr)arh)z)_)final) rPEP440_VERSION_REr_r groupsrsplitrrcisdigitrS) rmrunumsepochprepostdevlocalrpartrrr _pep_440_keysT         rc@s0eZdZdZddZegdZeddZdS)raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCs<t|}t|}|}tdd|ddD|_|S)Ncss|]}t|VqdSr(rbrdrrrrfrBz*NormalizedVersion.parse..rrg)_normalized_keyrtr_rurrv_release_clause)rrr`rxrurrrr s  zNormalizedVersion.parse)rpbr?rcr}cstfddjDS)Nc3s |]}|r|djvVqdS)rN) PREREL_TAGS)retr3rrrfrBz2NormalizedVersion.is_prerelease..)anyrr3rr3rr:szNormalizedVersion.is_prereleaseN) rrrrrsetrr;r:rrrrrs  rcCs>t|}t|}||krdS||s*dSt|}||dkS)NTFrg)str startswithr)xynrrr _match_prefixs rc @sneZdZeZddddddddd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZdS)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)rIrCrDrErFrGrHrJcCsV|rd|vo|jd}n|jd o,|jd}|rN|jddd}||}||fS)N+rhrr)rrrvrL)rrZr\rVZ strip_localrrrr _adjust_local6s zNormalizedMatcher._adjust_localcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrgcSsg|] }t|qSrrreirrr IrBz/NormalizedMatcher._match_lt..rrjoinrrrZr\rVZrelease_clausepfxrrrrDs zNormalizedMatcher._match_ltcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrgcSsg|] }t|qSrrrrrrrQrBz/NormalizedMatcher._match_gt..rrrrrrLs zNormalizedMatcher._match_gtcCs||||\}}||kSr(rrrZr\rVrrrrTszNormalizedMatcher._match_lecCs||||\}}||kSr(rrrrrrXszNormalizedMatcher._match_gecCs.||||\}}|s ||k}n t||}|Sr(rrrrZr\rVr`rrrr\s   zNormalizedMatcher._match_eqcCst|t|kSr(rrrrrrdsz"NormalizedMatcher._match_arbitrarycCs0||||\}}|s ||k}n t|| }|Sr(rrrrrrgs   zNormalizedMatcher._match_necCsf||||\}}||krdS||kr*dS|j}t|dkrH|dd}ddd|D}t||S)NTFrrhrgcSsg|] }t|qSrrrrrrrzrBz7NormalizedMatcher._match_compatible..)rrrrrrrrrros  z#NormalizedMatcher._match_compatibleN)rrrrrLrWrrrrrrrrrrrrrr's& rz[.+-]$z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}rgz\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cCsL|}tD]\}}|||}q|s.d}t|}|sFd}|}n|dd}dd|D}t|dkr~| dqft|dkr|| d}n8d dd|ddD|| d}|dd}d d d|D}|}|rt D]\}}|||}q|s|}nd |vr*d nd }|||}t |sHd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rrgcSsg|] }t|qSrrbrrrrrrBz-_suggest_semantic_version..NcSsg|] }t|qSrrrrrrrrBcSsg|] }t|qSrrrrrrrrBr}-r)rrO _REPLACEMENTSsub_NUMERIC_PREFIXr_rurvrrSendr_SUFFIX_REPLACEMENTS is_semver)rr`patreplrxrVsuffixseprrr_suggest_semantic_versions:      ,    rcCsdzt||WSty Yn0|}dD]\}}|||}q.tdd|}tdd|}tdd|}tdd |}td d |}|d r|d d}tdd |}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd |}z t|Wnty^d}Yn0|S)!aSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. ))z-alpharp)z-betar)rrp)rr)rr?)z-finalr)z-prer?)z-releaser)z.releaser)z-stabler)rrg)rrrg) r)z.finalr)rsrzpre$Zpre0zdev$Zdev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?rr>rNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$rz\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1)rr rOreplacererr)rrsorigrrrr_suggest_normalized_versions>       rz([a-z]+|\d+|[\.-])r?zfinal-@)r{previewrrr}rrgcCsrdd}g}||D]T}|dr^|dkrD|rD|ddkrD|q*|r^|ddkr^|qD||qt|S)NcSstg}t|D]R}t||}|rd|ddkrBdkrRnn |d}nd|}||q|d|S)N0r9**final) _VERSION_PARTrvrO_VERSION_REPLACErXzfillrS)rr`r@rrr get_partsCs     z_legacy_key..get_partsrrrhz*final-00000000)rpoprSr)rrr`r@rrr _legacy_keyBs      rc@s eZdZddZeddZdS)rcCst|Sr()rr"rrrr]szLegacyVersion.parsecCs8d}|jD](}t|tr |dr |dkr d}q4q |S)NFrrT)rrrr)rr`rrrrr:`s zLegacyVersion.is_prereleaseNrrrrr;r:rrrrr\src@s4eZdZeZeejZded<e dZ ddZ dS)r rrIz^(\d+(\.\d+)*)cCs`||kr dS|jt|}|s2td||dS|d}d|vrV|ddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrrgr) numeric_rer_rloggerwarningrursplitr)rrZr\rVrxrrrrrss zLegacyMatcher._match_compatibleN) rrrrrLdictr<rWrcompilerrrrrrr ks   r zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs t|Sr() _SEMVER_REr_)rrrrrsrc Csndd}t|}|st||}dd|ddD\}}}||dd||dd}}|||f||fS) NcSs8|dur|f}n$|ddd}tdd|D}|S)NrrgcSs"g|]}|r|dn|qS)r)rwr)rer@rrrrrBz5_semantic_key..make_tuple..)rvr)rZabsentr`rrrr make_tuples z!_semantic_key..make_tuplecSsg|] }t|qSrrbrrrrrrBz!_semantic_key..r|r)rr ru) rrrxrumajorminorpatchr{buildrrr _semantic_keys rc@s eZdZddZeddZdS)r cCst|Sr()rr"rrrrszSemanticVersion.parsecCs|jdddkS)Nrrr)rr3rrrr:szSemanticVersion.is_prereleaseNrrrrrr sr c@seZdZeZdS)r N)rrrr rLrrrrr sr c@s6eZdZd ddZddZddZdd Zd d ZdS) VersionSchemeNcCs||_||_||_dSr()rPmatcher suggester)rrPrrrrrrszVersionScheme.__init__cCs0z|j|d}Wnty*d}Yn0|SNTF)rrLr rrr`rrris_valid_versions    zVersionScheme.is_valid_versioncCs.z||d}Wnty(d}Yn0|Sr)rr rrrris_valid_matchers    zVersionScheme.is_valid_matchercCs$|dr|dd}|d|S)z: Used for processing some metadata fields ,Nrhzdummy_name (%s))rRrr"rrris_valid_constraint_lists  z&VersionScheme.is_valid_constraint_listcCs|jdurd}n ||}|Sr()rrrrrsuggests  zVersionScheme.suggest)N)rrrrrrrrrrrrrs   rcCs|Sr(rr"rrrrArBrA) normalizedlegacyZsemanticrdefaultcCs|tvrtd|t|S)Nzunknown scheme name: %r)_SCHEMESrM)rNrrrr s r )*rloggingrcompatrutilr__all__ getLoggerrrrMr objectrr<rrtrrrrrrrrrrIrrrrr rrrr r rrr rrrrs   1d =$ W               .r  ' PK!כg)+)+$__pycache__/resources.cpython-39.pycnu[a ReD* @sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZeeZdaGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZedee jeiZzNz ddlZWne yddl!ZYn0eeej"<eeej#<eeej$<[Wne e%fyRYn0ddZ&iZ'ddZ(e)e*dZ+ddZ,dS))unicode_literalsN)DistlibException)cached_propertyget_cache_baseCachecs.eZdZdfdd ZddZddZZS) ResourceCacheNcs0|durtjttd}tt||dS)Nzresource-cache)ospathjoinrstrsuperr__init__)selfbase __class__/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/resources.pyrszResourceCache.__init__cCsdS)z Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Trrresourcer rrris_stale"s zResourceCache.is_stalecCs|j|\}}|dur|}ntj|j|||}tj|}tj|sXt |tj |sjd}n | ||}|rt |d}| |jWdn1s0Y|S)z Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTwb)finderget_cache_infor r r r prefix_to_dirdirnameisdirmakedirsexistsropenwritebytes)rrprefixr resultrstalefrrrget-s      *zResourceCache.get)N)__name__ __module__ __qualname__rrr' __classcell__rrrrrs rc@seZdZddZdS) ResourceBasecCs||_||_dSN)rname)rrr.rrrrHszResourceBase.__init__N)r(r)r*rrrrrr,Gsr,c@s@eZdZdZdZddZeddZeddZed d Z d S) Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. FcCs |j|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_streamrrrr as_streamUszResource.as_streamcCstdurtat|Sr-)cacherr'r1rrr file_path^szResource.file_pathcCs |j|Sr-)r get_bytesr1rrrr"eszResource.bytescCs |j|Sr-)rget_sizer1rrrsizeisz Resource.sizeN) r(r)r*__doc__ is_containerr2rr4r"r7rrrrr/Ms   r/c@seZdZdZeddZdS)ResourceContainerTcCs |j|Sr-)r get_resourcesr1rrr resourcesqszResourceContainer.resourcesN)r(r)r*r9rr<rrrrr:nsr:c@seZdZdZejdrdZndZddZddZ d d Z d d Z d dZ ddZ ddZddZddZddZddZeejjZddZdS)ResourceFinderz4 Resource finder for file system resources. java).pyc.pyoz.class)r?r@cCs.||_t|dd|_tjt|dd|_dS)N __loader____file__)modulegetattrloaderr r rr)rrDrrrrszResourceFinder.__init__cCs tj|Sr-)r r realpathrr rrr _adjust_pathszResourceFinder._adjust_pathcCsBt|trd}nd}||}|d|jtjj|}||S)N//r) isinstancer"splitinsertrr r r rI)r resource_nameseppartsr$rrr _make_paths   zResourceFinder._make_pathcCs tj|Sr-)r r rrHrrr_findszResourceFinder._findcCs d|jfSr-)r rrrrrrszResourceFinder.get_cache_infocCsD||}||sd}n&||r0t||}n t||}||_|Sr-)rRrS _is_directoryr:r/r )rrOr r$rrrfinds     zResourceFinder.findcCs t|jdSNrb)r r rTrrrr0szResourceFinder.get_streamcCs8t|jd}|WdS1s*0YdSrW)r r read)rrr&rrrr5szResourceFinder.get_bytescCstj|jSr-)r r getsizerTrrrr6szResourceFinder.get_sizecs*fddtfddt|jDS)Ncs|dko|j S)N __pycache__)endswithskipped_extensions)r&r1rralloweds z-ResourceFinder.get_resources..allowedcsg|]}|r|qSrr).0r&)r^rr z0ResourceFinder.get_resources..)setr listdirr rTr)r^rrr;s zResourceFinder.get_resourcescCs ||jSr-)rUr rTrrrr9szResourceFinder.is_containerccs||}|dur|g}|r|d}|V|jr|j}|jD]>}|sL|}nd||g}||}|jrv||q>|Vq>qdS)NrrK)rVpopr9r.r<r append)rrOrtodornamer.new_namechildrrriterators      zResourceFinder.iteratorN)r(r)r*r8sysplatform startswithr]rrIrRrSrrVr0r5r6r;r9 staticmethodr r rrUrjrrrrr=vs"    r=cs`eZdZdZfddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ Z S)ZipResourceFinderz6 Resource finder for resources in .zip files. csZtt|||jj}dt||_t|jdr>|jj|_n t j ||_t |j|_ dS)Nr_files) r rorrFarchivelen prefix_lenhasattrrp zipimport_zip_directory_cachesortedindex)rrDrqrrrrs   zZipResourceFinder.__init__cCs|Sr-rrHrrrrIszZipResourceFinder._adjust_pathcCs||jd}||jvrd}nV|r:|dtjkr:|tj}t|j|}z|j||}Wntyrd}Yn0|st d||j j nt d||j j |S)NTFz_find failed: %r %rz_find worked: %r %r) rsrpr rPbisectrxrm IndexErrorloggerdebugrFr#)rr r$irrrrSs    zZipResourceFinder._findcCs&|jj}|jdt|d}||fS)Nr)rFrqr rr)rrr#r rrrrsz ZipResourceFinder.get_cache_infocCs|j|jSr-)rFget_datar rTrrrr5szZipResourceFinder.get_bytescCst||Sr-)ioBytesIOr5rTrrrr0szZipResourceFinder.get_streamcCs|j|jd}|j|dS)N)r rsrprrrrr6szZipResourceFinder.get_sizecCs|j|jd}|r,|dtjkr,|tj7}t|}t}t|j|}|t|jkr|j||shq|j||d}| | tjdd|d7}qH|S)Nryrr) r rsr rPrrrbrzrxrmaddrM)rrr plenr$r~srrrr;s  zZipResourceFinder.get_resourcescCsh||jd}|r*|dtjkr*|tj7}t|j|}z|j||}Wntybd}Yn0|S)NryF)rsr rPrzrxrmr{)rr r~r$rrrrUs   zZipResourceFinder._is_directory)r(r)r*r8rrIrSrr5r0r6r;rUr+rrrrros rocCs|tt|<dSr-)_finder_registrytype)rF finder_makerrrrregister_finder2srcCs|tvrt|}nv|tjvr$t|tj|}t|dd}|durJtdt|dd}tt|}|durxtd|||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packagerAzUnable to locate finder for %r) _finder_cacherkmodules __import__rErrr'r)packager$rDr rFrrrrr9s      r __dummy__cCsRd}t|tj|}tt|}|rNt}tj |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. NrC) pkgutil get_importerrkpath_importer_cacher'rr _dummy_moduler r r rBrA)r r$rFrrDrrrfinder_for_pathUs  r)- __future__rrzrloggingr rrktypesrurCrutilrrr getLoggerr(r|r3robjectr,r/r:r=ror zipimporterr_frozen_importlib_externalZ_fi ImportError_frozen_importlibSourceFileLoader FileFinderSourcelessFileLoaderAttributeErrorrrr ModuleTyper rrrrrrsJ   ,!ZO    PK!;8''#__pycache__/manifest.cpython-39.pycnu[a Re9@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ e eZedejZed ejejBZejdd ZGd ddeZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode convert_pathManifestz\\w* z#.*?(?= )| (?=$)c@szeZdZdZdddZddZddZd d Zdd d ZddZ ddZ ddZ dddZ d ddZ d!ddZddZdS)"rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. NcCs>tjtj|pt|_|jtj|_d|_t |_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfrr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/manifest.py__init__*szManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}|r|}t |} | D]R} tj || } t| } | j } || r|t | qN|| rN|| sN|| qNq6dS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrrpopappendr listdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"   zManifest.findallcCs4||jstj|j|}|jtj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrr r rrraddr )ritemrrrr*Ts z Manifest.addcCs|D]}||qdS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r*)ritemsr+rrradd_many^szManifest.add_manyFcsbfddtj}|rFt}|D]}|tj|q&||O}ddtdd|DDS)z8 Return sorted files in directory order csJ||td||jkrFtj|\}}|dvs.add_dircSsg|]}tjj|qSr)r r r).0Z path_tuplerrr zz#Manifest.sorted..css|]}tj|VqdS)N)r r r2)r9r rrr {r;z"Manifest.sorted..)rrr r dirnamesorted)rZwantdirsresultr3frr7rr>gs zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}szManifest.clearcCsj||\}}}}|dkrB|D]}|j|ddstd|qn$|dkrf|D]}|j|dd}qNn|dkr|D]}|j|ddsrtd|qrn|d kr|D]}|j|dd}qn|d kr|D] }|j||d std ||qn|d kr |D]}|j||d }qn\|dkr2|jd|d sftd|n4|dkrZ|jd|d sftd|n td|dS)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludeglobal-includeFz3no files found matching %r anywhere in distributionglobal-excluderecursive-include)rz-no files found matching %r under directory %rrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr0warning_exclude_patternr)r directiveactionpatternsthedirZ dirpatternpatternfoundrrrprocess_directivesN   zManifest.process_directivecCs|}t|dkr,|ddvr,|dd|d}d}}}|dvrxt|dkr`td|d d |ddD}n~|d vrt|d krtd |t|d}dd |ddD}n:|dvrt|dkrtd|t|d}n td|||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rr)rBrDrErFrGrHrIrJrBN)rBrDrErFrz$%r expects ...cSsg|] }t|qSrrr9wordrrrr:r;z-Manifest._parse_directive..)rGrHz*%r expects ...cSsg|] }t|qSrrrVrrrr:r;)rIrJz!%r expects a single zunknown action %r)r2leninsertrr)rrOwordsrPrQrRZ dir_patternrrrrKs4       zManifest._parse_directiveTcCsPd}|||||}|jdur&||jD]}||r,|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. FNT)_translate_patternrr(searchrr*)rrSrCris_regexrT pattern_rer%rrrrLs    zManifest._include_patterncCsBd}|||||}t|jD]}||r|j|d}q|S)atRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)r\listrr]remove)rrSrCrr^rTr_r@rrrrN)s   zManifest._exclude_patternc Cs|rt|trt|S|Stdkr:|dd\}}}|rj||}tdkrn||rd||snJnd}t t j |j d} |durftdkr|d} ||dt|  } n>||} | |r| |sJ| t|t| t|} t j} t jdkrd} tdkr4d| | | d|f}n0|t|t|t|}d || | | ||f}n8|rtdkrd| |}nd || |t|df}t|S) aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). )rXrr6r.N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionr)endswithescaper r rrrYr) rrSrCrr^startr6endr_rZ empty_patternZ prefix_rerrrrr\=sF             zManifest._translate_patterncCs8t|}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). rbz\\\\z\1[^%s]z((?rArUrKrLrNr\rirrrrr%s&   O/ )  7)rvrologgingr rfsysr.rcompatrutilr__all__ getLoggerrsr0rgMZ_COLLAPSE_PATTERNSZ_COMMENTED_LINE version_inforhobjectrrrrrs    PK!H;GG#__pycache__/__init__.cpython-39.pycnu[a ReE@slddlZdZGdddeZzddlmZWn$eyPGdddejZYn0eeZ e edS)Nz0.3.3c@s eZdZdS)DistlibExceptionN)__name__ __module__ __qualname__rr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/__init__.pyr sr) NullHandlerc@s$eZdZddZddZddZdS)rcCsdSNrselfrecordrrrhandlezNullHandler.handlecCsdSr rr rrremitrzNullHandler.emitcCs d|_dSr )lock)r rrr createLockrzNullHandler.createLockN)rrrr rrrrrrrsr) logging __version__ Exceptionrr ImportErrorHandler getLoggerrlogger addHandlerrrrrs  PK!"__pycache__/markers.cpython-39.pycnu[a Re}@sdZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z dgZ edZd d Zd d ZGd ddeZddZeZ[eZdddZdS)zG Parser for the environment markers micro-language defined in PEP 508. N) string_types)in_venv parse_marker)NormalizedVersion interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")cCst|tr|sdS|ddvS)NFr'") isinstancer)or /builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/markers.py _is_literalsr cCs2g}t|D]}|t|dqt|S)Nr)_VERSION_PATTERNfinditerappendNVgroupsset)sresultmr r r _get_versions!src @sfeZdZdZddddddddddddd dd dd dd dd dddd ZddZdS) Evaluatorz; This class is used to evaluate marker expessions. cCs||kSNr xyr r r -zEvaluator.cCs||kSrr rr r r r.rcCs||kp||kSrr rr r r r/rcCs||kSrr rr r r r0rcCs||kSrr rr r r r1rcCs||kp||kSrr rr r r r2rcCs||kSrr rr r r r3rcCs||kp||kSrr rr r r r4rcCs|o|Srr rr r r r5rcCs|p|Srr rr r r r6rcCs||vSrr rr r r r7rcCs||vSrr rr r r r8r) =====~=!=<<=>>=andorinnot inc Cs"t|trB|ddvr$|dd}n||vr8td|||}nt|tsPJ|d}||jvrntd||d}|d }t|drt|d rtd |||f|||}|||}|d ks|d kr|d vrt|}t|}n$|d kr|d vrt|}t |}|j|||}|S)z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rrrzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison: %s %s %spython_version)r#r$r%r&r rr"r!)r)r*) r r SyntaxErrordict operationsNotImplementedErrorr evaluaterr) selfexprcontextrr,ZelhsZerhsr-r.r r r r4;s4         zEvaluator.evaluateN)__name__ __module__ __qualname____doc__r2r4r r r r r'src Csdd}ttdr(|tjj}tjj}nd}d}||tjttt t tt t t t ddtjd }|S)NcSs<d|j|j|jf}|j}|dkr8||dt|j7}|S)Nz%s.%s.%sfinalr)majorminormicro releaselevelstrserial)infoversionkindr r r format_full_version^s z,default_context..format_full_versionimplementation0) implementation_nameimplementation_versionos_nameplatform_machineplatform_python_implementationplatform_releaseplatform_systemplatform_versionZplatform_in_venvpython_full_versionr/ sys_platform)hasattrsysrGrDnameosplatformmachinepython_implementationreleasesystemrArr/)rFrLrKrr r r default_context]s(   r^c Cszt|\}}Wn4tyD}ztd||fWYd}~n d}~00|rf|ddkrftd||ftt}|r|||t||S)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z)Unable to interpret marker syntax: %s: %sNr#z*unexpected trailing data in marker: %s: %s)r Exceptionr0r1DEFAULT_CONTEXTupdate evaluatorr4)markerZexecution_contextr6rester7r r r rs & )N)r;rXrerVrYcompatrutilrrrDrr__all__compilerr robjectrr^rarcrr r r r s"   6PK! |,,"__pycache__/scripts.cpython-39.pycnu[a Re8E@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZmZeeZdZedZd Zd d ZeZGd d d eZdS))BytesION) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executable get_platformin_venva s^#!.*pythonw?[0-9.]*([ ].*)?$z# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) cCsXd|vrT|drB|dd\}}d|vrT|dsTd||f}n|dsTd|}|S)N z /usr/bin/env r"z%s "%s"z"%s") startswithsplit) executableenv _executabler/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/scripts.pyenquote_executable3s  rc@seZdZdZeZdZd*ddZddZe j d rBd d Z d d Z ddZd+ddZddZeZddZddZdZddZd,ddZddZed d!Zejd"d!Zejd#ksejd krejd#krd$d%Zd-d&d'Z d.d(d)Z!dS)/ ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFcCs||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t d|_ |pRt ||_ tjdkprtjdkortjdk|_ tj|_dS)NFposixjava)X.Ynt) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr_fileop_is_ntsys version_info)selfrrr dry_runfileoprrr__init__Ns  zScriptMaker.__init__cCs@|ddr<|jr %srspythonwrr|) r#r5r7rr rrwr!r)newerrArr=r@r.readlinerB FIRST_LINE_REmatchr6groupclose copy_filer&rrinforseekrkrr>)r-rradjustrf first_linerrSrhlinesrjrrrrr _copy_script?sR          zScriptMaker._copy_scriptcCs|jjSrvr)r.)r-rrrr.rszScriptMaker.dry_runcCs ||j_dSrvr)r-valuerrrr.vsrcCsttddkrd}nd}tdkr&dnd}d|||f}td d d }t||}|snd ||f}t||jS) NPZ64Z32z win-arm64z-armrz %s%s%s.exerlrrz(Unable to find resource %s in package %s) structcalcsizer __name__rsplitrfindrgbytes)r-kindbitsZplatform_suffixr$Zdistlib_packageresourcemsgrrrr~szScriptMaker._get_launchercCs6g}t|}|dur"|||n|j|||d|S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. Nr)r rr)r- specificationr8rrtrrrmakes zScriptMaker.makecCs$g}|D]}||||q|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r-specificationsr8rrrrr make_multipleszScriptMaker.make_multiple)TFN)rYN)N)N)N)"r __module__ __qualname____doc__SCRIPT_TEMPLATErprr0r;r+rRrrDrKrXrkru_DEFAULT_MANIFESTrxr{rrrrrpropertyr.setterr#r$r%rrrrrrrrEs8     E4 3   r) iorloggingr#rerr+compatrrr resourcesrutilrr r r r r getLoggerrrAstriprcompilerrr_enquote_executableobjectrrrrrs      PK!,ӽ compat.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import absolute_import import os import re import sys try: import ssl except ImportError: # pragma: no cover ssl = None if sys.version_info[0] < 3: # pragma: no cover from StringIO import StringIO string_types = basestring, text_type = unicode from types import FileType as file_type import __builtin__ as builtins import ConfigParser as configparser from ._backport import shutil from urlparse import urlparse, urlunparse, urljoin, urlsplit, urlunsplit from urllib import (urlretrieve, quote as _quote, unquote, url2pathname, pathname2url, ContentTooShortError, splittype) def quote(s): if isinstance(s, unicode): s = s.encode('utf-8') return _quote(s) import urllib2 from urllib2 import (Request, urlopen, URLError, HTTPError, HTTPBasicAuthHandler, HTTPPasswordMgr, HTTPHandler, HTTPRedirectHandler, build_opener) if ssl: from urllib2 import HTTPSHandler import httplib import xmlrpclib import Queue as queue from HTMLParser import HTMLParser import htmlentitydefs raw_input = raw_input from itertools import ifilter as filter from itertools import ifilterfalse as filterfalse # Leaving this around for now, in case it needs resurrecting in some way # _userprog = None # def splituser(host): # """splituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.""" # global _userprog # if _userprog is None: # import re # _userprog = re.compile('^(.*)@(.*)$') # match = _userprog.match(host) # if match: return match.group(1, 2) # return None, host else: # pragma: no cover from io import StringIO string_types = str, text_type = str from io import TextIOWrapper as file_type import builtins import configparser import shutil from urllib.parse import (urlparse, urlunparse, urljoin, quote, unquote, urlsplit, urlunsplit, splittype) from urllib.request import (urlopen, urlretrieve, Request, url2pathname, pathname2url, HTTPBasicAuthHandler, HTTPPasswordMgr, HTTPHandler, HTTPRedirectHandler, build_opener) if ssl: from urllib.request import HTTPSHandler from urllib.error import HTTPError, URLError, ContentTooShortError import http.client as httplib import urllib.request as urllib2 import xmlrpc.client as xmlrpclib import queue from html.parser import HTMLParser import html.entities as htmlentitydefs raw_input = input from itertools import filterfalse filter = filter try: from ssl import match_hostname, CertificateError except ImportError: # pragma: no cover class CertificateError(ValueError): pass def _dnsname_match(dn, hostname, max_wildcards=1): """Matching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 """ pats = [] if not dn: return False parts = dn.split('.') leftmost, remainder = parts[0], 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, match_hostname needs a " "SSL socket or SSL context with either " "CERT_OPTIONAL or CERT_REQUIRED") 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") try: from types import SimpleNamespace as Container except ImportError: # pragma: no cover class Container(object): """ A generic container for when multiple values need to be returned """ def __init__(self, **kwargs): self.__dict__.update(kwargs) try: from shutil import which except ImportError: # pragma: no cover # Implementation from Python 3.3 def which(cmd, mode=os.F_OK | os.X_OK, path=None): """Given a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. """ # Check that a given file can be accessed with the correct mode. # Additionally check that `file` is not a directory, as on Windows # directories pass the os.access check. def _access_check(fn, mode): return (os.path.exists(fn) and os.access(fn, mode) and not os.path.isdir(fn)) # If we're given a path with a directory part, look it up directly rather # than referring to PATH directories. This includes checking relative to the # current directory, e.g. ./script if os.path.dirname(cmd): if _access_check(cmd, mode): return cmd return None if path is None: path = os.environ.get("PATH", os.defpath) if not path: return None path = path.split(os.pathsep) if sys.platform == "win32": # The current directory takes precedence on Windows. if not os.curdir in path: path.insert(0, os.curdir) # PATHEXT is necessary to check on Windows. pathext = os.environ.get("PATHEXT", "").split(os.pathsep) # See if the given file matches any of the expected path extensions. # This will allow us to short circuit when given "python.exe". # If it does match, only test that one, otherwise we have to try # others. if any(cmd.lower().endswith(ext.lower()) for ext in pathext): files = [cmd] else: files = [cmd + ext for ext in pathext] else: # On other platforms you don't have things like PATHEXT to tell you # what file suffixes are executable, so just pass on cmd as-is. files = [cmd] seen = set() for dir in path: normdir = os.path.normcase(dir) if not normdir in seen: seen.add(normdir) for thefile in files: name = os.path.join(dir, thefile) if _access_check(name, mode): return name return None # ZipFile is a context manager in 2.7, but not in 2.6 from zipfile import ZipFile as BaseZipFile if hasattr(BaseZipFile, '__enter__'): # pragma: no cover ZipFile = BaseZipFile else: # pragma: no cover from zipfile import ZipExtFile as BaseZipExtFile class ZipExtFile(BaseZipExtFile): def __init__(self, base): self.__dict__.update(base.__dict__) def __enter__(self): return self def __exit__(self, *exc_info): self.close() # return None, so if an exception occurred, it will propagate class ZipFile(BaseZipFile): def __enter__(self): return self def __exit__(self, *exc_info): self.close() # return None, so if an exception occurred, it will propagate def open(self, *args, **kwargs): base = BaseZipFile.open(self, *args, **kwargs) return ZipExtFile(base) try: from platform import python_implementation except ImportError: # pragma: no cover def python_implementation(): """Return a string identifying the Python implementation.""" if 'PyPy' in sys.version: return 'PyPy' if os.name == 'java': return 'Jython' if sys.version.startswith('IronPython'): return 'IronPython' return 'CPython' try: import sysconfig except ImportError: # pragma: no cover from ._backport import sysconfig try: callable = callable except NameError: # pragma: no cover from collections.abc import Callable def callable(obj): return isinstance(obj, Callable) try: fsencode = os.fsencode fsdecode = os.fsdecode except AttributeError: # pragma: no cover # Issue #99: on some systems (e.g. containerised), # sys.getfilesystemencoding() returns None, and we need a real value, # so fall back to utf-8. From the CPython 2.7 docs relating to Unix and # sys.getfilesystemencoding(): the return value is "the user’s preference # according to the result of nl_langinfo(CODESET), or None if the # nl_langinfo(CODESET) failed." _fsencoding = sys.getfilesystemencoding() or 'utf-8' if _fsencoding == 'mbcs': _fserrors = 'strict' else: _fserrors = 'surrogateescape' def fsencode(filename): if isinstance(filename, bytes): return filename elif isinstance(filename, text_type): return filename.encode(_fsencoding, _fserrors) else: raise TypeError("expect bytes or str, not %s" % type(filename).__name__) def fsdecode(filename): if isinstance(filename, text_type): return filename elif isinstance(filename, bytes): return filename.decode(_fsencoding, _fserrors) else: raise TypeError("expect bytes or str, not %s" % type(filename).__name__) try: from tokenize import detect_encoding except ImportError: # pragma: no cover from codecs import BOM_UTF8, lookup import re cookie_re = re.compile(r"coding[:=]\s*([-\w.]+)") def _get_normal_name(orig_enc): """Imitates get_normal_name in tokenizer.c.""" # Only care about the first 12 characters. enc = orig_enc[:12].lower().replace("_", "-") if enc == "utf-8" or enc.startswith("utf-8-"): return "utf-8" if enc in ("latin-1", "iso-8859-1", "iso-latin-1") or \ enc.startswith(("latin-1-", "iso-8859-1-", "iso-latin-1-")): return "iso-8859-1" return orig_enc def detect_encoding(readline): """ The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. """ try: filename = readline.__self__.name except AttributeError: filename = None bom_found = False encoding = None default = 'utf-8' def read_or_stop(): try: return readline() except StopIteration: return b'' def find_cookie(line): try: # Decode as UTF-8. Either the line is an encoding declaration, # in which case it should be pure ASCII, or it must be UTF-8 # per default encoding. line_string = line.decode('utf-8') except UnicodeDecodeError: msg = "invalid or missing encoding declaration" if filename is not None: msg = '{} for {!r}'.format(msg, filename) raise SyntaxError(msg) matches = cookie_re.findall(line_string) if not matches: return None encoding = _get_normal_name(matches[0]) try: codec = lookup(encoding) except LookupError: # This behaviour mimics the Python interpreter if filename is None: msg = "unknown encoding: " + encoding else: msg = "unknown encoding for {!r}: {}".format(filename, encoding) raise SyntaxError(msg) if bom_found: if codec.name != 'utf-8': # This behaviour mimics the Python interpreter if filename is None: msg = 'encoding problem: utf-8' else: msg = 'encoding problem for {!r}: utf-8'.format(filename) raise SyntaxError(msg) encoding += '-sig' return encoding first = read_or_stop() if first.startswith(BOM_UTF8): bom_found = True first = first[3:] default = 'utf-8-sig' if not first: return default, [] encoding = find_cookie(first) if encoding: return encoding, [first] second = read_or_stop() if not second: return default, [first] encoding = find_cookie(second) if encoding: return encoding, [first, second] return default, [first, second] # For converting & <-> & etc. try: from html import escape except ImportError: from cgi import escape if sys.version_info[:2] < (3, 4): unescape = HTMLParser().unescape else: from html import unescape try: from collections import ChainMap except ImportError: # pragma: no cover from collections import MutableMapping try: from reprlib import recursive_repr as _recursive_repr except ImportError: def _recursive_repr(fillvalue='...'): ''' Decorator to make a repr function return fillvalue for a recursive call ''' def decorating_function(user_function): repr_running = set() def wrapper(self): key = id(self), get_ident() if key in repr_running: return fillvalue repr_running.add(key) try: result = user_function(self) finally: repr_running.discard(key) return result # Can't use functools.wraps() here because of bootstrap issues wrapper.__module__ = getattr(user_function, '__module__') wrapper.__doc__ = getattr(user_function, '__doc__') wrapper.__name__ = getattr(user_function, '__name__') wrapper.__annotations__ = getattr(user_function, '__annotations__', {}) return wrapper return decorating_function class ChainMap(MutableMapping): ''' A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. ''' def __init__(self, *maps): '''Initialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. ''' self.maps = list(maps) or [{}] # always at least one map def __missing__(self, key): raise KeyError(key) def __getitem__(self, key): for mapping in self.maps: try: return mapping[key] # can't use 'key in mapping' with defaultdict except KeyError: pass return self.__missing__(key) # support subclasses that define __missing__ def get(self, key, default=None): return self[key] if key in self else default def __len__(self): return len(set().union(*self.maps)) # reuses stored hash values if possible def __iter__(self): return iter(set().union(*self.maps)) def __contains__(self, key): return any(key in m for m in self.maps) def __bool__(self): return any(self.maps) @_recursive_repr() def __repr__(self): return '{0.__class__.__name__}({1})'.format( self, ', '.join(map(repr, self.maps))) @classmethod def fromkeys(cls, iterable, *args): 'Create a ChainMap with a single dict created from the iterable.' return cls(dict.fromkeys(iterable, *args)) def copy(self): 'New ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]' return self.__class__(self.maps[0].copy(), *self.maps[1:]) __copy__ = copy def new_child(self): # like Django's Context.push() 'New ChainMap with a new dict followed by all previous maps.' return self.__class__({}, *self.maps) @property def parents(self): # like Django's Context.pop() 'New ChainMap from maps[1:].' return self.__class__(*self.maps[1:]) def __setitem__(self, key, value): self.maps[0][key] = value def __delitem__(self, key): try: del self.maps[0][key] except KeyError: raise KeyError('Key not found in the first mapping: {!r}'.format(key)) def popitem(self): 'Remove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.' try: return self.maps[0].popitem() except KeyError: raise KeyError('No keys found in the first mapping.') def pop(self, key, *args): 'Remove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].' try: return self.maps[0].pop(key, *args) except KeyError: raise KeyError('Key not found in the first mapping: {!r}'.format(key)) def clear(self): 'Clear maps[0], leaving maps[1:] intact.' self.maps[0].clear() try: from importlib.util import cache_from_source # Python >= 3.4 except ImportError: # pragma: no cover try: from imp import cache_from_source except ImportError: # pragma: no cover def cache_from_source(path, debug_override=None): assert path.endswith('.py') if debug_override is None: debug_override = __debug__ if debug_override: suffix = 'c' else: suffix = 'o' return path + suffix try: from collections import OrderedDict except ImportError: # pragma: no cover ## {{{ http://code.activestate.com/recipes/576693/ (r9) # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. try: from thread import get_ident as _get_ident except ImportError: from dummy_thread import get_ident as _get_ident try: from _abcoll import KeysView, ValuesView, ItemsView except ImportError: pass class OrderedDict(dict): 'Dictionary that remembers insertion order' # An inherited dict maps keys to values. # The inherited dict provides __getitem__, __len__, __contains__, and get. # The remaining methods are order-aware. # Big-O running times for all methods are the same as for regular dictionaries. # The internal self.__map dictionary maps keys to links in a doubly linked list. # The circular doubly linked list starts and ends with a sentinel element. # The sentinel element never gets deleted (this simplifies the algorithm). # Each link is stored as a list of length three: [PREV, NEXT, KEY]. def __init__(self, *args, **kwds): '''Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. ''' if len(args) > 1: raise TypeError('expected at most 1 arguments, got %d' % len(args)) try: self.__root except AttributeError: self.__root = root = [] # sentinel node root[:] = [root, root, None] self.__map = {} self.__update(*args, **kwds) def __setitem__(self, key, value, dict_setitem=dict.__setitem__): 'od.__setitem__(i, y) <==> od[i]=y' # Setting a new item creates a new link which goes at the end of the linked # list, and the inherited dictionary is updated with the new key/value pair. if key not in self: root = self.__root last = root[0] last[1] = root[0] = self.__map[key] = [last, root, key] dict_setitem(self, key, value) def __delitem__(self, key, dict_delitem=dict.__delitem__): 'od.__delitem__(y) <==> del od[y]' # Deleting an existing item uses self.__map to find the link which is # then removed by updating the links in the predecessor and successor nodes. dict_delitem(self, key) link_prev, link_next, key = self.__map.pop(key) link_prev[1] = link_next link_next[0] = link_prev def __iter__(self): 'od.__iter__() <==> iter(od)' root = self.__root curr = root[1] while curr is not root: yield curr[2] curr = curr[1] def __reversed__(self): 'od.__reversed__() <==> reversed(od)' root = self.__root curr = root[0] while curr is not root: yield curr[2] curr = curr[0] def clear(self): 'od.clear() -> None. Remove all items from od.' try: for node in self.__map.itervalues(): del node[:] root = self.__root root[:] = [root, root, None] self.__map.clear() except AttributeError: pass dict.clear(self) def popitem(self, last=True): '''od.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. ''' if not self: raise KeyError('dictionary is empty') root = self.__root if last: link = root[0] link_prev = link[0] link_prev[1] = root root[0] = link_prev else: link = root[1] link_next = link[1] root[1] = link_next link_next[0] = root key = link[2] del self.__map[key] value = dict.pop(self, key) return key, value # -- the following methods do not depend on the internal structure -- def keys(self): 'od.keys() -> list of keys in od' return list(self) def values(self): 'od.values() -> list of values in od' return [self[key] for key in self] def items(self): 'od.items() -> list of (key, value) pairs in od' return [(key, self[key]) for key in self] def iterkeys(self): 'od.iterkeys() -> an iterator over the keys in od' return iter(self) def itervalues(self): 'od.itervalues -> an iterator over the values in od' for k in self: yield self[k] def iteritems(self): 'od.iteritems -> an iterator over the (key, value) items in od' for k in self: yield (k, self[k]) def update(*args, **kwds): '''od.update(E, **F) -> None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v ''' if len(args) > 2: raise TypeError('update() takes at most 2 positional ' 'arguments (%d given)' % (len(args),)) elif not args: raise TypeError('update() takes at least 1 argument (0 given)') self = args[0] # Make progressively weaker assumptions about "other" other = () if len(args) == 2: other = args[1] if isinstance(other, dict): for key in other: self[key] = other[key] elif hasattr(other, 'keys'): for key in other.keys(): self[key] = other[key] else: for key, value in other: self[key] = value for key, value in kwds.items(): self[key] = value __update = update # let subclasses override update without breaking __init__ __marker = object() def pop(self, key, default=__marker): '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. ''' if key in self: result = self[key] del self[key] return result if default is self.__marker: raise KeyError(key) return default def setdefault(self, key, default=None): 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' if key in self: return self[key] self[key] = default return default def __repr__(self, _repr_running=None): 'od.__repr__() <==> repr(od)' if not _repr_running: _repr_running = {} call_key = id(self), _get_ident() if call_key in _repr_running: return '...' _repr_running[call_key] = 1 try: if not self: return '%s()' % (self.__class__.__name__,) return '%s(%r)' % (self.__class__.__name__, self.items()) finally: del _repr_running[call_key] def __reduce__(self): 'Return state information for pickling' items = [[k, self[k]] for k in self] inst_dict = vars(self).copy() for k in vars(OrderedDict()): inst_dict.pop(k, None) if inst_dict: return (self.__class__, (items,), inst_dict) return self.__class__, (items,) def copy(self): 'od.copy() -> a shallow copy of od' return self.__class__(self) @classmethod def fromkeys(cls, iterable, value=None): '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). ''' d = cls() for key in iterable: d[key] = value return d def __eq__(self, other): '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. ''' if isinstance(other, OrderedDict): return len(self)==len(other) and self.items() == other.items() return dict.__eq__(self, other) def __ne__(self, other): return not self == other # -- the following methods are only used in Python 2.7 -- def viewkeys(self): "od.viewkeys() -> a set-like object providing a view on od's keys" return KeysView(self) def viewvalues(self): "od.viewvalues() -> an object providing a view on od's values" return ValuesView(self) def viewitems(self): "od.viewitems() -> a set-like object providing a view on od's items" return ItemsView(self) try: from logging.config import BaseConfigurator, valid_ident except ImportError: # pragma: no cover IDENTIFIER = re.compile('^[a-z_][a-z0-9_]*$', re.I) def valid_ident(s): m = IDENTIFIER.match(s) if not m: raise ValueError('Not a valid Python identifier: %r' % s) return True # The ConvertingXXX classes are wrappers around standard Python containers, # and they serve to convert any suitable values in the container. The # conversion converts base dicts, lists and tuples to their wrapped # equivalents, whereas strings which match a conversion format are converted # appropriately. # # Each wrapper should have a configurator attribute holding the actual # configurator to use for conversion. class ConvertingDict(dict): """A converting dictionary wrapper.""" def __getitem__(self, key): value = dict.__getitem__(self, key) result = self.configurator.convert(value) #If the converted value is different, save for next time if value is not result: self[key] = result if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result def get(self, key, default=None): value = dict.get(self, key, default) result = self.configurator.convert(value) #If the converted value is different, save for next time if value is not result: self[key] = result if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result def pop(self, key, default=None): value = dict.pop(self, key, default) result = self.configurator.convert(value) if value is not result: if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result class ConvertingList(list): """A converting list wrapper.""" def __getitem__(self, key): value = list.__getitem__(self, key) result = self.configurator.convert(value) #If the converted value is different, save for next time if value is not result: self[key] = result if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result def pop(self, idx=-1): value = list.pop(self, idx) result = self.configurator.convert(value) if value is not result: if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self return result class ConvertingTuple(tuple): """A converting tuple wrapper.""" def __getitem__(self, key): value = tuple.__getitem__(self, key) result = self.configurator.convert(value) if value is not result: if type(result) in (ConvertingDict, ConvertingList, ConvertingTuple): result.parent = self result.key = key return result class BaseConfigurator(object): """ The configurator base class which defines some useful defaults. """ CONVERT_PATTERN = re.compile(r'^(?P[a-z]+)://(?P.*)$') WORD_PATTERN = re.compile(r'^\s*(\w+)\s*') DOT_PATTERN = re.compile(r'^\.\s*(\w+)\s*') INDEX_PATTERN = re.compile(r'^\[\s*(\w+)\s*\]\s*') DIGIT_PATTERN = re.compile(r'^\d+$') value_converters = { 'ext' : 'ext_convert', 'cfg' : 'cfg_convert', } # We might want to use a different one, e.g. importlib importer = staticmethod(__import__) def __init__(self, config): self.config = ConvertingDict(config) self.config.configurator = self def resolve(self, s): """ Resolve strings to objects using standard import and attribute syntax. """ name = s.split('.') used = name.pop(0) try: found = self.importer(used) for frag in name: used += '.' + frag try: found = getattr(found, frag) except AttributeError: self.importer(used) found = getattr(found, frag) return found except ImportError: e, tb = sys.exc_info()[1:] v = ValueError('Cannot resolve %r: %s' % (s, e)) v.__cause__, v.__traceback__ = e, tb raise v def ext_convert(self, value): """Default converter for the ext:// protocol.""" return self.resolve(value) def cfg_convert(self, value): """Default converter for the cfg:// protocol.""" rest = value m = self.WORD_PATTERN.match(rest) if m is None: raise ValueError("Unable to convert %r" % value) else: rest = rest[m.end():] d = self.config[m.groups()[0]] #print d, rest while rest: m = self.DOT_PATTERN.match(rest) if m: d = d[m.groups()[0]] else: m = self.INDEX_PATTERN.match(rest) if m: idx = m.groups()[0] if not self.DIGIT_PATTERN.match(idx): d = d[idx] else: try: n = int(idx) # try as number first (most likely) d = d[n] except TypeError: d = d[idx] if m: rest = rest[m.end():] else: raise ValueError('Unable to convert ' '%r at %r' % (value, rest)) #rest should be empty return d def convert(self, value): """ Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. """ if not isinstance(value, ConvertingDict) and isinstance(value, dict): value = ConvertingDict(value) value.configurator = self elif not isinstance(value, ConvertingList) and isinstance(value, list): value = ConvertingList(value) value.configurator = self elif not isinstance(value, ConvertingTuple) and\ isinstance(value, tuple): value = ConvertingTuple(value) value.configurator = self elif isinstance(value, string_types): m = self.CONVERT_PATTERN.match(value) if m: d = m.groupdict() prefix = d['prefix'] converter = self.value_converters.get(prefix, None) if converter: suffix = d['suffix'] converter = getattr(self, converter) value = converter(suffix) return value def configure_custom(self, config): """Configure an object with a user-supplied factory.""" c = config.pop('()') if not callable(c): c = self.resolve(c) props = config.pop('.', None) # Check for valid identifiers kwargs = dict([(k, config[k]) for k in config if valid_ident(k)]) result = c(**kwargs) if props: for name, value in props.items(): setattr(result, name, value) return result def as_tuple(self, value): """Utility function which converts lists to tuples.""" if isinstance(value, list): value = tuple(value) return value PK!Io locators.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except ImportError: # pragma: no cover import dummy_threading as threading import zlib from . import DistlibException from .compat import (urljoin, urlparse, urlunparse, url2pathname, pathname2url, queue, quote, unescape, build_opener, HTTPRedirectHandler as BaseRedirectHandler, text_type, Request, HTTPError, URLError) from .database import Distribution, DistributionPath, make_dist from .metadata import Metadata, MetadataInvalidError from .util import (cached_property, ensure_slash, split_filename, get_project_data, parse_requirement, parse_name_and_version, ServerProxy, normalize_name) from .version import get_scheme, UnsupportedVersionError from .wheel import Wheel, is_compatible logger = logging.getLogger(__name__) HASHER_HASH = re.compile(r'^(\w+)=([a-f0-9]+)') CHARSET = re.compile(r';\s*charset\s*=\s*(.*)\s*$', re.I) HTML_CONTENT_TYPE = re.compile('text/html|application/x(ht)?ml') DEFAULT_INDEX = 'https://pypi.org/pypi' def get_all_distribution_names(url=None): """ Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. """ if url is None: url = DEFAULT_INDEX client = ServerProxy(url, timeout=3.0) try: return client.list_packages() finally: client('close')() class RedirectHandler(BaseRedirectHandler): """ A class to work around a bug in some Python 3.2.x releases. """ # There's a bug in the base version for some 3.2.x # (e.g. 3.2.2 on Ubuntu Oneiric). If a Location header # returns e.g. /abc, it bails because it says the scheme '' # is bogus, when actually it should use the request's # URL for the scheme. See Python issue #13696. def http_error_302(self, req, fp, code, msg, headers): # Some servers (incorrectly) return multiple Location headers # (so probably same goes for URI). Use first header. newurl = None for key in ('location', 'uri'): if key in headers: newurl = headers[key] break if newurl is None: # pragma: no cover return urlparts = urlparse(newurl) if urlparts.scheme == '': newurl = urljoin(req.get_full_url(), newurl) if hasattr(headers, 'replace_header'): headers.replace_header(key, newurl) else: headers[key] = newurl return BaseRedirectHandler.http_error_302(self, req, fp, code, msg, headers) http_error_301 = http_error_303 = http_error_307 = http_error_302 class Locator(object): """ A base class for locators - things that locate distributions. """ source_extensions = ('.tar.gz', '.tar.bz2', '.tar', '.zip', '.tgz', '.tbz') binary_extensions = ('.egg', '.exe', '.whl') excluded_extensions = ('.pdf',) # A list of tags indicating which wheels you want to match. The default # value of None matches against the tags compatible with the running # Python. If you want to match other values, set wheel_tags on a locator # instance to a list of tuples (pyver, abi, arch) which you want to match. wheel_tags = None downloadable_extensions = source_extensions + ('.whl',) def __init__(self, scheme='default'): """ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. """ self._cache = {} self.scheme = scheme # Because of bugs in some of the handlers on some of the platforms, # we use our own opener rather than just using urlopen. self.opener = build_opener(RedirectHandler()) # If get_project() is called from locate(), the matcher instance # is set from the requirement passed to locate(). See issue #18 for # why this can be useful to know. self.matcher = None self.errors = queue.Queue() def get_errors(self): """ Return any errors which have occurred. """ result = [] while not self.errors.empty(): # pragma: no cover try: e = self.errors.get(False) result.append(e) except self.errors.Empty: continue self.errors.task_done() return result def clear_errors(self): """ Clear any errors which may have been logged. """ # Just get the errors and throw them away self.get_errors() def clear_cache(self): self._cache.clear() def _get_scheme(self): return self._scheme def _set_scheme(self, value): self._scheme = value scheme = property(_get_scheme, _set_scheme) def _get_project(self, name): """ For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. """ raise NotImplementedError('Please implement in the subclass') def get_distribution_names(self): """ Return all the distribution names known to this locator. """ raise NotImplementedError('Please implement in the subclass') def get_project(self, name): """ For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. """ if self._cache is None: # pragma: no cover result = self._get_project(name) elif name in self._cache: result = self._cache[name] else: self.clear_errors() result = self._get_project(name) self._cache[name] = result return result def score_url(self, url): """ Give an url a score which can be used to choose preferred URLs for a given project release. """ t = urlparse(url) basename = posixpath.basename(t.path) compatible = True is_wheel = basename.endswith('.whl') is_downloadable = basename.endswith(self.downloadable_extensions) if is_wheel: compatible = is_compatible(Wheel(basename), self.wheel_tags) return (t.scheme == 'https', 'pypi.org' in t.netloc, is_downloadable, is_wheel, compatible, basename) def prefer_url(self, url1, url2): """ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. """ result = url2 if url1: s1 = self.score_url(url1) s2 = self.score_url(url2) if s1 > s2: result = url1 if result != url2: logger.debug('Not replacing %r with %r', url1, url2) else: logger.debug('Replacing %r with %r', url1, url2) return result def split_filename(self, filename, project_name): """ Attempt to split a filename in project name, version and Python version. """ return split_filename(filename, project_name) def convert_url_to_download_info(self, url, project_name): """ See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned. """ def same_project(name1, name2): return normalize_name(name1) == normalize_name(name2) result = None scheme, netloc, path, params, query, frag = urlparse(url) if frag.lower().startswith('egg='): # pragma: no cover logger.debug('%s: version hint in fragment: %r', project_name, frag) m = HASHER_HASH.match(frag) if m: algo, digest = m.groups() else: algo, digest = None, None origpath = path if path and path[-1] == '/': # pragma: no cover path = path[:-1] if path.endswith('.whl'): try: wheel = Wheel(path) if not is_compatible(wheel, self.wheel_tags): logger.debug('Wheel not compatible: %s', path) else: if project_name is None: include = True else: include = same_project(wheel.name, project_name) if include: result = { 'name': wheel.name, 'version': wheel.version, 'filename': wheel.filename, 'url': urlunparse((scheme, netloc, origpath, params, query, '')), 'python-version': ', '.join( ['.'.join(list(v[2:])) for v in wheel.pyver]), } except Exception as e: # pragma: no cover logger.warning('invalid path for wheel: %s', path) elif not path.endswith(self.downloadable_extensions): # pragma: no cover logger.debug('Not downloadable: %s', path) else: # downloadable extension path = filename = posixpath.basename(path) for ext in self.downloadable_extensions: if path.endswith(ext): path = path[:-len(ext)] t = self.split_filename(path, project_name) if not t: # pragma: no cover logger.debug('No match for project/version: %s', path) else: name, version, pyver = t if not project_name or same_project(project_name, name): result = { 'name': name, 'version': version, 'filename': filename, 'url': urlunparse((scheme, netloc, origpath, params, query, '')), #'packagetype': 'sdist', } if pyver: # pragma: no cover result['python-version'] = pyver break if result and algo: result['%s_digest' % algo] = digest return result def _get_digest(self, info): """ Get a digest from a dictionary by looking at a "digests" dictionary or keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. """ result = None if 'digests' in info: digests = info['digests'] for algo in ('sha256', 'md5'): if algo in digests: result = (algo, digests[algo]) break if not result: for algo in ('sha256', 'md5'): key = '%s_digest' % algo if key in info: result = (algo, info[key]) break return result def _update_version_data(self, result, info): """ Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. """ name = info.pop('name') version = info.pop('version') if version in result: dist = result[version] md = dist.metadata else: dist = make_dist(name, version, scheme=self.scheme) md = dist.metadata dist.digest = digest = self._get_digest(info) url = info['url'] result['digests'][url] = digest if md.source_url != info['url']: md.source_url = self.prefer_url(md.source_url, url) result['urls'].setdefault(version, set()).add(url) dist.locator = self result[version] = dist def locate(self, requirement, prereleases=False): """ Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. """ result = None r = parse_requirement(requirement) if r is None: # pragma: no cover raise DistlibException('Not a valid requirement: %r' % requirement) scheme = get_scheme(self.scheme) self.matcher = matcher = scheme.matcher(r.requirement) logger.debug('matcher: %s (%s)', matcher, type(matcher).__name__) versions = self.get_project(r.name) if len(versions) > 2: # urls and digests keys are present # sometimes, versions are invalid slist = [] vcls = matcher.version_class for k in versions: if k in ('urls', 'digests'): continue try: if not matcher.match(k): pass # logger.debug('%s did not match %r', matcher, k) else: if prereleases or not vcls(k).is_prerelease: slist.append(k) # else: # logger.debug('skipping pre-release ' # 'version %s of %s', k, matcher.name) except Exception: # pragma: no cover logger.warning('error matching %s with %r', matcher, k) pass # slist.append(k) if len(slist) > 1: slist = sorted(slist, key=scheme.key) if slist: logger.debug('sorted list: %s', slist) version = slist[-1] result = versions[version] if result: if r.extras: result.extras = r.extras result.download_urls = versions.get('urls', {}).get(version, set()) d = {} sd = versions.get('digests', {}) for url in result.download_urls: if url in sd: # pragma: no cover d[url] = sd[url] result.digests = d self.matcher = None return result class PyPIRPCLocator(Locator): """ This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). """ def __init__(self, url, **kwargs): """ Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. """ super(PyPIRPCLocator, self).__init__(**kwargs) self.base_url = url self.client = ServerProxy(url, timeout=3.0) def get_distribution_names(self): """ Return all the distribution names known to this locator. """ return set(self.client.list_packages()) def _get_project(self, name): result = {'urls': {}, 'digests': {}} versions = self.client.package_releases(name, True) for v in versions: urls = self.client.release_urls(name, v) data = self.client.release_data(name, v) metadata = Metadata(scheme=self.scheme) metadata.name = data['name'] metadata.version = data['version'] metadata.license = data.get('license') metadata.keywords = data.get('keywords', []) metadata.summary = data.get('summary') dist = Distribution(metadata) if urls: info = urls[0] metadata.source_url = info['url'] dist.digest = self._get_digest(info) dist.locator = self result[v] = dist for info in urls: url = info['url'] digest = self._get_digest(info) result['urls'].setdefault(v, set()).add(url) result['digests'][url] = digest return result class PyPIJSONLocator(Locator): """ This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. """ def __init__(self, url, **kwargs): super(PyPIJSONLocator, self).__init__(**kwargs) self.base_url = ensure_slash(url) def get_distribution_names(self): """ Return all the distribution names known to this locator. """ raise NotImplementedError('Not available from this locator') def _get_project(self, name): result = {'urls': {}, 'digests': {}} url = urljoin(self.base_url, '%s/json' % quote(name)) try: resp = self.opener.open(url) data = resp.read().decode() # for now d = json.loads(data) md = Metadata(scheme=self.scheme) data = d['info'] md.name = data['name'] md.version = data['version'] md.license = data.get('license') md.keywords = data.get('keywords', []) md.summary = data.get('summary') dist = Distribution(md) dist.locator = self urls = d['urls'] result[md.version] = dist for info in d['urls']: url = info['url'] dist.download_urls.add(url) dist.digests[url] = self._get_digest(info) result['urls'].setdefault(md.version, set()).add(url) result['digests'][url] = self._get_digest(info) # Now get other releases for version, infos in d['releases'].items(): if version == md.version: continue # already done omd = Metadata(scheme=self.scheme) omd.name = md.name omd.version = version odist = Distribution(omd) odist.locator = self result[version] = odist for info in infos: url = info['url'] odist.download_urls.add(url) odist.digests[url] = self._get_digest(info) result['urls'].setdefault(version, set()).add(url) result['digests'][url] = self._get_digest(info) # for info in urls: # md.source_url = info['url'] # dist.digest = self._get_digest(info) # dist.locator = self # for info in urls: # url = info['url'] # result['urls'].setdefault(md.version, set()).add(url) # result['digests'][url] = self._get_digest(info) except Exception as e: self.errors.put(text_type(e)) logger.exception('JSON fetch failed: %s', e) return result class Page(object): """ This class represents a scraped HTML page. """ # The following slightly hairy-looking regex just looks for the contents of # an anchor link, which has an attribute "href" either immediately preceded # or immediately followed by a "rel" attribute. The attribute values can be # declared with double quotes, single quotes or no quotes - which leads to # the length of the expression. _href = re.compile(""" (rel\\s*=\\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\\s\n]*))\\s+)? href\\s*=\\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\\s\n]*)) (\\s+rel\\s*=\\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\\s\n]*)))? """, re.I | re.S | re.X) _base = re.compile(r"""]+)""", re.I | re.S) def __init__(self, data, url): """ Initialise an instance with the Unicode page contents and the URL they came from. """ self.data = data self.base_url = self.url = url m = self._base.search(self.data) if m: self.base_url = m.group(1) _clean_re = re.compile(r'[^a-z0-9$&+,/:;=?@.#%_\\|-]', re.I) @cached_property def links(self): """ Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. """ def clean(url): "Tidy up an URL." scheme, netloc, path, params, query, frag = urlparse(url) return urlunparse((scheme, netloc, quote(path), params, query, frag)) result = set() for match in self._href.finditer(self.data): d = match.groupdict('') rel = (d['rel1'] or d['rel2'] or d['rel3'] or d['rel4'] or d['rel5'] or d['rel6']) url = d['url1'] or d['url2'] or d['url3'] url = urljoin(self.base_url, url) url = unescape(url) url = self._clean_re.sub(lambda m: '%%%2x' % ord(m.group(0)), url) result.add((url, rel)) # We sort the result, hoping to bring the most recent versions # to the front result = sorted(result, key=lambda t: t[0], reverse=True) return result class SimpleScrapingLocator(Locator): """ A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. """ # These are used to deal with various Content-Encoding schemes. decoders = { 'deflate': zlib.decompress, 'gzip': lambda b: gzip.GzipFile(fileobj=BytesIO(b)).read(), 'none': lambda b: b, } def __init__(self, url, timeout=None, num_workers=10, **kwargs): """ Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. """ super(SimpleScrapingLocator, self).__init__(**kwargs) self.base_url = ensure_slash(url) self.timeout = timeout self._page_cache = {} self._seen = set() self._to_fetch = queue.Queue() self._bad_hosts = set() self.skip_externals = False self.num_workers = num_workers self._lock = threading.RLock() # See issue #45: we need to be resilient when the locator is used # in a thread, e.g. with concurrent.futures. We can't use self._lock # as it is for coordinating our internal threads - the ones created # in _prepare_threads. self._gplock = threading.RLock() self.platform_check = False # See issue #112 def _prepare_threads(self): """ Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). """ self._threads = [] for i in range(self.num_workers): t = threading.Thread(target=self._fetch) t.setDaemon(True) t.start() self._threads.append(t) def _wait_threads(self): """ Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. """ # Note that you need two loops, since you can't say which # thread will get each sentinel for t in self._threads: self._to_fetch.put(None) # sentinel for t in self._threads: t.join() self._threads = [] def _get_project(self, name): result = {'urls': {}, 'digests': {}} with self._gplock: self.result = result self.project_name = name url = urljoin(self.base_url, '%s/' % quote(name)) self._seen.clear() self._page_cache.clear() self._prepare_threads() try: logger.debug('Queueing %s', url) self._to_fetch.put(url) self._to_fetch.join() finally: self._wait_threads() del self.result return result platform_dependent = re.compile(r'\b(linux_(i\d86|x86_64|arm\w+)|' r'win(32|_amd64)|macosx_?\d+)\b', re.I) def _is_platform_dependent(self, url): """ Does an URL refer to a platform-specific download? """ return self.platform_dependent.search(url) def _process_download(self, url): """ See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. """ if self.platform_check and self._is_platform_dependent(url): info = None else: info = self.convert_url_to_download_info(url, self.project_name) logger.debug('process_download: %s -> %s', url, info) if info: with self._lock: # needed because self.result is shared self._update_version_data(self.result, info) return info def _should_queue(self, link, referrer, rel): """ Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. """ scheme, netloc, path, _, _, _ = urlparse(link) if path.endswith(self.source_extensions + self.binary_extensions + self.excluded_extensions): result = False elif self.skip_externals and not link.startswith(self.base_url): result = False elif not referrer.startswith(self.base_url): result = False elif rel not in ('homepage', 'download'): result = False elif scheme not in ('http', 'https', 'ftp'): result = False elif self._is_platform_dependent(link): result = False else: host = netloc.split(':', 1)[0] if host.lower() == 'localhost': result = False else: result = True logger.debug('should_queue: %s (%s) from %s -> %s', link, rel, referrer, result) return result def _fetch(self): """ Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. """ while True: url = self._to_fetch.get() try: if url: page = self.get_page(url) if page is None: # e.g. after an error continue for link, rel in page.links: if link not in self._seen: try: self._seen.add(link) if (not self._process_download(link) and self._should_queue(link, url, rel)): logger.debug('Queueing %s from %s', link, url) self._to_fetch.put(link) except MetadataInvalidError: # e.g. invalid versions pass except Exception as e: # pragma: no cover self.errors.put(text_type(e)) finally: # always do this, to avoid hangs :-) self._to_fetch.task_done() if not url: #logger.debug('Sentinel seen, quitting.') break def get_page(self, url): """ Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). """ # http://peak.telecommunity.com/DevCenter/EasyInstall#package-index-api scheme, netloc, path, _, _, _ = urlparse(url) if scheme == 'file' and os.path.isdir(url2pathname(path)): url = urljoin(ensure_slash(url), 'index.html') if url in self._page_cache: result = self._page_cache[url] logger.debug('Returning %s from cache: %s', url, result) else: host = netloc.split(':', 1)[0] result = None if host in self._bad_hosts: logger.debug('Skipping %s due to bad host %s', url, host) else: req = Request(url, headers={'Accept-encoding': 'identity'}) try: logger.debug('Fetching %s', url) resp = self.opener.open(req, timeout=self.timeout) logger.debug('Fetched %s', url) headers = resp.info() content_type = headers.get('Content-Type', '') if HTML_CONTENT_TYPE.match(content_type): final_url = resp.geturl() data = resp.read() encoding = headers.get('Content-Encoding') if encoding: decoder = self.decoders[encoding] # fail if not found data = decoder(data) encoding = 'utf-8' m = CHARSET.search(content_type) if m: encoding = m.group(1) try: data = data.decode(encoding) except UnicodeError: # pragma: no cover data = data.decode('latin-1') # fallback result = Page(data, final_url) self._page_cache[final_url] = result except HTTPError as e: if e.code != 404: logger.exception('Fetch failed: %s: %s', url, e) except URLError as e: # pragma: no cover logger.exception('Fetch failed: %s: %s', url, e) with self._lock: self._bad_hosts.add(host) except Exception as e: # pragma: no cover logger.exception('Fetch failed: %s: %s', url, e) finally: self._page_cache[url] = result # even if None (failure) return result _distname_re = re.compile(']*>([^<]+)<') def get_distribution_names(self): """ Return all the distribution names known to this locator. """ result = set() page = self.get_page(self.base_url) if not page: raise DistlibException('Unable to get %s' % self.base_url) for match in self._distname_re.finditer(page.data): result.add(match.group(1)) return result class DirectoryLocator(Locator): """ This class locates distributions in a directory tree. """ def __init__(self, path, **kwargs): """ Initialise an instance. :param path: The root of the directory tree to search. :param kwargs: Passed to the superclass constructor, except for: * recursive - if True (the default), subdirectories are recursed into. If False, only the top-level directory is searched, """ self.recursive = kwargs.pop('recursive', True) super(DirectoryLocator, self).__init__(**kwargs) path = os.path.abspath(path) if not os.path.isdir(path): # pragma: no cover raise DistlibException('Not a directory: %r' % path) self.base_dir = path def should_include(self, filename, parent): """ Should a filename be considered as a candidate for a distribution archive? As well as the filename, the directory which contains it is provided, though not used by the current implementation. """ return filename.endswith(self.downloadable_extensions) def _get_project(self, name): result = {'urls': {}, 'digests': {}} for root, dirs, files in os.walk(self.base_dir): for fn in files: if self.should_include(fn, root): fn = os.path.join(root, fn) url = urlunparse(('file', '', pathname2url(os.path.abspath(fn)), '', '', '')) info = self.convert_url_to_download_info(url, name) if info: self._update_version_data(result, info) if not self.recursive: break return result def get_distribution_names(self): """ Return all the distribution names known to this locator. """ result = set() for root, dirs, files in os.walk(self.base_dir): for fn in files: if self.should_include(fn, root): fn = os.path.join(root, fn) url = urlunparse(('file', '', pathname2url(os.path.abspath(fn)), '', '', '')) info = self.convert_url_to_download_info(url, None) if info: result.add(info['name']) if not self.recursive: break return result class JSONLocator(Locator): """ This locator uses special extended metadata (not available on PyPI) and is the basis of performant dependency resolution in distlib. Other locators require archive downloads before dependencies can be determined! As you might imagine, that can be slow. """ def get_distribution_names(self): """ Return all the distribution names known to this locator. """ raise NotImplementedError('Not available from this locator') def _get_project(self, name): result = {'urls': {}, 'digests': {}} data = get_project_data(name) if data: for info in data.get('files', []): if info['ptype'] != 'sdist' or info['pyversion'] != 'source': continue # We don't store summary in project metadata as it makes # the data bigger for no benefit during dependency # resolution dist = make_dist(data['name'], info['version'], summary=data.get('summary', 'Placeholder for summary'), scheme=self.scheme) md = dist.metadata md.source_url = info['url'] # TODO SHA256 digest if 'digest' in info and info['digest']: dist.digest = ('md5', info['digest']) md.dependencies = info.get('requirements', {}) dist.exports = info.get('exports', {}) result[dist.version] = dist result['urls'].setdefault(dist.version, set()).add(info['url']) return result class DistPathLocator(Locator): """ This locator finds installed distributions in a path. It can be useful for adding to an :class:`AggregatingLocator`. """ def __init__(self, distpath, **kwargs): """ Initialise an instance. :param distpath: A :class:`DistributionPath` instance to search. """ super(DistPathLocator, self).__init__(**kwargs) assert isinstance(distpath, DistributionPath) self.distpath = distpath def _get_project(self, name): dist = self.distpath.get_distribution(name) if dist is None: result = {'urls': {}, 'digests': {}} else: result = { dist.version: dist, 'urls': {dist.version: set([dist.source_url])}, 'digests': {dist.version: set([None])} } return result class AggregatingLocator(Locator): """ This class allows you to chain and/or merge a list of locators. """ def __init__(self, *locators, **kwargs): """ Initialise an instance. :param locators: The list of locators to search. :param kwargs: Passed to the superclass constructor, except for: * merge - if False (the default), the first successful search from any of the locators is returned. If True, the results from all locators are merged (this can be slow). """ self.merge = kwargs.pop('merge', False) self.locators = locators super(AggregatingLocator, self).__init__(**kwargs) def clear_cache(self): super(AggregatingLocator, self).clear_cache() for locator in self.locators: locator.clear_cache() def _set_scheme(self, value): self._scheme = value for locator in self.locators: locator.scheme = value scheme = property(Locator.scheme.fget, _set_scheme) def _get_project(self, name): result = {} for locator in self.locators: d = locator.get_project(name) if d: if self.merge: files = result.get('urls', {}) digests = result.get('digests', {}) # next line could overwrite result['urls'], result['digests'] result.update(d) df = result.get('urls') if files and df: for k, v in files.items(): if k in df: df[k] |= v else: df[k] = v dd = result.get('digests') if digests and dd: dd.update(digests) else: # See issue #18. If any dists are found and we're looking # for specific constraints, we only return something if # a match is found. For example, if a DirectoryLocator # returns just foo (1.0) while we're looking for # foo (>= 2.0), we'll pretend there was nothing there so # that subsequent locators can be queried. Otherwise we # would just return foo (1.0) which would then lead to a # failure to find foo (>= 2.0), because other locators # weren't searched. Note that this only matters when # merge=False. if self.matcher is None: found = True else: found = False for k in d: if self.matcher.match(k): found = True break if found: result = d break return result def get_distribution_names(self): """ Return all the distribution names known to this locator. """ result = set() for locator in self.locators: try: result |= locator.get_distribution_names() except NotImplementedError: pass return result # We use a legacy scheme simply because most of the dists on PyPI use legacy # versions which don't conform to PEP 426 / PEP 440. default_locator = AggregatingLocator( JSONLocator(), SimpleScrapingLocator('https://pypi.org/simple/', timeout=3.0), scheme='legacy') locate = default_locator.locate class DependencyFinder(object): """ Locate dependencies for distributions. """ def __init__(self, locator=None): """ Initialise an instance, using the specified locator to locate distributions. """ self.locator = locator or default_locator self.scheme = get_scheme(self.locator.scheme) def add_distribution(self, dist): """ Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. """ logger.debug('adding distribution %s', dist) name = dist.key self.dists_by_name[name] = dist self.dists[(name, dist.version)] = dist for p in dist.provides: name, version = parse_name_and_version(p) logger.debug('Add to provided: %s, %s, %s', name, version, dist) self.provided.setdefault(name, set()).add((version, dist)) def remove_distribution(self, dist): """ Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. """ logger.debug('removing distribution %s', dist) name = dist.key del self.dists_by_name[name] del self.dists[(name, dist.version)] for p in dist.provides: name, version = parse_name_and_version(p) logger.debug('Remove from provided: %s, %s, %s', name, version, dist) s = self.provided[name] s.remove((version, dist)) if not s: del self.provided[name] def get_matcher(self, reqt): """ Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). """ try: matcher = self.scheme.matcher(reqt) except UnsupportedVersionError: # pragma: no cover # XXX compat-mode if cannot read the version name = reqt.split()[0] matcher = self.scheme.matcher(name) return matcher def find_providers(self, reqt): """ Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. """ matcher = self.get_matcher(reqt) name = matcher.key # case-insensitive result = set() provided = self.provided if name in provided: for version, provider in provided[name]: try: match = matcher.match(version) except UnsupportedVersionError: match = False if match: result.add(provider) break return result def try_to_replace(self, provider, other, problems): """ Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. """ rlist = self.reqts[other] unmatched = set() for s in rlist: matcher = self.get_matcher(s) if not matcher.match(provider.version): unmatched.add(s) if unmatched: # can't replace other with provider problems.add(('cantreplace', provider, other, frozenset(unmatched))) result = False else: # can replace other with provider self.remove_distribution(other) del self.reqts[other] for s in rlist: self.reqts.setdefault(provider, set()).add(s) self.add_distribution(provider) result = True return result def find(self, requirement, meta_extras=None, prereleases=False): """ Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. """ self.provided = {} self.dists = {} self.dists_by_name = {} self.reqts = {} meta_extras = set(meta_extras or []) if ':*:' in meta_extras: meta_extras.remove(':*:') # :meta: and :run: are implicitly included meta_extras |= set([':test:', ':build:', ':dev:']) if isinstance(requirement, Distribution): dist = odist = requirement logger.debug('passed %s as requirement', odist) else: dist = odist = self.locator.locate(requirement, prereleases=prereleases) if dist is None: raise DistlibException('Unable to locate %r' % requirement) logger.debug('located %s', odist) dist.requested = True problems = set() todo = set([dist]) install_dists = set([odist]) while todo: dist = todo.pop() name = dist.key # case-insensitive if name not in self.dists_by_name: self.add_distribution(dist) else: #import pdb; pdb.set_trace() other = self.dists_by_name[name] if other != dist: self.try_to_replace(dist, other, problems) ireqts = dist.run_requires | dist.meta_requires sreqts = dist.build_requires ereqts = set() if meta_extras and dist in install_dists: for key in ('test', 'build', 'dev'): e = ':%s:' % key if e in meta_extras: ereqts |= getattr(dist, '%s_requires' % key) all_reqts = ireqts | sreqts | ereqts for r in all_reqts: providers = self.find_providers(r) if not providers: logger.debug('No providers found for %r', r) provider = self.locator.locate(r, prereleases=prereleases) # If no provider is found and we didn't consider # prereleases, consider them now. if provider is None and not prereleases: provider = self.locator.locate(r, prereleases=True) if provider is None: logger.debug('Cannot satisfy %r', r) problems.add(('unsatisfied', r)) else: n, v = provider.key, provider.version if (n, v) not in self.dists: todo.add(provider) providers.add(provider) if r in ireqts and dist in install_dists: install_dists.add(provider) logger.debug('Adding %s to install_dists', provider.name_and_version) for p in providers: name = p.key if name not in self.dists_by_name: self.reqts.setdefault(p, set()).add(r) else: other = self.dists_by_name[name] if other != p: # see if other can be replaced by p self.try_to_replace(p, other, problems) dists = set(self.dists.values()) for dist in dists: dist.build_time_dependency = dist not in install_dists if dist.build_time_dependency: logger.debug('%s is a build-time dependency only.', dist.name_and_version) logger.debug('find done for %s', odist) return dists, problems PK!=XŘŘ metadata.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Implementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and withdrawn 2.0). """ from __future__ import unicode_literals import codecs from email import message_from_file import json import logging import re from . import DistlibException, __version__ from .compat import StringIO, string_types, text_type from .markers import interpret from .util import extract_by_key, get_extras from .version import get_scheme, PEP440_VERSION_RE logger = logging.getLogger(__name__) class MetadataMissingError(DistlibException): """A required metadata is missing""" class MetadataConflictError(DistlibException): """Attempt to read or write metadata fields that are conflictual.""" class MetadataUnrecognizedVersionError(DistlibException): """Unknown metadata version number.""" class MetadataInvalidError(DistlibException): """A metadata value is invalid""" # public API of this module __all__ = ['Metadata', 'PKG_INFO_ENCODING', 'PKG_INFO_PREFERRED_VERSION'] # Encoding used for the PKG-INFO files PKG_INFO_ENCODING = 'utf-8' # preferred version. Hopefully will be changed # to 1.2 once PEP 345 is supported everywhere PKG_INFO_PREFERRED_VERSION = '1.1' _LINE_PREFIX_1_2 = re.compile('\n \\|') _LINE_PREFIX_PRE_1_2 = re.compile('\n ') _241_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', 'Summary', 'Description', 'Keywords', 'Home-page', 'Author', 'Author-email', 'License') _314_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform', 'Summary', 'Description', 'Keywords', 'Home-page', 'Author', 'Author-email', 'License', 'Classifier', 'Download-URL', 'Obsoletes', 'Provides', 'Requires') _314_MARKERS = ('Obsoletes', 'Provides', 'Requires', 'Classifier', 'Download-URL') _345_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform', 'Summary', 'Description', 'Keywords', 'Home-page', 'Author', 'Author-email', 'Maintainer', 'Maintainer-email', 'License', 'Classifier', 'Download-URL', 'Obsoletes-Dist', 'Project-URL', 'Provides-Dist', 'Requires-Dist', 'Requires-Python', 'Requires-External') _345_MARKERS = ('Provides-Dist', 'Requires-Dist', 'Requires-Python', 'Obsoletes-Dist', 'Requires-External', 'Maintainer', 'Maintainer-email', 'Project-URL') _426_FIELDS = ('Metadata-Version', 'Name', 'Version', 'Platform', 'Supported-Platform', 'Summary', 'Description', 'Keywords', 'Home-page', 'Author', 'Author-email', 'Maintainer', 'Maintainer-email', 'License', 'Classifier', 'Download-URL', 'Obsoletes-Dist', 'Project-URL', 'Provides-Dist', 'Requires-Dist', 'Requires-Python', 'Requires-External', 'Private-Version', 'Obsoleted-By', 'Setup-Requires-Dist', 'Extension', 'Provides-Extra') _426_MARKERS = ('Private-Version', 'Provides-Extra', 'Obsoleted-By', 'Setup-Requires-Dist', 'Extension') # See issue #106: Sometimes 'Requires' and 'Provides' occur wrongly in # the metadata. Include them in the tuple literal below to allow them # (for now). # Ditto for Obsoletes - see issue #140. _566_FIELDS = _426_FIELDS + ('Description-Content-Type', 'Requires', 'Provides', 'Obsoletes') _566_MARKERS = ('Description-Content-Type',) _ALL_FIELDS = set() _ALL_FIELDS.update(_241_FIELDS) _ALL_FIELDS.update(_314_FIELDS) _ALL_FIELDS.update(_345_FIELDS) _ALL_FIELDS.update(_426_FIELDS) _ALL_FIELDS.update(_566_FIELDS) EXTRA_RE = re.compile(r'''extra\s*==\s*("([^"]+)"|'([^']+)')''') def _version2fieldlist(version): if version == '1.0': return _241_FIELDS elif version == '1.1': return _314_FIELDS elif version == '1.2': return _345_FIELDS elif version in ('1.3', '2.1'): # avoid adding field names if already there return _345_FIELDS + tuple(f for f in _566_FIELDS if f not in _345_FIELDS) elif version == '2.0': return _426_FIELDS raise MetadataUnrecognizedVersionError(version) def _best_version(fields): """Detect the best version depending on the fields used.""" def _has_marker(keys, markers): for marker in markers: if marker in keys: return True return False keys = [] for key, value in fields.items(): if value in ([], 'UNKNOWN', None): continue keys.append(key) possible_versions = ['1.0', '1.1', '1.2', '1.3', '2.0', '2.1'] # first let's try to see if a field is not part of one of the version for key in keys: if key not in _241_FIELDS and '1.0' in possible_versions: possible_versions.remove('1.0') logger.debug('Removed 1.0 due to %s', key) if key not in _314_FIELDS and '1.1' in possible_versions: possible_versions.remove('1.1') logger.debug('Removed 1.1 due to %s', key) if key not in _345_FIELDS and '1.2' in possible_versions: possible_versions.remove('1.2') logger.debug('Removed 1.2 due to %s', key) if key not in _566_FIELDS and '1.3' in possible_versions: possible_versions.remove('1.3') logger.debug('Removed 1.3 due to %s', key) if key not in _566_FIELDS and '2.1' in possible_versions: if key != 'Description': # In 2.1, description allowed after headers possible_versions.remove('2.1') logger.debug('Removed 2.1 due to %s', key) if key not in _426_FIELDS and '2.0' in possible_versions: possible_versions.remove('2.0') logger.debug('Removed 2.0 due to %s', key) # possible_version contains qualified versions if len(possible_versions) == 1: return possible_versions[0] # found ! elif len(possible_versions) == 0: logger.debug('Out of options - unknown metadata set: %s', fields) raise MetadataConflictError('Unknown metadata set') # let's see if one unique marker is found is_1_1 = '1.1' in possible_versions and _has_marker(keys, _314_MARKERS) is_1_2 = '1.2' in possible_versions and _has_marker(keys, _345_MARKERS) is_2_1 = '2.1' in possible_versions and _has_marker(keys, _566_MARKERS) is_2_0 = '2.0' in possible_versions and _has_marker(keys, _426_MARKERS) if int(is_1_1) + int(is_1_2) + int(is_2_1) + int(is_2_0) > 1: raise MetadataConflictError('You used incompatible 1.1/1.2/2.0/2.1 fields') # we have the choice, 1.0, or 1.2, or 2.0 # - 1.0 has a broken Summary field but works with all tools # - 1.1 is to avoid # - 1.2 fixes Summary but has little adoption # - 2.0 adds more features and is very new if not is_1_1 and not is_1_2 and not is_2_1 and not is_2_0: # we couldn't find any specific marker if PKG_INFO_PREFERRED_VERSION in possible_versions: return PKG_INFO_PREFERRED_VERSION if is_1_1: return '1.1' if is_1_2: return '1.2' if is_2_1: return '2.1' return '2.0' # This follows the rules about transforming keys as described in # https://www.python.org/dev/peps/pep-0566/#id17 _ATTR2FIELD = { name.lower().replace("-", "_"): name for name in _ALL_FIELDS } _FIELD2ATTR = {field: attr for attr, field in _ATTR2FIELD.items()} _PREDICATE_FIELDS = ('Requires-Dist', 'Obsoletes-Dist', 'Provides-Dist') _VERSIONS_FIELDS = ('Requires-Python',) _VERSION_FIELDS = ('Version',) _LISTFIELDS = ('Platform', 'Classifier', 'Obsoletes', 'Requires', 'Provides', 'Obsoletes-Dist', 'Provides-Dist', 'Requires-Dist', 'Requires-External', 'Project-URL', 'Supported-Platform', 'Setup-Requires-Dist', 'Provides-Extra', 'Extension') _LISTTUPLEFIELDS = ('Project-URL',) _ELEMENTSFIELD = ('Keywords',) _UNICODEFIELDS = ('Author', 'Maintainer', 'Summary', 'Description') _MISSING = object() _FILESAFE = re.compile('[^A-Za-z0-9.]+') def _get_name_and_version(name, version, for_filename=False): """Return the distribution name with version. If for_filename is true, return a filename-escaped form.""" if for_filename: # For both name and version any runs of non-alphanumeric or '.' # characters are replaced with a single '-'. Additionally any # spaces in the version string become '.' name = _FILESAFE.sub('-', name) version = _FILESAFE.sub('-', version.replace(' ', '.')) return '%s-%s' % (name, version) class LegacyMetadata(object): """The legacy metadata of a release. Supports versions 1.0, 1.1, 1.2, 2.0 and 1.3/2.1 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name """ # TODO document the mapping API and UNKNOWN default key def __init__(self, path=None, fileobj=None, mapping=None, scheme='default'): if [path, fileobj, mapping].count(None) < 2: raise TypeError('path, fileobj and mapping are exclusive') self._fields = {} self.requires_files = [] self._dependencies = None self.scheme = scheme if path is not None: self.read(path) elif fileobj is not None: self.read_file(fileobj) elif mapping is not None: self.update(mapping) self.set_metadata_version() def set_metadata_version(self): self._fields['Metadata-Version'] = _best_version(self._fields) def _write_field(self, fileobj, name, value): fileobj.write('%s: %s\n' % (name, value)) def __getitem__(self, name): return self.get(name) def __setitem__(self, name, value): return self.set(name, value) def __delitem__(self, name): field_name = self._convert_name(name) try: del self._fields[field_name] except KeyError: raise KeyError(name) def __contains__(self, name): return (name in self._fields or self._convert_name(name) in self._fields) def _convert_name(self, name): if name in _ALL_FIELDS: return name name = name.replace('-', '_').lower() return _ATTR2FIELD.get(name, name) def _default_value(self, name): if name in _LISTFIELDS or name in _ELEMENTSFIELD: return [] return 'UNKNOWN' def _remove_line_prefix(self, value): if self.metadata_version in ('1.0', '1.1'): return _LINE_PREFIX_PRE_1_2.sub('\n', value) else: return _LINE_PREFIX_1_2.sub('\n', value) def __getattr__(self, name): if name in _ATTR2FIELD: return self[name] raise AttributeError(name) # # Public API # # dependencies = property(_get_dependencies, _set_dependencies) def get_fullname(self, filesafe=False): """Return the distribution name with version. If filesafe is true, return a filename-escaped form.""" return _get_name_and_version(self['Name'], self['Version'], filesafe) def is_field(self, name): """return True if name is a valid metadata key""" name = self._convert_name(name) return name in _ALL_FIELDS def is_multi_field(self, name): name = self._convert_name(name) return name in _LISTFIELDS def read(self, filepath): """Read the metadata values from a file path.""" fp = codecs.open(filepath, 'r', encoding='utf-8') try: self.read_file(fp) finally: fp.close() def read_file(self, fileob): """Read the metadata values from a file object.""" msg = message_from_file(fileob) self._fields['Metadata-Version'] = msg['metadata-version'] # When reading, get all the fields we can for field in _ALL_FIELDS: if field not in msg: continue if field in _LISTFIELDS: # we can have multiple lines values = msg.get_all(field) if field in _LISTTUPLEFIELDS and values is not None: values = [tuple(value.split(',')) for value in values] self.set(field, values) else: # single line value = msg[field] if value is not None and value != 'UNKNOWN': self.set(field, value) # PEP 566 specifies that the body be used for the description, if # available body = msg.get_payload() self["Description"] = body if body else self["Description"] # logger.debug('Attempting to set metadata for %s', self) # self.set_metadata_version() def write(self, filepath, skip_unknown=False): """Write the metadata fields to filepath.""" fp = codecs.open(filepath, 'w', encoding='utf-8') try: self.write_file(fp, skip_unknown) finally: fp.close() def write_file(self, fileobject, skip_unknown=False): """Write the PKG-INFO format data to a file object.""" self.set_metadata_version() for field in _version2fieldlist(self['Metadata-Version']): values = self.get(field) if skip_unknown and values in ('UNKNOWN', [], ['UNKNOWN']): continue if field in _ELEMENTSFIELD: self._write_field(fileobject, field, ','.join(values)) continue if field not in _LISTFIELDS: if field == 'Description': if self.metadata_version in ('1.0', '1.1'): values = values.replace('\n', '\n ') else: values = values.replace('\n', '\n |') values = [values] if field in _LISTTUPLEFIELDS: values = [','.join(value) for value in values] for value in values: self._write_field(fileobject, field, value) def update(self, other=None, **kwargs): """Set metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. """ def _set(key, value): if key in _ATTR2FIELD and value: self.set(self._convert_name(key), value) if not other: # other is None or empty container pass elif hasattr(other, 'keys'): for k in other.keys(): _set(k, other[k]) else: for k, v in other: _set(k, v) if kwargs: for k, v in kwargs.items(): _set(k, v) def set(self, name, value): """Control then set a metadata field.""" name = self._convert_name(name) if ((name in _ELEMENTSFIELD or name == 'Platform') and not isinstance(value, (list, tuple))): if isinstance(value, string_types): value = [v.strip() for v in value.split(',')] else: value = [] elif (name in _LISTFIELDS and not isinstance(value, (list, tuple))): if isinstance(value, string_types): value = [value] else: value = [] if logger.isEnabledFor(logging.WARNING): project_name = self['Name'] scheme = get_scheme(self.scheme) if name in _PREDICATE_FIELDS and value is not None: for v in value: # check that the values are valid if not scheme.is_valid_matcher(v.split(';')[0]): logger.warning( "'%s': '%s' is not valid (field '%s')", project_name, v, name) # FIXME this rejects UNKNOWN, is that right? elif name in _VERSIONS_FIELDS and value is not None: if not scheme.is_valid_constraint_list(value): logger.warning("'%s': '%s' is not a valid version (field '%s')", project_name, value, name) elif name in _VERSION_FIELDS and value is not None: if not scheme.is_valid_version(value): logger.warning("'%s': '%s' is not a valid version (field '%s')", project_name, value, name) if name in _UNICODEFIELDS: if name == 'Description': value = self._remove_line_prefix(value) self._fields[name] = value def get(self, name, default=_MISSING): """Get a metadata field.""" name = self._convert_name(name) if name not in self._fields: if default is _MISSING: default = self._default_value(name) return default if name in _UNICODEFIELDS: value = self._fields[name] return value elif name in _LISTFIELDS: value = self._fields[name] if value is None: return [] res = [] for val in value: if name not in _LISTTUPLEFIELDS: res.append(val) else: # That's for Project-URL res.append((val[0], val[1])) return res elif name in _ELEMENTSFIELD: value = self._fields[name] if isinstance(value, string_types): return value.split(',') return self._fields[name] def check(self, strict=False): """Check if the metadata is compliant. If strict is True then raise if no Name or Version are provided""" self.set_metadata_version() # XXX should check the versions (if the file was loaded) missing, warnings = [], [] for attr in ('Name', 'Version'): # required by PEP 345 if attr not in self: missing.append(attr) if strict and missing != []: msg = 'missing required metadata: %s' % ', '.join(missing) raise MetadataMissingError(msg) for attr in ('Home-page', 'Author'): if attr not in self: missing.append(attr) # checking metadata 1.2 (XXX needs to check 1.1, 1.0) if self['Metadata-Version'] != '1.2': return missing, warnings scheme = get_scheme(self.scheme) def are_valid_constraints(value): for v in value: if not scheme.is_valid_matcher(v.split(';')[0]): return False return True for fields, controller in ((_PREDICATE_FIELDS, are_valid_constraints), (_VERSIONS_FIELDS, scheme.is_valid_constraint_list), (_VERSION_FIELDS, scheme.is_valid_version)): for field in fields: value = self.get(field, None) if value is not None and not controller(value): warnings.append("Wrong value for '%s': %s" % (field, value)) return missing, warnings def todict(self, skip_missing=False): """Return fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). This is as per https://www.python.org/dev/peps/pep-0566/#id17. """ self.set_metadata_version() fields = _version2fieldlist(self['Metadata-Version']) data = {} for field_name in fields: if not skip_missing or field_name in self._fields: key = _FIELD2ATTR[field_name] if key != 'project_url': data[key] = self[field_name] else: data[key] = [','.join(u) for u in self[field_name]] return data def add_requirements(self, requirements): if self['Metadata-Version'] == '1.1': # we can't have 1.1 metadata *and* Setuptools requires for field in ('Obsoletes', 'Requires', 'Provides'): if field in self: del self[field] self['Requires-Dist'] += requirements # Mapping API # TODO could add iter* variants def keys(self): return list(_version2fieldlist(self['Metadata-Version'])) def __iter__(self): for key in self.keys(): yield key def values(self): return [self[key] for key in self.keys()] def items(self): return [(key, self[key]) for key in self.keys()] def __repr__(self): return '<%s %s %s>' % (self.__class__.__name__, self.name, self.version) METADATA_FILENAME = 'pydist.json' WHEEL_METADATA_FILENAME = 'metadata.json' LEGACY_METADATA_FILENAME = 'METADATA' class Metadata(object): """ The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. """ METADATA_VERSION_MATCHER = re.compile(r'^\d+(\.\d+)*$') NAME_MATCHER = re.compile('^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$', re.I) VERSION_MATCHER = PEP440_VERSION_RE SUMMARY_MATCHER = re.compile('.{1,2047}') METADATA_VERSION = '2.0' GENERATOR = 'distlib (%s)' % __version__ MANDATORY_KEYS = { 'name': (), 'version': (), 'summary': ('legacy',), } INDEX_KEYS = ('name version license summary description author ' 'author_email keywords platform home_page classifiers ' 'download_url') DEPENDENCY_KEYS = ('extras run_requires test_requires build_requires ' 'dev_requires provides meta_requires obsoleted_by ' 'supports_environments') SYNTAX_VALIDATORS = { 'metadata_version': (METADATA_VERSION_MATCHER, ()), 'name': (NAME_MATCHER, ('legacy',)), 'version': (VERSION_MATCHER, ('legacy',)), 'summary': (SUMMARY_MATCHER, ('legacy',)), } __slots__ = ('_legacy', '_data', 'scheme') def __init__(self, path=None, fileobj=None, mapping=None, scheme='default'): if [path, fileobj, mapping].count(None) < 2: raise TypeError('path, fileobj and mapping are exclusive') self._legacy = None self._data = None self.scheme = scheme #import pdb; pdb.set_trace() if mapping is not None: try: self._validate_mapping(mapping, scheme) self._data = mapping except MetadataUnrecognizedVersionError: self._legacy = LegacyMetadata(mapping=mapping, scheme=scheme) self.validate() else: data = None if path: with open(path, 'rb') as f: data = f.read() elif fileobj: data = fileobj.read() if data is None: # Initialised with no args - to be added self._data = { 'metadata_version': self.METADATA_VERSION, 'generator': self.GENERATOR, } else: if not isinstance(data, text_type): data = data.decode('utf-8') try: self._data = json.loads(data) self._validate_mapping(self._data, scheme) except ValueError: # Note: MetadataUnrecognizedVersionError does not # inherit from ValueError (it's a DistlibException, # which should not inherit from ValueError). # The ValueError comes from the json.load - if that # succeeds and we get a validation error, we want # that to propagate self._legacy = LegacyMetadata(fileobj=StringIO(data), scheme=scheme) self.validate() common_keys = set(('name', 'version', 'license', 'keywords', 'summary')) none_list = (None, list) none_dict = (None, dict) mapped_keys = { 'run_requires': ('Requires-Dist', list), 'build_requires': ('Setup-Requires-Dist', list), 'dev_requires': none_list, 'test_requires': none_list, 'meta_requires': none_list, 'extras': ('Provides-Extra', list), 'modules': none_list, 'namespaces': none_list, 'exports': none_dict, 'commands': none_dict, 'classifiers': ('Classifier', list), 'source_url': ('Download-URL', None), 'metadata_version': ('Metadata-Version', None), } del none_list, none_dict def __getattribute__(self, key): common = object.__getattribute__(self, 'common_keys') mapped = object.__getattribute__(self, 'mapped_keys') if key in mapped: lk, maker = mapped[key] if self._legacy: if lk is None: result = None if maker is None else maker() else: result = self._legacy.get(lk) else: value = None if maker is None else maker() if key not in ('commands', 'exports', 'modules', 'namespaces', 'classifiers'): result = self._data.get(key, value) else: # special cases for PEP 459 sentinel = object() result = sentinel d = self._data.get('extensions') if d: if key == 'commands': result = d.get('python.commands', value) elif key == 'classifiers': d = d.get('python.details') if d: result = d.get(key, value) else: d = d.get('python.exports') if not d: d = self._data.get('python.exports') if d: result = d.get(key, value) if result is sentinel: result = value elif key not in common: result = object.__getattribute__(self, key) elif self._legacy: result = self._legacy.get(key) else: result = self._data.get(key) return result def _validate_value(self, key, value, scheme=None): if key in self.SYNTAX_VALIDATORS: pattern, exclusions = self.SYNTAX_VALIDATORS[key] if (scheme or self.scheme) not in exclusions: m = pattern.match(value) if not m: raise MetadataInvalidError("'%s' is an invalid value for " "the '%s' property" % (value, key)) def __setattr__(self, key, value): self._validate_value(key, value) common = object.__getattribute__(self, 'common_keys') mapped = object.__getattribute__(self, 'mapped_keys') if key in mapped: lk, _ = mapped[key] if self._legacy: if lk is None: raise NotImplementedError self._legacy[lk] = value elif key not in ('commands', 'exports', 'modules', 'namespaces', 'classifiers'): self._data[key] = value else: # special cases for PEP 459 d = self._data.setdefault('extensions', {}) if key == 'commands': d['python.commands'] = value elif key == 'classifiers': d = d.setdefault('python.details', {}) d[key] = value else: d = d.setdefault('python.exports', {}) d[key] = value elif key not in common: object.__setattr__(self, key, value) else: if key == 'keywords': if isinstance(value, string_types): value = value.strip() if value: value = value.split() else: value = [] if self._legacy: self._legacy[key] = value else: self._data[key] = value @property def name_and_version(self): return _get_name_and_version(self.name, self.version, True) @property def provides(self): if self._legacy: result = self._legacy['Provides-Dist'] else: result = self._data.setdefault('provides', []) s = '%s (%s)' % (self.name, self.version) if s not in result: result.append(s) return result @provides.setter def provides(self, value): if self._legacy: self._legacy['Provides-Dist'] = value else: self._data['provides'] = value def get_requirements(self, reqts, extras=None, env=None): """ Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. """ if self._legacy: result = reqts else: result = [] extras = get_extras(extras or [], self.extras) for d in reqts: if 'extra' not in d and 'environment' not in d: # unconditional include = True else: if 'extra' not in d: # Not extra-dependent - only environment-dependent include = True else: include = d.get('extra') in extras if include: # Not excluded because of extras, check environment marker = d.get('environment') if marker: include = interpret(marker, env) if include: result.extend(d['requires']) for key in ('build', 'dev', 'test'): e = ':%s:' % key if e in extras: extras.remove(e) # A recursive call, but it should terminate since 'test' # has been removed from the extras reqts = self._data.get('%s_requires' % key, []) result.extend(self.get_requirements(reqts, extras=extras, env=env)) return result @property def dictionary(self): if self._legacy: return self._from_legacy() return self._data @property def dependencies(self): if self._legacy: raise NotImplementedError else: return extract_by_key(self._data, self.DEPENDENCY_KEYS) @dependencies.setter def dependencies(self, value): if self._legacy: raise NotImplementedError else: self._data.update(value) def _validate_mapping(self, mapping, scheme): if mapping.get('metadata_version') != self.METADATA_VERSION: raise MetadataUnrecognizedVersionError() missing = [] for key, exclusions in self.MANDATORY_KEYS.items(): if key not in mapping: if scheme not in exclusions: missing.append(key) if missing: msg = 'Missing metadata items: %s' % ', '.join(missing) raise MetadataMissingError(msg) for k, v in mapping.items(): self._validate_value(k, v, scheme) def validate(self): if self._legacy: missing, warnings = self._legacy.check(True) if missing or warnings: logger.warning('Metadata: missing: %s, warnings: %s', missing, warnings) else: self._validate_mapping(self._data, self.scheme) def todict(self): if self._legacy: return self._legacy.todict(True) else: result = extract_by_key(self._data, self.INDEX_KEYS) return result def _from_legacy(self): assert self._legacy and not self._data result = { 'metadata_version': self.METADATA_VERSION, 'generator': self.GENERATOR, } lmd = self._legacy.todict(True) # skip missing ones for k in ('name', 'version', 'license', 'summary', 'description', 'classifier'): if k in lmd: if k == 'classifier': nk = 'classifiers' else: nk = k result[nk] = lmd[k] kw = lmd.get('Keywords', []) if kw == ['']: kw = [] result['keywords'] = kw keys = (('requires_dist', 'run_requires'), ('setup_requires_dist', 'build_requires')) for ok, nk in keys: if ok in lmd and lmd[ok]: result[nk] = [{'requires': lmd[ok]}] result['provides'] = self.provides author = {} maintainer = {} return result LEGACY_MAPPING = { 'name': 'Name', 'version': 'Version', ('extensions', 'python.details', 'license'): 'License', 'summary': 'Summary', 'description': 'Description', ('extensions', 'python.project', 'project_urls', 'Home'): 'Home-page', ('extensions', 'python.project', 'contacts', 0, 'name'): 'Author', ('extensions', 'python.project', 'contacts', 0, 'email'): 'Author-email', 'source_url': 'Download-URL', ('extensions', 'python.details', 'classifiers'): 'Classifier', } def _to_legacy(self): def process_entries(entries): reqts = set() for e in entries: extra = e.get('extra') env = e.get('environment') rlist = e['requires'] for r in rlist: if not env and not extra: reqts.add(r) else: marker = '' if extra: marker = 'extra == "%s"' % extra if env: if marker: marker = '(%s) and %s' % (env, marker) else: marker = env reqts.add(';'.join((r, marker))) return reqts assert self._data and not self._legacy result = LegacyMetadata() nmd = self._data # import pdb; pdb.set_trace() for nk, ok in self.LEGACY_MAPPING.items(): if not isinstance(nk, tuple): if nk in nmd: result[ok] = nmd[nk] else: d = nmd found = True for k in nk: try: d = d[k] except (KeyError, IndexError): found = False break if found: result[ok] = d r1 = process_entries(self.run_requires + self.meta_requires) r2 = process_entries(self.build_requires + self.dev_requires) if self.extras: result['Provides-Extra'] = sorted(self.extras) result['Requires-Dist'] = sorted(r1) result['Setup-Requires-Dist'] = sorted(r2) # TODO: any other fields wanted return result def write(self, path=None, fileobj=None, legacy=False, skip_unknown=True): if [path, fileobj].count(None) != 1: raise ValueError('Exactly one of path and fileobj is needed') self.validate() if legacy: if self._legacy: legacy_md = self._legacy else: legacy_md = self._to_legacy() if path: legacy_md.write(path, skip_unknown=skip_unknown) else: legacy_md.write_file(fileobj, skip_unknown=skip_unknown) else: if self._legacy: d = self._from_legacy() else: d = self._data if fileobj: json.dump(d, fileobj, ensure_ascii=True, indent=2, sort_keys=True) else: with codecs.open(path, 'w', 'utf-8') as f: json.dump(d, f, ensure_ascii=True, indent=2, sort_keys=True) def add_requirements(self, requirements): if self._legacy: self._legacy.add_requirements(requirements) else: run_requires = self._data.setdefault('run_requires', []) always = None for entry in run_requires: if 'environment' not in entry and 'extra' not in entry: always = entry break if always is None: always = { 'requires': requirements } run_requires.insert(0, always) else: rset = set(always['requires']) | set(requirements) always['requires'] = sorted(rset) def __repr__(self): name = self.name or '(no name)' version = self.version or 'no version' return '<%s %s %s (%s)>' % (self.__class__.__name__, self.metadata_version, name, version) PK!2[[ version.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. """ import logging import re from .compat import string_types from .util import parse_requirement __all__ = ['NormalizedVersion', 'NormalizedMatcher', 'LegacyVersion', 'LegacyMatcher', 'SemanticVersion', 'SemanticMatcher', 'UnsupportedVersionError', 'get_scheme'] logger = logging.getLogger(__name__) class UnsupportedVersionError(ValueError): """This is an unsupported version.""" pass class Version(object): def __init__(self, s): self._string = s = s.strip() self._parts = parts = self.parse(s) assert isinstance(parts, tuple) assert len(parts) > 0 def parse(self, s): raise NotImplementedError('please implement in a subclass') def _check_compatible(self, other): if type(self) != type(other): raise TypeError('cannot compare %r and %r' % (self, other)) def __eq__(self, other): self._check_compatible(other) return self._parts == other._parts def __ne__(self, other): return not self.__eq__(other) def __lt__(self, other): self._check_compatible(other) return self._parts < other._parts def __gt__(self, other): return not (self.__lt__(other) or self.__eq__(other)) def __le__(self, other): return self.__lt__(other) or self.__eq__(other) def __ge__(self, other): return self.__gt__(other) or self.__eq__(other) # See http://docs.python.org/reference/datamodel#object.__hash__ def __hash__(self): return hash(self._parts) def __repr__(self): return "%s('%s')" % (self.__class__.__name__, self._string) def __str__(self): return self._string @property def is_prerelease(self): raise NotImplementedError('Please implement in subclasses.') class Matcher(object): version_class = None # value is either a callable or the name of a method _operators = { '<': lambda v, c, p: v < c, '>': lambda v, c, p: v > c, '<=': lambda v, c, p: v == c or v < c, '>=': lambda v, c, p: v == c or v > c, '==': lambda v, c, p: v == c, '===': lambda v, c, p: v == c, # by default, compatible => >=. '~=': lambda v, c, p: v == c or v > c, '!=': lambda v, c, p: v != c, } # this is a method only to support alternative implementations # via overriding def parse_requirement(self, s): return parse_requirement(s) def __init__(self, s): if self.version_class is None: raise ValueError('Please specify a version class') self._string = s = s.strip() r = self.parse_requirement(s) if not r: raise ValueError('Not valid: %r' % s) self.name = r.name self.key = self.name.lower() # for case-insensitive comparisons clist = [] if r.constraints: # import pdb; pdb.set_trace() for op, s in r.constraints: if s.endswith('.*'): if op not in ('==', '!='): raise ValueError('\'.*\' not allowed for ' '%r constraints' % op) # Could be a partial version (e.g. for '2.*') which # won't parse as a version, so keep it as a string vn, prefix = s[:-2], True # Just to check that vn is a valid version self.version_class(vn) else: # Should parse as a version, so we can create an # instance for the comparison vn, prefix = self.version_class(s), False clist.append((op, vn, prefix)) self._parts = tuple(clist) def match(self, version): """ Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. """ if isinstance(version, string_types): version = self.version_class(version) for operator, constraint, prefix in self._parts: f = self._operators.get(operator) if isinstance(f, string_types): f = getattr(self, f) if not f: msg = ('%r not implemented ' 'for %s' % (operator, self.__class__.__name__)) raise NotImplementedError(msg) if not f(version, constraint, prefix): return False return True @property def exact_version(self): result = None if len(self._parts) == 1 and self._parts[0][0] in ('==', '==='): result = self._parts[0][1] return result def _check_compatible(self, other): if type(self) != type(other) or self.name != other.name: raise TypeError('cannot compare %s and %s' % (self, other)) def __eq__(self, other): self._check_compatible(other) return self.key == other.key and self._parts == other._parts def __ne__(self, other): return not self.__eq__(other) # See http://docs.python.org/reference/datamodel#object.__hash__ def __hash__(self): return hash(self.key) + hash(self._parts) def __repr__(self): return "%s(%r)" % (self.__class__.__name__, self._string) def __str__(self): return self._string PEP440_VERSION_RE = re.compile(r'^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?' r'(\.(post)(\d+))?(\.(dev)(\d+))?' r'(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$') def _pep_440_key(s): s = s.strip() m = PEP440_VERSION_RE.match(s) if not m: raise UnsupportedVersionError('Not a valid version: %s' % s) groups = m.groups() nums = tuple(int(v) for v in groups[1].split('.')) while len(nums) > 1 and nums[-1] == 0: nums = nums[:-1] if not groups[0]: epoch = 0 else: epoch = int(groups[0][:-1]) pre = groups[4:6] post = groups[7:9] dev = groups[10:12] local = groups[13] if pre == (None, None): pre = () else: pre = pre[0], int(pre[1]) if post == (None, None): post = () else: post = post[0], int(post[1]) if dev == (None, None): dev = () else: dev = dev[0], int(dev[1]) if local is None: local = () else: parts = [] for part in local.split('.'): # to ensure that numeric compares as > lexicographic, avoid # comparing them directly, but encode a tuple which ensures # correct sorting if part.isdigit(): part = (1, int(part)) else: part = (0, part) parts.append(part) local = tuple(parts) if not pre: # either before pre-release, or final release and after if not post and dev: # before pre-release pre = ('a', -1) # to sort before a0 else: pre = ('z',) # to sort after all pre-releases # now look at the state of post and dev. if not post: post = ('_',) # sort before 'a' if not dev: dev = ('final',) #print('%s -> %s' % (s, m.groups())) return epoch, nums, pre, post, dev, local _normalized_key = _pep_440_key class NormalizedVersion(Version): """A rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b """ def parse(self, s): result = _normalized_key(s) # _normalized_key loses trailing zeroes in the release # clause, since that's needed to ensure that X.Y == X.Y.0 == X.Y.0.0 # However, PEP 440 prefix matching needs it: for example, # (~= 1.4.5.0) matches differently to (~= 1.4.5.0.0). m = PEP440_VERSION_RE.match(s) # must succeed groups = m.groups() self._release_clause = tuple(int(v) for v in groups[1].split('.')) return result PREREL_TAGS = set(['a', 'b', 'c', 'rc', 'dev']) @property def is_prerelease(self): return any(t[0] in self.PREREL_TAGS for t in self._parts if t) def _match_prefix(x, y): x = str(x) y = str(y) if x == y: return True if not x.startswith(y): return False n = len(y) return x[n] == '.' class NormalizedMatcher(Matcher): version_class = NormalizedVersion # value is either a callable or the name of a method _operators = { '~=': '_match_compatible', '<': '_match_lt', '>': '_match_gt', '<=': '_match_le', '>=': '_match_ge', '==': '_match_eq', '===': '_match_arbitrary', '!=': '_match_ne', } def _adjust_local(self, version, constraint, prefix): if prefix: strip_local = '+' not in constraint and version._parts[-1] else: # both constraint and version are # NormalizedVersion instances. # If constraint does not have a local component, # ensure the version doesn't, either. strip_local = not constraint._parts[-1] and version._parts[-1] if strip_local: s = version._string.split('+', 1)[0] version = self.version_class(s) return version, constraint def _match_lt(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if version >= constraint: return False release_clause = constraint._release_clause pfx = '.'.join([str(i) for i in release_clause]) return not _match_prefix(version, pfx) def _match_gt(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if version <= constraint: return False release_clause = constraint._release_clause pfx = '.'.join([str(i) for i in release_clause]) return not _match_prefix(version, pfx) def _match_le(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) return version <= constraint def _match_ge(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) return version >= constraint def _match_eq(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if not prefix: result = (version == constraint) else: result = _match_prefix(version, constraint) return result def _match_arbitrary(self, version, constraint, prefix): return str(version) == str(constraint) def _match_ne(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if not prefix: result = (version != constraint) else: result = not _match_prefix(version, constraint) return result def _match_compatible(self, version, constraint, prefix): version, constraint = self._adjust_local(version, constraint, prefix) if version == constraint: return True if version < constraint: return False # if not prefix: # return True release_clause = constraint._release_clause if len(release_clause) > 1: release_clause = release_clause[:-1] pfx = '.'.join([str(i) for i in release_clause]) return _match_prefix(version, pfx) _REPLACEMENTS = ( (re.compile('[.+-]$'), ''), # remove trailing puncts (re.compile(r'^[.](\d)'), r'0.\1'), # .N -> 0.N at start (re.compile('^[.-]'), ''), # remove leading puncts (re.compile(r'^\((.*)\)$'), r'\1'), # remove parentheses (re.compile(r'^v(ersion)?\s*(\d+)'), r'\2'), # remove leading v(ersion) (re.compile(r'^r(ev)?\s*(\d+)'), r'\2'), # remove leading v(ersion) (re.compile('[.]{2,}'), '.'), # multiple runs of '.' (re.compile(r'\b(alfa|apha)\b'), 'alpha'), # misspelt alpha (re.compile(r'\b(pre-alpha|prealpha)\b'), 'pre.alpha'), # standardise (re.compile(r'\(beta\)$'), 'beta'), # remove parentheses ) _SUFFIX_REPLACEMENTS = ( (re.compile('^[:~._+-]+'), ''), # remove leading puncts (re.compile('[,*")([\\]]'), ''), # remove unwanted chars (re.compile('[~:+_ -]'), '.'), # replace illegal chars (re.compile('[.]{2,}'), '.'), # multiple runs of '.' (re.compile(r'\.$'), ''), # trailing '.' ) _NUMERIC_PREFIX = re.compile(r'(\d+(\.\d+)*)') def _suggest_semantic_version(s): """ Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. """ result = s.strip().lower() for pat, repl in _REPLACEMENTS: result = pat.sub(repl, result) if not result: result = '0.0.0' # Now look for numeric prefix, and separate it out from # the rest. #import pdb; pdb.set_trace() m = _NUMERIC_PREFIX.match(result) if not m: prefix = '0.0.0' suffix = result else: prefix = m.groups()[0].split('.') prefix = [int(i) for i in prefix] while len(prefix) < 3: prefix.append(0) if len(prefix) == 3: suffix = result[m.end():] else: suffix = '.'.join([str(i) for i in prefix[3:]]) + result[m.end():] prefix = prefix[:3] prefix = '.'.join([str(i) for i in prefix]) suffix = suffix.strip() if suffix: #import pdb; pdb.set_trace() # massage the suffix. for pat, repl in _SUFFIX_REPLACEMENTS: suffix = pat.sub(repl, suffix) if not suffix: result = prefix else: sep = '-' if 'dev' in suffix else '+' result = prefix + sep + suffix if not is_semver(result): result = None return result def _suggest_normalized_version(s): """Suggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. """ try: _normalized_key(s) return s # already rational except UnsupportedVersionError: pass rs = s.lower() # part of this could use maketrans for orig, repl in (('-alpha', 'a'), ('-beta', 'b'), ('alpha', 'a'), ('beta', 'b'), ('rc', 'c'), ('-final', ''), ('-pre', 'c'), ('-release', ''), ('.release', ''), ('-stable', ''), ('+', '.'), ('_', '.'), (' ', ''), ('.final', ''), ('final', '')): rs = rs.replace(orig, repl) # if something ends with dev or pre, we add a 0 rs = re.sub(r"pre$", r"pre0", rs) rs = re.sub(r"dev$", r"dev0", rs) # if we have something like "b-2" or "a.2" at the end of the # version, that is probably beta, alpha, etc # let's remove the dash or dot rs = re.sub(r"([abc]|rc)[\-\.](\d+)$", r"\1\2", rs) # 1.0-dev-r371 -> 1.0.dev371 # 0.1-dev-r79 -> 0.1.dev79 rs = re.sub(r"[\-\.](dev)[\-\.]?r?(\d+)$", r".\1\2", rs) # Clean: 2.0.a.3, 2.0.b1, 0.9.0~c1 rs = re.sub(r"[.~]?([abc])\.?", r"\1", rs) # Clean: v0.3, v1.0 if rs.startswith('v'): rs = rs[1:] # Clean leading '0's on numbers. #TODO: unintended side-effect on, e.g., "2003.05.09" # PyPI stats: 77 (~2%) better rs = re.sub(r"\b0+(\d+)(?!\d)", r"\1", rs) # Clean a/b/c with no version. E.g. "1.0a" -> "1.0a0". Setuptools infers # zero. # PyPI stats: 245 (7.56%) better rs = re.sub(r"(\d+[abc])$", r"\g<1>0", rs) # the 'dev-rNNN' tag is a dev tag rs = re.sub(r"\.?(dev-r|dev\.r)\.?(\d+)$", r".dev\2", rs) # clean the - when used as a pre delimiter rs = re.sub(r"-(a|b|c)(\d+)$", r"\1\2", rs) # a terminal "dev" or "devel" can be changed into ".dev0" rs = re.sub(r"[\.\-](dev|devel)$", r".dev0", rs) # a terminal "dev" can be changed into ".dev0" rs = re.sub(r"(?![\.\-])dev$", r".dev0", rs) # a terminal "final" or "stable" can be removed rs = re.sub(r"(final|stable)$", "", rs) # The 'r' and the '-' tags are post release tags # 0.4a1.r10 -> 0.4a1.post10 # 0.9.33-17222 -> 0.9.33.post17222 # 0.9.33-r17222 -> 0.9.33.post17222 rs = re.sub(r"\.?(r|-|-r)\.?(\d+)$", r".post\2", rs) # Clean 'r' instead of 'dev' usage: # 0.9.33+r17222 -> 0.9.33.dev17222 # 1.0dev123 -> 1.0.dev123 # 1.0.git123 -> 1.0.dev123 # 1.0.bzr123 -> 1.0.dev123 # 0.1a0dev.123 -> 0.1a0.dev123 # PyPI stats: ~150 (~4%) better rs = re.sub(r"\.?(dev|git|bzr)\.?(\d+)$", r".dev\2", rs) # Clean '.pre' (normalized from '-pre' above) instead of 'c' usage: # 0.2.pre1 -> 0.2c1 # 0.2-c1 -> 0.2c1 # 1.0preview123 -> 1.0c123 # PyPI stats: ~21 (0.62%) better rs = re.sub(r"\.?(pre|preview|-c)(\d+)$", r"c\g<2>", rs) # Tcl/Tk uses "px" for their post release markers rs = re.sub(r"p(\d+)$", r".post\1", rs) try: _normalized_key(rs) except UnsupportedVersionError: rs = None return rs # # Legacy version processing (distribute-compatible) # _VERSION_PART = re.compile(r'([a-z]+|\d+|[\.-])', re.I) _VERSION_REPLACE = { 'pre': 'c', 'preview': 'c', '-': 'final-', 'rc': 'c', 'dev': '@', '': None, '.': None, } def _legacy_key(s): def get_parts(s): result = [] for p in _VERSION_PART.split(s.lower()): p = _VERSION_REPLACE.get(p, p) if p: if '0' <= p[:1] <= '9': p = p.zfill(8) else: p = '*' + p result.append(p) result.append('*final') return result result = [] for p in get_parts(s): if p.startswith('*'): if p < '*final': while result and result[-1] == '*final-': result.pop() while result and result[-1] == '00000000': result.pop() result.append(p) return tuple(result) class LegacyVersion(Version): def parse(self, s): return _legacy_key(s) @property def is_prerelease(self): result = False for x in self._parts: if (isinstance(x, string_types) and x.startswith('*') and x < '*final'): result = True break return result class LegacyMatcher(Matcher): version_class = LegacyVersion _operators = dict(Matcher._operators) _operators['~='] = '_match_compatible' numeric_re = re.compile(r'^(\d+(\.\d+)*)') def _match_compatible(self, version, constraint, prefix): if version < constraint: return False m = self.numeric_re.match(str(constraint)) if not m: logger.warning('Cannot compute compatible match for version %s ' ' and constraint %s', version, constraint) return True s = m.groups()[0] if '.' in s: s = s.rsplit('.', 1)[0] return _match_prefix(version, s) # # Semantic versioning # _SEMVER_RE = re.compile(r'^(\d+)\.(\d+)\.(\d+)' r'(-[a-z0-9]+(\.[a-z0-9-]+)*)?' r'(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$', re.I) def is_semver(s): return _SEMVER_RE.match(s) def _semantic_key(s): def make_tuple(s, absent): if s is None: result = (absent,) else: parts = s[1:].split('.') # We can't compare ints and strings on Python 3, so fudge it # by zero-filling numeric values so simulate a numeric comparison result = tuple([p.zfill(8) if p.isdigit() else p for p in parts]) return result m = is_semver(s) if not m: raise UnsupportedVersionError(s) groups = m.groups() major, minor, patch = [int(i) for i in groups[:3]] # choose the '|' and '*' so that versions sort correctly pre, build = make_tuple(groups[3], '|'), make_tuple(groups[5], '*') return (major, minor, patch), pre, build class SemanticVersion(Version): def parse(self, s): return _semantic_key(s) @property def is_prerelease(self): return self._parts[1][0] != '|' class SemanticMatcher(Matcher): version_class = SemanticVersion class VersionScheme(object): def __init__(self, key, matcher, suggester=None): self.key = key self.matcher = matcher self.suggester = suggester def is_valid_version(self, s): try: self.matcher.version_class(s) result = True except UnsupportedVersionError: result = False return result def is_valid_matcher(self, s): try: self.matcher(s) result = True except UnsupportedVersionError: result = False return result def is_valid_constraint_list(self, s): """ Used for processing some metadata fields """ # See issue #140. Be tolerant of a single trailing comma. if s.endswith(','): s = s[:-1] return self.is_valid_matcher('dummy_name (%s)' % s) def suggest(self, s): if self.suggester is None: result = None else: result = self.suggester(s) return result _SCHEMES = { 'normalized': VersionScheme(_normalized_key, NormalizedMatcher, _suggest_normalized_version), 'legacy': VersionScheme(_legacy_key, LegacyMatcher, lambda self, s: s), 'semantic': VersionScheme(_semantic_key, SemanticMatcher, _suggest_semantic_version), } _SCHEMES['default'] = _SCHEMES['normalized'] def get_scheme(name): if name not in _SCHEMES: raise ValueError('unknown scheme name: %r' % name) return _SCHEMES[name] PK!2HQQindex.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread except ImportError: from dummy_threading import Thread from . import DistlibException from .compat import (HTTPBasicAuthHandler, Request, HTTPPasswordMgr, urlparse, build_opener, string_types) from .util import zip_dir, ServerProxy logger = logging.getLogger(__name__) DEFAULT_INDEX = 'https://pypi.org/pypi' DEFAULT_REALM = 'pypi' class PackageIndex(object): """ This class represents a package index compatible with PyPI, the Python Package Index. """ boundary = b'----------ThIs_Is_tHe_distlib_index_bouNdaRY_$' def __init__(self, url=None): """ Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. """ self.url = url or DEFAULT_INDEX self.read_configuration() scheme, netloc, path, params, query, frag = urlparse(self.url) if params or query or frag or scheme not in ('http', 'https'): raise DistlibException('invalid repository: %s' % self.url) self.password_handler = None self.ssl_verifier = None self.gpg = None self.gpg_home = None with open(os.devnull, 'w') as sink: # Use gpg by default rather than gpg2, as gpg2 insists on # prompting for passwords for s in ('gpg', 'gpg2'): try: rc = subprocess.check_call([s, '--version'], stdout=sink, stderr=sink) if rc == 0: self.gpg = s break except OSError: pass def _get_pypirc_command(self): """ Get the distutils command for interacting with PyPI configurations. :return: the command. """ from .util import _get_pypirc_command as cmd return cmd() def read_configuration(self): """ Read the PyPI access configuration as supported by distutils. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. """ from .util import _load_pypirc cfg = _load_pypirc(self) self.username = cfg.get('username') self.password = cfg.get('password') self.realm = cfg.get('realm', 'pypi') self.url = cfg.get('repository', self.url) def save_configuration(self): """ Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. """ self.check_credentials() from .util import _store_pypirc _store_pypirc(self) def check_credentials(self): """ Check that ``username`` and ``password`` have been set, and raise an exception if not. """ if self.username is None or self.password is None: raise DistlibException('username and password must be set') pm = HTTPPasswordMgr() _, netloc, _, _, _, _ = urlparse(self.url) pm.add_password(self.realm, netloc, self.username, self.password) self.password_handler = HTTPBasicAuthHandler(pm) def register(self, metadata): """ Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. """ self.check_credentials() metadata.validate() d = metadata.todict() d[':action'] = 'verify' request = self.encode_request(d.items(), []) response = self.send_request(request) d[':action'] = 'submit' request = self.encode_request(d.items(), []) return self.send_request(request) def _reader(self, name, stream, outbuf): """ Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. """ while True: s = stream.readline() if not s: break s = s.decode('utf-8').rstrip() outbuf.append(s) logger.debug('%s: %s' % (name, s)) stream.close() def get_sign_command(self, filename, signer, sign_password, keystore=None): """ Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. """ cmd = [self.gpg, '--status-fd', '2', '--no-tty'] if keystore is None: keystore = self.gpg_home if keystore: cmd.extend(['--homedir', keystore]) if sign_password is not None: cmd.extend(['--batch', '--passphrase-fd', '0']) td = tempfile.mkdtemp() sf = os.path.join(td, os.path.basename(filename) + '.asc') cmd.extend(['--detach-sign', '--armor', '--local-user', signer, '--output', sf, filename]) logger.debug('invoking: %s', ' '.join(cmd)) return cmd, sf def run_command(self, cmd, input_data=None): """ Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. """ kwargs = { 'stdout': subprocess.PIPE, 'stderr': subprocess.PIPE, } if input_data is not None: kwargs['stdin'] = subprocess.PIPE stdout = [] stderr = [] p = subprocess.Popen(cmd, **kwargs) # We don't use communicate() here because we may need to # get clever with interacting with the command t1 = Thread(target=self._reader, args=('stdout', p.stdout, stdout)) t1.start() t2 = Thread(target=self._reader, args=('stderr', p.stderr, stderr)) t2.start() if input_data is not None: p.stdin.write(input_data) p.stdin.close() p.wait() t1.join() t2.join() return p.returncode, stdout, stderr def sign_file(self, filename, signer, sign_password, keystore=None): """ Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. """ cmd, sig_file = self.get_sign_command(filename, signer, sign_password, keystore) rc, stdout, stderr = self.run_command(cmd, sign_password.encode('utf-8')) if rc != 0: raise DistlibException('sign command failed with error ' 'code %s' % rc) return sig_file def upload_file(self, metadata, filename, signer=None, sign_password=None, filetype='sdist', pyversion='source', keystore=None): """ Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. """ self.check_credentials() if not os.path.exists(filename): raise DistlibException('not found: %s' % filename) metadata.validate() d = metadata.todict() sig_file = None if signer: if not self.gpg: logger.warning('no signing program available - not signed') else: sig_file = self.sign_file(filename, signer, sign_password, keystore) with open(filename, 'rb') as f: file_data = f.read() md5_digest = hashlib.md5(file_data).hexdigest() sha256_digest = hashlib.sha256(file_data).hexdigest() d.update({ ':action': 'file_upload', 'protocol_version': '1', 'filetype': filetype, 'pyversion': pyversion, 'md5_digest': md5_digest, 'sha256_digest': sha256_digest, }) files = [('content', os.path.basename(filename), file_data)] if sig_file: with open(sig_file, 'rb') as f: sig_data = f.read() files.append(('gpg_signature', os.path.basename(sig_file), sig_data)) shutil.rmtree(os.path.dirname(sig_file)) request = self.encode_request(d.items(), files) return self.send_request(request) def upload_documentation(self, metadata, doc_dir): """ Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. """ self.check_credentials() if not os.path.isdir(doc_dir): raise DistlibException('not a directory: %r' % doc_dir) fn = os.path.join(doc_dir, 'index.html') if not os.path.exists(fn): raise DistlibException('not found: %r' % fn) metadata.validate() name, version = metadata.name, metadata.version zip_data = zip_dir(doc_dir).getvalue() fields = [(':action', 'doc_upload'), ('name', name), ('version', version)] files = [('content', name, zip_data)] request = self.encode_request(fields, files) return self.send_request(request) def get_verify_command(self, signature_filename, data_filename, keystore=None): """ Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. """ cmd = [self.gpg, '--status-fd', '2', '--no-tty'] if keystore is None: keystore = self.gpg_home if keystore: cmd.extend(['--homedir', keystore]) cmd.extend(['--verify', signature_filename, data_filename]) logger.debug('invoking: %s', ' '.join(cmd)) return cmd def verify_signature(self, signature_filename, data_filename, keystore=None): """ Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. """ if not self.gpg: raise DistlibException('verification unavailable because gpg ' 'unavailable') cmd = self.get_verify_command(signature_filename, data_filename, keystore) rc, stdout, stderr = self.run_command(cmd) if rc not in (0, 1): raise DistlibException('verify command failed with error ' 'code %s' % rc) return rc == 0 def download_file(self, url, destfile, digest=None, reporthook=None): """ This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. """ if digest is None: digester = None logger.debug('No digest specified') else: if isinstance(digest, (list, tuple)): hasher, digest = digest else: hasher = 'md5' digester = getattr(hashlib, hasher)() logger.debug('Digest specified: %s' % digest) # The following code is equivalent to urlretrieve. # We need to do it this way so that we can compute the # digest of the file as we go. with open(destfile, 'wb') as dfp: # addinfourl is not a context manager on 2.x # so we have to use try/finally sfp = self.send_request(Request(url)) try: headers = sfp.info() blocksize = 8192 size = -1 read = 0 blocknum = 0 if "content-length" in headers: size = int(headers["Content-Length"]) if reporthook: reporthook(blocknum, blocksize, size) while True: block = sfp.read(blocksize) if not block: break read += len(block) dfp.write(block) if digester: digester.update(block) blocknum += 1 if reporthook: reporthook(blocknum, blocksize, size) finally: sfp.close() # check that we got the whole file, if we can if size >= 0 and read < size: raise DistlibException( 'retrieval incomplete: got only %d out of %d bytes' % (read, size)) # if we have a digest, it must match. if digester: actual = digester.hexdigest() if digest != actual: raise DistlibException('%s digest mismatch for %s: expected ' '%s, got %s' % (hasher, destfile, digest, actual)) logger.debug('Digest verified: %s', digest) def send_request(self, req): """ Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). """ handlers = [] if self.password_handler: handlers.append(self.password_handler) if self.ssl_verifier: handlers.append(self.ssl_verifier) opener = build_opener(*handlers) return opener.open(req) def encode_request(self, fields, files): """ Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. """ # Adapted from packaging, which in turn was adapted from # http://code.activestate.com/recipes/146306 parts = [] boundary = self.boundary for k, values in fields: if not isinstance(values, (list, tuple)): values = [values] for v in values: parts.extend(( b'--' + boundary, ('Content-Disposition: form-data; name="%s"' % k).encode('utf-8'), b'', v.encode('utf-8'))) for key, filename, value in files: parts.extend(( b'--' + boundary, ('Content-Disposition: form-data; name="%s"; filename="%s"' % (key, filename)).encode('utf-8'), b'', value)) parts.extend((b'--' + boundary + b'--', b'')) body = b'\r\n'.join(parts) ct = b'multipart/form-data; boundary=' + boundary headers = { 'Content-type': ct, 'Content-length': str(len(body)) } return Request(self.url, body, headers) def search(self, terms, operator=None): if isinstance(terms, string_types): terms = {'name': terms} rpc_proxy = ServerProxy(self.url, timeout=3.0) try: return rpc_proxy.search(terms, operator or 'and') finally: rpc_proxy('close')() PK!mutil.pynu[# # Copyright (C) 2012-2021 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import socket try: import ssl except ImportError: # pragma: no cover ssl = None import subprocess import sys import tarfile import tempfile import textwrap try: import threading except ImportError: # pragma: no cover import dummy_threading as threading import time from . import DistlibException from .compat import (string_types, text_type, shutil, raw_input, StringIO, cache_from_source, urlopen, urljoin, httplib, xmlrpclib, splittype, HTTPHandler, BaseConfigurator, valid_ident, Container, configparser, URLError, ZipFile, fsdecode, unquote, urlparse) logger = logging.getLogger(__name__) # # Requirement parsing code as per PEP 508 # IDENTIFIER = re.compile(r'^([\w\.-]+)\s*') VERSION_IDENTIFIER = re.compile(r'^([\w\.*+-]+)\s*') COMPARE_OP = re.compile(r'^(<=?|>=?|={2,3}|[~!]=)\s*') MARKER_OP = re.compile(r'^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*') OR = re.compile(r'^or\b\s*') AND = re.compile(r'^and\b\s*') NON_SPACE = re.compile(r'(\S+)\s*') STRING_CHUNK = re.compile(r'([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)') def parse_marker(marker_string): """ Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). """ def marker_var(remaining): # either identifier, or literal string m = IDENTIFIER.match(remaining) if m: result = m.groups()[0] remaining = remaining[m.end():] elif not remaining: raise SyntaxError('unexpected end of input') else: q = remaining[0] if q not in '\'"': raise SyntaxError('invalid expression: %s' % remaining) oq = '\'"'.replace(q, '') remaining = remaining[1:] parts = [q] while remaining: # either a string chunk, or oq, or q to terminate if remaining[0] == q: break elif remaining[0] == oq: parts.append(oq) remaining = remaining[1:] else: m = STRING_CHUNK.match(remaining) if not m: raise SyntaxError('error in string literal: %s' % remaining) parts.append(m.groups()[0]) remaining = remaining[m.end():] else: s = ''.join(parts) raise SyntaxError('unterminated string: %s' % s) parts.append(q) result = ''.join(parts) remaining = remaining[1:].lstrip() # skip past closing quote return result, remaining def marker_expr(remaining): if remaining and remaining[0] == '(': result, remaining = marker(remaining[1:].lstrip()) if remaining[0] != ')': raise SyntaxError('unterminated parenthesis: %s' % remaining) remaining = remaining[1:].lstrip() else: lhs, remaining = marker_var(remaining) while remaining: m = MARKER_OP.match(remaining) if not m: break op = m.groups()[0] remaining = remaining[m.end():] rhs, remaining = marker_var(remaining) lhs = {'op': op, 'lhs': lhs, 'rhs': rhs} result = lhs return result, remaining def marker_and(remaining): lhs, remaining = marker_expr(remaining) while remaining: m = AND.match(remaining) if not m: break remaining = remaining[m.end():] rhs, remaining = marker_expr(remaining) lhs = {'op': 'and', 'lhs': lhs, 'rhs': rhs} return lhs, remaining def marker(remaining): lhs, remaining = marker_and(remaining) while remaining: m = OR.match(remaining) if not m: break remaining = remaining[m.end():] rhs, remaining = marker_and(remaining) lhs = {'op': 'or', 'lhs': lhs, 'rhs': rhs} return lhs, remaining return marker(marker_string) def parse_requirement(req): """ Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. """ remaining = req.strip() if not remaining or remaining.startswith('#'): return None m = IDENTIFIER.match(remaining) if not m: raise SyntaxError('name expected: %s' % remaining) distname = m.groups()[0] remaining = remaining[m.end():] extras = mark_expr = versions = uri = None if remaining and remaining[0] == '[': i = remaining.find(']', 1) if i < 0: raise SyntaxError('unterminated extra: %s' % remaining) s = remaining[1:i] remaining = remaining[i + 1:].lstrip() extras = [] while s: m = IDENTIFIER.match(s) if not m: raise SyntaxError('malformed extra: %s' % s) extras.append(m.groups()[0]) s = s[m.end():] if not s: break if s[0] != ',': raise SyntaxError('comma expected in extras: %s' % s) s = s[1:].lstrip() if not extras: extras = None if remaining: if remaining[0] == '@': # it's a URI remaining = remaining[1:].lstrip() m = NON_SPACE.match(remaining) if not m: raise SyntaxError('invalid URI: %s' % remaining) uri = m.groups()[0] t = urlparse(uri) # there are issues with Python and URL parsing, so this test # is a bit crude. See bpo-20271, bpo-23505. Python doesn't # always parse invalid URLs correctly - it should raise # exceptions for malformed URLs if not (t.scheme and t.netloc): raise SyntaxError('Invalid URL: %s' % uri) remaining = remaining[m.end():].lstrip() else: def get_versions(ver_remaining): """ Return a list of operator, version tuples if any are specified, else None. """ m = COMPARE_OP.match(ver_remaining) versions = None if m: versions = [] while True: op = m.groups()[0] ver_remaining = ver_remaining[m.end():] m = VERSION_IDENTIFIER.match(ver_remaining) if not m: raise SyntaxError('invalid version: %s' % ver_remaining) v = m.groups()[0] versions.append((op, v)) ver_remaining = ver_remaining[m.end():] if not ver_remaining or ver_remaining[0] != ',': break ver_remaining = ver_remaining[1:].lstrip() # Some packages have a trailing comma which would break things # See issue #148 if not ver_remaining: break m = COMPARE_OP.match(ver_remaining) if not m: raise SyntaxError('invalid constraint: %s' % ver_remaining) if not versions: versions = None return versions, ver_remaining if remaining[0] != '(': versions, remaining = get_versions(remaining) else: i = remaining.find(')', 1) if i < 0: raise SyntaxError('unterminated parenthesis: %s' % remaining) s = remaining[1:i] remaining = remaining[i + 1:].lstrip() # As a special diversion from PEP 508, allow a version number # a.b.c in parentheses as a synonym for ~= a.b.c (because this # is allowed in earlier PEPs) if COMPARE_OP.match(s): versions, _ = get_versions(s) else: m = VERSION_IDENTIFIER.match(s) if not m: raise SyntaxError('invalid constraint: %s' % s) v = m.groups()[0] s = s[m.end():].lstrip() if s: raise SyntaxError('invalid constraint: %s' % s) versions = [('~=', v)] if remaining: if remaining[0] != ';': raise SyntaxError('invalid requirement: %s' % remaining) remaining = remaining[1:].lstrip() mark_expr, remaining = parse_marker(remaining) if remaining and remaining[0] != '#': raise SyntaxError('unexpected trailing data: %s' % remaining) if not versions: rs = distname else: rs = '%s %s' % (distname, ', '.join(['%s %s' % con for con in versions])) return Container(name=distname, extras=extras, constraints=versions, marker=mark_expr, url=uri, requirement=rs) def get_resources_dests(resources_root, rules): """Find destinations for resources files""" def get_rel_path(root, path): # normalizes and returns a lstripped-/-separated path root = root.replace(os.path.sep, '/') path = path.replace(os.path.sep, '/') assert path.startswith(root) return path[len(root):].lstrip('/') destinations = {} for base, suffix, dest in rules: prefix = os.path.join(resources_root, base) for abs_base in iglob(prefix): abs_glob = os.path.join(abs_base, suffix) for abs_path in iglob(abs_glob): resource_file = get_rel_path(resources_root, abs_path) if dest is None: # remove the entry if it was here destinations.pop(resource_file, None) else: rel_path = get_rel_path(abs_base, abs_path) rel_dest = dest.replace(os.path.sep, '/').rstrip('/') destinations[resource_file] = rel_dest + '/' + rel_path return destinations def in_venv(): if hasattr(sys, 'real_prefix'): # virtualenv venvs result = True else: # PEP 405 venvs result = sys.prefix != getattr(sys, 'base_prefix', sys.prefix) return result def get_executable(): # The __PYVENV_LAUNCHER__ dance is apparently no longer needed, as # changes to the stub launcher mean that sys.executable always points # to the stub on OS X # if sys.platform == 'darwin' and ('__PYVENV_LAUNCHER__' # in os.environ): # result = os.environ['__PYVENV_LAUNCHER__'] # else: # result = sys.executable # return result # Avoid normcasing: see issue #143 # result = os.path.normcase(sys.executable) result = sys.executable if not isinstance(result, text_type): result = fsdecode(result) return result def proceed(prompt, allowed_chars, error_prompt=None, default=None): p = prompt while True: s = raw_input(p) p = prompt if not s and default: s = default if s: c = s[0].lower() if c in allowed_chars: break if error_prompt: p = '%c: %s\n%s' % (c, error_prompt, prompt) return c def extract_by_key(d, keys): if isinstance(keys, string_types): keys = keys.split() result = {} for key in keys: if key in d: result[key] = d[key] return result def read_exports(stream): if sys.version_info[0] >= 3: # needs to be a text stream stream = codecs.getreader('utf-8')(stream) # Try to load as JSON, falling back on legacy format data = stream.read() stream = StringIO(data) try: jdata = json.load(stream) result = jdata['extensions']['python.exports']['exports'] for group, entries in result.items(): for k, v in entries.items(): s = '%s = %s' % (k, v) entry = get_export_entry(s) assert entry is not None entries[k] = entry return result except Exception: stream.seek(0, 0) def read_stream(cp, stream): if hasattr(cp, 'read_file'): cp.read_file(stream) else: cp.readfp(stream) cp = configparser.ConfigParser() try: read_stream(cp, stream) except configparser.MissingSectionHeaderError: stream.close() data = textwrap.dedent(data) stream = StringIO(data) read_stream(cp, stream) result = {} for key in cp.sections(): result[key] = entries = {} for name, value in cp.items(key): s = '%s = %s' % (name, value) entry = get_export_entry(s) assert entry is not None #entry.dist = self entries[name] = entry return result def write_exports(exports, stream): if sys.version_info[0] >= 3: # needs to be a text stream stream = codecs.getwriter('utf-8')(stream) cp = configparser.ConfigParser() for k, v in exports.items(): # TODO check k, v for valid values cp.add_section(k) for entry in v.values(): if entry.suffix is None: s = entry.prefix else: s = '%s:%s' % (entry.prefix, entry.suffix) if entry.flags: s = '%s [%s]' % (s, ', '.join(entry.flags)) cp.set(k, entry.name, s) cp.write(stream) @contextlib.contextmanager def tempdir(): td = tempfile.mkdtemp() try: yield td finally: shutil.rmtree(td) @contextlib.contextmanager def chdir(d): cwd = os.getcwd() try: os.chdir(d) yield finally: os.chdir(cwd) @contextlib.contextmanager def socket_timeout(seconds=15): cto = socket.getdefaulttimeout() try: socket.setdefaulttimeout(seconds) yield finally: socket.setdefaulttimeout(cto) class cached_property(object): def __init__(self, func): self.func = func #for attr in ('__name__', '__module__', '__doc__'): # setattr(self, attr, getattr(func, attr, None)) def __get__(self, obj, cls=None): if obj is None: return self value = self.func(obj) object.__setattr__(obj, self.func.__name__, value) #obj.__dict__[self.func.__name__] = value = self.func(obj) return value def convert_path(pathname): """Return 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put 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 os.curdir in paths: paths.remove(os.curdir) if not paths: return os.curdir return os.path.join(*paths) class FileOperator(object): def __init__(self, dry_run=False): self.dry_run = dry_run self.ensured = set() self._init_record() def _init_record(self): self.record = False self.files_written = set() self.dirs_created = set() def record_as_written(self, path): if self.record: self.files_written.add(path) def newer(self, source, target): """Tell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". """ if not os.path.exists(source): raise DistlibException("file '%r' does not exist" % os.path.abspath(source)) if not os.path.exists(target): return True return os.stat(source).st_mtime > os.stat(target).st_mtime def copy_file(self, infile, outfile, check=True): """Copy a file respecting dry-run and force flags. """ self.ensure_dir(os.path.dirname(outfile)) logger.info('Copying %s to %s', infile, outfile) if not self.dry_run: msg = None if check: if os.path.islink(outfile): msg = '%s is a symlink' % outfile elif os.path.exists(outfile) and not os.path.isfile(outfile): msg = '%s is a non-regular file' % outfile if msg: raise ValueError(msg + ' which would be overwritten') shutil.copyfile(infile, outfile) self.record_as_written(outfile) def copy_stream(self, instream, outfile, encoding=None): assert not os.path.isdir(outfile) self.ensure_dir(os.path.dirname(outfile)) logger.info('Copying stream %s to %s', instream, outfile) if not self.dry_run: if encoding is None: outstream = open(outfile, 'wb') else: outstream = codecs.open(outfile, 'w', encoding=encoding) try: shutil.copyfileobj(instream, outstream) finally: outstream.close() self.record_as_written(outfile) def write_binary_file(self, path, data): self.ensure_dir(os.path.dirname(path)) if not self.dry_run: if os.path.exists(path): os.remove(path) with open(path, 'wb') as f: f.write(data) self.record_as_written(path) def write_text_file(self, path, data, encoding): self.write_binary_file(path, data.encode(encoding)) def set_mode(self, bits, mask, files): if os.name == 'posix' or (os.name == 'java' and os._name == 'posix'): # Set the executable bits (owner, group, and world) on # all the files specified. for f in files: if self.dry_run: logger.info("changing mode of %s", f) else: mode = (os.stat(f).st_mode | bits) & mask logger.info("changing mode of %s to %o", f, mode) os.chmod(f, mode) set_executable_mode = lambda s, f: s.set_mode(0o555, 0o7777, f) def ensure_dir(self, path): path = os.path.abspath(path) if path not in self.ensured and not os.path.exists(path): self.ensured.add(path) d, f = os.path.split(path) self.ensure_dir(d) logger.info('Creating %s' % path) if not self.dry_run: os.mkdir(path) if self.record: self.dirs_created.add(path) def byte_compile(self, path, optimize=False, force=False, prefix=None, hashed_invalidation=False): dpath = cache_from_source(path, not optimize) logger.info('Byte-compiling %s to %s', path, dpath) if not self.dry_run: if force or self.newer(path, dpath): if not prefix: diagpath = None else: assert path.startswith(prefix) diagpath = path[len(prefix):] compile_kwargs = {} if hashed_invalidation and hasattr(py_compile, 'PycInvalidationMode'): compile_kwargs['invalidation_mode'] = py_compile.PycInvalidationMode.CHECKED_HASH py_compile.compile(path, dpath, diagpath, True, **compile_kwargs) # raise error self.record_as_written(dpath) return dpath def ensure_removed(self, path): if os.path.exists(path): if os.path.isdir(path) and not os.path.islink(path): logger.debug('Removing directory tree at %s', path) if not self.dry_run: shutil.rmtree(path) if self.record: if path in self.dirs_created: self.dirs_created.remove(path) else: if os.path.islink(path): s = 'link' else: s = 'file' logger.debug('Removing %s %s', s, path) if not self.dry_run: os.remove(path) if self.record: if path in self.files_written: self.files_written.remove(path) def is_writable(self, path): result = False while not result: if os.path.exists(path): result = os.access(path, os.W_OK) break parent = os.path.dirname(path) if parent == path: break path = parent return result def commit(self): """ Commit recorded changes, turn off recording, return changes. """ assert self.record result = self.files_written, self.dirs_created self._init_record() return result def rollback(self): if not self.dry_run: for f in list(self.files_written): if os.path.exists(f): os.remove(f) # dirs should all be empty now, except perhaps for # __pycache__ subdirs # reverse so that subdirs appear before their parents dirs = sorted(self.dirs_created, reverse=True) for d in dirs: flist = os.listdir(d) if flist: assert flist == ['__pycache__'] sd = os.path.join(d, flist[0]) os.rmdir(sd) os.rmdir(d) # should fail if non-empty self._init_record() def resolve(module_name, dotted_path): if module_name in sys.modules: mod = sys.modules[module_name] else: mod = __import__(module_name) if dotted_path is None: result = mod else: parts = dotted_path.split('.') result = getattr(mod, parts.pop(0)) for p in parts: result = getattr(result, p) return result class ExportEntry(object): def __init__(self, name, prefix, suffix, flags): self.name = name self.prefix = prefix self.suffix = suffix self.flags = flags @cached_property def value(self): return resolve(self.prefix, self.suffix) def __repr__(self): # pragma: no cover return '' % (self.name, self.prefix, self.suffix, self.flags) def __eq__(self, other): if not isinstance(other, ExportEntry): result = False else: result = (self.name == other.name and self.prefix == other.prefix and self.suffix == other.suffix and self.flags == other.flags) return result __hash__ = object.__hash__ ENTRY_RE = re.compile(r'''(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? ''', re.VERBOSE) def get_export_entry(specification): m = ENTRY_RE.search(specification) if not m: result = None if '[' in specification or ']' in specification: raise DistlibException("Invalid specification " "'%s'" % specification) else: d = m.groupdict() name = d['name'] path = d['callable'] colons = path.count(':') if colons == 0: prefix, suffix = path, None else: if colons != 1: raise DistlibException("Invalid specification " "'%s'" % specification) prefix, suffix = path.split(':') flags = d['flags'] if flags is None: if '[' in specification or ']' in specification: raise DistlibException("Invalid specification " "'%s'" % specification) flags = [] else: flags = [f.strip() for f in flags.split(',')] result = ExportEntry(name, prefix, suffix, flags) return result def get_cache_base(suffix=None): """ Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. """ if suffix is None: suffix = '.distlib' if os.name == 'nt' and 'LOCALAPPDATA' in os.environ: result = os.path.expandvars('$localappdata') else: # Assume posix, or old Windows result = os.path.expanduser('~') # we use 'isdir' instead of 'exists', because we want to # fail if there's a file with that name if os.path.isdir(result): usable = os.access(result, os.W_OK) if not usable: logger.warning('Directory exists but is not writable: %s', result) else: try: os.makedirs(result) usable = True except OSError: logger.warning('Unable to create %s', result, exc_info=True) usable = False if not usable: result = tempfile.mkdtemp() logger.warning('Default location unusable, using %s', result) return os.path.join(result, suffix) def path_to_cache_dir(path): """ Convert an absolute path to a directory name for use in a cache. The algorithm used is: #. On Windows, any ``':'`` in the drive is replaced with ``'---'``. #. Any occurrence of ``os.sep`` is replaced with ``'--'``. #. ``'.cache'`` is appended. """ d, p = os.path.splitdrive(os.path.abspath(path)) if d: d = d.replace(':', '---') p = p.replace(os.sep, '--') return d + p + '.cache' def ensure_slash(s): if not s.endswith('/'): return s + '/' return s def parse_credentials(netloc): username = password = None if '@' in netloc: prefix, netloc = netloc.rsplit('@', 1) if ':' not in prefix: username = prefix else: username, password = prefix.split(':', 1) if username: username = unquote(username) if password: password = unquote(password) return username, password, netloc def get_process_umask(): result = os.umask(0o22) os.umask(result) return result def is_string_sequence(seq): result = True i = None for i, s in enumerate(seq): if not isinstance(s, string_types): result = False break assert i is not None return result PROJECT_NAME_AND_VERSION = re.compile('([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-' '([a-z0-9_.+-]+)', re.I) PYTHON_VERSION = re.compile(r'-py(\d\.?\d?)') def split_filename(filename, project_name=None): """ Extract name, version, python version from a filename (no extension) Return name, version, pyver or None """ result = None pyver = None filename = unquote(filename).replace(' ', '-') m = PYTHON_VERSION.search(filename) if m: pyver = m.group(1) filename = filename[:m.start()] if project_name and len(filename) > len(project_name) + 1: m = re.match(re.escape(project_name) + r'\b', filename) if m: n = m.end() result = filename[:n], filename[n + 1:], pyver if result is None: m = PROJECT_NAME_AND_VERSION.match(filename) if m: result = m.group(1), m.group(3), pyver return result # Allow spaces in name because of legacy dists like "Twisted Core" NAME_VERSION_RE = re.compile(r'(?P[\w .-]+)\s*' r'\(\s*(?P[^\s)]+)\)$') def parse_name_and_version(p): """ A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. """ m = NAME_VERSION_RE.match(p) if not m: raise DistlibException('Ill-formed name/version string: \'%s\'' % p) d = m.groupdict() return d['name'].strip().lower(), d['ver'] def get_extras(requested, available): result = set() requested = set(requested or []) available = set(available or []) if '*' in requested: requested.remove('*') result |= available for r in requested: if r == '-': result.add(r) elif r.startswith('-'): unwanted = r[1:] if unwanted not in available: logger.warning('undeclared extra: %s' % unwanted) if unwanted in result: result.remove(unwanted) else: if r not in available: logger.warning('undeclared extra: %s' % r) result.add(r) return result # # Extended metadata functionality # def _get_external_data(url): result = {} try: # urlopen might fail if it runs into redirections, # because of Python issue #13696. Fixed in locators # using a custom redirect handler. resp = urlopen(url) headers = resp.info() ct = headers.get('Content-Type') if not ct.startswith('application/json'): logger.debug('Unexpected response for JSON request: %s', ct) else: reader = codecs.getreader('utf-8')(resp) #data = reader.read().decode('utf-8') #result = json.loads(data) result = json.load(reader) except Exception as e: logger.exception('Failed to get external data for %s: %s', url, e) return result _external_data_base_url = 'https://www.red-dove.com/pypi/projects/' def get_project_data(name): url = '%s/%s/project.json' % (name[0].upper(), name) url = urljoin(_external_data_base_url, url) result = _get_external_data(url) return result def get_package_data(name, version): url = '%s/%s/package-%s.json' % (name[0].upper(), name, version) url = urljoin(_external_data_base_url, url) return _get_external_data(url) class Cache(object): """ A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. """ def __init__(self, base): """ Initialise an instance. :param base: The base directory where the cache should be located. """ # we use 'isdir' instead of 'exists', because we want to # fail if there's a file with that name if not os.path.isdir(base): # pragma: no cover os.makedirs(base) if (os.stat(base).st_mode & 0o77) != 0: logger.warning('Directory \'%s\' is not private', base) self.base = os.path.abspath(os.path.normpath(base)) def prefix_to_dir(self, prefix): """ Converts a resource prefix to a directory name in the cache. """ return path_to_cache_dir(prefix) def clear(self): """ Clear the cache. """ not_removed = [] for fn in os.listdir(self.base): fn = os.path.join(self.base, fn) try: if os.path.islink(fn) or os.path.isfile(fn): os.remove(fn) elif os.path.isdir(fn): shutil.rmtree(fn) except Exception: not_removed.append(fn) return not_removed class EventMixin(object): """ A very simple publish/subscribe system. """ def __init__(self): self._subscribers = {} def add(self, event, subscriber, append=True): """ Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. """ subs = self._subscribers if event not in subs: subs[event] = deque([subscriber]) else: sq = subs[event] if append: sq.append(subscriber) else: sq.appendleft(subscriber) def remove(self, event, subscriber): """ Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. """ subs = self._subscribers if event not in subs: raise ValueError('No subscribers: %r' % event) subs[event].remove(subscriber) def get_subscribers(self, event): """ Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. """ return iter(self._subscribers.get(event, ())) def publish(self, event, *args, **kwargs): """ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. """ result = [] for subscriber in self.get_subscribers(event): try: value = subscriber(event, *args, **kwargs) except Exception: logger.exception('Exception during event publication') value = None result.append(value) logger.debug('publish %s: args = %s, kwargs = %s, result = %s', event, args, kwargs, result) return result # # Simple sequencing # class Sequencer(object): def __init__(self): self._preds = {} self._succs = {} self._nodes = set() # nodes with no preds/succs def add_node(self, node): self._nodes.add(node) def remove_node(self, node, edges=False): if node in self._nodes: self._nodes.remove(node) if edges: for p in set(self._preds.get(node, ())): self.remove(p, node) for s in set(self._succs.get(node, ())): self.remove(node, s) # Remove empties for k, v in list(self._preds.items()): if not v: del self._preds[k] for k, v in list(self._succs.items()): if not v: del self._succs[k] def add(self, pred, succ): assert pred != succ self._preds.setdefault(succ, set()).add(pred) self._succs.setdefault(pred, set()).add(succ) def remove(self, pred, succ): assert pred != succ try: preds = self._preds[succ] succs = self._succs[pred] except KeyError: # pragma: no cover raise ValueError('%r not a successor of anything' % succ) try: preds.remove(pred) succs.remove(succ) except KeyError: # pragma: no cover raise ValueError('%r not a successor of %r' % (succ, pred)) def is_step(self, step): return (step in self._preds or step in self._succs or step in self._nodes) def get_steps(self, final): if not self.is_step(final): raise ValueError('Unknown: %r' % final) result = [] todo = [] seen = set() todo.append(final) while todo: step = todo.pop(0) if step in seen: # if a step was already seen, # move it to the end (so it will appear earlier # when reversed on return) ... but not for the # final step, as that would be confusing for # users if step != final: result.remove(step) result.append(step) else: seen.add(step) result.append(step) preds = self._preds.get(step, ()) todo.extend(preds) return reversed(result) @property def strong_connections(self): #http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm index_counter = [0] stack = [] lowlinks = {} index = {} result = [] graph = self._succs def strongconnect(node): # set the depth index for this node to the smallest unused index index[node] = index_counter[0] lowlinks[node] = index_counter[0] index_counter[0] += 1 stack.append(node) # Consider successors try: successors = graph[node] except Exception: successors = [] for successor in successors: if successor not in lowlinks: # Successor has not yet been visited strongconnect(successor) lowlinks[node] = min(lowlinks[node],lowlinks[successor]) elif successor in stack: # the successor is in the stack and hence in the current # strongly connected component (SCC) lowlinks[node] = min(lowlinks[node],index[successor]) # If `node` is a root node, pop the stack and generate an SCC if lowlinks[node] == index[node]: connected_component = [] while True: successor = stack.pop() connected_component.append(successor) if successor == node: break component = tuple(connected_component) # storing the result result.append(component) for node in graph: if node not in lowlinks: strongconnect(node) return result @property def dot(self): result = ['digraph G {'] for succ in self._preds: preds = self._preds[succ] for pred in preds: result.append(' %s -> %s;' % (pred, succ)) for node in self._nodes: result.append(' %s;' % node) result.append('}') return '\n'.join(result) # # Unarchiving functionality for zip, tar, tgz, tbz, whl # ARCHIVE_EXTENSIONS = ('.tar.gz', '.tar.bz2', '.tar', '.zip', '.tgz', '.tbz', '.whl') def unarchive(archive_filename, dest_dir, format=None, check=True): def check_path(path): if not isinstance(path, text_type): path = path.decode('utf-8') p = os.path.abspath(os.path.join(dest_dir, path)) if not p.startswith(dest_dir) or p[plen] != os.sep: raise ValueError('path outside destination: %r' % p) dest_dir = os.path.abspath(dest_dir) plen = len(dest_dir) archive = None if format is None: if archive_filename.endswith(('.zip', '.whl')): format = 'zip' elif archive_filename.endswith(('.tar.gz', '.tgz')): format = 'tgz' mode = 'r:gz' elif archive_filename.endswith(('.tar.bz2', '.tbz')): format = 'tbz' mode = 'r:bz2' elif archive_filename.endswith('.tar'): format = 'tar' mode = 'r' else: # pragma: no cover raise ValueError('Unknown format for %r' % archive_filename) try: if format == 'zip': archive = ZipFile(archive_filename, 'r') if check: names = archive.namelist() for name in names: check_path(name) else: archive = tarfile.open(archive_filename, mode) if check: names = archive.getnames() for name in names: check_path(name) if format != 'zip' and sys.version_info[0] < 3: # See Python issue 17153. If the dest path contains Unicode, # tarfile extraction fails on Python 2.x if a member path name # contains non-ASCII characters - it leads to an implicit # bytes -> unicode conversion using ASCII to decode. for tarinfo in archive.getmembers(): if not isinstance(tarinfo.name, text_type): tarinfo.name = tarinfo.name.decode('utf-8') archive.extractall(dest_dir) finally: if archive: archive.close() def zip_dir(directory): """zip a directory tree into a BytesIO object""" result = io.BytesIO() dlen = len(directory) with ZipFile(result, "w") as zf: for root, dirs, files in os.walk(directory): for name in files: full = os.path.join(root, name) rel = root[dlen:] dest = os.path.join(rel, name) zf.write(full, dest) return result # # Simple progress bar # UNITS = ('', 'K', 'M', 'G','T','P') class Progress(object): unknown = 'UNKNOWN' def __init__(self, minval=0, maxval=100): assert maxval is None or maxval >= minval self.min = self.cur = minval self.max = maxval self.started = None self.elapsed = 0 self.done = False def update(self, curval): assert self.min <= curval assert self.max is None or curval <= self.max self.cur = curval now = time.time() if self.started is None: self.started = now else: self.elapsed = now - self.started def increment(self, incr): assert incr >= 0 self.update(self.cur + incr) def start(self): self.update(self.min) return self def stop(self): if self.max is not None: self.update(self.max) self.done = True @property def maximum(self): return self.unknown if self.max is None else self.max @property def percentage(self): if self.done: result = '100 %' elif self.max is None: result = ' ?? %' else: v = 100.0 * (self.cur - self.min) / (self.max - self.min) result = '%3d %%' % v return result def format_duration(self, duration): if (duration <= 0) and self.max is None or self.cur == self.min: result = '??:??:??' #elif duration < 1: # result = '--:--:--' else: result = time.strftime('%H:%M:%S', time.gmtime(duration)) return result @property def ETA(self): if self.done: prefix = 'Done' t = self.elapsed #import pdb; pdb.set_trace() else: prefix = 'ETA ' if self.max is None: t = -1 elif self.elapsed == 0 or (self.cur == self.min): t = 0 else: #import pdb; pdb.set_trace() t = float(self.max - self.min) t /= self.cur - self.min t = (t - 1) * self.elapsed return '%s: %s' % (prefix, self.format_duration(t)) @property def speed(self): if self.elapsed == 0: result = 0.0 else: result = (self.cur - self.min) / self.elapsed for unit in UNITS: if result < 1000: break result /= 1000.0 return '%d %sB/s' % (result, unit) # # Glob functionality # RICH_GLOB = re.compile(r'\{([^}]*)\}') _CHECK_RECURSIVE_GLOB = re.compile(r'[^/\\,{]\*\*|\*\*[^/\\,}]') _CHECK_MISMATCH_SET = re.compile(r'^[^{]*\}|\{[^}]*$') def iglob(path_glob): """Extended globbing function that supports ** and {opt1,opt2,opt3}.""" if _CHECK_RECURSIVE_GLOB.search(path_glob): msg = """invalid glob %r: recursive glob "**" must be used alone""" raise ValueError(msg % path_glob) if _CHECK_MISMATCH_SET.search(path_glob): msg = """invalid glob %r: mismatching set marker '{' or '}'""" raise ValueError(msg % path_glob) return _iglob(path_glob) def _iglob(path_glob): rich_path_glob = RICH_GLOB.split(path_glob, 1) if len(rich_path_glob) > 1: assert len(rich_path_glob) == 3, rich_path_glob prefix, set, suffix = rich_path_glob for item in set.split(','): for path in _iglob(''.join((prefix, item, suffix))): yield path else: if '**' not in path_glob: for item in std_iglob(path_glob): yield item else: prefix, radical = path_glob.split('**', 1) if prefix == '': prefix = '.' if radical == '': radical = '*' else: # we support both radical = radical.lstrip('/') radical = radical.lstrip('\\') for path, dir, files in os.walk(prefix): path = os.path.normpath(path) for fn in _iglob(os.path.join(path, radical)): yield fn if ssl: from .compat import (HTTPSHandler as BaseHTTPSHandler, match_hostname, CertificateError) # # HTTPSConnection which verifies certificates/matches domains # class HTTPSConnection(httplib.HTTPSConnection): ca_certs = None # set this to the path to the certs file (.pem) check_domain = True # only used if ca_certs is not None # noinspection PyPropertyAccess def connect(self): sock = socket.create_connection((self.host, self.port), self.timeout) if getattr(self, '_tunnel_host', False): self.sock = sock self._tunnel() if not hasattr(ssl, 'SSLContext'): # For 2.x if self.ca_certs: cert_reqs = ssl.CERT_REQUIRED else: cert_reqs = ssl.CERT_NONE self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file, cert_reqs=cert_reqs, ssl_version=ssl.PROTOCOL_SSLv23, ca_certs=self.ca_certs) else: # pragma: no cover context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) if hasattr(ssl, 'OP_NO_SSLv2'): context.options |= ssl.OP_NO_SSLv2 if self.cert_file: context.load_cert_chain(self.cert_file, self.key_file) kwargs = {} if self.ca_certs: context.verify_mode = ssl.CERT_REQUIRED context.load_verify_locations(cafile=self.ca_certs) if getattr(ssl, 'HAS_SNI', False): kwargs['server_hostname'] = self.host self.sock = context.wrap_socket(sock, **kwargs) if self.ca_certs and self.check_domain: try: match_hostname(self.sock.getpeercert(), self.host) logger.debug('Host verified: %s', self.host) except CertificateError: # pragma: no cover self.sock.shutdown(socket.SHUT_RDWR) self.sock.close() raise class HTTPSHandler(BaseHTTPSHandler): def __init__(self, ca_certs, check_domain=True): BaseHTTPSHandler.__init__(self) self.ca_certs = ca_certs self.check_domain = check_domain def _conn_maker(self, *args, **kwargs): """ This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. """ result = HTTPSConnection(*args, **kwargs) if self.ca_certs: result.ca_certs = self.ca_certs result.check_domain = self.check_domain return result def https_open(self, req): try: return self.do_open(self._conn_maker, req) except URLError as e: if 'certificate verify failed' in str(e.reason): raise CertificateError('Unable to verify server certificate ' 'for %s' % req.host) else: raise # # To prevent against mixing HTTP traffic with HTTPS (examples: A Man-In-The- # Middle proxy using HTTP listens on port 443, or an index mistakenly serves # HTML containing a http://xyz link when it should be https://xyz), # you can use the following handler class, which does not allow HTTP traffic. # # It works by inheriting from HTTPHandler - so build_opener won't add a # handler for HTTP itself. # class HTTPSOnlyHandler(HTTPSHandler, HTTPHandler): def http_open(self, req): raise URLError('Unexpected HTTP request on what should be a secure ' 'connection: %s' % req) # # XML-RPC with timeouts # _ver_info = sys.version_info[:2] if _ver_info == (2, 6): class HTTP(httplib.HTTP): def __init__(self, host='', port=None, **kwargs): if port == 0: # 0 means use port 0, not the default port port = None self._setup(self._connection_class(host, port, **kwargs)) if ssl: class HTTPS(httplib.HTTPS): def __init__(self, host='', port=None, **kwargs): if port == 0: # 0 means use port 0, not the default port port = None self._setup(self._connection_class(host, port, **kwargs)) class Transport(xmlrpclib.Transport): def __init__(self, timeout, use_datetime=0): self.timeout = timeout xmlrpclib.Transport.__init__(self, use_datetime) def make_connection(self, host): h, eh, x509 = self.get_host_info(host) if _ver_info == (2, 6): result = HTTP(h, timeout=self.timeout) else: if not self._connection or host != self._connection[0]: self._extra_headers = eh self._connection = host, httplib.HTTPConnection(h) result = self._connection[1] return result if ssl: class SafeTransport(xmlrpclib.SafeTransport): def __init__(self, timeout, use_datetime=0): self.timeout = timeout xmlrpclib.SafeTransport.__init__(self, use_datetime) def make_connection(self, host): h, eh, kwargs = self.get_host_info(host) if not kwargs: kwargs = {} kwargs['timeout'] = self.timeout if _ver_info == (2, 6): result = HTTPS(host, None, **kwargs) else: if not self._connection or host != self._connection[0]: self._extra_headers = eh self._connection = host, httplib.HTTPSConnection(h, None, **kwargs) result = self._connection[1] return result class ServerProxy(xmlrpclib.ServerProxy): def __init__(self, uri, **kwargs): self.timeout = timeout = kwargs.pop('timeout', None) # The above classes only come into play if a timeout # is specified if timeout is not None: # scheme = splittype(uri) # deprecated as of Python 3.8 scheme = urlparse(uri)[0] use_datetime = kwargs.get('use_datetime', 0) if scheme == 'https': tcls = SafeTransport else: tcls = Transport kwargs['transport'] = t = tcls(timeout, use_datetime=use_datetime) self.transport = t xmlrpclib.ServerProxy.__init__(self, uri, **kwargs) # # CSV functionality. This is provided because on 2.x, the csv module can't # handle Unicode. However, we need to deal with Unicode in e.g. RECORD files. # def _csv_open(fn, mode, **kwargs): if sys.version_info[0] < 3: mode += 'b' else: kwargs['newline'] = '' # Python 3 determines encoding from locale. Force 'utf-8' # file encoding to match other forced utf-8 encoding kwargs['encoding'] = 'utf-8' return open(fn, mode, **kwargs) class CSVBase(object): defaults = { 'delimiter': str(','), # The strs are used because we need native 'quotechar': str('"'), # str in the csv API (2.x won't take 'lineterminator': str('\n') # Unicode) } def __enter__(self): return self def __exit__(self, *exc_info): self.stream.close() class CSVReader(CSVBase): def __init__(self, **kwargs): if 'stream' in kwargs: stream = kwargs['stream'] if sys.version_info[0] >= 3: # needs to be a text stream stream = codecs.getreader('utf-8')(stream) self.stream = stream else: self.stream = _csv_open(kwargs['path'], 'r') self.reader = csv.reader(self.stream, **self.defaults) def __iter__(self): return self def next(self): result = next(self.reader) if sys.version_info[0] < 3: for i, item in enumerate(result): if not isinstance(item, text_type): result[i] = item.decode('utf-8') return result __next__ = next class CSVWriter(CSVBase): def __init__(self, fn, **kwargs): self.stream = _csv_open(fn, 'w') self.writer = csv.writer(self.stream, **self.defaults) def writerow(self, row): if sys.version_info[0] < 3: r = [] for item in row: if isinstance(item, text_type): item = item.encode('utf-8') r.append(item) row = r self.writer.writerow(row) # # Configurator functionality # class Configurator(BaseConfigurator): value_converters = dict(BaseConfigurator.value_converters) value_converters['inc'] = 'inc_convert' def __init__(self, config, base=None): super(Configurator, self).__init__(config) self.base = base or os.getcwd() def configure_custom(self, config): def convert(o): if isinstance(o, (list, tuple)): result = type(o)([convert(i) for i in o]) elif isinstance(o, dict): if '()' in o: result = self.configure_custom(o) else: result = {} for k in o: result[k] = convert(o[k]) else: result = self.convert(o) return result c = config.pop('()') if not callable(c): c = self.resolve(c) props = config.pop('.', None) # Check for valid identifiers args = config.pop('[]', ()) if args: args = tuple([convert(o) for o in args]) items = [(k, convert(config[k])) for k in config if valid_ident(k)] kwargs = dict(items) result = c(*args, **kwargs) if props: for n, v in props.items(): setattr(result, n, convert(v)) return result def __getitem__(self, key): result = self.config[key] if isinstance(result, dict) and '()' in result: self.config[key] = result = self.configure_custom(result) return result def inc_convert(self, value): """Default converter for the inc:// protocol.""" if not os.path.isabs(value): value = os.path.join(self.base, value) with codecs.open(value, 'r', encoding='utf-8') as f: result = json.load(f) return result class SubprocessMixin(object): """ Mixin for running subprocesses and capturing their output """ def __init__(self, verbose=False, progress=None): self.verbose = verbose self.progress = progress def reader(self, stream, context): """ Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. """ progress = self.progress verbose = self.verbose while True: s = stream.readline() if not s: break if progress is not None: progress(s, context) else: if not verbose: sys.stderr.write('.') else: sys.stderr.write(s.decode('utf-8')) sys.stderr.flush() stream.close() def run_command(self, cmd, **kwargs): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) t1 = threading.Thread(target=self.reader, args=(p.stdout, 'stdout')) t1.start() t2 = threading.Thread(target=self.reader, args=(p.stderr, 'stderr')) t2.start() p.wait() t1.join() t2.join() if self.progress is not None: self.progress('done.', 'main') elif self.verbose: sys.stderr.write('done.\n') return p def normalize_name(name): """Normalize a python package name a la PEP 503""" # https://www.python.org/dev/peps/pep-0503/#normalized-names return re.sub('[-_.]+', '-', name).lower() # def _get_pypirc_command(): # """ # Get the distutils command for interacting with PyPI configurations. # :return: the command. # """ # from distutils.core import Distribution # from distutils.config import PyPIRCCommand # d = Distribution() # return PyPIRCCommand(d) class PyPIRCFile(object): DEFAULT_REPOSITORY = 'https://upload.pypi.org/legacy/' DEFAULT_REALM = 'pypi' def __init__(self, fn=None, url=None): if fn is None: fn = os.path.join(os.path.expanduser('~'), '.pypirc') self.filename = fn self.url = url def read(self): result = {} if os.path.exists(self.filename): repository = self.url or self.DEFAULT_REPOSITORY config = configparser.RawConfigParser() config.read(self.filename) sections = config.sections() if 'distutils' in sections: # let's get the list of servers index_servers = config.get('distutils', 'index-servers') _servers = [server.strip() for server in index_servers.split('\n') if server.strip() != ''] if _servers == []: # nothing set, let's try to get the default pypi if 'pypi' in sections: _servers = ['pypi'] else: for server in _servers: result = {'server': server} result['username'] = config.get(server, 'username') # optional params for key, default in (('repository', self.DEFAULT_REPOSITORY), ('realm', self.DEFAULT_REALM), ('password', None)): if config.has_option(server, key): result[key] = config.get(server, key) else: result[key] = default # work around people having "repository" for the "pypi" # section of their config set to the HTTP (rather than # HTTPS) URL if (server == 'pypi' and repository in (self.DEFAULT_REPOSITORY, 'pypi')): result['repository'] = self.DEFAULT_REPOSITORY elif (result['server'] != repository and result['repository'] != repository): result = {} elif 'server-login' in sections: # old format server = 'server-login' if config.has_option(server, 'repository'): repository = config.get(server, 'repository') else: repository = self.DEFAULT_REPOSITORY result = { 'username': config.get(server, 'username'), 'password': config.get(server, 'password'), 'repository': repository, 'server': server, 'realm': self.DEFAULT_REALM } return result def update(self, username, password): # import pdb; pdb.set_trace() config = configparser.RawConfigParser() fn = self.filename config.read(fn) if not config.has_section('pypi'): config.add_section('pypi') config.set('pypi', 'username', username) config.set('pypi', 'password', password) with open(fn, 'w') as f: config.write(f) def _load_pypirc(index): """ Read the PyPI access configuration as supported by distutils. """ return PyPIRCFile(url=index.url).read() def _store_pypirc(index): PyPIRCFile().update(index.username, index.password) # # get_platform()/get_host_platform() copied from Python 3.10.a0 source, with some minor # tweaks # 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(' ', '_').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 _aix_support import aix_platform return aix_platform() 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) _TARGET_TO_PLAT = { 'x86' : 'win32', 'x64' : 'win-amd64', 'arm' : 'win-arm32', } def get_platform(): if os.name != 'nt': return get_host_platform() cross_compilation_target = os.environ.get('VSCMD_ARG_TGT_ARCH') if cross_compilation_target not in _TARGET_TO_PLAT: return get_host_platform() return _TARGET_TO_PLAT[cross_compilation_target] PK!9kdkd_backport/shutil.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os.path import abspath import fnmatch try: from collections.abc import Callable except ImportError: from collections import Callable import errno from . import tarfile try: import bz2 _BZ2_SUPPORTED = True except ImportError: _BZ2_SUPPORTED = False try: from pwd import getpwnam except ImportError: getpwnam = None try: from grp import getgrnam except ImportError: getgrnam = None __all__ = ["copyfileobj", "copyfile", "copymode", "copystat", "copy", "copy2", "copytree", "move", "rmtree", "Error", "SpecialFileError", "ExecError", "make_archive", "get_archive_formats", "register_archive_format", "unregister_archive_format", "get_unpack_formats", "register_unpack_format", "unregister_unpack_format", "unpack_archive", "ignore_patterns"] class Error(EnvironmentError): pass class SpecialFileError(EnvironmentError): """Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)""" class ExecError(EnvironmentError): """Raised when a command could not be executed""" class ReadError(EnvironmentError): """Raised when an archive cannot be read""" class RegistryError(Exception): """Raised when a registry operation with the archiving and unpacking registries fails""" try: WindowsError except NameError: WindowsError = None def copyfileobj(fsrc, fdst, length=16*1024): """copy data from file-like object fsrc to file-like object fdst""" while 1: buf = fsrc.read(length) if not buf: break fdst.write(buf) def _samefile(src, dst): # Macintosh, Unix. if hasattr(os.path, 'samefile'): try: return os.path.samefile(src, dst) except OSError: return False # All other platforms: check for same pathname. return (os.path.normcase(os.path.abspath(src)) == os.path.normcase(os.path.abspath(dst))) def copyfile(src, dst): """Copy data from src to dst""" if _samefile(src, dst): raise Error("`%s` and `%s` are the same file" % (src, dst)) for fn in [src, dst]: try: st = os.stat(fn) except OSError: # File most likely does not exist pass else: # XXX What about other special files? (sockets, devices...) if stat.S_ISFIFO(st.st_mode): raise SpecialFileError("`%s` is a named pipe" % fn) with open(src, 'rb') as fsrc: with open(dst, 'wb') as fdst: copyfileobj(fsrc, fdst) def copymode(src, dst): """Copy mode bits from src to dst""" if hasattr(os, 'chmod'): st = os.stat(src) mode = stat.S_IMODE(st.st_mode) os.chmod(dst, mode) def copystat(src, dst): """Copy all stat info (mode bits, atime, mtime, flags) from src to dst""" st = os.stat(src) mode = stat.S_IMODE(st.st_mode) if hasattr(os, 'utime'): os.utime(dst, (st.st_atime, st.st_mtime)) if hasattr(os, 'chmod'): os.chmod(dst, mode) if hasattr(os, 'chflags') and hasattr(st, 'st_flags'): try: os.chflags(dst, st.st_flags) except OSError as why: if (not hasattr(errno, 'EOPNOTSUPP') or why.errno != errno.EOPNOTSUPP): raise def copy(src, dst): """Copy data and mode bits ("cp src dst"). The destination may be a directory. """ if os.path.isdir(dst): dst = os.path.join(dst, os.path.basename(src)) copyfile(src, dst) copymode(src, dst) def copy2(src, dst): """Copy data and all stat info ("cp -p src dst"). The destination may be a directory. """ if os.path.isdir(dst): dst = os.path.join(dst, os.path.basename(src)) copyfile(src, dst) copystat(src, dst) def ignore_patterns(*patterns): """Function that can be used as copytree() ignore parameter. Patterns is a sequence of glob-style patterns that are used to exclude files""" def _ignore_patterns(path, names): ignored_names = [] for pattern in patterns: ignored_names.extend(fnmatch.filter(names, pattern)) return set(ignored_names) return _ignore_patterns def copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False): """Recursively copy a directory tree. The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. If the file pointed by the symlink doesn't exist, an exception will be added in the list of errors raised in an Error exception at the end of the copy process. You can set the optional ignore_dangling_symlinks flag to true if you want to silence this exception. Notice that this has no effect on platforms that don't support os.symlink. The optional ignore argument is a callable. If given, it is called with the `src` parameter, which is the directory being visited by copytree(), and `names` which is the list of `src` contents, as returned by os.listdir(): callable(src, names) -> ignored_names Since copytree() is called recursively, the callable will be called once for each directory that is copied. It returns a list of names relative to the `src` directory that should not be copied. The optional copy_function argument is a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. """ names = os.listdir(src) if ignore is not None: ignored_names = ignore(src, names) else: ignored_names = set() os.makedirs(dst) errors = [] for name in names: if name in ignored_names: continue srcname = os.path.join(src, name) dstname = os.path.join(dst, name) try: if os.path.islink(srcname): linkto = os.readlink(srcname) if symlinks: os.symlink(linkto, dstname) else: # ignore dangling symlink if the flag is on if not os.path.exists(linkto) and ignore_dangling_symlinks: continue # otherwise let the copy occurs. copy2 will raise an error copy_function(srcname, dstname) elif os.path.isdir(srcname): copytree(srcname, dstname, symlinks, ignore, copy_function) else: # Will raise a SpecialFileError for unsupported file types copy_function(srcname, dstname) # catch the Error from the recursive copytree so that we can # continue with other files except Error as err: errors.extend(err.args[0]) except EnvironmentError as why: errors.append((srcname, dstname, str(why))) try: copystat(src, dst) except OSError as why: if WindowsError is not None and isinstance(why, WindowsError): # Copying file access times may fail on Windows pass else: errors.extend((src, dst, str(why))) if errors: raise Error(errors) def rmtree(path, ignore_errors=False, onerror=None): """Recursively delete a directory tree. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, path, exc_info) where func is os.listdir, os.remove, or os.rmdir; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info(). If ignore_errors is false and onerror is None, an exception is raised. """ if ignore_errors: def onerror(*args): pass elif onerror is None: def onerror(*args): raise try: if os.path.islink(path): # symlinks to directories are forbidden, see bug #1669 raise OSError("Cannot call rmtree on a symbolic link") except OSError: onerror(os.path.islink, path, sys.exc_info()) # can't continue even if onerror hook returns return names = [] try: names = os.listdir(path) except os.error: onerror(os.listdir, path, sys.exc_info()) for name in names: fullname = os.path.join(path, name) try: mode = os.lstat(fullname).st_mode except os.error: mode = 0 if stat.S_ISDIR(mode): rmtree(fullname, ignore_errors, onerror) else: try: os.remove(fullname) except os.error: onerror(os.remove, fullname, sys.exc_info()) try: os.rmdir(path) except os.error: onerror(os.rmdir, path, sys.exc_info()) def _basename(path): # A basename() variant which first strips the trailing slash, if present. # Thus we always get the last component of the path, even for directories. return os.path.basename(path.rstrip(os.path.sep)) def move(src, dst): """Recursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics. If the destination is on our current filesystem, then rename() is used. Otherwise, src is copied to the destination and then removed. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over. """ real_dst = dst if os.path.isdir(dst): if _samefile(src, dst): # We might be on a case insensitive filesystem, # perform the rename anyway. os.rename(src, dst) return real_dst = os.path.join(dst, _basename(src)) if os.path.exists(real_dst): raise Error("Destination path '%s' already exists" % real_dst) try: os.rename(src, real_dst) except OSError: if os.path.isdir(src): if _destinsrc(src, dst): raise Error("Cannot move a directory '%s' into itself '%s'." % (src, dst)) copytree(src, real_dst, symlinks=True) rmtree(src) else: copy2(src, real_dst) os.unlink(src) def _destinsrc(src, dst): src = abspath(src) dst = abspath(dst) if not src.endswith(os.path.sep): src += os.path.sep if not dst.endswith(os.path.sep): dst += os.path.sep return dst.startswith(src) 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, logger=None): """Create a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "bzip2", or None. '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_name' + ".tar", possibly plus the appropriate compression extension (".gz", or ".bz2"). Returns the output filename. """ tar_compression = {'gzip': 'gz', None: ''} compress_ext = {'gzip': '.gz'} if _BZ2_SUPPORTED: tar_compression['bzip2'] = 'bz2' compress_ext['bzip2'] = '.bz2' # flags for compression program, each element of list will be an argument if compress is not None and compress not in compress_ext: raise ValueError("bad value for 'compress', or compression format not " "supported : {0}".format(compress)) archive_name = base_name + '.tar' + compress_ext.get(compress, '') archive_dir = os.path.dirname(archive_name) if not os.path.exists(archive_dir): if logger is not None: logger.info("creating %s", archive_dir) if not dry_run: os.makedirs(archive_dir) # creating the tarball if logger is not None: logger.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() return archive_name def _call_external_zip(base_dir, zip_filename, verbose=False, dry_run=False): # XXX see if we want to keep an external call here if verbose: zipoptions = "-r" else: zipoptions = "-rq" from distutils.errors import DistutilsExecError from distutils.spawn import spawn 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 ExecError("unable to create zip file '%s': " "could neither import the 'zipfile' module nor " "find a standalone zip utility") % zip_filename def _make_zipfile(base_name, base_dir, verbose=0, dry_run=0, logger=None): """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 ExecError. Returns the name of the output zip file. """ zip_filename = base_name + ".zip" archive_dir = os.path.dirname(base_name) if not os.path.exists(archive_dir): if logger is not None: logger.info("creating %s", archive_dir) if not dry_run: os.makedirs(archive_dir) # If zipfile module is not available, try spawning an external 'zip' # command. try: import zipfile except ImportError: zipfile = None if zipfile is None: _call_external_zip(base_dir, zip_filename, verbose, dry_run) else: if logger is not None: logger.info("creating '%s' and adding '%s' to it", zip_filename, base_dir) if not dry_run: zip = zipfile.ZipFile(zip_filename, "w", compression=zipfile.ZIP_DEFLATED) for dirpath, dirnames, filenames in os.walk(base_dir): for name in filenames: path = os.path.normpath(os.path.join(dirpath, name)) if os.path.isfile(path): zip.write(path, path) if logger is not None: logger.info("adding '%s'", path) zip.close() return zip_filename _ARCHIVE_FORMATS = { 'gztar': (_make_tarball, [('compress', 'gzip')], "gzip'ed tar-file"), 'bztar': (_make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file"), 'tar': (_make_tarball, [('compress', None)], "uncompressed tar file"), 'zip': (_make_zipfile, [], "ZIP file"), } if _BZ2_SUPPORTED: _ARCHIVE_FORMATS['bztar'] = (_make_tarball, [('compress', 'bzip2')], "bzip2'ed tar-file") def get_archive_formats(): """Returns a list of supported formats for archiving and unarchiving. Each element of the returned sequence is a tuple (name, description) """ formats = [(name, registry[2]) for name, registry in _ARCHIVE_FORMATS.items()] formats.sort() return formats def register_archive_format(name, function, extra_args=None, description=''): """Registers an archive format. name is the name of the format. function is the callable that will be used to create archives. If provided, extra_args is a sequence of (name, value) tuples that will be passed as arguments to the callable. description can be provided to describe the format, and will be returned by the get_archive_formats() function. """ if extra_args is None: extra_args = [] if not isinstance(function, Callable): raise TypeError('The %s object is not callable' % function) if not isinstance(extra_args, (tuple, list)): raise TypeError('extra_args needs to be a sequence') for element in extra_args: if not isinstance(element, (tuple, list)) or len(element) !=2: raise TypeError('extra_args elements are : (arg_name, value)') _ARCHIVE_FORMATS[name] = (function, extra_args, description) def unregister_archive_format(name): del _ARCHIVE_FORMATS[name] def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0, dry_run=0, owner=None, group=None, logger=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", "bztar" or "gztar". '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: if logger is not None: logger.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, 'logger': logger} 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: if logger is not None: logger.debug("changing back to '%s'", save_cwd) os.chdir(save_cwd) return filename def get_unpack_formats(): """Returns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description) """ formats = [(name, info[0], info[3]) for name, info in _UNPACK_FORMATS.items()] formats.sort() return formats def _check_unpack_options(extensions, function, extra_args): """Checks what gets registered as an unpacker.""" # first make sure no other unpacker is registered for this extension existing_extensions = {} for name, info in _UNPACK_FORMATS.items(): for ext in info[0]: existing_extensions[ext] = name for extension in extensions: if extension in existing_extensions: msg = '%s is already registered for "%s"' raise RegistryError(msg % (extension, existing_extensions[extension])) if not isinstance(function, Callable): raise TypeError('The registered function must be a callable') def register_unpack_format(name, extensions, function, extra_args=None, description=''): """Registers an unpack format. `name` is the name of the format. `extensions` is a list of extensions corresponding to the format. `function` is the callable that will be used to unpack archives. The callable will receive archives to unpack. If it's unable to handle an archive, it needs to raise a ReadError exception. If provided, `extra_args` is a sequence of (name, value) tuples that will be passed as arguments to the callable. description can be provided to describe the format, and will be returned by the get_unpack_formats() function. """ if extra_args is None: extra_args = [] _check_unpack_options(extensions, function, extra_args) _UNPACK_FORMATS[name] = extensions, function, extra_args, description def unregister_unpack_format(name): """Removes the pack format from the registry.""" del _UNPACK_FORMATS[name] def _ensure_directory(path): """Ensure that the parent directory of `path` exists""" dirname = os.path.dirname(path) if not os.path.isdir(dirname): os.makedirs(dirname) def _unpack_zipfile(filename, extract_dir): """Unpack zip `filename` to `extract_dir` """ try: import zipfile except ImportError: raise ReadError('zlib not supported, cannot unpack this archive.') if not zipfile.is_zipfile(filename): raise ReadError("%s is not a zip file" % filename) zip = zipfile.ZipFile(filename) try: for info in zip.infolist(): name = info.filename # don't extract absolute paths or ones with .. in them if name.startswith('/') or '..' in name: continue target = os.path.join(extract_dir, *name.split('/')) if not target: continue _ensure_directory(target) if not name.endswith('/'): # file data = zip.read(info.filename) f = open(target, 'wb') try: f.write(data) finally: f.close() del data finally: zip.close() def _unpack_tarfile(filename, extract_dir): """Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` """ try: tarobj = tarfile.open(filename) except tarfile.TarError: raise ReadError( "%s is not a compressed or uncompressed tar file" % filename) try: tarobj.extractall(extract_dir) finally: tarobj.close() _UNPACK_FORMATS = { 'gztar': (['.tar.gz', '.tgz'], _unpack_tarfile, [], "gzip'ed tar-file"), 'tar': (['.tar'], _unpack_tarfile, [], "uncompressed tar file"), 'zip': (['.zip'], _unpack_zipfile, [], "ZIP file") } if _BZ2_SUPPORTED: _UNPACK_FORMATS['bztar'] = (['.bz2'], _unpack_tarfile, [], "bzip2'ed tar-file") def _find_unpack_format(filename): for name, info in _UNPACK_FORMATS.items(): for extension in info[0]: if filename.endswith(extension): return name return None def unpack_archive(filename, extract_dir=None, format=None): """Unpack an archive. `filename` is the name of the archive. `extract_dir` is the name of the target directory, where the archive is unpacked. If not provided, the current working directory is used. `format` is the archive format: one of "zip", "tar", or "gztar". Or any other registered format. If not provided, unpack_archive will use the filename extension and see if an unpacker was registered for that extension. In case none is found, a ValueError is raised. """ if extract_dir is None: extract_dir = os.getcwd() if format is not None: try: format_info = _UNPACK_FORMATS[format] except KeyError: raise ValueError("Unknown unpack format '{0}'".format(format)) func = format_info[1] func(filename, extract_dir, **dict(format_info[2])) else: # we need to look at the registered unpackers supported extensions format = _find_unpack_format(filename) if format is None: raise ReadError("Unknown archive format '{0}'".format(filename)) func = _UNPACK_FORMATS[format][1] kwargs = dict(_UNPACK_FORMATS[format][2]) func(filename, extract_dir, **kwargs) PK!/e_backport/misc.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Backports for individual classes and functions.""" import os import sys __all__ = ['cache_from_source', 'callable', 'fsencode'] try: from imp import cache_from_source except ImportError: def cache_from_source(py_file, debug=__debug__): ext = debug and 'c' or 'o' return py_file + ext try: callable = callable except NameError: from collections import Callable def callable(obj): return isinstance(obj, Callable) try: fsencode = os.fsencode except AttributeError: def fsencode(filename): if isinstance(filename, bytes): return filename elif isinstance(filename, str): return filename.encode(sys.getfilesystemencoding()) else: raise TypeError("expect bytes or str, not %s" % type(filename).__name__) PK!zKTT+_backport/__pycache__/shutil.cpython-39.pycnu[a Rekd@sdZddlZddlZddlZddlmZddlZzddlmZWne y^ddl mZYn0ddl Z ddl m Z zddlZdZWne ydZYn0zdd lmZWne ydZYn0zdd lmZWne ydZYn0gd ZGd d d eZGdddeZGdddeZGdddeZGdddeZzeWneyddZYn0dfddZddZddZ ddZ!dd Z"d!d"Z#d#d$Z$d%d&Z%dde$dfd'd(Z&dgd)d*Z'd+d,Z(d-d.Z)d/d0Z*d1d2Z+d3d4Z,dhd6d7Z-did8d9Z.djd:d;Z/e-dgd?fe-d@gdAfe/gdBfdCZ0erLe-d>gd?fe0dD<dEdFZ1dkdHdIZ2dJdKZ3dldLdMZ4dNdOZ5dPdQZ6dmdRdSZ7dTdUZ8dVdWZ9dXdYZ:dZd[Z;d\d]ge;gd=fd^ge;gdAfd_ge:gdBfd`ZdS)ozUtility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. N)abspath)Callable)tarfileTF)getpwnam)getgrnam) copyfileobjcopyfilecopymodecopystatcopycopy2copytreemovermtreeErrorSpecialFileError ExecError make_archiveget_archive_formatsregister_archive_formatunregister_archive_formatget_unpack_formatsregister_unpack_formatunregister_unpack_formatunpack_archiveignore_patternsc@s eZdZdS)rN)__name__ __module__ __qualname__r r /builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/shutil.pyr/src@seZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)Nrrr__doc__r r r r!r2src@seZdZdZdS)rz+Raised when a command could not be executedNr"r r r r!r6src@seZdZdZdS) ReadErrorz%Raised when an archive cannot be readNr"r r r r!r$9sr$c@seZdZdZdS) RegistryErrorzVRaised when a registry operation with the archiving and unpacking registries failsNr"r r r r!r%<sr%@cCs ||}|sq||qdS)z=copy data from file-like object fsrc to file-like object fdstN)readwrite)fsrcfdstlengthbufr r r!rFs rcCsZttjdr2ztj||WSty0YdS0tjtj|tjtj|kS)NsamefileF)hasattrospathr-OSErrornormcasersrcdstr r r! _samefileNs  r6c Cst||rtd||f||fD]>}zt|}WntyFYq"0t|jr"td|q"t|dD}t|d}t ||Wdn1s0YWdn1s0YdS)zCopy data from src to dstz`%s` and `%s` are the same filez`%s` is a named piperbwbN) r6rr/statr1S_ISFIFOst_moderopenr)r4r5fnstr)r*r r r!r Zs      r cCs0ttdr,t|}t|j}t||dS)zCopy mode bits from src to dstchmodN)r.r/r9S_IMODEr;r?)r4r5r>moder r r!r ns   r c Cst|}t|j}ttdr4t||j|jfttdrJt||ttdrt|drzt ||j Wn<t y}z$tt dr|j t j krWYd}~n d}~00dS)zCCopy all stat info (mode bits, atime, mtime, flags) from src to dstutimer?chflagsst_flags EOPNOTSUPPN)r/r9r@r;r.rBst_atimest_mtimer?rCrDr1errnorE)r4r5r>rAwhyr r r!r us       r cCs:tj|r"tj|tj|}t||t||dS)zVCopy data and mode bits ("cp src dst"). The destination may be a directory. N)r/r0isdirjoinbasenamer r r3r r r!r s  r cCs:tj|r"tj|tj|}t||t||dS)z]Copy data and all stat info ("cp -p src dst"). The destination may be a directory. N)r/r0rJrKrLr r r3r r r!r s  r csfdd}|S)zFunction that can be used as copytree() ignore parameter. Patterns is a sequence of glob-style patterns that are used to exclude filescs(g}D]}|t||qt|SN)extendfnmatchfilterset)r0names ignored_namespatternpatternsr r!_ignore_patternssz)ignore_patterns.._ignore_patternsr )rVrWr rUr!rs rc Cst|}|dur|||}nt}t|g}|D]} | |vrFq6tj|| } tj|| } zttj| rt| } |rt| | qtj | s|rWq6|| | n(tj | rt | | |||n || | Wq6t y } z| | jdWYd} ~ q6d} ~ 0tyD}z || | t|fWYd}~q6d}~00q6zt||WnRty}z8tdurt|trn| ||t|fWYd}~n d}~00|rt |dS)aRecursively copy a directory tree. The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. If the file pointed by the symlink doesn't exist, an exception will be added in the list of errors raised in an Error exception at the end of the copy process. You can set the optional ignore_dangling_symlinks flag to true if you want to silence this exception. Notice that this has no effect on platforms that don't support os.symlink. The optional ignore argument is a callable. If given, it is called with the `src` parameter, which is the directory being visited by copytree(), and `names` which is the list of `src` contents, as returned by os.listdir(): callable(src, names) -> ignored_names Since copytree() is called recursively, the callable will be called once for each directory that is copied. It returns a list of names relative to the `src` directory that should not be copied. The optional copy_function argument is a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. Nr)r/listdirrQmakedirsr0rKislinkreadlinksymlinkexistsrJrrrNargsEnvironmentErrorappendstrr r1 WindowsError isinstance)r4r5symlinksignore copy_functionignore_dangling_symlinksrRrSerrorsnamesrcnamedstnamelinktoerrrIr r r!rsD$        $,*rc Csh|rdd}n|durdd}ztj|r4tdWn(ty^|tjj|tYdS0g}zt|}Wn&tjy|tj|tYn0|D]}tj||}zt |j }Wntjyd}Yn0t |rt |||qzt|Wqtjy(|tj|tYq0qzt|Wn(tjyb|tj|tYn0dS)aRecursively delete a directory tree. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, path, exc_info) where func is os.listdir, os.remove, or os.rmdir; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info(). If ignore_errors is false and onerror is None, an exception is raised. cWsdSrMr r^r r r!onerrorszrmtree..onerrorNcWsdSrMr rnr r r!rosz%Cannot call rmtree on a symbolic linkr)r/r0rZr1sysexc_inforXerrorrKlstatr;r9S_ISDIRrremovermdir)r0 ignore_errorsrorRrifullnamerAr r r!rs>       rcCstj|tjjSrM)r/r0rLrstripsep)r0r r r! _basename*sr{cCs|}tj|rTt||r*t||dStj|t|}tj|rTtd|zt||Wndt ytj|rt ||rtd||ft ||ddt |nt ||t|Yn0dS)aRecursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics. If the destination is on our current filesystem, then rename() is used. Otherwise, src is copied to the destination and then removed. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over. Nz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.T)rd)r/r0rJr6renamerKr{r]rr1 _destinsrcrrr unlink)r4r5real_dstr r r!r/s$          rcCsNt|}t|}|tjjs*|tjj7}|tjjsD|tjj7}||SrM)rendswithr/r0rz startswithr3r r r!r}Ws  r}cCsLtdus|durdSz t|}Wnty6d}Yn0|durH|dSdS)z"Returns a gid, given a group name.N)rKeyErrorriresultr r r!_get_gid`s   rcCsLtdus|durdSz t|}Wnty6d}Yn0|durH|dSdS)z"Returns an uid, given a user name.Nr)rrrr r r!_get_uidls   rgzipcs ddd}ddi} tr&d|d<d| d<|d urD|| vrDtd ||d | |d} tj| } tj| s|d ur|d | |st | |d ur|d t t fdd} |st | d||} z| j|| dW| n | 0| S)aCreate a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "bzip2", or None. '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_name' + ".tar", possibly plus the appropriate compression extension (".gz", or ".bz2"). Returns the output filename. gz)rNrz.gzbz2bzip2.bz2NzCbad value for 'compress', or compression format not supported : {0}.tar creating %szCreating tar archivecs,dur|_|_dur(|_|_|SrM)gidgnameuiduname)tarinforgroupownerrr r! _set_uid_gidsz#_make_tarball.._set_uid_gidzw|%s)rP)_BZ2_SUPPORTED ValueErrorformatgetr/r0dirnamer]inforYrrrr<addclose) base_namebase_dircompressverbosedry_runrrloggertar_compression compress_ext archive_name archive_dirrtarr rr! _make_tarballxs6       rcCsb|r d}nd}ddlm}ddlm}z|d|||g|dWn|y\td|Yn0dS) Nz-rz-rqr)DistutilsExecError)spawnzip)rzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utility)distutils.errorsrdistutils.spawnrr)r zip_filenamerr zipoptionsrrr r r!_call_external_zips   rcCs|d}tj|}tj|sB|dur4|d||sBt|z ddl}Wntydd}Yn0|dur~t||||n|dur|d|||s|j |d|j d}t |D]V\} } } | D]F} tj tj | | } tj| r|| | |dur|d| qq||S) amCreate 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 ExecError. Returns the name of the output zip file. .zipNrrz#creating '%s' and adding '%s' to itw) compressionz adding '%s')r/r0rr]rrYzipfile ImportErrorrZipFile ZIP_DEFLATEDwalknormpathrKisfiler(r)rrrrrrrrrdirpathdirnames filenamesrir0r r r! _make_zipfiles<          r)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rNzuncompressed tar filezZIP file)gztarbztarrrrcCsddtD}||S)zReturns a list of supported formats for archiving and unarchiving. Each element of the returned sequence is a tuple (name, description) cSsg|]\}}||dfqS)rr ).0riregistryr r r! z'get_archive_formats..)_ARCHIVE_FORMATSitemssortformatsr r r!rs rrcCsv|dur g}t|ts"td|t|ttfs8td|D]&}t|ttfrZt|dkr|dur$|d|tj|}|s>t||durLtj}||d} z t|} Wntyt d|Yn0| d} | dD]\} }|| | <q|dkr|| d<|| d <z<| ||fi| }W|dur|dur|d | t| n,|dur$|dur|d | 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", "bztar" or "gztar". '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')rrzunknown archive format '%s'rrrrrzchanging back to '%s') r/getcwddebugr0rchdircurdirrrr)rrroot_dirrrrrrrsave_cwdkwargs format_infofuncargvalfilenamer r r!r#s>            rcCsddtD}||S)zReturns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description) cSs"g|]\}}||d|dfqS)rr )rrirr r r!r`rz&get_unpack_formats..)_UNPACK_FORMATSrrrr r r!rZs rc Csli}tD]\}}|dD] }|||<qq |D]$}||vr0d}t||||fq0t|tshtddS)z+Checks what gets registered as an unpacker.rz!%s is already registered for "%s"z*The registered function must be a callableN)rrr%rcrr) extensionsrrexisting_extensionsrirext extensionmsgr r r!_check_unpack_optionses    rcCs,|dur g}t|||||||ft|<dS)aMRegisters an unpack format. `name` is the name of the format. `extensions` is a list of extensions corresponding to the format. `function` is the callable that will be used to unpack archives. The callable will receive archives to unpack. If it's unable to handle an archive, it needs to raise a ReadError exception. If provided, `extra_args` is a sequence of (name, value) tuples that will be passed as arguments to the callable. description can be provided to describe the format, and will be returned by the get_unpack_formats() function. N)rr)rirrrrr r r!rws rcCs t|=dS)z*Removes the pack format from the registry.N)rrr r r!rsrcCs&tj|}tj|s"t|dS)z1Ensure that the parent directory of `path` existsN)r/r0rrJrY)r0rr r r!_ensure_directorys  rc Csz ddl}Wnty&tdYn0||s>td|||}z|D]}|j}|dsRd|vrpqRtj j |g| dR}|sqRt || dsR||j}t|d}z||W|~qR|~0qRW|n |0dS)z+Unpack zip `filename` to `extract_dir` rNz/zlib not supported, cannot unpack this archive.z%s is not a zip file/z..r8)rrr$ is_zipfilerinfolistrrr/r0rKsplitrrr'r<r(r) r extract_dirrrrritargetdatafr r r!_unpack_zipfiles4          rcCsVzt|}Wn tjy.td|Yn0z||W|n |0dS)z:Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` z/%s is not a compressed or uncompressed tar fileN)rr<TarErrorr$ extractallr)rrtarobjr r r!_unpack_tarfiles  rz.tar.gzz.tgzrr)rrrrcCs:tD],\}}|dD]}||r|SqqdS)Nr)rrr)rrirrr r r!_find_unpack_formats   rcCs|durt}|durjz t|}Wn tyDtd|Yn0|d}|||fit|dnLt|}|durtd|t|d}tt|d}|||fi|dS)aUnpack an archive. `filename` is the name of the archive. `extract_dir` is the name of the target directory, where the archive is unpacked. If not provided, the current working directory is used. `format` is the archive format: one of "zip", "tar", or "gztar". Or any other registered format. If not provided, unpack_archive will use the filename extension and see if an unpacker was registered for that extension. In case none is found, a ValueError is raised. NzUnknown unpack format '{0}'rrzUnknown archive format '{0}') r/rrrrrdictrr$)rrrrrrr r r!rs   r)r&)FN)rrrNNN)FF)rrN)Nr)NNrrNNN)Nr)NN)?r#r/rpr9os.pathrrOcollections.abcrr collectionsrHrrrrpwdrgrpr__all__r_rrrr$ Exceptionr%rb NameErrorrr6r r r r r rrrr{rr}rrrrrrrrrrrrrrrrrrrrr r r r!s                R 1(    >  0     7  %  PK!^vv)_backport/__pycache__/misc.cpython-39.pycnu[a Re@sdZddlZddlZgdZzddlmZWneyHd ddZYn0zeZWn&eyxddl m Z d d ZYn0z ej Z Wne yd d Z Yn0dS)z/Backports for individual classes and functions.N)cache_from_sourcecallablefsencode)rTcCs|rdp d}||S)Nco)Zpy_filedebugextrr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/misc.pyrs r)CallablecCs t|tS)N) isinstancer )objrrr rsrcCs<t|tr|St|tr&|tStdt|jdS)Nzexpect bytes or str, not %s) r bytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenamerrr r"s  r)T) __doc__osr__all__impr ImportErrorr NameError collectionsr rAttributeErrorrrrr s      PK!sbm>>._backport/__pycache__/sysconfig.cpython-39.pycnu[a Reh@sdZddlZddlZddlZddlZddlmZmZz ddlZWne yZddl ZYn0gdZ ddZ ej reje ej Zn e eZejdkrded dvre ejeeZejdkrd ed dvre ejeeeZejdkr*d ed dvr*e ejeeeZddZeZdaddZeZedZddZdejddZdejddZ dejddZ!ej"ej#Z$ej"ej%Z&da'dZ(ddZ)ddZ*dd Z+d!d"Z,d#d$Z-d%d&Z.dId'd(Z/d)d*Z0d+d,Z1d-d.Z2dJd/d0Z3d1d2Z4d3d4Z5d5d6Z6e-dd7fd8d9Z7e-dd7fd:d;Z8dd?Z:d@dAZ;dBdCZe?dHkre>dS)Kz-Access to Python's configuration information.N)pardirrealpath) get_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hcCs&z t|WSty |YS0dSN)rOSError)pathr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpath"s  rntZpcbuildiz\pc\viz\pcbuild\amd64icCs,dD]"}tjtjtd|rdSqdS)N)z Setup.distz Setup.localModulesTF)osrisfilejoin _PROJECT_BASE)fnrrris_python_build:srFcCstsddlm}tddd}||}|d}|s>Jd|}t|Wdn1sf0Yt rdD] }t |d d t |d d qxd adS)N)finder.rz sysconfig.cfgzsysconfig.cfg exists) posix_prefix posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T) _cfg_read resourcesr__name__rsplitfind as_stream_SCHEMESreadfp _PYTHON_BUILDset)rZbackport_package_finderZ_cfgfilesschemerrr_ensure_cfg_readDs    (r2z \{([^{]*?)\}c st|dr|d}nt}|}|D]8}|dkr._replacer) r2 has_sectionitemstuplesections has_optionr.remove_sectiondict _VAR_REPLsub)configr3r?sectionoptionvaluer;rr9r_expand_globalsYs$       rIz%s.%s.%sz%s.%srz%s%scsfdd}t||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. cs8|d}|vr|S|tjvr.tj|S|dSr4)r6renvironr7 local_varsrrr;s    z_subst_vars.._replacerrCrD)rrMr;rrLr _subst_varss rOcCs0|}|D]\}}||vr"q|||<qdSr)keysr=) target_dict other_dict target_keyskeyrHrrr _extend_dicts rUcCs`i}|duri}t|tt|D]4\}}tjdvrDtj|}tjt ||||<q&|S)N)posixr) rUrr+r=rr8r expandusernormpathrO)r1varsresrTrHrrr _expand_varss   r[csfdd}t||S)Ncs$|d}|vr|S|dSr4r5r7rYrrr;s zformat_value.._replacerrN)rHrYr;rr\r format_values r]cCstjdkrdStjS)NrVr!)rr8rrrr_get_default_schemes r^cCstjdd}dd}tjdkrBtjdp.d}|r8|S||dStjdkr|td }|r||r`|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjtjj|Sr)rrrWr)argsrrrjoinusersz_getuserbase..joinuserrAPPDATA~PythondarwinPYTHONFRAMEWORKLibraryz%d.%drz.local)rrKgetr8sysplatformr version_info)env_baserabaseZ frameworkrrr _getuserbases$     rnc Cstd}td}td}|dur*i}i}i}tj|ddd}|}Wdn1s`0Y|D]} | dsn| d krqn|| } | rn| d d \} } | } | d d } d | vr| || <qnz t | } Wn"t y| d d || <Yqn0| || <qnt | }d}t|dkrt|D]}||}||pP||} | dur| d } d}| |vrt|| }n| |vrd}nx| tjvrtj| }n`| |vr|dr|dd|vrd }n$d| |vrd}nt|d| }n d || <}|r|| d}|d| ||}d |vrL|||<n|z t |}Wn t yx|||<Yn 0|||<|||dr|dd|vr|dd}||vr|||<n|||<||q.q|D]"\}} t| tr| ||<q|||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. z"([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_]*)}Nzutf-8surrogateescape)encodingerrors#r rz$$$)CFLAGSLDFLAGSCPPFLAGSrTFPY_rJ)recompilecodecsopen readlines startswithstripmatchr6replaceint ValueErrorlistrPlenr>searchstrrrKendstartremover= isinstanceupdate)filenamerY _variable_rx _findvar1_rx _findvar2_rxdonenotdoneflineslinemnvtmpvr:renamed_variablesr8rHfounditemafterkrrr_parse_makefiles   &                          rcCsDtrtjtdSttdr,dttjf}nd}tjt d|dS)z Return the path of the Makefile.Makefileabiflagsz config-%s%srEstdlib) r-rrrrhasattrri_PY_VERSION_SHORTrr)config_dir_namerrrrKs  rc Cst}zt||WnLty`}z4d|}t|drD|d|j}t|WYd}~n d}~00t}z6t|}t||Wdn1s0YWnLty}z4d|}t|dr|d|j}t|WYd}~n d}~00tr|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N BLDSHAREDLDSHARED) rrIOErrorrrrr|rr-)rYmakefileemsgconfig_hrrrr _init_posixVs&  , rcCsVtd|d<td|d<td|d<d|d<d |d <t|d <tjttj|d <d S)z+Initialize the module as appropriate for NTrLIBDEST platstdlib BINLIBDESTr# INCLUDEPYz.pydSOz.exeEXEVERSIONBINDIRN)r_PY_VERSION_SHORT_NO_DOTrrdirnamerri executabler\rrr_init_non_posixrs   rcCs|dur i}td}td}|}|s.q||}|rv|dd\}}z t|}WntyjYn0|||<q ||}|r d||d<q |S)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_]+) [*]/ r rr)ryrzreadlinerr6rr)fprY define_rxundef_rxrrrrrrrrs&       rcCs:tr$tjdkrtjtd}q,t}ntd}tj|dS)zReturn the path of pyconfig.h.rPCr$z pyconfig.h)r-rr8rrrr)inc_dirrrrrs  rcCstttS)z,Return a tuple containing the schemes names.)r>sortedr+r?rrrrr sr cCs tdS)z*Return a tuple containing the paths names.r!)r+optionsrrrrr sr TcCs&t|rt||Stt|SdS)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. N)r2r[rBr+r=)r1rYexpandrrrr s r cCst||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r8r1rYrrrrrsrcGstdurviattd<ttd<ttd<ttd<tdtdtd<ttd <ttd <ttd <ztjtd <Wntyd td <Yn0t j dvrt tt j dkrt ttj dkrttd<dtvrttd<nttdtd<trXt j dkrXt}z t }Wntyd}Yn0t jtdsX||krXt j|td}t j|td<tjdkrvt d}t|dd}|dkrdD]2}t|}tdd|}tdd|}|t|<qndt jvrt jd}dD]0}t|}tdd|}|d|}|t|<qtdd } td| } | durv| d} t j!| svdD]$}t|}tdd|}|t|<qP|rg} |D]} | "t| q| StSdS)ayWith no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS 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. Nprefix exec_prefix py_versionpy_version_shortrrpy_version_nodotrmplatbase projectbaserrs)rZos2rVz2.6userbasesrcdirrer)rv BASECFLAGSru PY_CFLAGSrz -arch\s+\w+\s z-isysroot [^ ]*Z ARCHFLAGSruz-isysroot\s+(\S+)r z-isysroot\s+\S+(\s|$))# _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrrrirAttributeErrorrr8rrversionrnrr-getcwdrrisabsrrXrjunamersplitryrDrKrhrr6existsappend)r`rmcwdrZkernel_version major_versionrTflagsarchrurZsdkvalsr8rrrrs                    rcCs t|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rrh)r8rrrrPsrcCsdtjdkrnd}tj|}|dkr(tjStjd|}tj|t||}|dkr\dS|dkrhdStjStjd ksttd stjSt \}}}}}| d d }| d d}| d d}|dddkrd||fS|dddkr&|ddkrVd}dt |dd|ddf}n0|dddkrDd||fS|dddkrdd|||fS|ddd krd }t d!} | |} | rV| }n|ddd"krVt} | d#} | } z td$}WntyYnR0zt d%|} W|n |0| dur8d&| d'd&dd} | sB| } | rV| }d(}| d&d)krd*td+d vrd,}td+}t d-|}ttt|}t|d'kr|d}n^|d.krd,}nN|d/krd0}n>|d1krd2}n.|d3krd4}n|d5kr d6}ntd7|fn<|d8kr6tjd9krVd:}n |d;vrVtjd9krRd<}nd=}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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit ()amd64z win-amd64Zitaniumzwin-ia64rVr/rsr_-Nlinuxz%s-%ssunosr5solarisz%d.%srJrZirixaixz%s-%s.%scygwinz[\d.]+reMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)rr macosxz10.4.z-archrufatz -arch\s+(\S+))i386ppc)rx86_64intel)rrrZfat3)ppc64rfat64)rrrr universalz%Don't know machine value for archs=%rrlr)PowerPCPower_Macintoshrrz%s-%s-%s) rr8rirr)rjrlowerrrrrryrzrr6rrhr|rrreadcloserrrfindallr>rr.rmaxsize)rijZlookosnamehostreleasermachinerel_rerZcfgvarsZmacverZ macreleasercflagsZarchsrrrr Ys     $                   r cCstSr)rrrrrr sr cCsFtt|D]0\}\}}|dkr0td|td||fqdS)Nrz%s: z %s = "%s") enumeraterr=print)titledataindexrTrHrrr _print_dicts rcCsRtdttdttdtttdtttdtdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"Paths VariablesN)r r r r^rr rrrrr_mains r__main__)N)N)@__doc__r{rryrios.pathrr configparser ImportError ConfigParser__all__rrrrrrr8rrrr-r%r2RawConfigParserr+rzrCrIrkrrrrXrrrrr _USER_BASErOrUr[r]r^rnrrrrrrr r r rrrr r rrr'rrrrsx   " !   v     # PK!mR  -_backport/__pycache__/__init__.cpython-39.pycnu[a Re@sdZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__rr/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/__init__.pyPK! N22,_backport/__pycache__/tarfile.cpython-39.pycnu[a Rei @sFddlmZdZdZdZdZdZdZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZzddlZddlZWneydZZYn0eefZzeef7ZWneyYn0gd Zejdd krddlZnddlZejZd Zd Zed Z dZ!dZ"dZ#dZ$dZ%dZ&d Z'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5d Z6d!Z7e6Z8e&e'e(e)e,e-e.e*e+e/e0e1f Z9e&e'e.e1fZ:e/e0e1fZ;d"Ze?e?e?e@e@e@d$ZAd%ZBd&ZCd'ZDd(ZEd)ZFd*ZGd+ZHd,ZId ZJd-ZKd.ZLd/ZMd0ZNd1ZOd2ZPd3ZQd!ZRd ZSe jTd4vrd5ZUneVZUd6d7ZWd8d9ZXd:d;ZYd2e8fdd?Z[d{d@dAZ\eBdBfeCdCfeDdDfeEdEfeFdFfeGdGffeKdHffeLdIffeMeHBdJfeHdKfeMdLffeNdHffeOdIffePeIBdJfeIdKfePdLffeQdHffeRdIffeSeJBdMfeJdNfeSdLfff Z]dOdPZ^GdQdRdRe_Z`GdSdTdTe`ZaGdUdVdVe`ZbGdWdXdXe`ZcGdYdZdZe`ZdGd[d\d\e`ZeGd]d^d^eeZfGd_d`d`eeZgGdadbdbeeZhGdcddddeeZiGdedfdfeeZjGdgdhdhekZlGdidjdjekZmGdkdldlekZnGdmdndnekZoGdodpdpekZpGdqdrdrekZqGdsdtdtekZrGdudvdvekZsGdwdxdxekZtdydzZueZvesjZdS)|)print_functionz $Revision$z0.9.0u"Lars Gustäbel (lars@gustaebel.de)z5$Date: 2011-02-25 17:42:01 +0200 (Fri, 25 Feb 2011) $z?$Id: tarfile.py 88586 2011-02-25 15:42:01Z marc-andre.lemburg $u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.N)TarFileTarInfo is_tarfileTarErrorsustar sustar00d01234567LKSxgX)pathlinkpathsizemtimeuidgidunamegname)rrr#r$)atimectimer r!r"riii`@i ii@ )ntZcezutf-8cCs(|||}|d||t|tS)z8Convert a string to a null-terminated bytes object. N)encodelenNUL)slengthencodingerrorsr8/builddir/build/BUILDROOT/alt-python39-pip-21.3.1-2.el8.x86_64/opt/alt/python39/lib/python3.9/site-packages/pip/_vendor/distlib/_backport/tarfile.pystns r:cCs*|d}|dkr|d|}|||S)z8Convert a null-terminated bytes object to a string. rN)finddecode)r4r6r7pr8r8r9ntss  r?cCs|dtdkrHztt|ddp"dd}Wq~tyDtdYq~0n6d}tt|dD] }|dK}|t||d7}q\|S) z/Convert a number field to a python number. rr*asciistrict0r.zinvalid headerr)chrintr? ValueErrorInvalidHeaderErrorranger2ord)r4nir8r8r9ntis rKcCsd|krd|dkrrwr4SxtTcCsJg}tD]6}|D]"\}}||@|kr||qq|dqd|S)zcConvert a file's mode to a string of the form -rwxrwxrwx. Used by TarFile.list() rj)filemode_tableappendjoin)modepermtablebitcharr8r8r9filemode8s    r|c@seZdZdZdS)rzBase exception.N__name__ __module__ __qualname____doc__r8r8r8r9rGsrc@seZdZdZdS) ExtractErrorz%General exception for extract errors.Nr}r8r8r8r9rJsrc@seZdZdZdS) ReadErrorz&Exception for unreadable tar archives.Nr}r8r8r8r9rMsrc@seZdZdZdS)CompressionErrorz.Exception for unavailable compression methods.Nr}r8r8r8r9rPsrc@seZdZdZdS) StreamErrorz=Exception for unsupported operations on stream-like TarFiles.Nr}r8r8r8r9rSsrc@seZdZdZdS) HeaderErrorz!Base exception for header errors.Nr}r8r8r8r9rVsrc@seZdZdZdS)EmptyHeaderErrorzException for empty headers.Nr}r8r8r8r9rYsrc@seZdZdZdS)TruncatedHeaderErrorz Exception for truncated headers.Nr}r8r8r8r9r\src@seZdZdZdS)EOFHeaderErrorz"Exception for end of file headers.Nr}r8r8r8r9r_src@seZdZdZdS)rFzException for invalid headers.Nr}r8r8r8r9rFbsrFc@seZdZdZdS)SubsequentHeaderErrorz3Exception for missing and invalid extended headers.Nr}r8r8r8r9resrc@s0eZdZdZddZddZddZdd Zd S) _LowLevelFilezLow-level file object. Supports reading and writing. It is used instead of a regular file object for streaming access. cCsFtjtjtjBtjBd|}ttdr2|tjO}t||d|_dS)N)rmrnO_BINARYi) osO_RDONLYO_WRONLYO_CREATO_TRUNChasattrropenfd)selfnamerwr8r8r9__init__rs  z_LowLevelFile.__init__cCst|jdSN)rcloserrr8r8r9r{sz_LowLevelFile.closecCst|j|Sr)rr_rrrr8r8r9r_~sz_LowLevelFile.readcCst|j|dSr)rr`rrr4r8r8r9r`sz_LowLevelFile.writeN)r~rrrrrr_r`r8r8r8r9rls  rc@steZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ dddZ dddZ ddZddZdS)_StreamaClass that serves as an adapter between TarFile and a stream-like object. The stream-like object only needs to have a read() or write() method and is accessed blockwise. Use of gzip or bzip2 compression is possible. A stream-like object could be for example: sys.stdin, sys.stdout, a socket, a tape device etc. _Stream is intended to be used only internally. cCsNd|_|durt||}d|_|dkr6t|}|}|pZ(d?d@Z)dAdBZ*dCdDZ+dEdFZ,dGdHZ-dIdJZ.dKdLZ/dMdNZ0dOdPZ1dQdRZ2dSdTZ3dUS)WraInformational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally. )rrwr!r"rr chksumtypelinknamer#r$devmajordevminorrr pax_headersrr_sparse_structs _link_targetrscCsj||_d|_d|_d|_d|_d|_d|_t|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_i|_dS)zXConstruct a TarInfo object. name is the optional name of the member. irrsN)rrwr!r"rr rREGTYPErrr#r$rrrrrrrrr8r8r9rs"zTarInfo.__init__cCs|jSrrrr8r8r9_getpathszTarInfo._getpathcCs ||_dSrr r r8r8r9_setpathszTarInfo._setpathcCs|jSrrrr8r8r9 _getlinkpathszTarInfo._getlinkpathcCs ||_dSrr)rrr8r8r9 _setlinkpathszTarInfo._setlinkpathcCsd|jj|jt|fS)Nz<%s %r at %#x>) __class__r~ridrr8r8r9__repr__szTarInfo.__repr__cCsl|j|jd@|j|j|j|j|j|j|j|j |j |j |j d }|dt krh|ddsh|dd7<|S)z9Return the TarInfo's attributes as a dictionary. ) rrwr!r"rr rrrr#r$rrrr/)rrwr!r"rr rrrr#r$rrDIRTYPEr)rinfor8r8r9get_infos"zTarInfo.get_infosurrogateescapecCsT|}|tkr||||S|tkr4||||S|tkrH|||StddS)zq*z||dd Wn"tyt||||<Yq*Yn0t|||kr*||||<q*d D]`\}}||vrd ||<q||}d |krd |d krnn t|t rt |||<d ||<q|r| |t |} nd} | | |tddS)zReturn the object as a ustar header block. If it cannot be represented this way, prepend a pax extended header sequence with supplement information. r!rrrr)r#r#r,)r$r$r,r@rA))r!r.)r"r.)r )r r,rr.rrr)r#rcopyr%r$r1UnicodeEncodeErrorr2 isinstancefloatstr_create_pax_generic_headerXHDTYPEr'r) rrr6rrhnamer5rUvalr[r8r8r9rs4     *  zTarInfo.create_pax_headercCs||tdS)zAReturn the object as a pax global header block sequence. utf8)r2XGLTYPE)clsrr8r8r9create_pax_global_headerDsz TarInfo.create_pax_global_headercCsj|dtd}|r.|ddkr.|dd}q|t|d}|dd}|rZt|tkrbtd||fS)zUSplit a name longer than 100 chars into a prefix and a name part. Nrr;rzname is too long) LENGTH_PREFIXr2r%rE)rrr"r8r8r9r&Js zTarInfo._posix_split_namecCsVt|ddd||t|ddd@d|t|ddd|t|d dd|t|d dd |t|d dd |d |dtt|ddd|||dtt|ddd||t|ddd||t|ddd|t|ddd|t|ddd||g}tdtd|}t |t dd}|ddd| d|dd}|S)zReturn a header block. info is a dictionary with file information, format must be one of the *_FORMAT constants. rrsr rwrrr.r!r"rr,r s rrr!r#r,r$rrr"r z%dsrNiz%06or@i) r:getrWr r#rPrRrrvr^r1)rrVr6r7partsr[rr8r8r9r'Ys(  &zTarInfo._create_headercCs.tt|t\}}|dkr*|t|t7}|S)zdReturn the string payload filled with zero bytes up to the next 512 byte border. r)rar2rr3)payloadrfrgr8r8r9_create_payloaduszTarInfo._create_payloadcCsR|||t}i}d|d<||d<t||d<t|d<||t||||S)zTReturn a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence for name. z ././@LongLinkrrrr!)r1r3r2r(r'rr>)r8rrr6r7rr8r8r9r)s zTarInfo._create_gnu_long_headerc Cs0d}|D]6\}}z|ddWq ty@d}YqDYq 0q d}|rT|d7}|D]\}}|d}|r||d}n |d}t|t|d}d } } |tt| } | | krq| } q|tt| d d |d |d 7}q\i} d| d<|| d<t|| d<t| d<|| td d| |S)zReturn a POSIX.1-2008 extended or global header sequence that contains a list of keyword, value pairs. The values must be strings. Fr6rATrs21 hdrcharset=BINARY rrrr@ =rz././@PaxHeaderrrrr!r) itemsr1r.r2r1bytesr#r'rr>) r8rrr6binarykeywordvaluerecordsrMrIr>rr8r8r9r2s<   ( z"TarInfo._create_pax_generic_headerc Cstt|dkrtdt|tkr(td|ttkr>tdt|dd}|t|vrbt d|}t |dd|||_ t|dd |_ t|d d |_ t|d d |_t|d d |_t|d d|_||_|dd |_t |d d|||_t |dd|||_t |dd|||_t|dd|_t|dd|_t |dd||}|jtkr|j drt|_|jtkr6d}g}tdD]j} z0t|||d} t||d|d} WntyYqYn0|| | f|d7}qt|d} t|dd} || | f|_ |!rN|j "d|_ |rp|jt#vrp|d|j |_ |S)zAConstruct a TarInfo object from a 512 byte bytes object. rz empty headerztruncated headerzend of file headerrXrYz bad checksumr lt|ii i)iIiQiYirir/r,iii)$r2rrrcountr3rrKr^rFr?rrwr!r"rr rrrr#r$rrAREGTYPErrGNUTYPE_SPARSErGrEruboolrisdirrstrip GNU_TYPES)r8r[r6r7robjr"rstructsrJrnumbytes isextendedorigsizer8r8r9frombufsZ         zTarInfo.frombufcCs8|jt}|||j|j}|jt|_||S)zOReturn the next TarInfo object from TarFile object tarfile. ) rr_rrYr6r7rr _proc_member)r8rr[rTr8r8r9 fromtarfiles zTarInfo.fromtarfilecCsT|jttfvr||S|jtkr,||S|jtttfvrF| |S| |SdS)zYChoose the right processing method depending on the type and call it. N) rr+r* _proc_gnulongrO _proc_sparser3r7SOLARIS_XHDTYPE _proc_pax _proc_builtinrrr8r8r9rZs    zTarInfo._proc_membercCsR|j|_|j}|s$|jtvr4|||j7}||_| |j |j |j |S)zfProcess a builtin type or an unknown type which will be treated as a regular file. ) rrrisregrSUPPORTED_TYPES_blockrr_apply_pax_inforr6r7)rrrr8r8r9r`$s zTarInfo._proc_builtincCs|j||j}z||}Wnty<tdYn0|j|_|jt krdt ||j |j |_ n|jtkrt ||j |j |_|S)zSProcess the blocks that hold a GNU longname or longlink member. missing or bad subsequent header)rr_rdrr[rrrrr+r?r6r7rr*r)rrr[nextr8r8r9r\5s   zTarInfo._proc_gnulongc Cs|j\}}}|`|r|jt}d}tdD]l}z0t|||d}t||d|d} WntyxYqYn0|r| r||| f|d7}q,t|d}q||_ |j |_ |j | |j |_||_ |S)z8Process a GNU sparse header plus extra headers. rr,rLi)rrr_rrGrKrErurPrrrrdrr) rrrUrWrXr[rrJrrVr8r8r9r]Ks(       zTarInfo._proc_sparsecCs|j||j}|jtkr&|j}n |j}t d|}|durX| d d|d<| d}|dkrr|j }nd}td}d}|||}|sq&|\} } t| } ||d d|d| d} || dd|j} | tvr|| ||j |j} n|| dd|j} | || <|| 7}qz||} WntyPtd Yn0d |vrj|| |nHd |vr|| ||n.| d dkr| ddkr|| |||jttfvr| ||j |j|j | _ d|vr| j!} | "s| jt#vr| | | j7} | |_ | S)zVProcess an extended or global header as described in POSIX.1-2008. s\d+ hdrcharset=([^\n]+)\nNrr6 hdrcharsetBINARYs(\d+) ([^=]+)=rrrfGNU.sparse.mapGNU.sparse.sizezGNU.sparse.major1zGNU.sparse.minorrBr)$rr_rdrrr7rr-researchgroupr=r;r6compilematchgroupsrDendr_decode_pax_fieldr7PAX_NAME_FIELDSr[rr_proc_gnusparse_01_proc_gnusparse_00_proc_gnusparse_10r3r^rerrrbrc)rrr[rrrrir6regexrr5rDrErgrr8r8r9r_gsd       $         zTarInfo._proc_paxcCshg}td|D]}|t|dqg}td|D]}|t|dq:tt|||_dS)z?Process a GNU tar extended sparse header, version 0.0. s\d+ GNU.sparse.offset=(\d+)\nrs\d+ GNU.sparse.numbytes=(\d+)\nN)rnfinditerrurDrplistzipr)rrgrr[offsetsrrrVr8r8r9rxszTarInfo._proc_gnusparse_00cCs@dd|ddD}tt|ddd|ddd|_dS)z?Process a GNU tar extended sparse header, version 0.1. cSsg|] }t|qSr8)rD).0rpr8r8r9 rz.TarInfo._proc_gnusparse_01..rk,Nrr)splitr|r}r)rrgrrr8r8r9rwszTarInfo._proc_gnusparse_01cCsd}g}|jt}|dd\}}t|}t||dkrtd|vrT||jt7}|dd\}}|t|q,|j|_t t |ddd|ddd|_ dS)z?Process a GNU tar extended sparse header, version 1.0. Nrrr) rr_rrrDr2rurrr|r}r)rrgrrfieldsrr[numberr8r8r9rys  zTarInfo._proc_gnusparse_10c Cs|D]\}}|dkr&t|d|q|dkr@t|dt|q|dkrZt|dt|q|tvr|tvrzt||}Wntyd}Yn0|dkr|d}t|||q||_dS) zoReplace fields with supplemental information from a previous pax extended or global header. zGNU.sparse.namerrlrzGNU.sparse.realsizerrN) rAsetattrrD PAX_FIELDSPAX_NUMBER_FIELDSrErRr-r)rrr6r7rDrEr8r8r9res"   zTarInfo._apply_pax_infocCs2z||dWSty,|||YS0dS)z1Decode a single field from a pax record. rAN)r=UnicodeDecodeError)rrEr6fallback_encodingfallback_errorsr8r8r9rus zTarInfo._decode_pax_fieldcCs"t|t\}}|r|d7}|tS)z_Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024. r)rar)rrMrfrgr8r8r9rd szTarInfo._blockcCs |jtvSr)r REGULAR_TYPESrr8r8r9rbsz TarInfo.isregcCs|Sr)rbrr8r8r9isfileszTarInfo.isfilecCs |jtkSr)rrrr8r8r9rQsz TarInfo.isdircCs |jtkSr)rSYMTYPErr8r8r9issymsz TarInfo.issymcCs |jtkSr)rLNKTYPErr8r8r9islnksz TarInfo.islnkcCs |jtkSr)rCHRTYPErr8r8r9ischr sz TarInfo.ischrcCs |jtkSr)rBLKTYPErr8r8r9isblk"sz TarInfo.isblkcCs |jtkSr)rFIFOTYPErr8r8r9isfifo$szTarInfo.isfifocCs |jduSr)rrr8r8r9issparse&szTarInfo.issparsecCs|jtttfvSr)rrrrrr8r8r9isdev(sz TarInfo.isdevN)rs)4r~rrr __slots__rr rpropertyrrrrrrDEFAULT_FORMATENCODINGr rrr classmethodr9r& staticmethodr'r>r)r2rYr[rZr`r\r]r_rxrwryrerurdrbrrQrrrrrrrr8r8r8r9rsf    1     2 >  f  rc @seZdZdZdZdZdZdZeZ e Z dZ e ZeZdVdd Zedddefd d ZedWd d ZedXddZedYddZddddZddZddZddZddZdZdd Zd[d"d#Zd\d$d%Zd]d&d'Z d^d)d*Z!d_d,d-Z"d.d/Z#d`d0d1Z$d2d3Z%d4d5Z&d6d7Z'd8d9Z(d:d;Z)dd?Z+d@dAZ,dBdCZ-dDdEZ.dadFdGZ/dHdIZ0dbdJdKZ1dLdMZ2dNdOZ3dPdQZ4dRdSZ5dTdUZ6dS)crz=The TarFile Class provides an interface to tar archives. rFrNrmrc  Cst|dks|dvrtd||_dddd||_|sn|jdkrZtj|sZd |_d|_t||j}d |_n0|d urt |d r|j }t |d r|j|_d|_|rtj |nd |_ ||_ |d ur||_ |d ur||_|d ur||_|d ur||_|d ur||_| |_| d ur&|j tkr&| |_ni|_| d ur<| |_| d urL| |_d |_g|_d |_|j |_i|_z|jdkrd |_||_|jdkr"|j |jz|j |}|j!|WnXt"y|j |jYq"Yn2t#y} zt$t%| WYd } ~ n d } ~ 00q|jdvrld|_|jrl|j&|j'}|j (||jt|7_Wn&|js|j )d|_Yn0d S)aOpen an (uncompressed) tar archive `name'. `mode' is either 'r' to read from an existing archive, 'a' to append data to an existing file or 'w' to create a new file overwriting an existing one. `mode' defaults to 'r'. If `fileobj' is given, it is used for reading or writing data. If it can be determined, `mode' is overridden by `fileobj's mode. `fileobj' is not closed, when TarFile is closed. rrmode must be 'r', 'a' or 'w'rbzr+bwb)rmarnrrnFNrrwTrmaw)*r2rErw_moderrexists bltn_openrrrabspathrrVr dereference ignore_zerosr6r7rrdebug errorlevelrmembers_loadedrrinodes firstmemberrgrr[rurrrr1r9r-r`r)rrrwrrVrrrr6r7rrrer[r8r8r9rFs            &   zTarFile.__init__c Ks|s|std|dvr|jD]}t||j|}|durB|}z||d|fi|WSttfy} z*|dur||WYd} ~ qWYd} ~ qd} ~ 00qtdnd|vr|dd\} }| pd} |pd}||jvrt||j|}n td |||| |fi|Sd |vr|d d\} }| p:d} |pDd}| d vrXtd t|| |||} z||| | fi|} Wn| Yn0d | _ | S|dvr|j |||fi|StddS)a|Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for reading exclusively uncompressed 'r:gz' open for reading with gzip compression 'r:bz2' open for reading with bzip2 compression 'a' or 'a:' open for appending, creating the file if necessary 'w' or 'w:' open for writing without compression 'w:gz' open for writing with gzip compression 'w:bz2' open for writing with bzip2 compression 'r|*' open a stream of tar blocks with transparent compression 'r|' open an uncompressed stream of tar blocks for reading 'r|gz' open a gzip compressed stream of tar blocks 'r|bz2' open a bzip2 compressed stream of tar blocks 'w|' open an uncompressed stream for writing 'w|gz' open a gzip compressed stream for writing 'w|bz2' open a bzip2 compressed stream for writing znothing to open)rmzr:*Nrmz%file could not be opened successfully:rrzunknown compression type %r|rwmode must be 'r' or 'w'Frzundiscernible mode) rE OPEN_METHrrrrrrrrrtaropen) r8rrwrrkwargsrfunc saved_posrr|streamrqr8r8r9rsN  $         z TarFile.opencKs0t|dks|dvrtd||||fi|S)zCOpen uncompressed tar archive name for reading or writing. rrr)r2rE)r8rrwrrr8r8r9rszTarFile.taropenrc Kst|dks|dvrtdzddl}|jWnttfyLtdYn0|du}z.|||d||}|j|||fi|}WnXty|s|dur| |durt dYn"|s|dur| Yn0||_ |S) zkOpen gzip compressed tar archive name for reading or writing. Appending is not allowed. rrrrNzgzip module is not availablerhr) r2rEgzipGzipFilerAttributeErrorrrrbrrr) r8rrwr compresslevelrrZ extfileobjrqr8r8r9gzopens.     zTarFile.gzopenc Kst|dks|dvrtdz ddl}WntyBtdYn0|durXt||}n|j|||d}z|j|||fi|}Wn&tt fy| t dYn0d |_ |S) zlOpen bzip2 compressed tar archive name for reading or writing. Appending is not allowed. rrzmode must be 'r' or 'w'.rNr)rznot a bzip2 fileF) r2rErrrrBZ2FilerrbEOFErrorrrr)r8rrwrrrrrqr8r8r9bz2open$s    zTarFile.bz2openrrr)rrrcCs|jr dS|jdvrf|jttd|jtd7_t|jt\}}|dkrf|jtt||j sv|j d|_dS)zlClose the TarFile. In write-mode, two finishing zero blocks are appended to the archive. NrrrT) rrwrr`r3rrra RECORDSIZErr)rrfrgr8r8r9rHs  z TarFile.closecCs"||}|durtd||S)aReturn a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version. Nzfilename %r not found) _getmemberKeyError)rrrr8r8r9 getmember\s  zTarFile.getmembercCs||js||jS)zReturn the members of the archive as a list of TarInfo objects. The list has the same order as the members in the archive. )_checkr_loadrrr8r8r9 getmembersgszTarFile.getmemberscCsdd|DS)zReturn the members of the archive as a list of their names. It has the same order as the list returned by getmembers(). cSsg|] }|jqSr8r )rrr8r8r9rurz$TarFile.getnames..)rrr8r8r9getnamesqszTarFile.getnamesc Csh|d|dur|j}|dur$|}tj|\}}|tjd}|d}|}||_ |durt tdr~|j s~t |}qt |}nt|}d}|j}t |r |j|jf} |j s|jdkr| |jvr||j| krt} |j| }nt} | drt||j| <nht |rt} nVt |r0t} nDt |rLt} t|}n(t |r^t } nt !|rpt"} ndS||_||_#|j$|_%|j&|_'| tkr|j(|_)nd|_)|j*|_+| |_,||_-t.rzt./|j%d|_0Wnt1yYn0t2r"zt23|j'd|_4Wnt1y Yn0| t t"fvrdt tdrdt td rdt5|j6|_7t8|j6|_9|S) aOCreate a TarInfo object for either the file `name' or the file object `fileobj' (using os.fstat on its file descriptor). You can modify some of the TarInfo's attributes before you add it using addfile(). If given, `arcname' specifies an alternative name for the file in the archive. rNrlstatrsrrmajorminor):rrrr splitdriverseplstriprrrrrstatfstatfilenost_modeS_ISREGst_inost_devst_nlinkrrr S_ISDIRrS_ISFIFOrS_ISLNKrreadlinkS_ISCHRrS_ISBLKrrwst_uidr!st_gidr"st_sizerst_mtimer rrpwdgetpwuidr#rgrpgetgrgidr$rst_rdevrrr) rrarcnamerdrvrstatresrstmdinoderr8r8r9 gettarinfows                  zTarFile.gettarinfoTcCs||D]}|rtt|jddtd|jp4|j|jp>|jfdd|sZ| rxtdd|j |j fddntd|j ddtdt |jdd ddt|j|rd nd dd|r|rtd |jdd|rtd |jddtq dS)zPrint a table of contents to sys.stdout. If `verbose' is False, only the names of the members are printed. If it is True, an `ls -l'-like output is produced.  )rtz%s/%sz%10sz%d,%dz%10dz%d-%02d-%02d %02d:%02d:%02dNrrrsz->zlink to)rprintr|rwr#r!r$r"rrrrrr localtimer rrQrrr)rverboserr8r8r9r|s8  z TarFile.listc Csn|d|dur|}|durPddl}|dtd||rP|dd|dS|jdurtj||jkr|dd|dS|d|| ||}|dur|dd |dS|dur||}|dur|dd|dS| r t |d }| ||| n`|r`| ||rjt|D].}|jtj||tj|||||d q.n | |dS) a~Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `recursive' to False. `exclude' is a function that should return True for each filename to be excluded. `filter' is a function that expects a TarInfo object argument and returns the changed TarInfo object, if it returns None the TarInfo object will be excluded from the archive. rNrzuse the filter argument insteadrztarfile: Excluded %rztarfile: Skipped %rrztarfile: Unsupported type %rr)filter)rwarningswarnDeprecationWarning_dbgrrrrrrbraddfilerrQlistdiraddrv) rrr recursiveexcluderrrfr8r8r9rsH          z TarFile.addcCs|dt|}||j|j|j}|j||jt |7_|durt ||j|j t |j t \}}|dkr|jtt ||d7}|j|t 7_|j|dS)a]Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. rNrr)rr-r rVr6r7rr`rr2rirrarr3rru)rrrr[rfrgr8r8r9r4s   zTarFile.addfile.c Csg}|dur|}|D]<}|r:||t|}d|_|j||| dq|jddd||D]}tj ||j }z(| ||| ||| ||Wqnty}z*|jdkrȂn|dd|WYd}~qnd}~00qndS) aMExtract all members from the archive to the current working directory and set owner, modification time and permissions on directories afterwards. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by getmembers(). N set_attrscSs|jSrr )rr8r8r9drz$TarFile.extractall..)keyr tarfile: %s)rQrur-rwextractsortreverserrrvrchownutimechmodrrr)rrr directoriesrdirpathrr8r8r9 extractallNs*     zTarFile.extractallrsc Cs|dt|tr ||}n|}|r>tj||j|_ z |j |tj||j |dWnt y}zP|j dkr|n6|jdur|dd|jn|dd|j|jfWYd}~nLd}~0ty}z*|j dkrn|dd|WYd}~n d}~00dS)axExtract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a TarInfo object. You can specify a different directory using `path'. File attributes (owner, mtime, mode) are set unless `set_attrs' is False. rmrrNrrztarfile: %s %r)rr/r1rrrrrvrr _extract_memberrEnvironmentErrorrfilenamerstrerrorr)rmemberrrrrr8r8r9rts(      , zTarFile.extractcCs|dt|tr ||}n|}|r8|||S|jtvrN|||S|s^| rt|j t rtt dq| ||SndSdS)aExtract a member from the archive as a file object. `member' may be a filename or a TarInfo object. If `member' is a regular file, a file-like object is returned. If `member' is a link, a file-like object is constructed from the link's target. If `member' is none of the above, None is returned. The file-like object is read-only and provides the following methods: read(), readline(), readlines(), seek() and tell() rmz'cannot extract (sym)link as file objectN)rr/r1rrb fileobjectrrcrrrrr extractfile_find_link_target)rrrr8r8r9rs        zTarFile.extractfilecCsR|d}|dtj}tj|}|r>tj|s>t||sN| rh| dd|j |j fn| d|j | r|||n|r|||nx|r|||nb|s|r|||nD|s| r|||n&|jtvr|||n ||||rN|||| sN||||||dS)z\Extract the TarInfo object tarinfo to a physical file called targetpath. rrz%s -> %sN)rRrrrrdirnamermakedirsrrrrrrbmakefilerQmakedirrmakefiforrmakedevmakelinkrrc makeunknownrr r)rr targetpathr upperdirsr8r8r9r s4        zTarFile._extract_memberc CsHzt|dWn2tyB}z|jtjkr.WYd}~n d}~00dS)z,Make a directory called targetpath. rN)rmkdirrerrnoEEXISTrrrrr8r8r9rs  zTarFile.makedircCs||j}||jt|d}|jdurN|jD]\}}||t|||q,nt|||j||j||dS)z'Make a file called targetpath. rN) rrrrrrirtruncater)rrrsourcetargetrrr8r8r9rs     zTarFile.makefilecCs"||||dd|jdS)zYMake a file from a TarInfo object with an unknown type at targetpath. rz9tarfile: Unknown file type %r, extracted as regular file.N)rrrrrrr8r8r9r s zTarFile.makeunknowncCs"ttdrt|ntddS)z'Make a fifo called targetpath. mkfifozfifo not supported by systemN)rrr'rr&r8r8r9r s  zTarFile.makefifocCs^ttdrttdstd|j}|r6|tjO}n |tjO}t||t |j |j dS)z| rttdrt |||ntjdkrt|||Wn,ty}ztdWYd}~n d}~00dS)z6Set owner of targetpath according to tarinfo. geteuidrrlchownZos2emxzcould not change ownerN)rrrr.rgetgrnamr$rr"getpwnamr#r!rr/sysplatformrrr)rrrgurr8r8r9rD s      z TarFile.chownc CsNttdrJzt||jWn,tyH}ztdWYd}~n d}~00dS)zASet file permissions of targetpath according to tarinfo. r zcould not change modeN)rrr rwrrr"r8r8r9r Z s  z TarFile.chmodc CsXttdsdSzt||j|jfWn,tyR}ztdWYd}~n d}~00dS)zBSet modification time of targetpath according to tarinfo. rNz"could not change modification time)rrrr rrr"r8r8r9rc s  z TarFile.utimec Cs|d|jdur$|j}d|_|S|j|jd}z|j|}Wqty}zD|jr| dd|j|f|jt 7_WYd}~q6WYd}~qd}~0t y}z\|jr| dd|j|f|jt 7_WYd}~q6n|jdkrt t |WYd}~nd}~0ty>|jdkr:t dYnntyz}z$|jdkrft t |WYd}~n:d}~0ty}zt t |WYd}~n d}~00qq6|dur|j|nd|_|S)zReturn the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. raNrz0x%X: %srz empty fileT)rrrrrrr[rrrrrFrr1rrrrrur)rmrrr8r8r9rgn sD  "      " z TarFile.nextcCsn|}|dur"|d||}|r2tj|}t|D].}|rRtj|j}n|j}||kr:|Sq:dS)z}Find an archive member by name from bottom to top. If tarinfo is given, it is used as the starting point. N)rindexrrnormpathreversedr)rrr normalizerr member_namer8r8r9r s  zTarFile._getmembercCs|}|durqqd|_dS)zWRead through the entire archive file and look for readable members. NT)rgrrrr8r8r9r sz TarFile._loadcCs:|jrtd|jj|dur6|j|vr6td|jdS)znCheck if TarFile is still open, and if the operation's mode corresponds to TarFile's mode. z %s is closedNzbad operation for mode %r)rrbrr~rw)rrwr8r8r9r szTarFile._checkcCsX|r&tj|jd|j}d}n |j}|}|j||dd}|durTtd||S)zZFind the target member of a symlink or hardlink member in the archive. rNT)rr;zlinkname %r not found)rrrrrrrr)rrrlimitrr8r8r9r s zTarFile._find_link_targetcCs|jrt|jSt|SdS)z$Provide an iterator object. N)riterrTarIterrr8r8r9r s zTarFile.__iter__cCs||jkrt|tjddS)z.Write debugging output to sys.stderr. )fileN)rrr2stderr)rlevelmsgr8r8r9r s z TarFile._dbgcCs ||Sr)rrr8r8r9 __enter__ szTarFile.__enter__cCs,|dur|n|js"|jd|_dSr)rrrr)rrrE tracebackr8r8r9__exit__ s   zTarFile.__exit__) NrmNNNNNNrNNN)rmN)rmNr)rmNr)NNN)T)NTNN)N)rN)rsT)T)NF)N)7r~rrrrrrrrrVrr6r7rrrrrrrrrrrrrrrrrr|rrr rrr rrrrrrrr rrgrrrrrrrErGr8r8r8r9r,sp kK       b  >  & #& 0   1  rc@s,eZdZdZddZddZddZeZdS) r@zMIterator Class. for tarinfo in TarFile(...): suite... cCs||_d|_dS)z$Construct a TarIter object. rN)rr8rar8r8r9r szTarIter.__init__cCs|S)z Return iterator object. r8rr8r8r9r szTarIter.__iter__cCs`|jjs$|j}|sNd|j_tn*z|jj|j}WntyLtYn0|jd7_|S)zReturn the next item using TarFile's next() method. When all members have been read, set TarFile as _loaded. Tr)rrrg StopIterationrr8 IndexErrorr=r8r8r9__next__ s   zTarIter.__next__N)r~rrrrrrJrgr8r8r8r9r@ s r@cCs0zt|}|WdSty*YdS0dS)zfReturn True if name points to a tar archive that we are able to handle, else return False. TFN)rrr)rrqr8r8r9r# s  r)N)w __future__r __version__version __author____date__Z __cvsid__ __credits__r2rrr rrPr-rnrrrrNotImplementedErrorr-Z WindowsError NameError__all__ version_info __builtin__builtinsr_openr3rrr(r#r%r$r:r rNrrrrrrCONTTYPEr+r*rOr3r7r^rrOrrrcrrSrsetrvr0rDrS_IFLNKS_IFREGr)S_IFDIRr*S_IFIFOZTSUIDZTSGIDZTSVTXZTUREADZTUWRITEZTUEXECZTGREADZTGWRITEZTGEXECZTOREADZTOWRITEZTOEXECrrgetfilesystemencodingr:r?rKrWr^rirtr| ExceptionrrrrrrrrrrFrobjectrrrrrrrrr@rrr8r8r8r9sN          i?KT* PK!yhh_backport/sysconfig.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Access to Python's configuration information.""" import codecs import os import re import sys from os.path import pardir, realpath try: import configparser except ImportError: import ConfigParser as configparser __all__ = [ 'get_config_h_filename', 'get_config_var', 'get_config_vars', 'get_makefile_filename', 'get_path', 'get_path_names', 'get_paths', 'get_platform', 'get_python_version', 'get_scheme_names', 'parse_config_h', ] def _safe_realpath(path): try: return realpath(path) except OSError: return path if sys.executable: _PROJECT_BASE = os.path.dirname(_safe_realpath(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 = _safe_realpath(os.getcwd()) if os.name == "nt" and "pcbuild" in _PROJECT_BASE[-8:].lower(): _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir)) # PC/VS7.1 if os.name == "nt" and "\\pc\\v" in _PROJECT_BASE[-10:].lower(): _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir)) # PC/AMD64 if os.name == "nt" and "\\pcbuild\\amd64" in _PROJECT_BASE[-14:].lower(): _PROJECT_BASE = _safe_realpath(os.path.join(_PROJECT_BASE, pardir, pardir)) def is_python_build(): for fn in ("Setup.dist", "Setup.local"): if os.path.isfile(os.path.join(_PROJECT_BASE, "Modules", fn)): return True return False _PYTHON_BUILD = is_python_build() _cfg_read = False def _ensure_cfg_read(): global _cfg_read if not _cfg_read: from ..resources import finder backport_package = __name__.rsplit('.', 1)[0] _finder = finder(backport_package) _cfgfile = _finder.find('sysconfig.cfg') assert _cfgfile, 'sysconfig.cfg exists' with _cfgfile.as_stream() as s: _SCHEMES.readfp(s) if _PYTHON_BUILD: for scheme in ('posix_prefix', 'posix_home'): _SCHEMES.set(scheme, 'include', '{srcdir}/Include') _SCHEMES.set(scheme, 'platinclude', '{projectbase}/.') _cfg_read = True _SCHEMES = configparser.RawConfigParser() _VAR_REPL = re.compile(r'\{([^{]*?)\}') def _expand_globals(config): _ensure_cfg_read() if config.has_section('globals'): globals = config.items('globals') else: globals = tuple() sections = config.sections() for section in sections: if section == 'globals': continue for option, value in globals: if config.has_option(section, option): continue config.set(section, option, value) config.remove_section('globals') # now expanding local variables defined in the cfg file # for section in config.sections(): variables = dict(config.items(section)) def _replacer(matchobj): name = matchobj.group(1) if name in variables: return variables[name] return matchobj.group(0) for option, value in config.items(section): config.set(section, option, _VAR_REPL.sub(_replacer, value)) #_expand_globals(_SCHEMES) _PY_VERSION = '%s.%s.%s' % sys.version_info[:3] _PY_VERSION_SHORT = '%s.%s' % sys.version_info[:2] _PY_VERSION_SHORT_NO_DOT = '%s%s' % sys.version_info[:2] _PREFIX = os.path.normpath(sys.prefix) _EXEC_PREFIX = os.path.normpath(sys.exec_prefix) _CONFIG_VARS = None _USER_BASE = None def _subst_vars(path, local_vars): """In the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. """ def _replacer(matchobj): name = matchobj.group(1) if name in local_vars: return local_vars[name] elif name in os.environ: return os.environ[name] return matchobj.group(0) return _VAR_REPL.sub(_replacer, path) def _extend_dict(target_dict, other_dict): target_keys = target_dict.keys() for key, value in other_dict.items(): if key in target_keys: continue target_dict[key] = value def _expand_vars(scheme, vars): res = {} if vars is None: vars = {} _extend_dict(vars, get_config_vars()) for key, value in _SCHEMES.items(scheme): if os.name in ('posix', 'nt'): value = os.path.expanduser(value) res[key] = os.path.normpath(_subst_vars(value, vars)) return res def format_value(value, vars): def _replacer(matchobj): name = matchobj.group(1) if name in vars: return vars[name] return matchobj.group(0) return _VAR_REPL.sub(_replacer, value) def _get_default_scheme(): if os.name == 'posix': # the default scheme for posix is posix_prefix return 'posix_prefix' return os.name def _getuserbase(): env_base = os.environ.get("PYTHONUSERBASE", None) def joinuser(*args): return os.path.expanduser(os.path.join(*args)) # what about 'os2emx', 'riscos' ? if os.name == "nt": base = os.environ.get("APPDATA") or "~" if env_base: return env_base else: return joinuser(base, "Python") if sys.platform == "darwin": framework = get_config_var("PYTHONFRAMEWORK") if framework: if env_base: return env_base else: return joinuser("~", "Library", framework, "%d.%d" % sys.version_info[:2]) if env_base: return env_base else: return joinuser("~", ".local") def _parse_makefile(filename, vars=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. """ # 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_]*)}") if vars is None: vars = {} done = {} notdone = {} with codecs.open(filename, encoding='utf-8', errors="surrogateescape") as f: lines = f.readlines() for line in lines: if line.startswith('#') or line.strip() == '': continue 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 # do variable interpolation here variables = list(notdone.keys()) # 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') while len(variables) > 0: for name in tuple(variables): value = notdone[name] m = _findvar1_rx.search(value) or _findvar2_rx.search(value) if m is not None: 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 variables.remove(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 (e.g. "prefix=$/opt/python"); # just drop it since we can't deal done[name] = value variables.remove(name) # strip spurious spaces for k, v in done.items(): if isinstance(v, str): done[k] = v.strip() # save the results in the global dictionary vars.update(done) return vars def get_makefile_filename(): """Return the path of the Makefile.""" if _PYTHON_BUILD: return os.path.join(_PROJECT_BASE, "Makefile") if hasattr(sys, 'abiflags'): config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags) else: config_dir_name = 'config' return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') def _init_posix(vars): """Initialize the module as appropriate for POSIX systems.""" # load the installed Makefile: makefile = get_makefile_filename() try: _parse_makefile(makefile, vars) except IOError as e: msg = "invalid Python installation: unable to open %s" % makefile if hasattr(e, "strerror"): msg = msg + " (%s)" % e.strerror raise IOError(msg) # load the installed pyconfig.h: config_h = get_config_h_filename() try: with open(config_h) as f: parse_config_h(f, vars) except IOError as e: msg = "invalid Python installation: unable to open %s" % config_h if hasattr(e, "strerror"): msg = msg + " (%s)" % e.strerror raise IOError(msg) # On AIX, there are wrong paths to the linker scripts in the Makefile # -- these paths are relative to the Python source, but when installed # the scripts are in another directory. if _PYTHON_BUILD: vars['LDSHARED'] = vars['BLDSHARED'] def _init_non_posix(vars): """Initialize the module as appropriate for NT""" # set basic install directories vars['LIBDEST'] = get_path('stdlib') vars['BINLIBDEST'] = get_path('platstdlib') vars['INCLUDEPY'] = get_path('include') vars['SO'] = '.pyd' vars['EXE'] = '.exe' vars['VERSION'] = _PY_VERSION_SHORT_NO_DOT vars['BINDIR'] = os.path.dirname(_safe_realpath(sys.executable)) # # public APIs # def parse_config_h(fp, vars=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 vars is None: vars = {} 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 vars[n] = v else: m = undef_rx.match(line) if m: vars[m.group(1)] = 0 return vars def get_config_h_filename(): """Return the path of pyconfig.h.""" if _PYTHON_BUILD: if os.name == "nt": inc_dir = os.path.join(_PROJECT_BASE, "PC") else: inc_dir = _PROJECT_BASE else: inc_dir = get_path('platinclude') return os.path.join(inc_dir, 'pyconfig.h') def get_scheme_names(): """Return a tuple containing the schemes names.""" return tuple(sorted(_SCHEMES.sections())) def get_path_names(): """Return a tuple containing the paths names.""" # xxx see if we want a static list return _SCHEMES.options('posix_prefix') def get_paths(scheme=_get_default_scheme(), vars=None, expand=True): """Return a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. """ _ensure_cfg_read() if expand: return _expand_vars(scheme, vars) else: return dict(_SCHEMES.items(scheme)) def get_path(name, scheme=_get_default_scheme(), vars=None, expand=True): """Return a path corresponding to the scheme. ``scheme`` is the install scheme name. """ return get_paths(scheme, vars, expand)[name] def get_config_vars(*args): """With no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS 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: _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 # distutils2 module. _CONFIG_VARS['prefix'] = _PREFIX _CONFIG_VARS['exec_prefix'] = _EXEC_PREFIX _CONFIG_VARS['py_version'] = _PY_VERSION _CONFIG_VARS['py_version_short'] = _PY_VERSION_SHORT _CONFIG_VARS['py_version_nodot'] = _PY_VERSION[0] + _PY_VERSION[2] _CONFIG_VARS['base'] = _PREFIX _CONFIG_VARS['platbase'] = _EXEC_PREFIX _CONFIG_VARS['projectbase'] = _PROJECT_BASE try: _CONFIG_VARS['abiflags'] = sys.abiflags except AttributeError: # sys.abiflags may not be defined on all platforms. _CONFIG_VARS['abiflags'] = '' if os.name in ('nt', 'os2'): _init_non_posix(_CONFIG_VARS) if os.name == 'posix': _init_posix(_CONFIG_VARS) # Setting 'userbase' is done below the call to the # init function to enable using 'get_config_var' in # the init-function. if sys.version >= '2.6': _CONFIG_VARS['userbase'] = _getuserbase() if 'srcdir' not in _CONFIG_VARS: _CONFIG_VARS['srcdir'] = _PROJECT_BASE else: _CONFIG_VARS['srcdir'] = _safe_realpath(_CONFIG_VARS['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 try: cwd = os.getcwd() except OSError: cwd = None if (not os.path.isabs(_CONFIG_VARS['srcdir']) and base != cwd): # 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) if sys.platform == 'darwin': kernel_version = os.uname()[2] # Kernel version (8.4.3) major_version = int(kernel_version.split('.')[0]) if major_version < 8: # On Mac OS X before 10.4, check if -arch and -isysroot # are in CFLAGS or LDFLAGS and remove them if they are. # This is needed when building extensions on a 10.3 system # using a universal build of python. for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub(r'-arch\s+\w+\s', ' ', flags) flags = re.sub('-isysroot [^ \t]*', ' ', flags) _CONFIG_VARS[key] = flags else: # Allow the user to override the architecture flags using # an environment variable. # NOTE: This name was introduced by Apple in OSX 10.5 and # is used by several scripting languages distributed with # that OS release. if 'ARCHFLAGS' in os.environ: arch = os.environ['ARCHFLAGS'] for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub(r'-arch\s+\w+\s', ' ', flags) flags = flags + ' ' + arch _CONFIG_VARS[key] = flags # If we're on OSX 10.5 or later and the user tries to # compiles an extension using an SDK that is not present # on the current machine it is better to not use an SDK # than to fail. # # The major usecase for this is users using a Python.org # binary installer on OSX 10.6: that installer uses # the 10.4u SDK, but that SDK is not installed by default # when you install Xcode. # CFLAGS = _CONFIG_VARS.get('CFLAGS', '') m = re.search(r'-isysroot\s+(\S+)', CFLAGS) if m is not None: sdk = m.group(1) if not os.path.exists(sdk): for key in ('LDFLAGS', 'BASECFLAGS', # a number of derived variables. These need to be # patched up as well. 'CFLAGS', 'PY_CFLAGS', 'BLDSHARED'): flags = _CONFIG_VARS[key] flags = re.sub(r'-isysroot\s+\S+(\s|$)', ' ', flags) _CONFIG_VARS[key] = flags 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) """ return get_config_vars().get(name) def get_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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. """ if os.name == 'nt': # sniff sys.version for architecture. prefix = " bit (" i = sys.version.find(prefix) if i == -1: return sys.platform j = sys.version.find(")", i) look = sys.version[i+len(prefix):j].lower() if look == 'amd64': return 'win-amd64' if look == 'itanium': return 'win-ia64' return sys.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 # (to accommodate BSD/OS), 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:]) # fall through to standard osname-release-machine representation elif osname[:4] == "irix": # could be "irix64"! return "%s-%s" % (osname, release) elif osname[:3] == "aix": return "%s-%s.%s" % (osname, version, release) elif osname[:6] == "cygwin": osname = "cygwin" rel_re = re.compile(r'[\d.]+') m = rel_re.match(release) if m: release = m.group() elif osname[:6] == "darwin": # # For our purposes, we'll assume that the system version from # distutils' perspective is what MACOSX_DEPLOYMENT_TARGET is set # to. This makes the compatibility story a bit more sane because the # machine is going to compile and link as if it were # MACOSX_DEPLOYMENT_TARGET. cfgvars = get_config_vars() macver = cfgvars.get('MACOSX_DEPLOYMENT_TARGET') if True: # Always calculate the release of the running machine, # needed to determine if we can build fat binaries or not. macrelease = macver # Get the system version. Reading this plist is a documented # way to get the system version (see the documentation for # the Gestalt Manager) try: f = open('/System/Library/CoreServices/SystemVersion.plist') except IOError: # We're on a plain darwin box, fall back to the default # behaviour. pass else: try: m = re.search(r'ProductUserVisibleVersion\s*' r'(.*?)', f.read()) finally: f.close() if m is not None: macrelease = '.'.join(m.group(1).split('.')[:2]) # else: fall back to the default behaviour if not macver: macver = macrelease if macver: release = macver osname = "macosx" if ((macrelease + '.') >= '10.4.' and '-arch' in get_config_vars().get('CFLAGS', '').strip()): # The universal build will build fat binaries, but not on # systems before 10.4 # # Try to detect 4-way universal builds, those have machine-type # 'universal' instead of 'fat'. machine = 'fat' cflags = get_config_vars().get('CFLAGS') archs = re.findall(r'-arch\s+(\S+)', cflags) archs = tuple(sorted(set(archs))) if len(archs) == 1: machine = archs[0] elif archs == ('i386', 'ppc'): machine = 'fat' elif archs == ('i386', 'x86_64'): machine = 'intel' elif archs == ('i386', 'ppc', 'x86_64'): machine = 'fat3' elif archs == ('ppc64', 'x86_64'): machine = 'fat64' elif archs == ('i386', 'ppc', 'ppc64', 'x86_64'): machine = 'universal' else: raise ValueError( "Don't know machine value for archs=%r" % (archs,)) elif machine == 'i386': # On OSX the machine type returned by uname is always the # 32-bit variant, even if the executable architecture is # the 64-bit variant if sys.maxsize >= 2**32: machine = 'x86_64' elif machine in ('PowerPC', 'Power_Macintosh'): # Pick a sane name for the PPC architecture. # See 'i386' case if sys.maxsize >= 2**32: machine = 'ppc64' else: machine = 'ppc' return "%s-%s-%s" % (osname, release, machine) def get_python_version(): return _PY_VERSION_SHORT def _print_dict(title, data): for index, (key, value) in enumerate(sorted(data.items())): if index == 0: print('%s: ' % (title)) print('\t%s = "%s"' % (key, value)) def _main(): """Display all information sysconfig detains.""" print('Platform: "%s"' % get_platform()) print('Python version: "%s"' % get_python_version()) print('Current installation scheme: "%s"' % _get_default_scheme()) print() _print_dict('Paths', get_paths()) print() _print_dict('Variables', get_config_vars()) if __name__ == '__main__': _main() PK!o9 9 _backport/sysconfig.cfgnu[[posix_prefix] # Configuration directories. Some of these come straight out of the # configure script. They are for implementing the other variables, not to # be used directly in [resource_locations]. confdir = /etc datadir = /usr/share libdir = /usr/lib statedir = /var # User resource directory local = ~/.local/{distribution.name} stdlib = {base}/lib/python{py_version_short} platstdlib = {platbase}/lib/python{py_version_short} purelib = {base}/lib/python{py_version_short}/site-packages platlib = {platbase}/lib/python{py_version_short}/site-packages include = {base}/include/python{py_version_short}{abiflags} platinclude = {platbase}/include/python{py_version_short}{abiflags} data = {base} [posix_home] stdlib = {base}/lib/python platstdlib = {base}/lib/python purelib = {base}/lib/python platlib = {base}/lib/python include = {base}/include/python platinclude = {base}/include/python scripts = {base}/bin data = {base} [nt] stdlib = {base}/Lib platstdlib = {base}/Lib purelib = {base}/Lib/site-packages platlib = {base}/Lib/site-packages include = {base}/Include platinclude = {base}/Include scripts = {base}/Scripts data = {base} [os2] stdlib = {base}/Lib platstdlib = {base}/Lib purelib = {base}/Lib/site-packages platlib = {base}/Lib/site-packages include = {base}/Include platinclude = {base}/Include scripts = {base}/Scripts data = {base} [os2_home] stdlib = {userbase}/lib/python{py_version_short} platstdlib = {userbase}/lib/python{py_version_short} purelib = {userbase}/lib/python{py_version_short}/site-packages platlib = {userbase}/lib/python{py_version_short}/site-packages include = {userbase}/include/python{py_version_short} scripts = {userbase}/bin data = {userbase} [nt_user] stdlib = {userbase}/Python{py_version_nodot} platstdlib = {userbase}/Python{py_version_nodot} purelib = {userbase}/Python{py_version_nodot}/site-packages platlib = {userbase}/Python{py_version_nodot}/site-packages include = {userbase}/Python{py_version_nodot}/Include scripts = {userbase}/Scripts data = {userbase} [posix_user] stdlib = {userbase}/lib/python{py_version_short} platstdlib = {userbase}/lib/python{py_version_short} purelib = {userbase}/lib/python{py_version_short}/site-packages platlib = {userbase}/lib/python{py_version_short}/site-packages include = {userbase}/include/python{py_version_short} scripts = {userbase}/bin data = {userbase} [osx_framework_user] stdlib = {userbase}/lib/python platstdlib = {userbase}/lib/python purelib = {userbase}/lib/python/site-packages platlib = {userbase}/lib/python/site-packages include = {userbase}/include scripts = {userbase}/bin data = {userbase} PK!DBCii_backport/tarfile.pynu[#------------------------------------------------------------------- # tarfile.py #------------------------------------------------------------------- # Copyright (C) 2002 Lars Gustaebel # All rights reserved. # # 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 print_function """Read from and write to tar format archives. """ __version__ = "$Revision$" version = "0.9.0" __author__ = "Lars Gust\u00e4bel (lars@gustaebel.de)" __date__ = "$Date: 2011-02-25 17:42:01 +0200 (Fri, 25 Feb 2011) $" __cvsid__ = "$Id: tarfile.py 88586 2011-02-25 15:42:01Z marc-andre.lemburg $" __credits__ = "Gustavo Niemeyer, Niels Gust\u00e4bel, Richard Townsend." #--------- # Imports #--------- import sys import os import stat import errno import time import struct import copy import re try: import grp, pwd except ImportError: grp = pwd = None # os.symlink on Windows prior to 6.0 raises NotImplementedError symlink_exception = (AttributeError, NotImplementedError) try: # WindowsError (1314) will be raised if the caller does not hold the # SeCreateSymbolicLinkPrivilege privilege symlink_exception += (WindowsError,) except NameError: pass # from tarfile import * __all__ = ["TarFile", "TarInfo", "is_tarfile", "TarError"] if sys.version_info[0] < 3: import __builtin__ as builtins else: import builtins _open = builtins.open # Since 'open' is TarFile.open #--------------------------------------------------------- # tar constants #--------------------------------------------------------- NUL = b"\0" # the null character BLOCKSIZE = 512 # length of processing blocks RECORDSIZE = BLOCKSIZE * 20 # length of records GNU_MAGIC = b"ustar \0" # magic gnu tar string POSIX_MAGIC = b"ustar\x0000" # magic posix tar string LENGTH_NAME = 100 # maximum length of a filename LENGTH_LINK = 100 # maximum length of a linkname LENGTH_PREFIX = 155 # maximum length of the prefix field REGTYPE = b"0" # regular file AREGTYPE = b"\0" # regular file LNKTYPE = b"1" # link (inside tarfile) SYMTYPE = b"2" # symbolic link CHRTYPE = b"3" # character special device BLKTYPE = b"4" # block special device DIRTYPE = b"5" # directory FIFOTYPE = b"6" # fifo special device CONTTYPE = b"7" # contiguous file GNUTYPE_LONGNAME = b"L" # GNU tar longname GNUTYPE_LONGLINK = b"K" # GNU tar longlink GNUTYPE_SPARSE = b"S" # GNU tar sparse file XHDTYPE = b"x" # POSIX.1-2001 extended header XGLTYPE = b"g" # POSIX.1-2001 global header SOLARIS_XHDTYPE = b"X" # Solaris extended header USTAR_FORMAT = 0 # POSIX.1-1988 (ustar) format GNU_FORMAT = 1 # GNU tar format PAX_FORMAT = 2 # POSIX.1-2001 (pax) format DEFAULT_FORMAT = GNU_FORMAT #--------------------------------------------------------- # tarfile constants #--------------------------------------------------------- # File types that tarfile supports: SUPPORTED_TYPES = (REGTYPE, AREGTYPE, LNKTYPE, SYMTYPE, DIRTYPE, FIFOTYPE, CONTTYPE, CHRTYPE, BLKTYPE, GNUTYPE_LONGNAME, GNUTYPE_LONGLINK, GNUTYPE_SPARSE) # File types that will be treated as a regular file. REGULAR_TYPES = (REGTYPE, AREGTYPE, CONTTYPE, GNUTYPE_SPARSE) # File types that are part of the GNU tar format. GNU_TYPES = (GNUTYPE_LONGNAME, GNUTYPE_LONGLINK, GNUTYPE_SPARSE) # Fields from a pax header that override a TarInfo attribute. PAX_FIELDS = ("path", "linkpath", "size", "mtime", "uid", "gid", "uname", "gname") # Fields from a pax header that are affected by hdrcharset. PAX_NAME_FIELDS = set(("path", "linkpath", "uname", "gname")) # Fields in a pax header that are numbers, all other fields # are treated as strings. PAX_NUMBER_FIELDS = { "atime": float, "ctime": float, "mtime": float, "uid": int, "gid": int, "size": int } #--------------------------------------------------------- # Bits used in the mode field, values in octal. #--------------------------------------------------------- S_IFLNK = 0o120000 # symbolic link S_IFREG = 0o100000 # regular file S_IFBLK = 0o060000 # block device S_IFDIR = 0o040000 # directory S_IFCHR = 0o020000 # character device S_IFIFO = 0o010000 # fifo TSUID = 0o4000 # set UID on execution TSGID = 0o2000 # set GID on execution TSVTX = 0o1000 # reserved TUREAD = 0o400 # read by owner TUWRITE = 0o200 # write by owner TUEXEC = 0o100 # execute/search by owner TGREAD = 0o040 # read by group TGWRITE = 0o020 # write by group TGEXEC = 0o010 # execute/search by group TOREAD = 0o004 # read by other TOWRITE = 0o002 # write by other TOEXEC = 0o001 # execute/search by other #--------------------------------------------------------- # initialization #--------------------------------------------------------- if os.name in ("nt", "ce"): ENCODING = "utf-8" else: ENCODING = sys.getfilesystemencoding() #--------------------------------------------------------- # Some useful functions #--------------------------------------------------------- def stn(s, length, encoding, errors): """Convert a string to a null-terminated bytes object. """ s = s.encode(encoding, errors) return s[:length] + (length - len(s)) * NUL def nts(s, encoding, errors): """Convert a null-terminated bytes object to a string. """ p = s.find(b"\0") if p != -1: s = s[:p] return s.decode(encoding, errors) def nti(s): """Convert a number field to a python number. """ # There are two possible encodings for a number field, see # itn() below. if s[0] != chr(0o200): try: n = int(nts(s, "ascii", "strict") or "0", 8) except ValueError: raise InvalidHeaderError("invalid header") else: n = 0 for i in range(len(s) - 1): n <<= 8 n += ord(s[i + 1]) return n def itn(n, digits=8, format=DEFAULT_FORMAT): """Convert a python number to a number field. """ # POSIX 1003.1-1988 requires numbers to be encoded as a string of # octal digits followed by a null-byte, this allows values up to # (8**(digits-1))-1. GNU tar allows storing numbers greater than # that if necessary. A leading 0o200 byte indicates this particular # encoding, the following digits-1 bytes are a big-endian # representation. This allows values up to (256**(digits-1))-1. if 0 <= n < 8 ** (digits - 1): s = ("%0*o" % (digits - 1, n)).encode("ascii") + NUL else: if format != GNU_FORMAT or n >= 256 ** (digits - 1): raise ValueError("overflow in number field") if n < 0: # XXX We mimic GNU tar's behaviour with negative numbers, # this could raise OverflowError. n = struct.unpack("L", struct.pack("l", n))[0] s = bytearray() for i in range(digits - 1): s.insert(0, n & 0o377) n >>= 8 s.insert(0, 0o200) return s def calc_chksums(buf): """Calculate the checksum for a member's header by summing up all characters except for the chksum field which is treated as if it was filled with spaces. According to the GNU tar sources, some tars (Sun and NeXT) calculate chksum with signed char, which will be different if there are chars in the buffer with the high bit set. So we calculate two checksums, unsigned and signed. """ unsigned_chksum = 256 + sum(struct.unpack("148B", buf[:148]) + struct.unpack("356B", buf[156:512])) signed_chksum = 256 + sum(struct.unpack("148b", buf[:148]) + struct.unpack("356b", buf[156:512])) return unsigned_chksum, signed_chksum def copyfileobj(src, dst, length=None): """Copy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. """ if length == 0: return if length is None: while True: buf = src.read(16*1024) if not buf: break dst.write(buf) return BUFSIZE = 16 * 1024 blocks, remainder = divmod(length, BUFSIZE) for b in range(blocks): buf = src.read(BUFSIZE) if len(buf) < BUFSIZE: raise IOError("end of file reached") dst.write(buf) if remainder != 0: buf = src.read(remainder) if len(buf) < remainder: raise IOError("end of file reached") dst.write(buf) return filemode_table = ( ((S_IFLNK, "l"), (S_IFREG, "-"), (S_IFBLK, "b"), (S_IFDIR, "d"), (S_IFCHR, "c"), (S_IFIFO, "p")), ((TUREAD, "r"),), ((TUWRITE, "w"),), ((TUEXEC|TSUID, "s"), (TSUID, "S"), (TUEXEC, "x")), ((TGREAD, "r"),), ((TGWRITE, "w"),), ((TGEXEC|TSGID, "s"), (TSGID, "S"), (TGEXEC, "x")), ((TOREAD, "r"),), ((TOWRITE, "w"),), ((TOEXEC|TSVTX, "t"), (TSVTX, "T"), (TOEXEC, "x")) ) def filemode(mode): """Convert a file's mode to a string of the form -rwxrwxrwx. Used by TarFile.list() """ perm = [] for table in filemode_table: for bit, char in table: if mode & bit == bit: perm.append(char) break else: perm.append("-") return "".join(perm) class TarError(Exception): """Base exception.""" pass class ExtractError(TarError): """General exception for extract errors.""" pass class ReadError(TarError): """Exception for unreadable tar archives.""" pass class CompressionError(TarError): """Exception for unavailable compression methods.""" pass class StreamError(TarError): """Exception for unsupported operations on stream-like TarFiles.""" pass class HeaderError(TarError): """Base exception for header errors.""" pass class EmptyHeaderError(HeaderError): """Exception for empty headers.""" pass class TruncatedHeaderError(HeaderError): """Exception for truncated headers.""" pass class EOFHeaderError(HeaderError): """Exception for end of file headers.""" pass class InvalidHeaderError(HeaderError): """Exception for invalid headers.""" pass class SubsequentHeaderError(HeaderError): """Exception for missing and invalid extended headers.""" pass #--------------------------- # internal stream interface #--------------------------- class _LowLevelFile(object): """Low-level file object. Supports reading and writing. It is used instead of a regular file object for streaming access. """ def __init__(self, name, mode): mode = { "r": os.O_RDONLY, "w": os.O_WRONLY | os.O_CREAT | os.O_TRUNC, }[mode] if hasattr(os, "O_BINARY"): mode |= os.O_BINARY self.fd = os.open(name, mode, 0o666) def close(self): os.close(self.fd) def read(self, size): return os.read(self.fd, size) def write(self, s): os.write(self.fd, s) class _Stream(object): """Class that serves as an adapter between TarFile and a stream-like object. The stream-like object only needs to have a read() or write() method and is accessed blockwise. Use of gzip or bzip2 compression is possible. A stream-like object could be for example: sys.stdin, sys.stdout, a socket, a tape device etc. _Stream is intended to be used only internally. """ def __init__(self, name, mode, comptype, fileobj, bufsize): """Construct a _Stream object. """ self._extfileobj = True if fileobj is None: fileobj = _LowLevelFile(name, mode) self._extfileobj = False if comptype == '*': # Enable transparent compression detection for the # stream interface fileobj = _StreamProxy(fileobj) comptype = fileobj.getcomptype() self.name = name or "" self.mode = mode self.comptype = comptype self.fileobj = fileobj self.bufsize = bufsize self.buf = b"" self.pos = 0 self.closed = False try: if comptype == "gz": try: import zlib except ImportError: raise CompressionError("zlib module is not available") self.zlib = zlib self.crc = zlib.crc32(b"") if mode == "r": self._init_read_gz() else: self._init_write_gz() if comptype == "bz2": try: import bz2 except ImportError: raise CompressionError("bz2 module is not available") if mode == "r": self.dbuf = b"" self.cmp = bz2.BZ2Decompressor() else: self.cmp = bz2.BZ2Compressor() except: if not self._extfileobj: self.fileobj.close() self.closed = True raise def __del__(self): if hasattr(self, "closed") and not self.closed: self.close() def _init_write_gz(self): """Initialize for writing with gzip compression. """ self.cmp = self.zlib.compressobj(9, self.zlib.DEFLATED, -self.zlib.MAX_WBITS, self.zlib.DEF_MEM_LEVEL, 0) timestamp = struct.pack(" self.bufsize: self.fileobj.write(self.buf[:self.bufsize]) self.buf = self.buf[self.bufsize:] def close(self): """Close the _Stream object. No operation should be done on it afterwards. """ if self.closed: return if self.mode == "w" and self.comptype != "tar": self.buf += self.cmp.flush() if self.mode == "w" and self.buf: self.fileobj.write(self.buf) self.buf = b"" if self.comptype == "gz": # The native zlib crc is an unsigned 32-bit integer, but # the Python wrapper implicitly casts that to a signed C # long. So, on a 32-bit box self.crc may "look negative", # while the same crc on a 64-bit box may "look positive". # To avoid irksome warnings from the `struct` module, force # it to look positive on all boxes. self.fileobj.write(struct.pack("= 0: blocks, remainder = divmod(pos - self.pos, self.bufsize) for i in range(blocks): self.read(self.bufsize) self.read(remainder) else: raise StreamError("seeking backwards is not allowed") return self.pos def read(self, size=None): """Return the next size number of bytes from the stream. If size is not defined, return all bytes of the stream up to EOF. """ if size is None: t = [] while True: buf = self._read(self.bufsize) if not buf: break t.append(buf) buf = "".join(t) else: buf = self._read(size) self.pos += len(buf) return buf def _read(self, size): """Return size bytes from the stream. """ if self.comptype == "tar": return self.__read(size) c = len(self.dbuf) while c < size: buf = self.__read(self.bufsize) if not buf: break try: buf = self.cmp.decompress(buf) except IOError: raise ReadError("invalid compressed data") self.dbuf += buf c += len(buf) buf = self.dbuf[:size] self.dbuf = self.dbuf[size:] return buf def __read(self, size): """Return size bytes from stream. If internal buffer is empty, read another block from the stream. """ c = len(self.buf) while c < size: buf = self.fileobj.read(self.bufsize) if not buf: break self.buf += buf c += len(buf) buf = self.buf[:size] self.buf = self.buf[size:] return buf # class _Stream class _StreamProxy(object): """Small proxy class that enables transparent compression detection for the Stream interface (mode 'r|*'). """ def __init__(self, fileobj): self.fileobj = fileobj self.buf = self.fileobj.read(BLOCKSIZE) def read(self, size): self.read = self.fileobj.read return self.buf def getcomptype(self): if self.buf.startswith(b"\037\213\010"): return "gz" if self.buf.startswith(b"BZh91"): return "bz2" return "tar" def close(self): self.fileobj.close() # class StreamProxy class _BZ2Proxy(object): """Small proxy class that enables external file object support for "r:bz2" and "w:bz2" modes. This is actually a workaround for a limitation in bz2 module's BZ2File class which (unlike gzip.GzipFile) has no support for a file object argument. """ blocksize = 16 * 1024 def __init__(self, fileobj, mode): self.fileobj = fileobj self.mode = mode self.name = getattr(self.fileobj, "name", None) self.init() def init(self): import bz2 self.pos = 0 if self.mode == "r": self.bz2obj = bz2.BZ2Decompressor() self.fileobj.seek(0) self.buf = b"" else: self.bz2obj = bz2.BZ2Compressor() def read(self, size): x = len(self.buf) while x < size: raw = self.fileobj.read(self.blocksize) if not raw: break data = self.bz2obj.decompress(raw) self.buf += data x += len(data) buf = self.buf[:size] self.buf = self.buf[size:] self.pos += len(buf) return buf def seek(self, pos): if pos < self.pos: self.init() self.read(pos - self.pos) def tell(self): return self.pos def write(self, data): self.pos += len(data) raw = self.bz2obj.compress(data) self.fileobj.write(raw) def close(self): if self.mode == "w": raw = self.bz2obj.flush() self.fileobj.write(raw) # class _BZ2Proxy #------------------------ # Extraction file object #------------------------ class _FileInFile(object): """A thin wrapper around an existing file object that provides a part of its data as an individual file object. """ def __init__(self, fileobj, offset, size, blockinfo=None): self.fileobj = fileobj self.offset = offset self.size = size self.position = 0 if blockinfo is None: blockinfo = [(0, size)] # Construct a map with data and zero blocks. self.map_index = 0 self.map = [] lastpos = 0 realpos = self.offset for offset, size in blockinfo: if offset > lastpos: self.map.append((False, lastpos, offset, None)) self.map.append((True, offset, offset + size, realpos)) realpos += size lastpos = offset + size if lastpos < self.size: self.map.append((False, lastpos, self.size, None)) def seekable(self): if not hasattr(self.fileobj, "seekable"): # XXX gzip.GzipFile and bz2.BZ2File return True return self.fileobj.seekable() def tell(self): """Return the current file position. """ return self.position def seek(self, position): """Seek to a position in the file. """ self.position = position def read(self, size=None): """Read data from the file. """ if size is None: size = self.size - self.position else: size = min(size, self.size - self.position) buf = b"" while size > 0: while True: data, start, stop, offset = self.map[self.map_index] if start <= self.position < stop: break else: self.map_index += 1 if self.map_index == len(self.map): self.map_index = 0 length = min(size, stop - self.position) if data: self.fileobj.seek(offset + (self.position - start)) buf += self.fileobj.read(length) else: buf += NUL * length size -= length self.position += length return buf #class _FileInFile class ExFileObject(object): """File-like object for reading an archive member. Is returned by TarFile.extractfile(). """ blocksize = 1024 def __init__(self, tarfile, tarinfo): self.fileobj = _FileInFile(tarfile.fileobj, tarinfo.offset_data, tarinfo.size, tarinfo.sparse) self.name = tarinfo.name self.mode = "r" self.closed = False self.size = tarinfo.size self.position = 0 self.buffer = b"" def readable(self): return True def writable(self): return False def seekable(self): return self.fileobj.seekable() def read(self, size=None): """Read at most size bytes from the file. If size is not present or None, read all data until EOF is reached. """ if self.closed: raise ValueError("I/O operation on closed file") buf = b"" if self.buffer: if size is None: buf = self.buffer self.buffer = b"" else: buf = self.buffer[:size] self.buffer = self.buffer[size:] if size is None: buf += self.fileobj.read() else: buf += self.fileobj.read(size - len(buf)) self.position += len(buf) return buf # XXX TextIOWrapper uses the read1() method. read1 = read def readline(self, size=-1): """Read one entire line from the file. If size is present and non-negative, return a string with at most that size, which may be an incomplete line. """ if self.closed: raise ValueError("I/O operation on closed file") pos = self.buffer.find(b"\n") + 1 if pos == 0: # no newline found. while True: buf = self.fileobj.read(self.blocksize) self.buffer += buf if not buf or b"\n" in buf: pos = self.buffer.find(b"\n") + 1 if pos == 0: # no newline found. pos = len(self.buffer) break if size != -1: pos = min(size, pos) buf = self.buffer[:pos] self.buffer = self.buffer[pos:] self.position += len(buf) return buf def readlines(self): """Return a list with all remaining lines. """ result = [] while True: line = self.readline() if not line: break result.append(line) return result def tell(self): """Return the current file position. """ if self.closed: raise ValueError("I/O operation on closed file") return self.position def seek(self, pos, whence=os.SEEK_SET): """Seek to a position in the file. """ if self.closed: raise ValueError("I/O operation on closed file") if whence == os.SEEK_SET: self.position = min(max(pos, 0), self.size) elif whence == os.SEEK_CUR: if pos < 0: self.position = max(self.position + pos, 0) else: self.position = min(self.position + pos, self.size) elif whence == os.SEEK_END: self.position = max(min(self.size + pos, self.size), 0) else: raise ValueError("Invalid argument") self.buffer = b"" self.fileobj.seek(self.position) def close(self): """Close the file object. """ self.closed = True def __iter__(self): """Get an iterator over the file's lines. """ while True: line = self.readline() if not line: break yield line #class ExFileObject #------------------ # Exported Classes #------------------ class TarInfo(object): """Informational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally. """ __slots__ = ("name", "mode", "uid", "gid", "size", "mtime", "chksum", "type", "linkname", "uname", "gname", "devmajor", "devminor", "offset", "offset_data", "pax_headers", "sparse", "tarfile", "_sparse_structs", "_link_target") def __init__(self, name=""): """Construct a TarInfo object. name is the optional name of the member. """ self.name = name # member name self.mode = 0o644 # file permissions self.uid = 0 # user id self.gid = 0 # group id self.size = 0 # file size self.mtime = 0 # modification time self.chksum = 0 # header checksum self.type = REGTYPE # member type self.linkname = "" # link name self.uname = "" # user name self.gname = "" # group name self.devmajor = 0 # device major number self.devminor = 0 # device minor number self.offset = 0 # the tar header starts here self.offset_data = 0 # the file's data starts here self.sparse = None # sparse member information self.pax_headers = {} # pax header information # In pax headers the "name" and "linkname" field are called # "path" and "linkpath". def _getpath(self): return self.name def _setpath(self, name): self.name = name path = property(_getpath, _setpath) def _getlinkpath(self): return self.linkname def _setlinkpath(self, linkname): self.linkname = linkname linkpath = property(_getlinkpath, _setlinkpath) def __repr__(self): return "<%s %r at %#x>" % (self.__class__.__name__,self.name,id(self)) def get_info(self): """Return the TarInfo's attributes as a dictionary. """ info = { "name": self.name, "mode": self.mode & 0o7777, "uid": self.uid, "gid": self.gid, "size": self.size, "mtime": self.mtime, "chksum": self.chksum, "type": self.type, "linkname": self.linkname, "uname": self.uname, "gname": self.gname, "devmajor": self.devmajor, "devminor": self.devminor } if info["type"] == DIRTYPE and not info["name"].endswith("/"): info["name"] += "/" return info def tobuf(self, format=DEFAULT_FORMAT, encoding=ENCODING, errors="surrogateescape"): """Return a tar header as a string of 512 byte blocks. """ info = self.get_info() if format == USTAR_FORMAT: return self.create_ustar_header(info, encoding, errors) elif format == GNU_FORMAT: return self.create_gnu_header(info, encoding, errors) elif format == PAX_FORMAT: return self.create_pax_header(info, encoding) else: raise ValueError("invalid format") def create_ustar_header(self, info, encoding, errors): """Return the object as a ustar header block. """ info["magic"] = POSIX_MAGIC if len(info["linkname"]) > LENGTH_LINK: raise ValueError("linkname is too long") if len(info["name"]) > LENGTH_NAME: info["prefix"], info["name"] = self._posix_split_name(info["name"]) return self._create_header(info, USTAR_FORMAT, encoding, errors) def create_gnu_header(self, info, encoding, errors): """Return the object as a GNU header block sequence. """ info["magic"] = GNU_MAGIC buf = b"" if len(info["linkname"]) > LENGTH_LINK: buf += self._create_gnu_long_header(info["linkname"], GNUTYPE_LONGLINK, encoding, errors) if len(info["name"]) > LENGTH_NAME: buf += self._create_gnu_long_header(info["name"], GNUTYPE_LONGNAME, encoding, errors) return buf + self._create_header(info, GNU_FORMAT, encoding, errors) def create_pax_header(self, info, encoding): """Return the object as a ustar header block. If it cannot be represented this way, prepend a pax extended header sequence with supplement information. """ info["magic"] = POSIX_MAGIC pax_headers = self.pax_headers.copy() # Test string fields for values that exceed the field length or cannot # be represented in ASCII encoding. for name, hname, length in ( ("name", "path", LENGTH_NAME), ("linkname", "linkpath", LENGTH_LINK), ("uname", "uname", 32), ("gname", "gname", 32)): if hname in pax_headers: # The pax header has priority. continue # Try to encode the string as ASCII. try: info[name].encode("ascii", "strict") except UnicodeEncodeError: pax_headers[hname] = info[name] continue if len(info[name]) > length: pax_headers[hname] = info[name] # Test number fields for values that exceed the field limit or values # that like to be stored as float. for name, digits in (("uid", 8), ("gid", 8), ("size", 12), ("mtime", 12)): if name in pax_headers: # The pax header has priority. Avoid overflow. info[name] = 0 continue val = info[name] if not 0 <= val < 8 ** (digits - 1) or isinstance(val, float): pax_headers[name] = str(val) info[name] = 0 # Create a pax extended header if necessary. if pax_headers: buf = self._create_pax_generic_header(pax_headers, XHDTYPE, encoding) else: buf = b"" return buf + self._create_header(info, USTAR_FORMAT, "ascii", "replace") @classmethod def create_pax_global_header(cls, pax_headers): """Return the object as a pax global header block sequence. """ return cls._create_pax_generic_header(pax_headers, XGLTYPE, "utf8") def _posix_split_name(self, name): """Split a name longer than 100 chars into a prefix and a name part. """ prefix = name[:LENGTH_PREFIX + 1] while prefix and prefix[-1] != "/": prefix = prefix[:-1] name = name[len(prefix):] prefix = prefix[:-1] if not prefix or len(name) > LENGTH_NAME: raise ValueError("name is too long") return prefix, name @staticmethod def _create_header(info, format, encoding, errors): """Return a header block. info is a dictionary with file information, format must be one of the *_FORMAT constants. """ parts = [ stn(info.get("name", ""), 100, encoding, errors), itn(info.get("mode", 0) & 0o7777, 8, format), itn(info.get("uid", 0), 8, format), itn(info.get("gid", 0), 8, format), itn(info.get("size", 0), 12, format), itn(info.get("mtime", 0), 12, format), b" ", # checksum field info.get("type", REGTYPE), stn(info.get("linkname", ""), 100, encoding, errors), info.get("magic", POSIX_MAGIC), stn(info.get("uname", ""), 32, encoding, errors), stn(info.get("gname", ""), 32, encoding, errors), itn(info.get("devmajor", 0), 8, format), itn(info.get("devminor", 0), 8, format), stn(info.get("prefix", ""), 155, encoding, errors) ] buf = struct.pack("%ds" % BLOCKSIZE, b"".join(parts)) chksum = calc_chksums(buf[-BLOCKSIZE:])[0] buf = buf[:-364] + ("%06o\0" % chksum).encode("ascii") + buf[-357:] return buf @staticmethod def _create_payload(payload): """Return the string payload filled with zero bytes up to the next 512 byte border. """ blocks, remainder = divmod(len(payload), BLOCKSIZE) if remainder > 0: payload += (BLOCKSIZE - remainder) * NUL return payload @classmethod def _create_gnu_long_header(cls, name, type, encoding, errors): """Return a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence for name. """ name = name.encode(encoding, errors) + NUL info = {} info["name"] = "././@LongLink" info["type"] = type info["size"] = len(name) info["magic"] = GNU_MAGIC # create extended header + name blocks. return cls._create_header(info, USTAR_FORMAT, encoding, errors) + \ cls._create_payload(name) @classmethod def _create_pax_generic_header(cls, pax_headers, type, encoding): """Return a POSIX.1-2008 extended or global header sequence that contains a list of keyword, value pairs. The values must be strings. """ # Check if one of the fields contains surrogate characters and thereby # forces hdrcharset=BINARY, see _proc_pax() for more information. binary = False for keyword, value in pax_headers.items(): try: value.encode("utf8", "strict") except UnicodeEncodeError: binary = True break records = b"" if binary: # Put the hdrcharset field at the beginning of the header. records += b"21 hdrcharset=BINARY\n" for keyword, value in pax_headers.items(): keyword = keyword.encode("utf8") if binary: # Try to restore the original byte representation of `value'. # Needless to say, that the encoding must match the string. value = value.encode(encoding, "surrogateescape") else: value = value.encode("utf8") l = len(keyword) + len(value) + 3 # ' ' + '=' + '\n' n = p = 0 while True: n = l + len(str(p)) if n == p: break p = n records += bytes(str(p), "ascii") + b" " + keyword + b"=" + value + b"\n" # We use a hardcoded "././@PaxHeader" name like star does # instead of the one that POSIX recommends. info = {} info["name"] = "././@PaxHeader" info["type"] = type info["size"] = len(records) info["magic"] = POSIX_MAGIC # Create pax header + record blocks. return cls._create_header(info, USTAR_FORMAT, "ascii", "replace") + \ cls._create_payload(records) @classmethod def frombuf(cls, buf, encoding, errors): """Construct a TarInfo object from a 512 byte bytes object. """ if len(buf) == 0: raise EmptyHeaderError("empty header") if len(buf) != BLOCKSIZE: raise TruncatedHeaderError("truncated header") if buf.count(NUL) == BLOCKSIZE: raise EOFHeaderError("end of file header") chksum = nti(buf[148:156]) if chksum not in calc_chksums(buf): raise InvalidHeaderError("bad checksum") obj = cls() obj.name = nts(buf[0:100], encoding, errors) obj.mode = nti(buf[100:108]) obj.uid = nti(buf[108:116]) obj.gid = nti(buf[116:124]) obj.size = nti(buf[124:136]) obj.mtime = nti(buf[136:148]) obj.chksum = chksum obj.type = buf[156:157] obj.linkname = nts(buf[157:257], encoding, errors) obj.uname = nts(buf[265:297], encoding, errors) obj.gname = nts(buf[297:329], encoding, errors) obj.devmajor = nti(buf[329:337]) obj.devminor = nti(buf[337:345]) prefix = nts(buf[345:500], encoding, errors) # Old V7 tar format represents a directory as a regular # file with a trailing slash. if obj.type == AREGTYPE and obj.name.endswith("/"): obj.type = DIRTYPE # The old GNU sparse format occupies some of the unused # space in the buffer for up to 4 sparse structures. # Save the them for later processing in _proc_sparse(). if obj.type == GNUTYPE_SPARSE: pos = 386 structs = [] for i in range(4): try: offset = nti(buf[pos:pos + 12]) numbytes = nti(buf[pos + 12:pos + 24]) except ValueError: break structs.append((offset, numbytes)) pos += 24 isextended = bool(buf[482]) origsize = nti(buf[483:495]) obj._sparse_structs = (structs, isextended, origsize) # Remove redundant slashes from directories. if obj.isdir(): obj.name = obj.name.rstrip("/") # Reconstruct a ustar longname. if prefix and obj.type not in GNU_TYPES: obj.name = prefix + "/" + obj.name return obj @classmethod def fromtarfile(cls, tarfile): """Return the next TarInfo object from TarFile object tarfile. """ buf = tarfile.fileobj.read(BLOCKSIZE) obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors) obj.offset = tarfile.fileobj.tell() - BLOCKSIZE return obj._proc_member(tarfile) #-------------------------------------------------------------------------- # The following are methods that are called depending on the type of a # member. The entry point is _proc_member() which can be overridden in a # subclass to add custom _proc_*() methods. A _proc_*() method MUST # implement the following # operations: # 1. Set self.offset_data to the position where the data blocks begin, # if there is data that follows. # 2. Set tarfile.offset to the position where the next member's header will # begin. # 3. Return self or another valid TarInfo object. def _proc_member(self, tarfile): """Choose the right processing method depending on the type and call it. """ if self.type in (GNUTYPE_LONGNAME, GNUTYPE_LONGLINK): return self._proc_gnulong(tarfile) elif self.type == GNUTYPE_SPARSE: return self._proc_sparse(tarfile) elif self.type in (XHDTYPE, XGLTYPE, SOLARIS_XHDTYPE): return self._proc_pax(tarfile) else: return self._proc_builtin(tarfile) def _proc_builtin(self, tarfile): """Process a builtin type or an unknown type which will be treated as a regular file. """ self.offset_data = tarfile.fileobj.tell() offset = self.offset_data if self.isreg() or self.type not in SUPPORTED_TYPES: # Skip the following data blocks. offset += self._block(self.size) tarfile.offset = offset # Patch the TarInfo object with saved global # header information. self._apply_pax_info(tarfile.pax_headers, tarfile.encoding, tarfile.errors) return self def _proc_gnulong(self, tarfile): """Process the blocks that hold a GNU longname or longlink member. """ buf = tarfile.fileobj.read(self._block(self.size)) # Fetch the next header and process it. try: next = self.fromtarfile(tarfile) except HeaderError: raise SubsequentHeaderError("missing or bad subsequent header") # Patch the TarInfo object from the next header with # the longname information. next.offset = self.offset if self.type == GNUTYPE_LONGNAME: next.name = nts(buf, tarfile.encoding, tarfile.errors) elif self.type == GNUTYPE_LONGLINK: next.linkname = nts(buf, tarfile.encoding, tarfile.errors) return next def _proc_sparse(self, tarfile): """Process a GNU sparse header plus extra headers. """ # We already collected some sparse structures in frombuf(). structs, isextended, origsize = self._sparse_structs del self._sparse_structs # Collect sparse structures from extended header blocks. while isextended: buf = tarfile.fileobj.read(BLOCKSIZE) pos = 0 for i in range(21): try: offset = nti(buf[pos:pos + 12]) numbytes = nti(buf[pos + 12:pos + 24]) except ValueError: break if offset and numbytes: structs.append((offset, numbytes)) pos += 24 isextended = bool(buf[504]) self.sparse = structs self.offset_data = tarfile.fileobj.tell() tarfile.offset = self.offset_data + self._block(self.size) self.size = origsize return self def _proc_pax(self, tarfile): """Process an extended or global header as described in POSIX.1-2008. """ # Read the header information. buf = tarfile.fileobj.read(self._block(self.size)) # A pax header stores supplemental information for either # the following file (extended) or all following files # (global). if self.type == XGLTYPE: pax_headers = tarfile.pax_headers else: pax_headers = tarfile.pax_headers.copy() # Check if the pax header contains a hdrcharset field. This tells us # the encoding of the path, linkpath, uname and gname fields. Normally, # these fields are UTF-8 encoded but since POSIX.1-2008 tar # implementations are allowed to store them as raw binary strings if # the translation to UTF-8 fails. match = re.search(br"\d+ hdrcharset=([^\n]+)\n", buf) if match is not None: pax_headers["hdrcharset"] = match.group(1).decode("utf8") # For the time being, we don't care about anything other than "BINARY". # The only other value that is currently allowed by the standard is # "ISO-IR 10646 2000 UTF-8" in other words UTF-8. hdrcharset = pax_headers.get("hdrcharset") if hdrcharset == "BINARY": encoding = tarfile.encoding else: encoding = "utf8" # Parse pax header information. A record looks like that: # "%d %s=%s\n" % (length, keyword, value). length is the size # of the complete record including the length field itself and # the newline. keyword and value are both UTF-8 encoded strings. regex = re.compile(br"(\d+) ([^=]+)=") pos = 0 while True: match = regex.match(buf, pos) if not match: break length, keyword = match.groups() length = int(length) value = buf[match.end(2) + 1:match.start(1) + length - 1] # Normally, we could just use "utf8" as the encoding and "strict" # as the error handler, but we better not take the risk. For # example, GNU tar <= 1.23 is known to store filenames it cannot # translate to UTF-8 as raw strings (unfortunately without a # hdrcharset=BINARY header). # We first try the strict standard encoding, and if that fails we # fall back on the user's encoding and error handler. keyword = self._decode_pax_field(keyword, "utf8", "utf8", tarfile.errors) if keyword in PAX_NAME_FIELDS: value = self._decode_pax_field(value, encoding, tarfile.encoding, tarfile.errors) else: value = self._decode_pax_field(value, "utf8", "utf8", tarfile.errors) pax_headers[keyword] = value pos += length # Fetch the next header. try: next = self.fromtarfile(tarfile) except HeaderError: raise SubsequentHeaderError("missing or bad subsequent header") # Process GNU sparse information. if "GNU.sparse.map" in pax_headers: # GNU extended sparse format version 0.1. self._proc_gnusparse_01(next, pax_headers) elif "GNU.sparse.size" in pax_headers: # GNU extended sparse format version 0.0. self._proc_gnusparse_00(next, pax_headers, buf) elif pax_headers.get("GNU.sparse.major") == "1" and pax_headers.get("GNU.sparse.minor") == "0": # GNU extended sparse format version 1.0. self._proc_gnusparse_10(next, pax_headers, tarfile) if self.type in (XHDTYPE, SOLARIS_XHDTYPE): # Patch the TarInfo object with the extended header info. next._apply_pax_info(pax_headers, tarfile.encoding, tarfile.errors) next.offset = self.offset if "size" in pax_headers: # If the extended header replaces the size field, # we need to recalculate the offset where the next # header starts. offset = next.offset_data if next.isreg() or next.type not in SUPPORTED_TYPES: offset += next._block(next.size) tarfile.offset = offset return next def _proc_gnusparse_00(self, next, pax_headers, buf): """Process a GNU tar extended sparse header, version 0.0. """ offsets = [] for match in re.finditer(br"\d+ GNU.sparse.offset=(\d+)\n", buf): offsets.append(int(match.group(1))) numbytes = [] for match in re.finditer(br"\d+ GNU.sparse.numbytes=(\d+)\n", buf): numbytes.append(int(match.group(1))) next.sparse = list(zip(offsets, numbytes)) def _proc_gnusparse_01(self, next, pax_headers): """Process a GNU tar extended sparse header, version 0.1. """ sparse = [int(x) for x in pax_headers["GNU.sparse.map"].split(",")] next.sparse = list(zip(sparse[::2], sparse[1::2])) def _proc_gnusparse_10(self, next, pax_headers, tarfile): """Process a GNU tar extended sparse header, version 1.0. """ fields = None sparse = [] buf = tarfile.fileobj.read(BLOCKSIZE) fields, buf = buf.split(b"\n", 1) fields = int(fields) while len(sparse) < fields * 2: if b"\n" not in buf: buf += tarfile.fileobj.read(BLOCKSIZE) number, buf = buf.split(b"\n", 1) sparse.append(int(number)) next.offset_data = tarfile.fileobj.tell() next.sparse = list(zip(sparse[::2], sparse[1::2])) def _apply_pax_info(self, pax_headers, encoding, errors): """Replace fields with supplemental information from a previous pax extended or global header. """ for keyword, value in pax_headers.items(): if keyword == "GNU.sparse.name": setattr(self, "path", value) elif keyword == "GNU.sparse.size": setattr(self, "size", int(value)) elif keyword == "GNU.sparse.realsize": setattr(self, "size", int(value)) elif keyword in PAX_FIELDS: if keyword in PAX_NUMBER_FIELDS: try: value = PAX_NUMBER_FIELDS[keyword](value) except ValueError: value = 0 if keyword == "path": value = value.rstrip("/") setattr(self, keyword, value) self.pax_headers = pax_headers.copy() def _decode_pax_field(self, value, encoding, fallback_encoding, fallback_errors): """Decode a single field from a pax record. """ try: return value.decode(encoding, "strict") except UnicodeDecodeError: return value.decode(fallback_encoding, fallback_errors) def _block(self, count): """Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024. """ blocks, remainder = divmod(count, BLOCKSIZE) if remainder: blocks += 1 return blocks * BLOCKSIZE def isreg(self): return self.type in REGULAR_TYPES def isfile(self): return self.isreg() def isdir(self): return self.type == DIRTYPE def issym(self): return self.type == SYMTYPE def islnk(self): return self.type == LNKTYPE def ischr(self): return self.type == CHRTYPE def isblk(self): return self.type == BLKTYPE def isfifo(self): return self.type == FIFOTYPE def issparse(self): return self.sparse is not None def isdev(self): return self.type in (CHRTYPE, BLKTYPE, FIFOTYPE) # class TarInfo class TarFile(object): """The TarFile Class provides an interface to tar archives. """ debug = 0 # May be set from 0 (no msgs) to 3 (all msgs) dereference = False # If true, add content of linked file to the # tar file, else the link. ignore_zeros = False # If true, skips empty or invalid blocks and # continues processing. errorlevel = 1 # If 0, fatal errors only appear in debug # messages (if debug >= 0). If > 0, errors # are passed to the caller as exceptions. format = DEFAULT_FORMAT # The format to use when creating an archive. encoding = ENCODING # Encoding for 8-bit character strings. errors = None # Error handler for unicode conversion. tarinfo = TarInfo # The default TarInfo class to use. fileobject = ExFileObject # The default ExFileObject class to use. def __init__(self, name=None, mode="r", fileobj=None, format=None, tarinfo=None, dereference=None, ignore_zeros=None, encoding=None, errors="surrogateescape", pax_headers=None, debug=None, errorlevel=None): """Open an (uncompressed) tar archive `name'. `mode' is either 'r' to read from an existing archive, 'a' to append data to an existing file or 'w' to create a new file overwriting an existing one. `mode' defaults to 'r'. If `fileobj' is given, it is used for reading or writing data. If it can be determined, `mode' is overridden by `fileobj's mode. `fileobj' is not closed, when TarFile is closed. """ if len(mode) > 1 or mode not in "raw": raise ValueError("mode must be 'r', 'a' or 'w'") self.mode = mode self._mode = {"r": "rb", "a": "r+b", "w": "wb"}[mode] if not fileobj: if self.mode == "a" and not os.path.exists(name): # Create nonexistent files in append mode. self.mode = "w" self._mode = "wb" fileobj = bltn_open(name, self._mode) self._extfileobj = False else: if name is None and hasattr(fileobj, "name"): name = fileobj.name if hasattr(fileobj, "mode"): self._mode = fileobj.mode self._extfileobj = True self.name = os.path.abspath(name) if name else None self.fileobj = fileobj # Init attributes. if format is not None: self.format = format if tarinfo is not None: self.tarinfo = tarinfo if dereference is not None: self.dereference = dereference if ignore_zeros is not None: self.ignore_zeros = ignore_zeros if encoding is not None: self.encoding = encoding self.errors = errors if pax_headers is not None and self.format == PAX_FORMAT: self.pax_headers = pax_headers else: self.pax_headers = {} if debug is not None: self.debug = debug if errorlevel is not None: self.errorlevel = errorlevel # Init datastructures. self.closed = False self.members = [] # list of members as TarInfo objects self._loaded = False # flag if all members have been read self.offset = self.fileobj.tell() # current position in the archive file self.inodes = {} # dictionary caching the inodes of # archive members already added try: if self.mode == "r": self.firstmember = None self.firstmember = self.next() if self.mode == "a": # Move to the end of the archive, # before the first empty block. while True: self.fileobj.seek(self.offset) try: tarinfo = self.tarinfo.fromtarfile(self) self.members.append(tarinfo) except EOFHeaderError: self.fileobj.seek(self.offset) break except HeaderError as e: raise ReadError(str(e)) if self.mode in "aw": self._loaded = True if self.pax_headers: buf = self.tarinfo.create_pax_global_header(self.pax_headers.copy()) self.fileobj.write(buf) self.offset += len(buf) except: if not self._extfileobj: self.fileobj.close() self.closed = True raise #-------------------------------------------------------------------------- # Below are the classmethods which act as alternate constructors to the # TarFile class. The open() method is the only one that is needed for # public use; it is the "super"-constructor and is able to select an # adequate "sub"-constructor for a particular compression using the mapping # from OPEN_METH. # # This concept allows one to subclass TarFile without losing the comfort of # the super-constructor. A sub-constructor is registered and made available # by adding it to the mapping in OPEN_METH. @classmethod def open(cls, name=None, mode="r", fileobj=None, bufsize=RECORDSIZE, **kwargs): """Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for reading exclusively uncompressed 'r:gz' open for reading with gzip compression 'r:bz2' open for reading with bzip2 compression 'a' or 'a:' open for appending, creating the file if necessary 'w' or 'w:' open for writing without compression 'w:gz' open for writing with gzip compression 'w:bz2' open for writing with bzip2 compression 'r|*' open a stream of tar blocks with transparent compression 'r|' open an uncompressed stream of tar blocks for reading 'r|gz' open a gzip compressed stream of tar blocks 'r|bz2' open a bzip2 compressed stream of tar blocks 'w|' open an uncompressed stream for writing 'w|gz' open a gzip compressed stream for writing 'w|bz2' open a bzip2 compressed stream for writing """ if not name and not fileobj: raise ValueError("nothing to open") if mode in ("r", "r:*"): # Find out which *open() is appropriate for opening the file. for comptype in cls.OPEN_METH: func = getattr(cls, cls.OPEN_METH[comptype]) if fileobj is not None: saved_pos = fileobj.tell() try: return func(name, "r", fileobj, **kwargs) except (ReadError, CompressionError) as e: if fileobj is not None: fileobj.seek(saved_pos) continue raise ReadError("file could not be opened successfully") elif ":" in mode: filemode, comptype = mode.split(":", 1) filemode = filemode or "r" comptype = comptype or "tar" # Select the *open() function according to # given compression. if comptype in cls.OPEN_METH: func = getattr(cls, cls.OPEN_METH[comptype]) else: raise CompressionError("unknown compression type %r" % comptype) return func(name, filemode, fileobj, **kwargs) elif "|" in mode: filemode, comptype = mode.split("|", 1) filemode = filemode or "r" comptype = comptype or "tar" if filemode not in "rw": raise ValueError("mode must be 'r' or 'w'") stream = _Stream(name, filemode, comptype, fileobj, bufsize) try: t = cls(name, filemode, stream, **kwargs) except: stream.close() raise t._extfileobj = False return t elif mode in "aw": return cls.taropen(name, mode, fileobj, **kwargs) raise ValueError("undiscernible mode") @classmethod def taropen(cls, name, mode="r", fileobj=None, **kwargs): """Open uncompressed tar archive name for reading or writing. """ if len(mode) > 1 or mode not in "raw": raise ValueError("mode must be 'r', 'a' or 'w'") return cls(name, mode, fileobj, **kwargs) @classmethod def gzopen(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs): """Open gzip compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError("mode must be 'r' or 'w'") try: import gzip gzip.GzipFile except (ImportError, AttributeError): raise CompressionError("gzip module is not available") extfileobj = fileobj is not None try: fileobj = gzip.GzipFile(name, mode + "b", compresslevel, fileobj) t = cls.taropen(name, mode, fileobj, **kwargs) except IOError: if not extfileobj and fileobj is not None: fileobj.close() if fileobj is None: raise raise ReadError("not a gzip file") except: if not extfileobj and fileobj is not None: fileobj.close() raise t._extfileobj = extfileobj return t @classmethod def bz2open(cls, name, mode="r", fileobj=None, compresslevel=9, **kwargs): """Open bzip2 compressed tar archive name for reading or writing. Appending is not allowed. """ if len(mode) > 1 or mode not in "rw": raise ValueError("mode must be 'r' or 'w'.") try: import bz2 except ImportError: raise CompressionError("bz2 module is not available") if fileobj is not None: fileobj = _BZ2Proxy(fileobj, mode) else: fileobj = bz2.BZ2File(name, mode, compresslevel=compresslevel) try: t = cls.taropen(name, mode, fileobj, **kwargs) except (IOError, EOFError): fileobj.close() raise ReadError("not a bzip2 file") t._extfileobj = False return t # All *open() methods are registered here. OPEN_METH = { "tar": "taropen", # uncompressed tar "gz": "gzopen", # gzip compressed tar "bz2": "bz2open" # bzip2 compressed tar } #-------------------------------------------------------------------------- # The public methods which TarFile provides: def close(self): """Close the TarFile. In write-mode, two finishing zero blocks are appended to the archive. """ if self.closed: return if self.mode in "aw": self.fileobj.write(NUL * (BLOCKSIZE * 2)) self.offset += (BLOCKSIZE * 2) # fill up the end with zero-blocks # (like option -b20 for tar does) blocks, remainder = divmod(self.offset, RECORDSIZE) if remainder > 0: self.fileobj.write(NUL * (RECORDSIZE - remainder)) if not self._extfileobj: self.fileobj.close() self.closed = True def getmember(self, name): """Return a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version. """ tarinfo = self._getmember(name) if tarinfo is None: raise KeyError("filename %r not found" % name) return tarinfo def getmembers(self): """Return the members of the archive as a list of TarInfo objects. The list has the same order as the members in the archive. """ self._check() if not self._loaded: # if we want to obtain a list of self._load() # all members, we first have to # scan the whole archive. return self.members def getnames(self): """Return the members of the archive as a list of their names. It has the same order as the list returned by getmembers(). """ return [tarinfo.name for tarinfo in self.getmembers()] def gettarinfo(self, name=None, arcname=None, fileobj=None): """Create a TarInfo object for either the file `name' or the file object `fileobj' (using os.fstat on its file descriptor). You can modify some of the TarInfo's attributes before you add it using addfile(). If given, `arcname' specifies an alternative name for the file in the archive. """ self._check("aw") # When fileobj is given, replace name by # fileobj's real name. if fileobj is not None: name = fileobj.name # Building the name of the member in the archive. # Backward slashes are converted to forward slashes, # Absolute paths are turned to relative paths. if arcname is None: arcname = name drv, arcname = os.path.splitdrive(arcname) arcname = arcname.replace(os.sep, "/") arcname = arcname.lstrip("/") # Now, fill the TarInfo object with # information specific for the file. tarinfo = self.tarinfo() tarinfo.tarfile = self # Use os.stat or os.lstat, depending on platform # and if symlinks shall be resolved. if fileobj is None: if hasattr(os, "lstat") and not self.dereference: statres = os.lstat(name) else: statres = os.stat(name) else: statres = os.fstat(fileobj.fileno()) linkname = "" stmd = statres.st_mode if stat.S_ISREG(stmd): inode = (statres.st_ino, statres.st_dev) if not self.dereference and statres.st_nlink > 1 and \ inode in self.inodes and arcname != self.inodes[inode]: # Is it a hardlink to an already # archived file? type = LNKTYPE linkname = self.inodes[inode] else: # The inode is added only if its valid. # For win32 it is always 0. type = REGTYPE if inode[0]: self.inodes[inode] = arcname elif stat.S_ISDIR(stmd): type = DIRTYPE elif stat.S_ISFIFO(stmd): type = FIFOTYPE elif stat.S_ISLNK(stmd): type = SYMTYPE linkname = os.readlink(name) elif stat.S_ISCHR(stmd): type = CHRTYPE elif stat.S_ISBLK(stmd): type = BLKTYPE else: return None # Fill the TarInfo object with all # information we can get. tarinfo.name = arcname tarinfo.mode = stmd tarinfo.uid = statres.st_uid tarinfo.gid = statres.st_gid if type == REGTYPE: tarinfo.size = statres.st_size else: tarinfo.size = 0 tarinfo.mtime = statres.st_mtime tarinfo.type = type tarinfo.linkname = linkname if pwd: try: tarinfo.uname = pwd.getpwuid(tarinfo.uid)[0] except KeyError: pass if grp: try: tarinfo.gname = grp.getgrgid(tarinfo.gid)[0] except KeyError: pass if type in (CHRTYPE, BLKTYPE): if hasattr(os, "major") and hasattr(os, "minor"): tarinfo.devmajor = os.major(statres.st_rdev) tarinfo.devminor = os.minor(statres.st_rdev) return tarinfo def list(self, verbose=True): """Print a table of contents to sys.stdout. If `verbose' is False, only the names of the members are printed. If it is True, an `ls -l'-like output is produced. """ self._check() for tarinfo in self: if verbose: print(filemode(tarinfo.mode), end=' ') print("%s/%s" % (tarinfo.uname or tarinfo.uid, tarinfo.gname or tarinfo.gid), end=' ') if tarinfo.ischr() or tarinfo.isblk(): print("%10s" % ("%d,%d" \ % (tarinfo.devmajor, tarinfo.devminor)), end=' ') else: print("%10d" % tarinfo.size, end=' ') print("%d-%02d-%02d %02d:%02d:%02d" \ % time.localtime(tarinfo.mtime)[:6], end=' ') print(tarinfo.name + ("/" if tarinfo.isdir() else ""), end=' ') if verbose: if tarinfo.issym(): print("->", tarinfo.linkname, end=' ') if tarinfo.islnk(): print("link to", tarinfo.linkname, end=' ') print() def add(self, name, arcname=None, recursive=True, exclude=None, filter=None): """Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `recursive' to False. `exclude' is a function that should return True for each filename to be excluded. `filter' is a function that expects a TarInfo object argument and returns the changed TarInfo object, if it returns None the TarInfo object will be excluded from the archive. """ self._check("aw") if arcname is None: arcname = name # Exclude pathnames. if exclude is not None: import warnings warnings.warn("use the filter argument instead", DeprecationWarning, 2) if exclude(name): self._dbg(2, "tarfile: Excluded %r" % name) return # Skip if somebody tries to archive the archive... if self.name is not None and os.path.abspath(name) == self.name: self._dbg(2, "tarfile: Skipped %r" % name) return self._dbg(1, name) # Create a TarInfo object from the file. tarinfo = self.gettarinfo(name, arcname) if tarinfo is None: self._dbg(1, "tarfile: Unsupported type %r" % name) return # Change or exclude the TarInfo object. if filter is not None: tarinfo = filter(tarinfo) if tarinfo is None: self._dbg(2, "tarfile: Excluded %r" % name) return # Append the tar header and data to the archive. if tarinfo.isreg(): f = bltn_open(name, "rb") self.addfile(tarinfo, f) f.close() elif tarinfo.isdir(): self.addfile(tarinfo) if recursive: for f in os.listdir(name): self.add(os.path.join(name, f), os.path.join(arcname, f), recursive, exclude, filter=filter) else: self.addfile(tarinfo) def addfile(self, tarinfo, fileobj=None): """Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. """ self._check("aw") tarinfo = copy.copy(tarinfo) buf = tarinfo.tobuf(self.format, self.encoding, self.errors) self.fileobj.write(buf) self.offset += len(buf) # If there's data to follow, append it. if fileobj is not None: copyfileobj(fileobj, self.fileobj, tarinfo.size) blocks, remainder = divmod(tarinfo.size, BLOCKSIZE) if remainder > 0: self.fileobj.write(NUL * (BLOCKSIZE - remainder)) blocks += 1 self.offset += blocks * BLOCKSIZE self.members.append(tarinfo) def extractall(self, path=".", members=None): """Extract all members from the archive to the current working directory and set owner, modification time and permissions on directories afterwards. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by getmembers(). """ directories = [] if members is None: members = self for tarinfo in members: if tarinfo.isdir(): # Extract directories with a safe mode. directories.append(tarinfo) tarinfo = copy.copy(tarinfo) tarinfo.mode = 0o700 # Do not set_attrs directories, as we will do that further down self.extract(tarinfo, path, set_attrs=not tarinfo.isdir()) # Reverse sort directories. directories.sort(key=lambda a: a.name) directories.reverse() # Set correct owner, mtime and filemode on directories. for tarinfo in directories: dirpath = os.path.join(path, tarinfo.name) try: self.chown(tarinfo, dirpath) self.utime(tarinfo, dirpath) self.chmod(tarinfo, dirpath) except ExtractError as e: if self.errorlevel > 1: raise else: self._dbg(1, "tarfile: %s" % e) def extract(self, member, path="", set_attrs=True): """Extract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a TarInfo object. You can specify a different directory using `path'. File attributes (owner, mtime, mode) are set unless `set_attrs' is False. """ self._check("r") if isinstance(member, str): tarinfo = self.getmember(member) else: tarinfo = member # Prepare the link target for makelink(). if tarinfo.islnk(): tarinfo._link_target = os.path.join(path, tarinfo.linkname) try: self._extract_member(tarinfo, os.path.join(path, tarinfo.name), set_attrs=set_attrs) except EnvironmentError as e: if self.errorlevel > 0: raise else: if e.filename is None: self._dbg(1, "tarfile: %s" % e.strerror) else: self._dbg(1, "tarfile: %s %r" % (e.strerror, e.filename)) except ExtractError as e: if self.errorlevel > 1: raise else: self._dbg(1, "tarfile: %s" % e) def extractfile(self, member): """Extract a member from the archive as a file object. `member' may be a filename or a TarInfo object. If `member' is a regular file, a file-like object is returned. If `member' is a link, a file-like object is constructed from the link's target. If `member' is none of the above, None is returned. The file-like object is read-only and provides the following methods: read(), readline(), readlines(), seek() and tell() """ self._check("r") if isinstance(member, str): tarinfo = self.getmember(member) else: tarinfo = member if tarinfo.isreg(): return self.fileobject(self, tarinfo) elif tarinfo.type not in SUPPORTED_TYPES: # If a member's type is unknown, it is treated as a # regular file. return self.fileobject(self, tarinfo) elif tarinfo.islnk() or tarinfo.issym(): if isinstance(self.fileobj, _Stream): # A small but ugly workaround for the case that someone tries # to extract a (sym)link as a file-object from a non-seekable # stream of tar blocks. raise StreamError("cannot extract (sym)link as file object") else: # A (sym)link's file object is its target's file object. return self.extractfile(self._find_link_target(tarinfo)) else: # If there's no data associated with the member (directory, chrdev, # blkdev, etc.), return None instead of a file object. return None def _extract_member(self, tarinfo, targetpath, set_attrs=True): """Extract the TarInfo object tarinfo to a physical file called targetpath. """ # Fetch the TarInfo object for the given name # and build the destination pathname, replacing # forward slashes to platform specific separators. targetpath = targetpath.rstrip("/") targetpath = targetpath.replace("/", os.sep) # Create all upper directories. upperdirs = os.path.dirname(targetpath) if upperdirs and not os.path.exists(upperdirs): # Create directories that are not part of the archive with # default permissions. os.makedirs(upperdirs) if tarinfo.islnk() or tarinfo.issym(): self._dbg(1, "%s -> %s" % (tarinfo.name, tarinfo.linkname)) else: self._dbg(1, tarinfo.name) if tarinfo.isreg(): self.makefile(tarinfo, targetpath) elif tarinfo.isdir(): self.makedir(tarinfo, targetpath) elif tarinfo.isfifo(): self.makefifo(tarinfo, targetpath) elif tarinfo.ischr() or tarinfo.isblk(): self.makedev(tarinfo, targetpath) elif tarinfo.islnk() or tarinfo.issym(): self.makelink(tarinfo, targetpath) elif tarinfo.type not in SUPPORTED_TYPES: self.makeunknown(tarinfo, targetpath) else: self.makefile(tarinfo, targetpath) if set_attrs: self.chown(tarinfo, targetpath) if not tarinfo.issym(): self.chmod(tarinfo, targetpath) self.utime(tarinfo, targetpath) #-------------------------------------------------------------------------- # Below are the different file methods. They are called via # _extract_member() when extract() is called. They can be replaced in a # subclass to implement other functionality. def makedir(self, tarinfo, targetpath): """Make a directory called targetpath. """ try: # Use a safe mode for the directory, the real mode is set # later in _extract_member(). os.mkdir(targetpath, 0o700) except EnvironmentError as e: if e.errno != errno.EEXIST: raise def makefile(self, tarinfo, targetpath): """Make a file called targetpath. """ source = self.fileobj source.seek(tarinfo.offset_data) target = bltn_open(targetpath, "wb") if tarinfo.sparse is not None: for offset, size in tarinfo.sparse: target.seek(offset) copyfileobj(source, target, size) else: copyfileobj(source, target, tarinfo.size) target.seek(tarinfo.size) target.truncate() target.close() def makeunknown(self, tarinfo, targetpath): """Make a file from a TarInfo object with an unknown type at targetpath. """ self.makefile(tarinfo, targetpath) self._dbg(1, "tarfile: Unknown file type %r, " \ "extracted as regular file." % tarinfo.type) def makefifo(self, tarinfo, targetpath): """Make a fifo called targetpath. """ if hasattr(os, "mkfifo"): os.mkfifo(targetpath) else: raise ExtractError("fifo not supported by system") def makedev(self, tarinfo, targetpath): """Make a character or block device called targetpath. """ if not hasattr(os, "mknod") or not hasattr(os, "makedev"): raise ExtractError("special devices not supported by system") mode = tarinfo.mode if tarinfo.isblk(): mode |= stat.S_IFBLK else: mode |= stat.S_IFCHR os.mknod(targetpath, mode, os.makedev(tarinfo.devmajor, tarinfo.devminor)) def makelink(self, tarinfo, targetpath): """Make a (symbolic) link called targetpath. If it cannot be created (platform limitation), we try to make a copy of the referenced file instead of a link. """ try: # For systems that support symbolic and hard links. if tarinfo.issym(): os.symlink(tarinfo.linkname, targetpath) else: # See extract(). if os.path.exists(tarinfo._link_target): os.link(tarinfo._link_target, targetpath) else: self._extract_member(self._find_link_target(tarinfo), targetpath) except symlink_exception: if tarinfo.issym(): linkpath = os.path.join(os.path.dirname(tarinfo.name), tarinfo.linkname) else: linkpath = tarinfo.linkname else: try: self._extract_member(self._find_link_target(tarinfo), targetpath) except KeyError: raise ExtractError("unable to resolve link inside archive") def chown(self, tarinfo, targetpath): """Set owner of targetpath according to tarinfo. """ if pwd and hasattr(os, "geteuid") and os.geteuid() == 0: # We have to be root to do so. try: g = grp.getgrnam(tarinfo.gname)[2] except KeyError: g = tarinfo.gid try: u = pwd.getpwnam(tarinfo.uname)[2] except KeyError: u = tarinfo.uid try: if tarinfo.issym() and hasattr(os, "lchown"): os.lchown(targetpath, u, g) else: if sys.platform != "os2emx": os.chown(targetpath, u, g) except EnvironmentError as e: raise ExtractError("could not change owner") def chmod(self, tarinfo, targetpath): """Set file permissions of targetpath according to tarinfo. """ if hasattr(os, 'chmod'): try: os.chmod(targetpath, tarinfo.mode) except EnvironmentError as e: raise ExtractError("could not change mode") def utime(self, tarinfo, targetpath): """Set modification time of targetpath according to tarinfo. """ if not hasattr(os, 'utime'): return try: os.utime(targetpath, (tarinfo.mtime, tarinfo.mtime)) except EnvironmentError as e: raise ExtractError("could not change modification time") #-------------------------------------------------------------------------- def next(self): """Return the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. """ self._check("ra") if self.firstmember is not None: m = self.firstmember self.firstmember = None return m # Read the next block. self.fileobj.seek(self.offset) tarinfo = None while True: try: tarinfo = self.tarinfo.fromtarfile(self) except EOFHeaderError as e: if self.ignore_zeros: self._dbg(2, "0x%X: %s" % (self.offset, e)) self.offset += BLOCKSIZE continue except InvalidHeaderError as e: if self.ignore_zeros: self._dbg(2, "0x%X: %s" % (self.offset, e)) self.offset += BLOCKSIZE continue elif self.offset == 0: raise ReadError(str(e)) except EmptyHeaderError: if self.offset == 0: raise ReadError("empty file") except TruncatedHeaderError as e: if self.offset == 0: raise ReadError(str(e)) except SubsequentHeaderError as e: raise ReadError(str(e)) break if tarinfo is not None: self.members.append(tarinfo) else: self._loaded = True return tarinfo #-------------------------------------------------------------------------- # Little helper methods: def _getmember(self, name, tarinfo=None, normalize=False): """Find an archive member by name from bottom to top. If tarinfo is given, it is used as the starting point. """ # Ensure that all members have been loaded. members = self.getmembers() # Limit the member search list up to tarinfo. if tarinfo is not None: members = members[:members.index(tarinfo)] if normalize: name = os.path.normpath(name) for member in reversed(members): if normalize: member_name = os.path.normpath(member.name) else: member_name = member.name if name == member_name: return member def _load(self): """Read through the entire archive file and look for readable members. """ while True: tarinfo = self.next() if tarinfo is None: break self._loaded = True def _check(self, mode=None): """Check if TarFile is still open, and if the operation's mode corresponds to TarFile's mode. """ if self.closed: raise IOError("%s is closed" % self.__class__.__name__) if mode is not None and self.mode not in mode: raise IOError("bad operation for mode %r" % self.mode) def _find_link_target(self, tarinfo): """Find the target member of a symlink or hardlink member in the archive. """ if tarinfo.issym(): # Always search the entire archive. linkname = os.path.dirname(tarinfo.name) + "/" + tarinfo.linkname limit = None else: # Search the archive before the link, because a hard link is # just a reference to an already archived file. linkname = tarinfo.linkname limit = tarinfo member = self._getmember(linkname, tarinfo=limit, normalize=True) if member is None: raise KeyError("linkname %r not found" % linkname) return member def __iter__(self): """Provide an iterator object. """ if self._loaded: return iter(self.members) else: return TarIter(self) def _dbg(self, level, msg): """Write debugging output to sys.stderr. """ if level <= self.debug: print(msg, file=sys.stderr) def __enter__(self): self._check() return self def __exit__(self, type, value, traceback): if type is None: self.close() else: # An exception occurred. We must not call close() because # it would try to write end-of-archive blocks and padding. if not self._extfileobj: self.fileobj.close() self.closed = True # class TarFile class TarIter(object): """Iterator Class. for tarinfo in TarFile(...): suite... """ def __init__(self, tarfile): """Construct a TarIter object. """ self.tarfile = tarfile self.index = 0 def __iter__(self): """Return iterator object. """ return self def __next__(self): """Return the next item using TarFile's next() method. When all members have been read, set TarFile as _loaded. """ # Fix for SF #1100429: Under rare circumstances it can # happen that getmembers() is called during iteration, # which will cause TarIter to stop prematurely. if not self.tarfile._loaded: tarinfo = self.tarfile.next() if not tarinfo: self.tarfile._loaded = True raise StopIteration else: try: tarinfo = self.tarfile.members[self.index] except IndexError: raise StopIteration self.index += 1 return tarinfo next = __next__ # for Python 2.x #-------------------- # exported functions #-------------------- def is_tarfile(name): """Return True if name points to a tar archive that we are able to handle, else return False. """ try: t = open(name) t.close() return True except TarError: return False bltn_open = open open = TarFile.open PK!#g_backport/__init__.pynu["""Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. """ PK!y}} markers.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # """ Parser for the environment markers micro-language defined in PEP 508. """ # Note: In PEP 345, the micro-language was Python compatible, so the ast # module could be used to parse it. However, PEP 508 introduced operators such # as ~= and === which aren't in Python, necessitating a different approach. import os import re import sys import platform from .compat import string_types from .util import in_venv, parse_marker from .version import NormalizedVersion as NV __all__ = ['interpret'] _VERSION_PATTERN = re.compile(r'((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")') def _is_literal(o): if not isinstance(o, string_types) or not o: return False return o[0] in '\'"' def _get_versions(s): result = [] for m in _VERSION_PATTERN.finditer(s): result.append(NV(m.groups()[0])) return set(result) class Evaluator(object): """ This class is used to evaluate marker expessions. """ operations = { '==': lambda x, y: x == y, '===': lambda x, y: x == y, '~=': lambda x, y: x == y or x > y, '!=': lambda x, y: x != y, '<': lambda x, y: x < y, '<=': lambda x, y: x == y or x < y, '>': lambda x, y: x > y, '>=': lambda x, y: x == y or x > y, 'and': lambda x, y: x and y, 'or': lambda x, y: x or y, 'in': lambda x, y: x in y, 'not in': lambda x, y: x not in y, } def evaluate(self, expr, context): """ Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. """ if isinstance(expr, string_types): if expr[0] in '\'"': result = expr[1:-1] else: if expr not in context: raise SyntaxError('unknown variable: %s' % expr) result = context[expr] else: assert isinstance(expr, dict) op = expr['op'] if op not in self.operations: raise NotImplementedError('op not implemented: %s' % op) elhs = expr['lhs'] erhs = expr['rhs'] if _is_literal(expr['lhs']) and _is_literal(expr['rhs']): raise SyntaxError('invalid comparison: %s %s %s' % (elhs, op, erhs)) lhs = self.evaluate(elhs, context) rhs = self.evaluate(erhs, context) if ((elhs == 'python_version' or erhs == 'python_version') and op in ('<', '<=', '>', '>=', '===', '==', '!=', '~=')): lhs = NV(lhs) rhs = NV(rhs) elif elhs == 'python_version' and op in ('in', 'not in'): lhs = NV(lhs) rhs = _get_versions(rhs) result = self.operations[op](lhs, rhs) return result def default_context(): def format_full_version(info): version = '%s.%s.%s' % (info.major, info.minor, info.micro) kind = info.releaselevel if kind != 'final': version += kind[0] + str(info.serial) return version if hasattr(sys, 'implementation'): implementation_version = format_full_version(sys.implementation.version) implementation_name = sys.implementation.name else: implementation_version = '0' implementation_name = '' result = { 'implementation_name': implementation_name, 'implementation_version': implementation_version, 'os_name': os.name, 'platform_machine': platform.machine(), 'platform_python_implementation': platform.python_implementation(), 'platform_release': platform.release(), 'platform_system': platform.system(), 'platform_version': platform.version(), 'platform_in_venv': str(in_venv()), 'python_full_version': platform.python_version(), 'python_version': platform.python_version()[:3], 'sys_platform': sys.platform, } return result DEFAULT_CONTEXT = default_context() del default_context evaluator = Evaluator() def interpret(marker, execution_context=None): """ Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping """ try: expr, rest = parse_marker(marker) except Exception as e: raise SyntaxError('Unable to interpret marker syntax: %s: %s' % (marker, e)) if rest and rest[0] != '#': raise SyntaxError('unexpected trailing data in marker: %s: %s' % (marker, rest)) context = dict(DEFAULT_CONTEXT) if execution_context: context.update(execution_context) return evaluator.evaluate(expr, context) PK!ՀD*D* resources.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013-2017 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import bisect import io import logging import os import pkgutil import sys import types import zipimport from . import DistlibException from .util import cached_property, get_cache_base, Cache logger = logging.getLogger(__name__) cache = None # created when needed class ResourceCache(Cache): def __init__(self, base=None): if base is None: # Use native string to avoid issues on 2.x: see Python #20140. base = os.path.join(get_cache_base(), str('resource-cache')) super(ResourceCache, self).__init__(base) def is_stale(self, resource, path): """ Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. """ # Cache invalidation is a hard problem :-) return True def get(self, resource): """ Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. """ prefix, path = resource.finder.get_cache_info(resource) if prefix is None: result = path else: result = os.path.join(self.base, self.prefix_to_dir(prefix), path) dirname = os.path.dirname(result) if not os.path.isdir(dirname): os.makedirs(dirname) if not os.path.exists(result): stale = True else: stale = self.is_stale(resource, path) if stale: # write the bytes of the resource to the cache location with open(result, 'wb') as f: f.write(resource.bytes) return result class ResourceBase(object): def __init__(self, finder, name): self.finder = finder self.name = name class Resource(ResourceBase): """ A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. """ is_container = False # Backwards compatibility def as_stream(self): """ Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. """ return self.finder.get_stream(self) @cached_property def file_path(self): global cache if cache is None: cache = ResourceCache() return cache.get(self) @cached_property def bytes(self): return self.finder.get_bytes(self) @cached_property def size(self): return self.finder.get_size(self) class ResourceContainer(ResourceBase): is_container = True # Backwards compatibility @cached_property def resources(self): return self.finder.get_resources(self) class ResourceFinder(object): """ Resource finder for file system resources. """ if sys.platform.startswith('java'): skipped_extensions = ('.pyc', '.pyo', '.class') else: skipped_extensions = ('.pyc', '.pyo') def __init__(self, module): self.module = module self.loader = getattr(module, '__loader__', None) self.base = os.path.dirname(getattr(module, '__file__', '')) def _adjust_path(self, path): return os.path.realpath(path) def _make_path(self, resource_name): # Issue #50: need to preserve type of path on Python 2.x # like os.path._get_sep if isinstance(resource_name, bytes): # should only happen on 2.x sep = b'/' else: sep = '/' parts = resource_name.split(sep) parts.insert(0, self.base) result = os.path.join(*parts) return self._adjust_path(result) def _find(self, path): return os.path.exists(path) def get_cache_info(self, resource): return None, resource.path def find(self, resource_name): path = self._make_path(resource_name) if not self._find(path): result = None else: if self._is_directory(path): result = ResourceContainer(self, resource_name) else: result = Resource(self, resource_name) result.path = path return result def get_stream(self, resource): return open(resource.path, 'rb') def get_bytes(self, resource): with open(resource.path, 'rb') as f: return f.read() def get_size(self, resource): return os.path.getsize(resource.path) def get_resources(self, resource): def allowed(f): return (f != '__pycache__' and not f.endswith(self.skipped_extensions)) return set([f for f in os.listdir(resource.path) if allowed(f)]) def is_container(self, resource): return self._is_directory(resource.path) _is_directory = staticmethod(os.path.isdir) def iterator(self, resource_name): resource = self.find(resource_name) if resource is not None: todo = [resource] while todo: resource = todo.pop(0) yield resource if resource.is_container: rname = resource.name for name in resource.resources: if not rname: new_name = name else: new_name = '/'.join([rname, name]) child = self.find(new_name) if child.is_container: todo.append(child) else: yield child class ZipResourceFinder(ResourceFinder): """ Resource finder for resources in .zip files. """ def __init__(self, module): super(ZipResourceFinder, self).__init__(module) archive = self.loader.archive self.prefix_len = 1 + len(archive) # PyPy doesn't have a _files attr on zipimporter, and you can't set one if hasattr(self.loader, '_files'): self._files = self.loader._files else: self._files = zipimport._zip_directory_cache[archive] self.index = sorted(self._files) def _adjust_path(self, path): return path def _find(self, path): path = path[self.prefix_len:] if path in self._files: result = True else: if path and path[-1] != os.sep: path = path + os.sep i = bisect.bisect(self.index, path) try: result = self.index[i].startswith(path) except IndexError: result = False if not result: logger.debug('_find failed: %r %r', path, self.loader.prefix) else: logger.debug('_find worked: %r %r', path, self.loader.prefix) return result def get_cache_info(self, resource): prefix = self.loader.archive path = resource.path[1 + len(prefix):] return prefix, path def get_bytes(self, resource): return self.loader.get_data(resource.path) def get_stream(self, resource): return io.BytesIO(self.get_bytes(resource)) def get_size(self, resource): path = resource.path[self.prefix_len:] return self._files[path][3] def get_resources(self, resource): path = resource.path[self.prefix_len:] if path and path[-1] != os.sep: path += os.sep plen = len(path) result = set() i = bisect.bisect(self.index, path) while i < len(self.index): if not self.index[i].startswith(path): break s = self.index[i][plen:] result.add(s.split(os.sep, 1)[0]) # only immediate children i += 1 return result def _is_directory(self, path): path = path[self.prefix_len:] if path and path[-1] != os.sep: path += os.sep i = bisect.bisect(self.index, path) try: result = self.index[i].startswith(path) except IndexError: result = False return result _finder_registry = { type(None): ResourceFinder, zipimport.zipimporter: ZipResourceFinder } try: # In Python 3.6, _frozen_importlib -> _frozen_importlib_external try: import _frozen_importlib_external as _fi except ImportError: import _frozen_importlib as _fi _finder_registry[_fi.SourceFileLoader] = ResourceFinder _finder_registry[_fi.FileFinder] = ResourceFinder # See issue #146 _finder_registry[_fi.SourcelessFileLoader] = ResourceFinder del _fi except (ImportError, AttributeError): pass def register_finder(loader, finder_maker): _finder_registry[type(loader)] = finder_maker _finder_cache = {} def finder(package): """ Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. """ if package in _finder_cache: result = _finder_cache[package] else: if package not in sys.modules: __import__(package) module = sys.modules[package] path = getattr(module, '__path__', None) if path is None: raise DistlibException('You cannot get a finder for a module, ' 'only for a package') loader = getattr(module, '__loader__', None) finder_maker = _finder_registry.get(type(loader)) if finder_maker is None: raise DistlibException('Unable to locate finder for %r' % package) result = finder_maker(module) _finder_cache[package] = result return result _dummy_module = types.ModuleType(str('__dummy__')) def finder_for_path(path): """ Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. """ result = None # calls any path hooks, gets importer into cache pkgutil.get_importer(path) loader = sys.path_importer_cache.get(path) finder = _finder_registry.get(type(loader)) if finder: module = _dummy_module module.__file__ = os.path.join(path, '') module.__loader__ = loader result = finder(module) return result PK!]oEE __init__.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2019 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import logging __version__ = '0.3.3' class DistlibException(Exception): pass try: from logging import NullHandler except ImportError: # pragma: no cover class NullHandler(logging.Handler): def handle(self, record): pass def emit(self, record): pass def createLock(self): self.lock = None logger = logging.getLogger(__name__) logger.addHandler(NullHandler()) PK!wheel.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2013-2020 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # from __future__ import unicode_literals import base64 import codecs import datetime from email import message_from_file import hashlib import imp import json import logging import os import posixpath import re import shutil import sys import tempfile import zipfile from . import __version__, DistlibException from .compat import sysconfig, ZipFile, fsdecode, text_type, filter from .database import InstalledDistribution from .metadata import (Metadata, METADATA_FILENAME, WHEEL_METADATA_FILENAME, LEGACY_METADATA_FILENAME) from .util import (FileOperator, convert_path, CSVReader, CSVWriter, Cache, cached_property, get_cache_base, read_exports, tempdir, get_platform) from .version import NormalizedVersion, UnsupportedVersionError logger = logging.getLogger(__name__) cache = None # created when needed if hasattr(sys, 'pypy_version_info'): # pragma: no cover IMP_PREFIX = 'pp' elif sys.platform.startswith('java'): # pragma: no cover IMP_PREFIX = 'jy' elif sys.platform == 'cli': # pragma: no cover IMP_PREFIX = 'ip' else: IMP_PREFIX = 'cp' VER_SUFFIX = sysconfig.get_config_var('py_version_nodot') if not VER_SUFFIX: # pragma: no cover VER_SUFFIX = '%s%s' % sys.version_info[:2] PYVER = 'py' + VER_SUFFIX IMPVER = IMP_PREFIX + VER_SUFFIX ARCH = get_platform().replace('-', '_').replace('.', '_') ABI = sysconfig.get_config_var('SOABI') if ABI and ABI.startswith('cpython-'): ABI = ABI.replace('cpython-', 'cp').split('-')[0] else: def _derive_abi(): parts = ['cp', VER_SUFFIX] if sysconfig.get_config_var('Py_DEBUG'): parts.append('d') if sysconfig.get_config_var('WITH_PYMALLOC'): parts.append('m') if sysconfig.get_config_var('Py_UNICODE_SIZE') == 4: parts.append('u') return ''.join(parts) ABI = _derive_abi() del _derive_abi FILENAME_RE = re.compile(r''' (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ ''', re.IGNORECASE | re.VERBOSE) NAME_VERSION_RE = re.compile(r''' (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ ''', re.IGNORECASE | re.VERBOSE) SHEBANG_RE = re.compile(br'\s*#![^\r\n]*') SHEBANG_DETAIL_RE = re.compile(br'^(\s*#!("[^"]+"|\S+))\s+(.*)$') SHEBANG_PYTHON = b'#!python' SHEBANG_PYTHONW = b'#!pythonw' if os.sep == '/': to_posix = lambda o: o else: to_posix = lambda o: o.replace(os.sep, '/') class Mounter(object): def __init__(self): self.impure_wheels = {} self.libs = {} def add(self, pathname, extensions): self.impure_wheels[pathname] = extensions self.libs.update(extensions) def remove(self, pathname): extensions = self.impure_wheels.pop(pathname) for k, v in extensions: if k in self.libs: del self.libs[k] def find_module(self, fullname, path=None): if fullname in self.libs: result = self else: result = None return result def load_module(self, fullname): if fullname in sys.modules: result = sys.modules[fullname] else: if fullname not in self.libs: raise ImportError('unable to find extension for %s' % fullname) result = imp.load_dynamic(fullname, self.libs[fullname]) result.__loader__ = self parts = fullname.rsplit('.', 1) if len(parts) > 1: result.__package__ = parts[0] return result _hook = Mounter() class Wheel(object): """ Class to build and install from Wheel files (PEP 427). """ wheel_version = (1, 1) hash_kind = 'sha256' def __init__(self, filename=None, sign=False, verify=False): """ Initialise an instance using a (valid) filename. """ self.sign = sign self.should_verify = verify self.buildver = '' self.pyver = [PYVER] self.abi = ['none'] self.arch = ['any'] self.dirname = os.getcwd() if filename is None: self.name = 'dummy' self.version = '0.1' self._filename = self.filename else: m = NAME_VERSION_RE.match(filename) if m: info = m.groupdict('') self.name = info['nm'] # Reinstate the local version separator self.version = info['vn'].replace('_', '-') self.buildver = info['bn'] self._filename = self.filename else: dirname, filename = os.path.split(filename) m = FILENAME_RE.match(filename) if not m: raise DistlibException('Invalid name or ' 'filename: %r' % filename) if dirname: self.dirname = os.path.abspath(dirname) self._filename = filename info = m.groupdict('') self.name = info['nm'] self.version = info['vn'] self.buildver = info['bn'] self.pyver = info['py'].split('.') self.abi = info['bi'].split('.') self.arch = info['ar'].split('.') @property def filename(self): """ Build and return a filename from the various components. """ if self.buildver: buildver = '-' + self.buildver else: buildver = '' pyver = '.'.join(self.pyver) abi = '.'.join(self.abi) arch = '.'.join(self.arch) # replace - with _ as a local version separator version = self.version.replace('-', '_') return '%s-%s%s-%s-%s-%s.whl' % (self.name, version, buildver, pyver, abi, arch) @property def exists(self): path = os.path.join(self.dirname, self.filename) return os.path.isfile(path) @property def tags(self): for pyver in self.pyver: for abi in self.abi: for arch in self.arch: yield pyver, abi, arch @cached_property def metadata(self): pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) info_dir = '%s.dist-info' % name_ver wrapper = codecs.getreader('utf-8') with ZipFile(pathname, 'r') as zf: wheel_metadata = self.get_wheel_metadata(zf) wv = wheel_metadata['Wheel-Version'].split('.', 1) file_version = tuple([int(i) for i in wv]) # if file_version < (1, 1): # fns = [WHEEL_METADATA_FILENAME, METADATA_FILENAME, # LEGACY_METADATA_FILENAME] # else: # fns = [WHEEL_METADATA_FILENAME, METADATA_FILENAME] fns = [WHEEL_METADATA_FILENAME, LEGACY_METADATA_FILENAME] result = None for fn in fns: try: metadata_filename = posixpath.join(info_dir, fn) with zf.open(metadata_filename) as bf: wf = wrapper(bf) result = Metadata(fileobj=wf) if result: break except KeyError: pass if not result: raise ValueError('Invalid wheel, because metadata is ' 'missing: looked in %s' % ', '.join(fns)) return result def get_wheel_metadata(self, zf): name_ver = '%s-%s' % (self.name, self.version) info_dir = '%s.dist-info' % name_ver metadata_filename = posixpath.join(info_dir, 'WHEEL') with zf.open(metadata_filename) as bf: wf = codecs.getreader('utf-8')(bf) message = message_from_file(wf) return dict(message) @cached_property def info(self): pathname = os.path.join(self.dirname, self.filename) with ZipFile(pathname, 'r') as zf: result = self.get_wheel_metadata(zf) return result def process_shebang(self, data): m = SHEBANG_RE.match(data) if m: end = m.end() shebang, data_after_shebang = data[:end], data[end:] # Preserve any arguments after the interpreter if b'pythonw' in shebang.lower(): shebang_python = SHEBANG_PYTHONW else: shebang_python = SHEBANG_PYTHON m = SHEBANG_DETAIL_RE.match(shebang) if m: args = b' ' + m.groups()[-1] else: args = b'' shebang = shebang_python + args data = shebang + data_after_shebang else: cr = data.find(b'\r') lf = data.find(b'\n') if cr < 0 or cr > lf: term = b'\n' else: if data[cr:cr + 2] == b'\r\n': term = b'\r\n' else: term = b'\r' data = SHEBANG_PYTHON + term + data return data def get_hash(self, data, hash_kind=None): if hash_kind is None: hash_kind = self.hash_kind try: hasher = getattr(hashlib, hash_kind) except AttributeError: raise DistlibException('Unsupported hash algorithm: %r' % hash_kind) result = hasher(data).digest() result = base64.urlsafe_b64encode(result).rstrip(b'=').decode('ascii') return hash_kind, result def write_record(self, records, record_path, base): records = list(records) # make a copy, as mutated p = to_posix(os.path.relpath(record_path, base)) records.append((p, '', '')) with CSVWriter(record_path) as writer: for row in records: writer.writerow(row) def write_records(self, info, libdir, archive_paths): records = [] distinfo, info_dir = info hasher = getattr(hashlib, self.hash_kind) for ap, p in archive_paths: with open(p, 'rb') as f: data = f.read() digest = '%s=%s' % self.get_hash(data) size = os.path.getsize(p) records.append((ap, digest, size)) p = os.path.join(distinfo, 'RECORD') self.write_record(records, p, libdir) ap = to_posix(os.path.join(info_dir, 'RECORD')) archive_paths.append((ap, p)) def build_zip(self, pathname, archive_paths): with ZipFile(pathname, 'w', zipfile.ZIP_DEFLATED) as zf: for ap, p in archive_paths: logger.debug('Wrote %s to %s in wheel', p, ap) zf.write(p, ap) def build(self, paths, tags=None, wheel_version=None): """ Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. """ if tags is None: tags = {} libkey = list(filter(lambda o: o in paths, ('purelib', 'platlib')))[0] if libkey == 'platlib': is_pure = 'false' default_pyver = [IMPVER] default_abi = [ABI] default_arch = [ARCH] else: is_pure = 'true' default_pyver = [PYVER] default_abi = ['none'] default_arch = ['any'] self.pyver = tags.get('pyver', default_pyver) self.abi = tags.get('abi', default_abi) self.arch = tags.get('arch', default_arch) libdir = paths[libkey] name_ver = '%s-%s' % (self.name, self.version) data_dir = '%s.data' % name_ver info_dir = '%s.dist-info' % name_ver archive_paths = [] # First, stuff which is not in site-packages for key in ('data', 'headers', 'scripts'): if key not in paths: continue path = paths[key] if os.path.isdir(path): for root, dirs, files in os.walk(path): for fn in files: p = fsdecode(os.path.join(root, fn)) rp = os.path.relpath(p, path) ap = to_posix(os.path.join(data_dir, key, rp)) archive_paths.append((ap, p)) if key == 'scripts' and not p.endswith('.exe'): with open(p, 'rb') as f: data = f.read() data = self.process_shebang(data) with open(p, 'wb') as f: f.write(data) # Now, stuff which is in site-packages, other than the # distinfo stuff. path = libdir distinfo = None for root, dirs, files in os.walk(path): if root == path: # At the top level only, save distinfo for later # and skip it for now for i, dn in enumerate(dirs): dn = fsdecode(dn) if dn.endswith('.dist-info'): distinfo = os.path.join(root, dn) del dirs[i] break assert distinfo, '.dist-info directory expected, not found' for fn in files: # comment out next suite to leave .pyc files in if fsdecode(fn).endswith(('.pyc', '.pyo')): continue p = os.path.join(root, fn) rp = to_posix(os.path.relpath(p, path)) archive_paths.append((rp, p)) # Now distinfo. Assumed to be flat, i.e. os.listdir is enough. files = os.listdir(distinfo) for fn in files: if fn not in ('RECORD', 'INSTALLER', 'SHARED', 'WHEEL'): p = fsdecode(os.path.join(distinfo, fn)) ap = to_posix(os.path.join(info_dir, fn)) archive_paths.append((ap, p)) wheel_metadata = [ 'Wheel-Version: %d.%d' % (wheel_version or self.wheel_version), 'Generator: distlib %s' % __version__, 'Root-Is-Purelib: %s' % is_pure, ] for pyver, abi, arch in self.tags: wheel_metadata.append('Tag: %s-%s-%s' % (pyver, abi, arch)) p = os.path.join(distinfo, 'WHEEL') with open(p, 'w') as f: f.write('\n'.join(wheel_metadata)) ap = to_posix(os.path.join(info_dir, 'WHEEL')) archive_paths.append((ap, p)) # sort the entries by archive path. Not needed by any spec, but it # keeps the archive listing and RECORD tidier than they would otherwise # be. Use the number of path segments to keep directory entries together, # and keep the dist-info stuff at the end. def sorter(t): ap = t[0] n = ap.count('/') if '.dist-info' in ap: n += 10000 return (n, ap) archive_paths = sorted(archive_paths, key=sorter) # Now, at last, RECORD. # Paths in here are archive paths - nothing else makes sense. self.write_records((distinfo, info_dir), libdir, archive_paths) # Now, ready to build the zip file pathname = os.path.join(self.dirname, self.filename) self.build_zip(pathname, archive_paths) return pathname def skip_entry(self, arcname): """ Determine whether an archive entry should be skipped when verifying or installing. """ # The signature file won't be in RECORD, # and we don't currently don't do anything with it # We also skip directories, as they won't be in RECORD # either. See: # # https://github.com/pypa/wheel/issues/294 # https://github.com/pypa/wheel/issues/287 # https://github.com/pypa/wheel/pull/289 # return arcname.endswith(('/', '/RECORD.jws')) def install(self, paths, maker, **kwargs): """ Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. If kwarg ``bytecode_hashed_invalidation`` is True, written bytecode will try to use file-hash based invalidation (PEP-552) on supported interpreter versions (CPython 2.7+). The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. """ dry_run = maker.dry_run warner = kwargs.get('warner') lib_only = kwargs.get('lib_only', False) bc_hashed_invalidation = kwargs.get('bytecode_hashed_invalidation', False) pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) data_dir = '%s.data' % name_ver info_dir = '%s.dist-info' % name_ver metadata_name = posixpath.join(info_dir, LEGACY_METADATA_FILENAME) wheel_metadata_name = posixpath.join(info_dir, 'WHEEL') record_name = posixpath.join(info_dir, 'RECORD') wrapper = codecs.getreader('utf-8') with ZipFile(pathname, 'r') as zf: with zf.open(wheel_metadata_name) as bwf: wf = wrapper(bwf) message = message_from_file(wf) wv = message['Wheel-Version'].split('.', 1) file_version = tuple([int(i) for i in wv]) if (file_version != self.wheel_version) and warner: warner(self.wheel_version, file_version) if message['Root-Is-Purelib'] == 'true': libdir = paths['purelib'] else: libdir = paths['platlib'] records = {} with zf.open(record_name) as bf: with CSVReader(stream=bf) as reader: for row in reader: p = row[0] records[p] = row data_pfx = posixpath.join(data_dir, '') info_pfx = posixpath.join(info_dir, '') script_pfx = posixpath.join(data_dir, 'scripts', '') # make a new instance rather than a copy of maker's, # as we mutate it fileop = FileOperator(dry_run=dry_run) fileop.record = True # so we can rollback if needed bc = not sys.dont_write_bytecode # Double negatives. Lovely! outfiles = [] # for RECORD writing # for script copying/shebang processing workdir = tempfile.mkdtemp() # set target dir later # we default add_launchers to False, as the # Python Launcher should be used instead maker.source_dir = workdir maker.target_dir = None try: for zinfo in zf.infolist(): arcname = zinfo.filename if isinstance(arcname, text_type): u_arcname = arcname else: u_arcname = arcname.decode('utf-8') if self.skip_entry(u_arcname): continue row = records[u_arcname] if row[2] and str(zinfo.file_size) != row[2]: raise DistlibException('size mismatch for ' '%s' % u_arcname) if row[1]: kind, value = row[1].split('=', 1) with zf.open(arcname) as bf: data = bf.read() _, digest = self.get_hash(data, kind) if digest != value: raise DistlibException('digest mismatch for ' '%s' % arcname) if lib_only and u_arcname.startswith((info_pfx, data_pfx)): logger.debug('lib_only: skipping %s', u_arcname) continue is_script = (u_arcname.startswith(script_pfx) and not u_arcname.endswith('.exe')) if u_arcname.startswith(data_pfx): _, where, rp = u_arcname.split('/', 2) outfile = os.path.join(paths[where], convert_path(rp)) else: # meant for site-packages. if u_arcname in (wheel_metadata_name, record_name): continue outfile = os.path.join(libdir, convert_path(u_arcname)) if not is_script: with zf.open(arcname) as bf: fileop.copy_stream(bf, outfile) # Issue #147: permission bits aren't preserved. Using # zf.extract(zinfo, libdir) should have worked, but didn't, # see https://www.thetopsites.net/article/53834422.shtml # So ... manually preserve permission bits as given in zinfo if os.name == 'posix': # just set the normal permission bits os.chmod(outfile, (zinfo.external_attr >> 16) & 0x1FF) outfiles.append(outfile) # Double check the digest of the written file if not dry_run and row[1]: with open(outfile, 'rb') as bf: data = bf.read() _, newdigest = self.get_hash(data, kind) if newdigest != digest: raise DistlibException('digest mismatch ' 'on write for ' '%s' % outfile) if bc and outfile.endswith('.py'): try: pyc = fileop.byte_compile(outfile, hashed_invalidation=bc_hashed_invalidation) outfiles.append(pyc) except Exception: # Don't give up if byte-compilation fails, # but log it and perhaps warn the user logger.warning('Byte-compilation failed', exc_info=True) else: fn = os.path.basename(convert_path(arcname)) workname = os.path.join(workdir, fn) with zf.open(arcname) as bf: fileop.copy_stream(bf, workname) dn, fn = os.path.split(outfile) maker.target_dir = dn filenames = maker.make(fn) fileop.set_executable_mode(filenames) outfiles.extend(filenames) if lib_only: logger.debug('lib_only: returning None') dist = None else: # Generate scripts # Try to get pydist.json so we can see if there are # any commands to generate. If this fails (e.g. because # of a legacy wheel), log a warning but don't give up. commands = None file_version = self.info['Wheel-Version'] if file_version == '1.0': # Use legacy info ep = posixpath.join(info_dir, 'entry_points.txt') try: with zf.open(ep) as bwf: epdata = read_exports(bwf) commands = {} for key in ('console', 'gui'): k = '%s_scripts' % key if k in epdata: commands['wrap_%s' % key] = d = {} for v in epdata[k].values(): s = '%s:%s' % (v.prefix, v.suffix) if v.flags: s += ' [%s]' % ','.join(v.flags) d[v.name] = s except Exception: logger.warning('Unable to read legacy script ' 'metadata, so cannot generate ' 'scripts') else: try: with zf.open(metadata_name) as bwf: wf = wrapper(bwf) commands = json.load(wf).get('extensions') if commands: commands = commands.get('python.commands') except Exception: logger.warning('Unable to read JSON metadata, so ' 'cannot generate scripts') if commands: console_scripts = commands.get('wrap_console', {}) gui_scripts = commands.get('wrap_gui', {}) if console_scripts or gui_scripts: script_dir = paths.get('scripts', '') if not os.path.isdir(script_dir): raise ValueError('Valid script path not ' 'specified') maker.target_dir = script_dir for k, v in console_scripts.items(): script = '%s = %s' % (k, v) filenames = maker.make(script) fileop.set_executable_mode(filenames) if gui_scripts: options = {'gui': True } for k, v in gui_scripts.items(): script = '%s = %s' % (k, v) filenames = maker.make(script, options) fileop.set_executable_mode(filenames) p = os.path.join(libdir, info_dir) dist = InstalledDistribution(p) # Write SHARED paths = dict(paths) # don't change passed in dict del paths['purelib'] del paths['platlib'] paths['lib'] = libdir p = dist.write_shared_locations(paths, dry_run) if p: outfiles.append(p) # Write RECORD dist.write_installed_files(outfiles, paths['prefix'], dry_run) return dist except Exception: # pragma: no cover logger.exception('installation failed.') fileop.rollback() raise finally: shutil.rmtree(workdir) def _get_dylib_cache(self): global cache if cache is None: # Use native string to avoid issues on 2.x: see Python #20140. base = os.path.join(get_cache_base(), str('dylib-cache'), '%s.%s' % sys.version_info[:2]) cache = Cache(base) return cache def _get_extensions(self): pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) info_dir = '%s.dist-info' % name_ver arcname = posixpath.join(info_dir, 'EXTENSIONS') wrapper = codecs.getreader('utf-8') result = [] with ZipFile(pathname, 'r') as zf: try: with zf.open(arcname) as bf: wf = wrapper(bf) extensions = json.load(wf) cache = self._get_dylib_cache() prefix = cache.prefix_to_dir(pathname) cache_base = os.path.join(cache.base, prefix) if not os.path.isdir(cache_base): os.makedirs(cache_base) for name, relpath in extensions.items(): dest = os.path.join(cache_base, convert_path(relpath)) if not os.path.exists(dest): extract = True else: file_time = os.stat(dest).st_mtime file_time = datetime.datetime.fromtimestamp(file_time) info = zf.getinfo(relpath) wheel_time = datetime.datetime(*info.date_time) extract = wheel_time > file_time if extract: zf.extract(relpath, cache_base) result.append((name, dest)) except KeyError: pass return result def is_compatible(self): """ Determine if a wheel is compatible with the running system. """ return is_compatible(self) def is_mountable(self): """ Determine if a wheel is asserted as mountable by its metadata. """ return True # for now - metadata details TBD def mount(self, append=False): pathname = os.path.abspath(os.path.join(self.dirname, self.filename)) if not self.is_compatible(): msg = 'Wheel %s not compatible with this Python.' % pathname raise DistlibException(msg) if not self.is_mountable(): msg = 'Wheel %s is marked as not mountable.' % pathname raise DistlibException(msg) if pathname in sys.path: logger.debug('%s already in path', pathname) else: if append: sys.path.append(pathname) else: sys.path.insert(0, pathname) extensions = self._get_extensions() if extensions: if _hook not in sys.meta_path: sys.meta_path.append(_hook) _hook.add(pathname, extensions) def unmount(self): pathname = os.path.abspath(os.path.join(self.dirname, self.filename)) if pathname not in sys.path: logger.debug('%s not in path', pathname) else: sys.path.remove(pathname) if pathname in _hook.impure_wheels: _hook.remove(pathname) if not _hook.impure_wheels: if _hook in sys.meta_path: sys.meta_path.remove(_hook) def verify(self): pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) data_dir = '%s.data' % name_ver info_dir = '%s.dist-info' % name_ver metadata_name = posixpath.join(info_dir, LEGACY_METADATA_FILENAME) wheel_metadata_name = posixpath.join(info_dir, 'WHEEL') record_name = posixpath.join(info_dir, 'RECORD') wrapper = codecs.getreader('utf-8') with ZipFile(pathname, 'r') as zf: with zf.open(wheel_metadata_name) as bwf: wf = wrapper(bwf) message = message_from_file(wf) wv = message['Wheel-Version'].split('.', 1) file_version = tuple([int(i) for i in wv]) # TODO version verification records = {} with zf.open(record_name) as bf: with CSVReader(stream=bf) as reader: for row in reader: p = row[0] records[p] = row for zinfo in zf.infolist(): arcname = zinfo.filename if isinstance(arcname, text_type): u_arcname = arcname else: u_arcname = arcname.decode('utf-8') # See issue #115: some wheels have .. in their entries, but # in the filename ... e.g. __main__..py ! So the check is # updated to look for .. in the directory portions p = u_arcname.split('/') if '..' in p: raise DistlibException('invalid entry in ' 'wheel: %r' % u_arcname) if self.skip_entry(u_arcname): continue row = records[u_arcname] if row[2] and str(zinfo.file_size) != row[2]: raise DistlibException('size mismatch for ' '%s' % u_arcname) if row[1]: kind, value = row[1].split('=', 1) with zf.open(arcname) as bf: data = bf.read() _, digest = self.get_hash(data, kind) if digest != value: raise DistlibException('digest mismatch for ' '%s' % arcname) def update(self, modifier, dest_dir=None, **kwargs): """ Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. """ def get_version(path_map, info_dir): version = path = None key = '%s/%s' % (info_dir, LEGACY_METADATA_FILENAME) if key not in path_map: key = '%s/PKG-INFO' % info_dir if key in path_map: path = path_map[key] version = Metadata(path=path).version return version, path def update_version(version, path): updated = None try: v = NormalizedVersion(version) i = version.find('-') if i < 0: updated = '%s+1' % version else: parts = [int(s) for s in version[i + 1:].split('.')] parts[-1] += 1 updated = '%s+%s' % (version[:i], '.'.join(str(i) for i in parts)) except UnsupportedVersionError: logger.debug('Cannot update non-compliant (PEP-440) ' 'version %r', version) if updated: md = Metadata(path=path) md.version = updated legacy = path.endswith(LEGACY_METADATA_FILENAME) md.write(path=path, legacy=legacy) logger.debug('Version updated from %r to %r', version, updated) pathname = os.path.join(self.dirname, self.filename) name_ver = '%s-%s' % (self.name, self.version) info_dir = '%s.dist-info' % name_ver record_name = posixpath.join(info_dir, 'RECORD') with tempdir() as workdir: with ZipFile(pathname, 'r') as zf: path_map = {} for zinfo in zf.infolist(): arcname = zinfo.filename if isinstance(arcname, text_type): u_arcname = arcname else: u_arcname = arcname.decode('utf-8') if u_arcname == record_name: continue if '..' in u_arcname: raise DistlibException('invalid entry in ' 'wheel: %r' % u_arcname) zf.extract(zinfo, workdir) path = os.path.join(workdir, convert_path(u_arcname)) path_map[u_arcname] = path # Remember the version. original_version, _ = get_version(path_map, info_dir) # Files extracted. Call the modifier. modified = modifier(path_map, **kwargs) if modified: # Something changed - need to build a new wheel. current_version, path = get_version(path_map, info_dir) if current_version and (current_version == original_version): # Add or update local version to signify changes. update_version(current_version, path) # Decide where the new wheel goes. if dest_dir is None: fd, newpath = tempfile.mkstemp(suffix='.whl', prefix='wheel-update-', dir=workdir) os.close(fd) else: if not os.path.isdir(dest_dir): raise DistlibException('Not a directory: %r' % dest_dir) newpath = os.path.join(dest_dir, self.filename) archive_paths = list(path_map.items()) distinfo = os.path.join(workdir, info_dir) info = distinfo, info_dir self.write_records(info, workdir, archive_paths) self.build_zip(newpath, archive_paths) if dest_dir is None: shutil.copyfile(newpath, pathname) return modified def _get_glibc_version(): import platform ver = platform.libc_ver() result = [] if ver[0] == 'glibc': for s in ver[1].split('.'): result.append(int(s) if s.isdigit() else 0) result = tuple(result) return result def compatible_tags(): """ Return (pyver, abi, arch) tuples compatible with this Python. """ versions = [VER_SUFFIX] major = VER_SUFFIX[0] for minor in range(sys.version_info[1] - 1, - 1, -1): versions.append(''.join([major, str(minor)])) abis = [] for suffix, _, _ in imp.get_suffixes(): if suffix.startswith('.abi'): abis.append(suffix.split('.', 2)[1]) abis.sort() if ABI != 'none': abis.insert(0, ABI) abis.append('none') result = [] arches = [ARCH] if sys.platform == 'darwin': m = re.match(r'(\w+)_(\d+)_(\d+)_(\w+)$', ARCH) if m: name, major, minor, arch = m.groups() minor = int(minor) matches = [arch] if arch in ('i386', 'ppc'): matches.append('fat') if arch in ('i386', 'ppc', 'x86_64'): matches.append('fat3') if arch in ('ppc64', 'x86_64'): matches.append('fat64') if arch in ('i386', 'x86_64'): matches.append('intel') if arch in ('i386', 'x86_64', 'intel', 'ppc', 'ppc64'): matches.append('universal') while minor >= 0: for match in matches: s = '%s_%s_%s_%s' % (name, major, minor, match) if s != ARCH: # already there arches.append(s) minor -= 1 # Most specific - our Python version, ABI and arch for abi in abis: for arch in arches: result.append((''.join((IMP_PREFIX, versions[0])), abi, arch)) # manylinux if abi != 'none' and sys.platform.startswith('linux'): arch = arch.replace('linux_', '') parts = _get_glibc_version() if len(parts) == 2: if parts >= (2, 5): result.append((''.join((IMP_PREFIX, versions[0])), abi, 'manylinux1_%s' % arch)) if parts >= (2, 12): result.append((''.join((IMP_PREFIX, versions[0])), abi, 'manylinux2010_%s' % arch)) if parts >= (2, 17): result.append((''.join((IMP_PREFIX, versions[0])), abi, 'manylinux2014_%s' % arch)) result.append((''.join((IMP_PREFIX, versions[0])), abi, 'manylinux_%s_%s_%s' % (parts[0], parts[1], arch))) # where no ABI / arch dependency, but IMP_PREFIX dependency for i, version in enumerate(versions): result.append((''.join((IMP_PREFIX, version)), 'none', 'any')) if i == 0: result.append((''.join((IMP_PREFIX, version[0])), 'none', 'any')) # no IMP_PREFIX, ABI or arch dependency for i, version in enumerate(versions): result.append((''.join(('py', version)), 'none', 'any')) if i == 0: result.append((''.join(('py', version[0])), 'none', 'any')) return set(result) COMPATIBLE_TAGS = compatible_tags() del compatible_tags def is_compatible(wheel, tags=None): if not isinstance(wheel, Wheel): wheel = Wheel(wheel) # assume it's a filename result = False if tags is None: tags = COMPATIBLE_TAGS for ver, abi, arch in tags: if ver in wheel.pyver and abi in wheel.abi and arch in wheel.arch: result = True break return result PK!@css database.pynu[# -*- coding: utf-8 -*- # # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """PEP 376 implementation.""" from __future__ import unicode_literals import base64 import codecs import contextlib import hashlib import logging import os import posixpath import sys import zipimport from . import DistlibException, resources from .compat import StringIO from .version import get_scheme, UnsupportedVersionError from .metadata import (Metadata, METADATA_FILENAME, WHEEL_METADATA_FILENAME, LEGACY_METADATA_FILENAME) from .util import (parse_requirement, cached_property, parse_name_and_version, read_exports, write_exports, CSVReader, CSVWriter) __all__ = ['Distribution', 'BaseInstalledDistribution', 'InstalledDistribution', 'EggInfoDistribution', 'DistributionPath'] logger = logging.getLogger(__name__) EXPORTS_FILENAME = 'pydist-exports.json' COMMANDS_FILENAME = 'pydist-commands.json' DIST_FILES = ('INSTALLER', METADATA_FILENAME, 'RECORD', 'REQUESTED', 'RESOURCES', EXPORTS_FILENAME, 'SHARED') DISTINFO_EXT = '.dist-info' class _Cache(object): """ A simple cache mapping names and .dist-info paths to distributions """ def __init__(self): """ Initialise an instance. There is normally one for each DistributionPath. """ self.name = {} self.path = {} self.generated = False def clear(self): """ Clear the cache, setting it to its initial state. """ self.name.clear() self.path.clear() self.generated = False def add(self, dist): """ Add a distribution to the cache. :param dist: The distribution to add. """ if dist.path not in self.path: self.path[dist.path] = dist self.name.setdefault(dist.key, []).append(dist) class DistributionPath(object): """ Represents a set of distributions installed on a path (typically sys.path). """ def __init__(self, path=None, include_egg=False): """ Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. """ if path is None: path = sys.path self.path = path self._include_dist = True self._include_egg = include_egg self._cache = _Cache() self._cache_egg = _Cache() self._cache_enabled = True self._scheme = get_scheme('default') def _get_cache_enabled(self): return self._cache_enabled def _set_cache_enabled(self, value): self._cache_enabled = value cache_enabled = property(_get_cache_enabled, _set_cache_enabled) def clear_cache(self): """ Clears the internal cache. """ self._cache.clear() self._cache_egg.clear() def _yield_distributions(self): """ Yield .dist-info and/or .egg(-info) distributions. """ # We need to check if we've seen some resources already, because on # some Linux systems (e.g. some Debian/Ubuntu variants) there are # symlinks which alias other files in the environment. seen = set() for path in self.path: finder = resources.finder_for_path(path) if finder is None: continue r = finder.find('') if not r or not r.is_container: continue rset = sorted(r.resources) for entry in rset: r = finder.find(entry) if not r or r.path in seen: continue if self._include_dist and entry.endswith(DISTINFO_EXT): possible_filenames = [METADATA_FILENAME, WHEEL_METADATA_FILENAME, LEGACY_METADATA_FILENAME] for metadata_filename in possible_filenames: metadata_path = posixpath.join(entry, metadata_filename) pydist = finder.find(metadata_path) if pydist: break else: continue with contextlib.closing(pydist.as_stream()) as stream: metadata = Metadata(fileobj=stream, scheme='legacy') logger.debug('Found %s', r.path) seen.add(r.path) yield new_dist_class(r.path, metadata=metadata, env=self) elif self._include_egg and entry.endswith(('.egg-info', '.egg')): logger.debug('Found %s', r.path) seen.add(r.path) yield old_dist_class(r.path, self) def _generate_cache(self): """ Scan the path for distributions and populate the cache with those that are found. """ gen_dist = not self._cache.generated gen_egg = self._include_egg and not self._cache_egg.generated if gen_dist or gen_egg: for dist in self._yield_distributions(): if isinstance(dist, InstalledDistribution): self._cache.add(dist) else: self._cache_egg.add(dist) if gen_dist: self._cache.generated = True if gen_egg: self._cache_egg.generated = True @classmethod def distinfo_dirname(cls, name, version): """ The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: string""" name = name.replace('-', '_') return '-'.join([name, version]) + DISTINFO_EXT def get_distributions(self): """ Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances """ if not self._cache_enabled: for dist in self._yield_distributions(): yield dist else: self._generate_cache() for dist in self._cache.path.values(): yield dist if self._include_egg: for dist in self._cache_egg.path.values(): yield dist def get_distribution(self, name): """ Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` """ result = None name = name.lower() if not self._cache_enabled: for dist in self._yield_distributions(): if dist.key == name: result = dist break else: self._generate_cache() if name in self._cache.name: result = self._cache.name[name][0] elif self._include_egg and name in self._cache_egg.name: result = self._cache_egg.name[name][0] return result def provides_distribution(self, name, version=None): """ Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string """ matcher = None if version is not None: try: matcher = self._scheme.matcher('%s (%s)' % (name, version)) except ValueError: raise DistlibException('invalid name or version: %r, %r' % (name, version)) for dist in self.get_distributions(): # We hit a problem on Travis where enum34 was installed and doesn't # have a provides attribute ... if not hasattr(dist, 'provides'): logger.debug('No "provides": %s', dist) else: provided = dist.provides for p in provided: p_name, p_ver = parse_name_and_version(p) if matcher is None: if p_name == name: yield dist break else: if p_name == name and matcher.match(p_ver): yield dist break def get_file_path(self, name, relative_path): """ Return the path to a resource file. """ dist = self.get_distribution(name) if dist is None: raise LookupError('no distribution named %r found' % name) return dist.get_resource_path(relative_path) def get_exported_entries(self, category, name=None): """ Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. """ for dist in self.get_distributions(): r = dist.exports if category in r: d = r[category] if name is not None: if name in d: yield d[name] else: for v in d.values(): yield v class Distribution(object): """ A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. """ build_time_dependency = False """ Set to True if it's known to be only a build-time dependency (i.e. not needed after installation). """ requested = False """A boolean that indicates whether the ``REQUESTED`` metadata file is present (in other words, whether the package was installed by user request or it was installed as a dependency).""" def __init__(self, metadata): """ Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. """ self.metadata = metadata self.name = metadata.name self.key = self.name.lower() # for case-insensitive comparisons self.version = metadata.version self.locator = None self.digest = None self.extras = None # additional features requested self.context = None # environment marker overrides self.download_urls = set() self.digests = {} @property def source_url(self): """ The source archive download URL for this distribution. """ return self.metadata.source_url download_url = source_url # Backward compatibility @property def name_and_version(self): """ A utility property which displays the name and version in parentheses. """ return '%s (%s)' % (self.name, self.version) @property def provides(self): """ A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. """ plist = self.metadata.provides s = '%s (%s)' % (self.name, self.version) if s not in plist: plist.append(s) return plist def _get_requirements(self, req_attr): md = self.metadata logger.debug('Getting requirements from metadata %r', md.todict()) reqts = getattr(md, req_attr) return set(md.get_requirements(reqts, extras=self.extras, env=self.context)) @property def run_requires(self): return self._get_requirements('run_requires') @property def meta_requires(self): return self._get_requirements('meta_requires') @property def build_requires(self): return self._get_requirements('build_requires') @property def test_requires(self): return self._get_requirements('test_requires') @property def dev_requires(self): return self._get_requirements('dev_requires') def matches_requirement(self, req): """ Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. """ # Requirement may contain extras - parse to lose those # from what's passed to the matcher r = parse_requirement(req) scheme = get_scheme(self.metadata.scheme) try: matcher = scheme.matcher(r.requirement) except UnsupportedVersionError: # XXX compat-mode if cannot read the version logger.warning('could not read version %r - using name only', req) name = req.split()[0] matcher = scheme.matcher(name) name = matcher.key # case-insensitive result = False for p in self.provides: p_name, p_ver = parse_name_and_version(p) if p_name != name: continue try: result = matcher.match(p_ver) break except UnsupportedVersionError: pass return result def __repr__(self): """ Return a textual representation of this instance, """ if self.source_url: suffix = ' [%s]' % self.source_url else: suffix = '' return '' % (self.name, self.version, suffix) def __eq__(self, other): """ See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. """ if type(other) is not type(self): result = False else: result = (self.name == other.name and self.version == other.version and self.source_url == other.source_url) return result def __hash__(self): """ Compute hash in a way which matches the equality test. """ return hash(self.name) + hash(self.version) + hash(self.source_url) class BaseInstalledDistribution(Distribution): """ This is the base class for installed distributions (whether PEP 376 or legacy). """ hasher = None def __init__(self, metadata, path, env=None): """ Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. """ super(BaseInstalledDistribution, self).__init__(metadata) self.path = path self.dist_path = env def get_hash(self, data, hasher=None): """ Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str """ if hasher is None: hasher = self.hasher if hasher is None: hasher = hashlib.md5 prefix = '' else: hasher = getattr(hashlib, hasher) prefix = '%s=' % self.hasher digest = hasher(data).digest() digest = base64.urlsafe_b64encode(digest).rstrip(b'=').decode('ascii') return '%s%s' % (prefix, digest) class InstalledDistribution(BaseInstalledDistribution): """ Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). """ hasher = 'sha256' def __init__(self, path, metadata=None, env=None): self.modules = [] self.finder = finder = resources.finder_for_path(path) if finder is None: raise ValueError('finder unavailable for %s' % path) if env and env._cache_enabled and path in env._cache.path: metadata = env._cache.path[path].metadata elif metadata is None: r = finder.find(METADATA_FILENAME) # Temporary - for Wheel 0.23 support if r is None: r = finder.find(WHEEL_METADATA_FILENAME) # Temporary - for legacy support if r is None: r = finder.find(LEGACY_METADATA_FILENAME) if r is None: raise ValueError('no %s found in %s' % (METADATA_FILENAME, path)) with contextlib.closing(r.as_stream()) as stream: metadata = Metadata(fileobj=stream, scheme='legacy') super(InstalledDistribution, self).__init__(metadata, path, env) if env and env._cache_enabled: env._cache.add(self) r = finder.find('REQUESTED') self.requested = r is not None p = os.path.join(path, 'top_level.txt') if os.path.exists(p): with open(p, 'rb') as f: data = f.read().decode('utf-8') self.modules = data.splitlines() def __repr__(self): return '' % ( self.name, self.version, self.path) def __str__(self): return "%s %s" % (self.name, self.version) def _get_records(self): """ Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). """ results = [] r = self.get_distinfo_resource('RECORD') with contextlib.closing(r.as_stream()) as stream: with CSVReader(stream=stream) as record_reader: # Base location is parent dir of .dist-info dir #base_location = os.path.dirname(self.path) #base_location = os.path.abspath(base_location) for row in record_reader: missing = [None for i in range(len(row), 3)] path, checksum, size = row + missing #if not os.path.isabs(path): # path = path.replace('/', os.sep) # path = os.path.join(base_location, path) results.append((path, checksum, size)) return results @cached_property def exports(self): """ Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. """ result = {} r = self.get_distinfo_resource(EXPORTS_FILENAME) if r: result = self.read_exports() return result def read_exports(self): """ Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. """ result = {} r = self.get_distinfo_resource(EXPORTS_FILENAME) if r: with contextlib.closing(r.as_stream()) as stream: result = read_exports(stream) return result def write_exports(self, exports): """ Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. """ rf = self.get_distinfo_file(EXPORTS_FILENAME) with open(rf, 'w') as f: write_exports(exports, f) def get_resource_path(self, relative_path): """ NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. """ r = self.get_distinfo_resource('RESOURCES') with contextlib.closing(r.as_stream()) as stream: with CSVReader(stream=stream) as resources_reader: for relative, destination in resources_reader: if relative == relative_path: return destination raise KeyError('no resource file with relative path %r ' 'is installed' % relative_path) def list_installed_files(self): """ Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) """ for result in self._get_records(): yield result def write_installed_files(self, paths, prefix, dry_run=False): """ Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. """ prefix = os.path.join(prefix, '') base = os.path.dirname(self.path) base_under_prefix = base.startswith(prefix) base = os.path.join(base, '') record_path = self.get_distinfo_file('RECORD') logger.info('creating %s', record_path) if dry_run: return None with CSVWriter(record_path) as writer: for path in paths: if os.path.isdir(path) or path.endswith(('.pyc', '.pyo')): # do not put size and hash, as in PEP-376 hash_value = size = '' else: size = '%d' % os.path.getsize(path) with open(path, 'rb') as fp: hash_value = self.get_hash(fp.read()) if path.startswith(base) or (base_under_prefix and path.startswith(prefix)): path = os.path.relpath(path, base) writer.writerow((path, hash_value, size)) # add the RECORD file itself if record_path.startswith(base): record_path = os.path.relpath(record_path, base) writer.writerow((record_path, '', '')) return record_path def check_installed_files(self): """ Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. """ mismatches = [] base = os.path.dirname(self.path) record_path = self.get_distinfo_file('RECORD') for path, hash_value, size in self.list_installed_files(): if not os.path.isabs(path): path = os.path.join(base, path) if path == record_path: continue if not os.path.exists(path): mismatches.append((path, 'exists', True, False)) elif os.path.isfile(path): actual_size = str(os.path.getsize(path)) if size and actual_size != size: mismatches.append((path, 'size', size, actual_size)) elif hash_value: if '=' in hash_value: hasher = hash_value.split('=', 1)[0] else: hasher = None with open(path, 'rb') as f: actual_hash = self.get_hash(f.read(), hasher) if actual_hash != hash_value: mismatches.append((path, 'hash', hash_value, actual_hash)) return mismatches @cached_property def shared_locations(self): """ A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. """ result = {} shared_path = os.path.join(self.path, 'SHARED') if os.path.isfile(shared_path): with codecs.open(shared_path, 'r', encoding='utf-8') as f: lines = f.read().splitlines() for line in lines: key, value = line.split('=', 1) if key == 'namespace': result.setdefault(key, []).append(value) else: result[key] = value return result def write_shared_locations(self, paths, dry_run=False): """ Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. """ shared_path = os.path.join(self.path, 'SHARED') logger.info('creating %s', shared_path) if dry_run: return None lines = [] for key in ('prefix', 'lib', 'headers', 'scripts', 'data'): path = paths[key] if os.path.isdir(paths[key]): lines.append('%s=%s' % (key, path)) for ns in paths.get('namespace', ()): lines.append('namespace=%s' % ns) with codecs.open(shared_path, 'w', encoding='utf-8') as f: f.write('\n'.join(lines)) return shared_path def get_distinfo_resource(self, path): if path not in DIST_FILES: raise DistlibException('invalid path for a dist-info file: ' '%r at %r' % (path, self.path)) finder = resources.finder_for_path(self.path) if finder is None: raise DistlibException('Unable to get a finder for %s' % self.path) return finder.find(path) def get_distinfo_file(self, path): """ Returns a path located under the ``.dist-info`` directory. Returns a string representing the path. :parameter path: a ``'/'``-separated path relative to the ``.dist-info`` directory or an absolute path; If *path* is an absolute path and doesn't start with the ``.dist-info`` directory path, a :class:`DistlibException` is raised :type path: str :rtype: str """ # Check if it is an absolute path # XXX use relpath, add tests if path.find(os.sep) >= 0: # it's an absolute path? distinfo_dirname, path = path.split(os.sep)[-2:] if distinfo_dirname != self.path.split(os.sep)[-1]: raise DistlibException( 'dist-info file %r does not belong to the %r %s ' 'distribution' % (path, self.name, self.version)) # The file must be relative if path not in DIST_FILES: raise DistlibException('invalid path for a dist-info file: ' '%r at %r' % (path, self.path)) return os.path.join(self.path, path) def list_distinfo_files(self): """ Iterates over the ``RECORD`` entries and returns paths for each line if the path is pointing to a file located in the ``.dist-info`` directory or one of its subdirectories. :returns: iterator of paths """ base = os.path.dirname(self.path) for path, checksum, size in self._get_records(): # XXX add separator or use real relpath algo if not os.path.isabs(path): path = os.path.join(base, path) if path.startswith(self.path): yield path def __eq__(self, other): return (isinstance(other, InstalledDistribution) and self.path == other.path) # See http://docs.python.org/reference/datamodel#object.__hash__ __hash__ = object.__hash__ class EggInfoDistribution(BaseInstalledDistribution): """Created with the *path* of the ``.egg-info`` directory or file provided to the constructor. It reads the metadata contained in the file itself, or if the given path happens to be a directory, the metadata is read from the file ``PKG-INFO`` under that directory.""" requested = True # as we have no way of knowing, assume it was shared_locations = {} def __init__(self, path, env=None): def set_name_and_version(s, n, v): s.name = n s.key = n.lower() # for case-insensitive comparisons s.version = v self.path = path self.dist_path = env if env and env._cache_enabled and path in env._cache_egg.path: metadata = env._cache_egg.path[path].metadata set_name_and_version(self, metadata.name, metadata.version) else: metadata = self._get_metadata(path) # Need to be set before caching set_name_and_version(self, metadata.name, metadata.version) if env and env._cache_enabled: env._cache_egg.add(self) super(EggInfoDistribution, self).__init__(metadata, path, env) def _get_metadata(self, path): requires = None def parse_requires_data(data): """Create a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. """ reqs = [] lines = data.splitlines() for line in lines: line = line.strip() if line.startswith('['): logger.warning('Unexpected line: quitting requirement scan: %r', line) break r = parse_requirement(line) if not r: logger.warning('Not recognised as a requirement: %r', line) continue if r.extras: logger.warning('extra requirements in requires.txt are ' 'not supported') if not r.constraints: reqs.append(r.name) else: cons = ', '.join('%s%s' % c for c in r.constraints) reqs.append('%s (%s)' % (r.name, cons)) return reqs def parse_requires_path(req_path): """Create a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. """ reqs = [] try: with codecs.open(req_path, 'r', 'utf-8') as fp: reqs = parse_requires_data(fp.read()) except IOError: pass return reqs tl_path = tl_data = None if path.endswith('.egg'): if os.path.isdir(path): p = os.path.join(path, 'EGG-INFO') meta_path = os.path.join(p, 'PKG-INFO') metadata = Metadata(path=meta_path, scheme='legacy') req_path = os.path.join(p, 'requires.txt') tl_path = os.path.join(p, 'top_level.txt') requires = parse_requires_path(req_path) else: # FIXME handle the case where zipfile is not available zipf = zipimport.zipimporter(path) fileobj = StringIO( zipf.get_data('EGG-INFO/PKG-INFO').decode('utf8')) metadata = Metadata(fileobj=fileobj, scheme='legacy') try: data = zipf.get_data('EGG-INFO/requires.txt') tl_data = zipf.get_data('EGG-INFO/top_level.txt').decode('utf-8') requires = parse_requires_data(data.decode('utf-8')) except IOError: requires = None elif path.endswith('.egg-info'): if os.path.isdir(path): req_path = os.path.join(path, 'requires.txt') requires = parse_requires_path(req_path) path = os.path.join(path, 'PKG-INFO') tl_path = os.path.join(path, 'top_level.txt') metadata = Metadata(path=path, scheme='legacy') else: raise DistlibException('path must end with .egg-info or .egg, ' 'got %r' % path) if requires: metadata.add_requirements(requires) # look for top-level modules in top_level.txt, if present if tl_data is None: if tl_path is not None and os.path.exists(tl_path): with open(tl_path, 'rb') as f: tl_data = f.read().decode('utf-8') if not tl_data: tl_data = [] else: tl_data = tl_data.splitlines() self.modules = tl_data return metadata def __repr__(self): return '' % ( self.name, self.version, self.path) def __str__(self): return "%s %s" % (self.name, self.version) def check_installed_files(self): """ Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. """ mismatches = [] record_path = os.path.join(self.path, 'installed-files.txt') if os.path.exists(record_path): for path, _, _ in self.list_installed_files(): if path == record_path: continue if not os.path.exists(path): mismatches.append((path, 'exists', True, False)) return mismatches def list_installed_files(self): """ Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) """ def _md5(path): f = open(path, 'rb') try: content = f.read() finally: f.close() return hashlib.md5(content).hexdigest() def _size(path): return os.stat(path).st_size record_path = os.path.join(self.path, 'installed-files.txt') result = [] if os.path.exists(record_path): with codecs.open(record_path, 'r', encoding='utf-8') as f: for line in f: line = line.strip() p = os.path.normpath(os.path.join(self.path, line)) # "./" is present as a marker between installed files # and installation metadata files if not os.path.exists(p): logger.warning('Non-existent file: %s', p) if p.endswith(('.pyc', '.pyo')): continue #otherwise fall through and fail if not os.path.isdir(p): result.append((p, _md5(p), _size(p))) result.append((record_path, None, None)) return result def list_distinfo_files(self, absolute=False): """ Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths """ record_path = os.path.join(self.path, 'installed-files.txt') if os.path.exists(record_path): skip = True with codecs.open(record_path, 'r', encoding='utf-8') as f: for line in f: line = line.strip() if line == './': skip = False continue if not skip: p = os.path.normpath(os.path.join(self.path, line)) if p.startswith(self.path): if absolute: yield p else: yield line def __eq__(self, other): return (isinstance(other, EggInfoDistribution) and self.path == other.path) # See http://docs.python.org/reference/datamodel#object.__hash__ __hash__ = object.__hash__ new_dist_class = InstalledDistribution old_dist_class = EggInfoDistribution class DependencyGraph(object): """ Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. """ def __init__(self): self.adjacency_list = {} self.reverse_list = {} self.missing = {} def add_distribution(self, distribution): """Add the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` """ self.adjacency_list[distribution] = [] self.reverse_list[distribution] = [] #self.missing[distribution] = [] def add_edge(self, x, y, label=None): """Add an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` """ self.adjacency_list[x].append((y, label)) # multiple edges are allowed, so be careful if x not in self.reverse_list[y]: self.reverse_list[y].append(x) def add_missing(self, distribution, requirement): """ Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` """ logger.debug('%s missing %r', distribution, requirement) self.missing.setdefault(distribution, []).append(requirement) def _repr_dist(self, dist): return '%s %s' % (dist.name, dist.version) def repr_node(self, dist, level=1): """Prints only a subgraph""" output = [self._repr_dist(dist)] for other, label in self.adjacency_list[dist]: dist = self._repr_dist(other) if label is not None: dist = '%s [%s]' % (dist, label) output.append(' ' * level + str(dist)) suboutput = self.repr_node(other, level + 1) subs = suboutput.split('\n') output.extend(subs[1:]) return '\n'.join(output) def to_dot(self, f, skip_disconnected=True): """Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` """ disconnected = [] f.write("digraph dependencies {\n") for dist, adjs in self.adjacency_list.items(): if len(adjs) == 0 and not skip_disconnected: disconnected.append(dist) for other, label in adjs: if not label is None: f.write('"%s" -> "%s" [label="%s"]\n' % (dist.name, other.name, label)) else: f.write('"%s" -> "%s"\n' % (dist.name, other.name)) if not skip_disconnected and len(disconnected) > 0: f.write('subgraph disconnected {\n') f.write('label = "Disconnected"\n') f.write('bgcolor = red\n') for dist in disconnected: f.write('"%s"' % dist.name) f.write('\n') f.write('}\n') f.write('}\n') def topological_sort(self): """ Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. """ result = [] # Make a shallow copy of the adjacency list alist = {} for k, v in self.adjacency_list.items(): alist[k] = v[:] while True: # See what we can remove in this run to_remove = [] for k, v in list(alist.items())[:]: if not v: to_remove.append(k) del alist[k] if not to_remove: # What's left in alist (if anything) is a cycle. break # Remove from the adjacency list of others for k, v in alist.items(): alist[k] = [(d, r) for d, r in v if d not in to_remove] logger.debug('Moving to result: %s', ['%s (%s)' % (d.name, d.version) for d in to_remove]) result.extend(to_remove) return result, list(alist.keys()) def __repr__(self): """Representation of the graph""" output = [] for dist, adjs in self.adjacency_list.items(): output.append(self.repr_node(dist)) return '\n'.join(output) def make_graph(dists, scheme='default'): """Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance """ scheme = get_scheme(scheme) graph = DependencyGraph() provided = {} # maps names to lists of (version, dist) tuples # first, build the graph and find out what's provided for dist in dists: graph.add_distribution(dist) for p in dist.provides: name, version = parse_name_and_version(p) logger.debug('Add to provided: %s, %s, %s', name, version, dist) provided.setdefault(name, []).append((version, dist)) # now make the edges for dist in dists: requires = (dist.run_requires | dist.meta_requires | dist.build_requires | dist.dev_requires) for req in requires: try: matcher = scheme.matcher(req) except UnsupportedVersionError: # XXX compat-mode if cannot read the version logger.warning('could not read version %r - using name only', req) name = req.split()[0] matcher = scheme.matcher(name) name = matcher.key # case-insensitive matched = False if name in provided: for version, provider in provided[name]: try: match = matcher.match(version) except UnsupportedVersionError: match = False if match: graph.add_edge(dist, provider, req) matched = True break if not matched: graph.add_missing(dist, req) return graph def get_dependent_dists(dists, dist): """Recursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested """ if dist not in dists: raise DistlibException('given distribution %r is not a member ' 'of the list' % dist.name) graph = make_graph(dists) dep = [dist] # dependent distributions todo = graph.reverse_list[dist] # list of nodes we should inspect while todo: d = todo.pop() dep.append(d) for succ in graph.reverse_list[d]: if succ not in dep: todo.append(succ) dep.pop(0) # remove dist from dep, was there to prevent infinite loops return dep def get_required_dists(dists, dist): """Recursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested """ if dist not in dists: raise DistlibException('given distribution %r is not a member ' 'of the list' % dist.name) graph = make_graph(dists) req = [] # required distributions todo = graph.adjacency_list[dist] # list of nodes we should inspect while todo: d = todo.pop()[0] req.append(d) for pred in graph.adjacency_list[d]: if pred not in req: todo.append(pred) return req def make_dist(name, version, **kwargs): """ A convenience method for making a dist given just a name and version. """ summary = kwargs.pop('summary', 'Placeholder for summary') md = Metadata(**kwargs) md.name = name md.version = version md.summary = summary or 'Placeholder for summary' return Distribution(md) PK!7Y99$__pycache__/metadata.cpython-312.pycnu[ >gDdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZej0eZGd d e ZGd de ZGdde ZGdde ZgdZdZ dZ!ejDdZ#ejDdZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+e*dzZ,d Z-d!Z.e,e.zZ/e0Z1e1jee%e1jee&e1jee(e1jee*e1jee,e1jee/ejDd"Z3d#Z4d$Z5e1Dcic]#}|jmjod%d&|%c}Z8e8jsDcic]\}}|| c}}Z:d'Z;d(Zd+Z?d,Z@d-ZAeBZCejDd.ZDd7d/ZEGd0d1eBZFd2ZGd3ZHd4ZIGd5d6eBZJycc}wcc}}w)8zzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and 2.2). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REceZdZdZy)MetadataMissingErrorzA required metadata is missingN__name__ __module__ __qualname____doc__?/opt/hc_python/lib/python3.12/site-packages/distlib/metadata.pyrrs(rrceZdZdZy)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.NrrrrrrsHrrceZdZdZy) MetadataUnrecognizedVersionErrorz Unknown metadata version number.Nrrrrrr#s*rrceZdZdZy)MetadataInvalidErrorzA metadata value is invalidNrrrrrr's%rr)MetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONutf-81.1z \| ) Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicense)r&r'r(r)Supported-Platformr*r+r,r-r.r/r0 Classifier Download-URL ObsoletesProvidesRequires)r4r5r6r2r3)r&r'r(r)r1r*r+r,r-r.r/ MaintainerMaintainer-emailr0r2r3Obsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-External)r;r<r=r9r>r7r8r:)r&r'r(r)r1r*r+r,r-r.r/r7r8r0r2r3r9r:r;r<r=r>Private-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extra)r?rCr@rArB)Description-Content-Typer6r5r4)rD)Dynamic License-Filez"extra\s*==\s*("([^"]+)"|'([^']+)')c|dk(rtS|dk(rtS|dk(rtS|dvrttdtDzS|dk(r t d|dk(rt St|) N1.0r$1.2)1.32.1c32K|]}|tvs |ywN) _345_FIELDS).0fs r z%_version2fieldlist..ps"RkQk=Q1ks 2.0z+Metadata 2.0 is withdrawn and not supported2.2) _241_FIELDS _314_FIELDSrNtuple _566_FIELDS ValueError _643_FIELDSr)versions r_version2fieldlistr[gsw% E  E  N "U"Rk"RRRR E FGG E  *7 33rcd}|jDcgc]\}}|gddfvs|}}}gd}|D]>}|tvr+d|vr'|jdtj d||t vr+d|vr'|jdtj d||t vr+d |vr'|jd tj d ||tvr+d |vr'|jd tj d ||tvr0d |vr,|dk7r'|jd tj d||tvsd|vs|jdtj d|At|dk(r|dSt|dk(r!tj d|tdd|vxr ||t}d |vxr ||t}d |vxr ||t}d|vxr ||t} t|t|zt|zt| zdkDr td|s|s|s| st |vrt S|ry|ry |ry ycc}}w)z5Detect the best version depending on the fields used.c,tfd|DS)Nc3&K|]}|v ywrMr)rOmarkerkeyss rrQz5_best_version.._has_marker..}s8f6T>s)any)r`markerss` r _has_markerz"_best_version.._has_marker|s8888rUNKNOWNN)rHr$rIrJrKrSrHzRemoved 1.0 due to %sr$zRemoved 1.1 due to %srIzRemoved 1.2 due to %srJzRemoved 1.3 due to %srKr+zRemoved 2.1 due to %srSzRemoved 2.2 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.1/2.2 fields)itemsrTremoveloggerdebugrUrNrWrYlenr _314_MARKERS _345_MARKERS _566_MARKERS _643_MARKERSintr") fieldsrckeyvaluer`possible_versionsis_1_1is_1_2is_2_1is_2_2s r _best_versionrwysk9#),,. W.JCE"iQUAV4VC.D WB k !e/@&@  $ $U + LL0# 6 k !e/@&@  $ $U + LL0# 6 k !e/@&@  $ $U + LL0# 6 k !e/@&@  $ $U + LL0# 6 k !e/@&@m#!((/ 4c: k !e/@&@  $ $U + LL0# 6'2 " ##  1 $ @&I#$:;;' ' KKl,KF ' ' KKl,KF ' ' KKl,KF ' ' KKl,KF 6{S[ 3v;.Vr:r1rArCrBrF)r:)r,)r.r7r*r+z[^A-Za-z0-9.]+c|r?G $$rceZdZdZd dZdZdZdZdZdZ d Z d Z d Z d Z d Zd!dZdZdZdZdZd!dZd!dZd"dZdZefdZd!dZd!dZdZdZdZdZdZ dZ!y)#LegacyMetadataaoThe legacy metadata of a release. Supports versions 1.0, 1.1, 1.2, 2.0 and 1.3/2.1 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name Nc|||gjddkr tdi|_g|_d|_||_||j |y||j|y|"|j||jyy)N'path, fileobj and mapping are exclusive) count TypeError_fieldsrequires_files _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrs r__init__zLegacyMetadata.__init__s '7 # ) )$ /! 3EF F  !   IIdO  NN7 #  KK  % % '!rcHt|j|jd<yNr&)rwrrs rrz#LegacyMetadata.set_metadata_versions+8+F '(rc2|j|d|dy)Nz:  )write)rrrrqs r _write_fieldzLegacyMetadata._write_fields D%01rc$|j|SrM)getrrs r __getitem__zLegacyMetadata.__getitem__sxx~rc&|j||SrM)set)rrrqs r __setitem__zLegacyMetadata.__setitem__ sxxe$$rcr|j|} |j|=y#t$r t|wxYwrM) _convert_namerKeyError)rr field_names r __delitem__zLegacyMetadata.__delitem__ s<''-  ! Z( !4.  !s !6c\||jvxs|j||jvSrM)rrrs r __contains__zLegacyMetadata.__contains__s* $P(:(:4(@DLL(PQrc|tvr|S|jddj}tj ||S)Nrxry) _ALL_FIELDSrlower _ATTR2FIELDrrs rrzLegacyMetadata._convert_names9 ; K||C%++-tT**rc(|tvs|tvrgSy)Nrd) _LISTFIELDS_ELEMENTSFIELDrs r_default_valuezLegacyMetadata._default_values ; $."8Ircv|jdvrtjd|Stjd|S)NrHr$r)metadata_version_LINE_PREFIX_PRE_1_2r~_LINE_PREFIX_1_2rrqs r_remove_line_prefixz"LegacyMetadata._remove_line_prefix!s6  N 2'++D%8 8#''e4 4rc2|tvr||St|rM)rAttributeErrorrs r __getattr__zLegacyMetadata.__getattr__'s ; : T""rc(t|d|d|S)zz Return the distribution name with version. If filesafe is true, return a filename-escaped form. r'r()r)rfilesafes r get_fullnamezLegacyMetadata.get_fullname0s %T&\4 ?HMMrc4|j|}|tvS)z+return True if name is a valid metadata key)rrrs ris_fieldzLegacyMetadata.is_field8s!!$'{""rc4|j|}|tvSrM)rrrs ris_multi_fieldzLegacyMetadata.is_multi_field=s!!$'{""rctj|dd} |j||jy#|jwxYw)z*Read the metadata values from a file path.rr#encodingN)codecsopenrclose)rfilepathfps rrzLegacyMetadata.readAs8 [[3 9  NN2  HHJBHHJs <Ac t|}|d|jd<tD]}||vr|tvrU|j |}|t vr)|'|Dcgc]}t |jd}}|j||e||}|m|dk7ss|j|||j}|r||d<y|d|d<ycc}w)z,Read the metadata values from a file object.zmetadata-versionr&N,rdr+) rrrrget_all_LISTTUPLEFIELDSrVsplitr get_payload)rfileobmsgfieldvaluesrqbodys rrzLegacyMetadata.read_fileIs'+./A+B '(!EC #U+,,1CCIJ6%eEKK$456FJ'E $));HHUE*!" &*d]]0C]Ks!C ctj|dd} |j|||jy#|jwxYw)z&Write the metadata fields to filepath.wr#rN)rr write_filer)rr skip_unknownrs rrzLegacyMetadata.writees: [[3 9  OOB - HHJBHHJs =Ac|jt|dD]}|j|}|r |dgdgfvr|tvr#|j ||dj |J|t vr;|dk(r3|jdvr|jdd}n|jdd}|g}|tvr|Dcgc]}dj |}}|D]}|j |||y cc}w) z0Write the PKG-INFO format data to a file object.r&rdrr+rrr%z |N) rr[rrrjoinrrrr)r fileobjectrrrrqs rrzLegacyMetadata.write_filems !!#'-?(@AEXXe_F9b9+*F F&!!*eSXXf5EFK'M),,>!'l!C!'l!C ((7=>ve#((5/v>!!*eU; %B ?s8C/c fd}|snAt|dr"|jD]}||||n|D]\}}||||r"|jD]\}}|||yy)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. c`|tvr%|r"jj||yyyrM)rrr)rprqrs r_setz#LegacyMetadata.update.._sets.k!e++C0%8',!rr`N)hasattrr`re)rotherkwargsrkvs` rrzLegacyMetadata.updatesx 9  UF #ZZ\Qa!"1Q   1Q ' rc|j|}|tvs|dk(rVt|ttfs@t|t r-|j dDcgc]}|j}}n7g}n4|tvr,t|ttfst|t r|g}ng}tjtjr|d}t|j}|tvrF|D|D]>}|j!|j ddr'tj#d|||@ng|t$vr,|*|j'|sLtj#d|||n3|t(vr+|)|j+|stj#d||||t,vr|d k(r|j/|}||j0|<ycc}w) z"Control then set a metadata field.r)rr'N;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r+)rr isinstancelistrVr rstriprrg isEnabledForloggingWARNINGrr_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrr)rrrqr project_namers rrzLegacyMetadata.sets!!$' ^ #tz'9:eVZ\aUbCc%.,1KK,<=,A!221773<?C'M|]^`de ))e.?66u=NN#SUachjno(U->..u5NN#SUachjno > !}$007" T=>sG c|j|}||jvr|tur|j|}|S|tvr|j|}|S|t vrQ|j|}|gSg}|D]5}|t vr|j||j|d|df7|S|tvr0|j|}t|tr|jdS|j|S)zGet a metadata field.rrr) rr_MISSINGrrrrappendrrr r)rrdefaultrqresvals rrzLegacyMetadata.gets!!$' t|| #("--d3N > !LL&EL [ LL&E} C//JJsOJJAA/0  J ^ #LL&E%.{{3''||D!!rc |jgg}}dD]}||vs|j||r$|gk7rddj|z}t|dD]}||vs|j||ddk7r||fSt |j  fd}t |ft jft jffD]A\}}|D]7} |j| d} | || r!|jd | d | 9C||fS) zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are provided)r'r(zmissing required metadata: %s, )r-r.r&rIc^|D]'}j|jddr'yy)NrrFT)rr)rqrrs rare_valid_constraintsz3LegacyMetadata.check..are_valid_constraintss/..qwws|A? rNzWrong value for 'z': ) rrrrrrrrrrrr) rstrictmissingwarningsattrrrro controllerrrqrs @rcheckzLegacyMetadata.checks5 !!#'D4t$( gm1DIIg4FFC&s+ ++D4t$, " #u ,H$ $DKK(  %67L#M$4f6U6U#VYhY_YpYpYr#s FJ -$Z->OO%$OP #s  rc|jt|d}i}|D]O}|r||jvst|}|dk7r ||||<+||Dcgc]}dj |c}||<Q|Scc}w)aReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). This is as per https://www.python.org/dev/peps/pep-0566/#id17. r& project_urlr)rr[r _FIELD2ATTRr)r skip_missingrodatarrpus rtodictzLegacyMetadata.todicts !!##D);$<= J:#=!*--' $Z 0DI6::6F G6F!6F GDI ! !HsA7cL|ddk(rdD] }||vs||= |dxx|z cc<y)Nr&r$)r4r6r5r<r)r requirementsrs radd_requirementszLegacyMetadata.add_requirements's: " #u ,>D=U ? _-rc0tt|dSr)rr[rs rr`zLegacyMetadata.keys2s&t,>'?@AArc#>K|jD]}|ywrMr`rrps r__iter__zLegacyMetadata.__iter__5s99;CIscN|jDcgc]}|| c}Scc}wrMrrs rrzLegacyMetadata.values9s$%)YY[1[cS [111s "cR|jDcgc] }|||f c}Scc}wrMrrs rrezLegacyMetadata.items<s),0IIK8KSd3i K888s$cjd|jjd|jd|jdS)N) __class__rrrZrs r__repr__zLegacyMetadata.__repr__?s!#~~66 4<<PPrNNNrFrM)"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrr`rrrerrrrrrs (G2%!R+  5 #N# #D8<2:$#L!)":(!T..B29Qrrz pydist.jsonz metadata.jsonMETADATAcfeZdZdZej dZej dejZej dejZ e Z ej dZ dZ dezZddd d Zd Zd Zedfed fe d fe d fe d fd ZdZd5dZedZdefZdefZdefdefeeedefeeeedefddd Z[[dZd6dZdZe dZ!e dZ"e"jFdZ"d7dZ$e d Z%e d!Z&e&jFd"Z&d#Z'd$Z(d%Z)d&Z*d'd(d)d*d+d,d-d.d/dd0 Z+d1Z,d8d2Z-d3Z.d4Z/y)9r z The metadata of a release. This implementation uses 2.1 metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z^[A-Z]([0-9A-Z-]*[0-9A-Z])?$z .{1,2047}rRz distlib (%s)r)legacy)rrZsummaryzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)rrrZr$dynamic)_legacy_datarNc|||gjddkr tdd|_d|_||_| |j ||||_yd}|r&t|d5}|j}dddn|r|j}||j|jd|_yt|ts|jd} t!j"||_|j |j|y#t $r%t|||_|jYywxYw#1swYxYw#t$$r.tt'|||_|jYywxYw)Nrr)rrrbr generatorr#)rr)rrr&r'r_validate_mappingrrvalidaterrMETADATA_VERSION GENERATORrr decodejsonloadsrXr)rrrrrr rPs rrzMetadata.__init__usX '7 # ) )$ /! 3EF F     &&w7$ D$%668D&%||~|)-(=(=!% "$ 2;;w/D $!%D!1DJ**4::v>+4 -gfM   &% "$$2(4.QW#XDLMMO$s/D %D<6E +D98D9<E4E?>E?)rrZlicensekeywordsr$r<rArCr2)r3N)r&N) run_requiresbuild_requires dev_requires test_requires meta_requiresextrasmodules namespacesexportscommands classifiers source_urlrcntj|d}tj|d}||vr#||\}}|jr,| |dn|}|S|jj|}|S|dn|}|dvr|jj||}|St}|}|jjd} | r|dk(r| jd|}nm|dk(r&| jd} | rU| j||}nB| jd } | s|jjd } | r| j||}||ur|}|S||vrtj||}|S|jr|jj|}|S|jj|}|S) N common_keys mapped_keysr>r=r;r<r? extensionsr>python.commandsr?python.detailspython.exports)object__getattribute__r&rr') rrpcommonmappedlkmakerresultrqsentinelds rrJzMetadata.__getattribute__s((}=((}= &=s IB||:%*]TFB ?"\\--b1F> ;!& 57]]!ZZ^^C7F6 1 &xH%F |4A*,%&UU+rFr?rGrHr4) rYrIrJr&NotImplementedErrorr' setdefault __setattr__rr rr)rrprqrKrLrMryrQs rr]zMetadata.__setattr__sS S%(((}=((}= &=3KEB||:--#( R [["' 3JJ)),;*$+0A'(M) %5r:A"AcF %5r:A"AcF     tS% 0j e\2!KKME %  "||$) S!"' 3rcDt|j|jdSNT)rrrZrs rname_and_versionzMetadata.name_and_versions$TYY dCCrc|jr|jd}n|jjdg}|jd|jd}||vr|j ||S)Nr;provides ())r&r'r\rrZr)rrOss rrbzMetadata.providessW <<\\/2FZZ**:r:FDLL 1 F? MM!  rcZ|jr||jd<y||jd<y)Nr;rb)r&r'rs rrbzMetadata.providess% <<,1DLL )%*DJJz "rc|jr|}|Sg}t|xsg|j}|D]_}d|vrd|vrd}n;d|vrd}n|jd|v}|r|jd}|r t ||}|sL|j |dadD]_}d|z} | |vs |j | |jjd|zg}|j |j|||a|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrequires)builddevtestz:%s:z %s_requires)r:env) r&r r:rr extendrfr'get_requirements) rreqtsr:rnrOrQincluder_rpes rrpzMetadata.get_requirements&s  <<F: 7F "dkk:F!# Q(>"Ga'"&"#%%.F":!"}!5!&/&CEMM$"7"7fRU"7"VW0 rcR|jr|jS|jSrM)r& _from_legacyr'rs r dictionaryzMetadata.dictionaryOs" <<$$& &zzrcf|jrtt|j|jSrM)r&r[r r'DEPENDENCY_KEYSrs r dependencieszMetadata.dependenciesUs& <<% %!$**d.B.BC Crc^|jrt|jj|yrM)r&r[r'rrs rryzMetadata.dependencies\s! <<% % JJ  e $rcj|jd|jk7r tg}|jj D] \}}||vs ||vs|j |"|rddj |z}t||j D]\}}|j|||y)NrzMissing metadata items: %sr) rr.rMANDATORY_KEYSrerrrrY) rrrrrprWrrrs rr,zMetadata._validate_mappingcs ;;) *d.C.C C24 4#2288:OC'!+NN3' ; .71CCC&s+ +MMODAq  Av .$rc|jr;|jjd\}}|s|rtjd||yy|j |j |j y)NTz#Metadata: missing: %s, warnings: %s)r&rrgrr,r'r)rrrs rr-zMetadata.validateqsW << $ 2 24 8 GX(DgxX#  " "4::t{{ ;rc|jr|jjdSt|j|j}|Sr_)r&rr r' INDEX_KEYS)rrOs rrzMetadata.todictys7 <<<<&&t, ,#DJJ@FMrc~|jr |jrJ|j|jd}|jj d}dD]}||vs|dk(rd}n|}||||<|j dg}|dgk(rg}||d<d }|D]\}}||vs ||sd ||ig||<|j |d <|S) Nr*T)rrZr3r$ description classifierrr?r,r4)) requires_distr5)setup_requires_distr6rjrb)r&r'r.r/rrrb)rrOlmdrnkkwr`oks rruzMetadata._from_legacys||DJJ.. $ 5 5 ll!!$'WACx $&BB Vr XWWZ $ ":Bz]FBSySW)3r734r "]]z rr'r(r0r*r+r-r.r/r3) rrZ)rErGr3r$r)rEpython.project project_urlsHome)rErcontactsrr)rErrremailr@)rErGr?cJd}|jr |jrJt}|j}|jj D]<\}}t |t s||vs||||<$|}d}|D]} ||} |s8|||<>||j|jz} ||j|jz} |jrt|j|d<t| |d<t| |d<|S#ttf$rd}YwxYw)Nc$t}|D]}|jd}|jd}|d}|D]R}|s|s|j|d}|rd|z}|r |r d|d|}n|}|jdj||fT|S) Nrhrirjrz extra == "%s"(z) and r)rraddr)entriesrqrsrhrnrlistrr_s rprocess_entriesz,Metadata._to_legacy..process_entriessEEgeeM** Au ! !# %4u%)rrZrrr)rrrZs rrzMetadata.__repr__s?yy'K,,.,$(NN$;$;T=R=RTXZabbrrrM)NN)NNFT)0rrrrrecompileMETADATA_VERSION_MATCHERI NAME_MATCHERFIELDNAME_MATCHERrVERSION_MATCHERSUMMARY_MATCHERr.rr/r|rrxrT __slots__rrrBr none_listdict none_dictrCrJrYr]propertyr`rbsetterrprvryr,r-rrurrrrrrrrr r Hs( *rzz*:;2::A244HL" #A244H'O bjj-O,IN !J/O 6r:|,#\2#\2%|4 /I)$VKLKt It I)$/0$7!""#T*$d+,6K 9(TS$(LDD__++ 'R DD %% /<85>$BMAIBP$9E N1fQ02"crr r )Kr __future__rrrrr1rrrrrcompatrr r rbr utilr r rZrr getLoggerrrgrrrr__all__r!r"rrrrTrUrjrNrk _426_FIELDS _426_MARKERSrWrlrmrYrrrEXTRA_REr[rwrrrrer rrrrrrrrIrr}rrMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAMEr )rrrs000rrs\ ( #  +55,2   8 $)+)I,I+'7+&+& J#2::n-!rzz,/4 ' S 7 A . i ]] - * L( e ; ; ; ; ; ; 2::? @4$ETALL tzz|##C-t3 L .9.?.?.AB.A{tUud{.AB H(> %C 8 BJJ' (  %\QV\Q~ ")%cvcK MBs (G- G2PK!bC#__pycache__/markers.cpython-312.pycnu[ >g,dZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z dgZ ejdZd d hZd Zd Zd ZGddeZejdZdZeZ[eZddZy)zG Parser for the environment markers micro-language defined in PEP 508. N) string_types)in_venv parse_marker) LegacyVersion interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")python_versionpython_full_versionc6t|txr|tvSN) isinstancer_VERSION_MARKERS)ss >/opt/hc_python/lib/python3.12/site-packages/distlib/markers.py_is_version_markerrs a & @10@+@@c6t|tr|sy|ddvS)NFr'")r r)os r _is_literalr"s a &a Q45=rctj|Dchc]}t|jd c}Scc}w)Nr)_VERSION_PATTERNfinditerLVgroups)rms r _get_versionsr(s6'7'@'@'C D'C!Bqxxz!} 'C DD Ds#>c LeZdZdZdddddddd d d d d d ZdZy) Evaluatorz< This class is used to evaluate marker expressions. c ||k(Sr xys rzEvaluator.216rc ||k(Sr r!r"s rr%zEvaluator.3sAFrc||k(xs||kDSr r!r"s rr%zEvaluator.416?QU?rc ||k7Sr r!r"s rr%zEvaluator.5r&rc ||kSr r!r"s rr%zEvaluator.6!a%rc||k(xs||kSr r!r"s rr%zEvaluator.7r)rc ||kDSr r!r"s rr%zEvaluator.8r,rc||k(xs||kDSr r!r"s rr%zEvaluator.9r)rc|xr|Sr r!r"s rr%zEvaluator.:s AG!Grc|xs|Sr r!r"s rr%zEvaluator.;s 166rc ||vSr r!r"s rr%zEvaluator.<s16rc ||vSr r!r"s rr%zEvaluator.=sqzr) =====~=!=<<=>>=andorinnot incnt|tr'|ddvr|dd}|S||vrtd|z||}|St|tsJ|d}||jvrt d|z|d}|d }t |dr"t |d rtd |d |d ||j||}|j||}t|s t|r|d vrt|}t|}n%t|r|d vrt|}t|}|j|||}|S)z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rrrzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison:  )r8r9r:r;r5r4r7r6)r>r?) r r SyntaxErrordict operationsNotImplementedErrorrevaluaterrr) selfexprcontextresultrBelhserhsrCrDs rrJzEvaluator.evaluate@sT dL )Aw%a2 /w&%&.format_full_versionhsM $ DJJ C   7? tAwT[[!11 1Grimplementation0r) implementation_nameimplementation_versionos_nameplatform_machineplatform_python_implementationplatform_releaseplatform_systemplatform_versionplatform_in_venvr r sys_platform)hasattrsysrcr`nameplatformr _DIGITSmatchgrouposmachinepython_implementationreleasesystemr]r)rbrgrfppvrpvrNs rdefault_contextr~fss$%!4S5G5G5O5O!P!0055!$   ! ! #C cA B2"877$,,.*2*H*H*J$,,.#??,$,,. N"  F Mrc  t|\}}|r|ddk7rtd|d|tt}|r|j |t j||S#t$r}td|d|d}~wwxYw)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z#Unable to interpret marker syntax: z: Nr#z$unexpected trailing data in marker: )r ExceptionrFrGDEFAULT_CONTEXTupdate evaluatorrJ)markerexecution_contextrLresterMs rrrsU!&) d Q3&RVWXX?#G()   dG ,, UQRSTTUsA## B,A==Br )rTrwrerqrscompatrutilrrr`rr__all__compilerrrrrobjectrrtr~rrrr!rrrs  '( -2::]^$&;<A E44n "**[ !!H"# K -rPK!,"__pycache__/compat.cpython-312.pycnu[ >gddlmZddlZddlZddlZddlZ ddlZejddkrddl m Z e fZ e Z ddlmZddlZddlZddlmZmZmZmZmZddlmZmZmZmZm Z m!Z!m"Z"dZddl#Z#dd l#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,erdd l#m-Z-ddl.Z.ddl/Z/ddl0Z1dd l2m2Z2ddl3Z3e4Z4dd l5m6Z7dd l5m8Z9nddl:m Z e;fZ e;Z ddl:mm%Z%mZm$Z$mZm Z m(Z(m)Z)m*Z*m+Z+m,Z,erdd l>m-Z-ddl?m'Z'm&Z&m!Z!ddl@mAZ.ddl>mBZ#ddlCmAZ/ddl1Z1dd lDm2Z2ddlEmFZ3eGZ4ddl5m9Z9e7Z7 ddlmHZHmIZI ddlmLZM ddlmOZOddlRmSZTeUeTdreTZSnddlRmVZWGd d!eWZVGd"d#eTZS dd$lXmYZYddlZZZ e[Z[ ejZ_ejZ` dd.lemfZf dd3lmmnZnejdd4d5kre2jZpndd6lmmpZp dd7lqmrZr dd=lwmxZx dd?lqmyZy ddDlmZmZy#e$rdZYwxYw#e$rGddeJZIdPdZKdZHYwxYw#e$rGddeNZMYwxYw#e$r!ejejzdfdZOYwxYw#e$rd%ZYYwxYw#e\$r dd&l]m^Z^d'Z[YwxYw#ea$r)ejxsd(Zcecd)k(rd*Zdnd+Zdd,Z_d-Z`YwxYw#e$r$dd/lgmhZhmiZiejd0Zkd1Zld2ZfY5wxYw#e$r dd3lomnZnY@wxYw#e$r,dd8lqmsZs dd9ltmuZvn#e$rdQd:ZvYnwxYwGd;dZxYLwxYw#e$r? dd@lzm{Z|n#e$r dd@l}m{Z|YnwxYw ddAl~mZmZmZn #e$rYnwxYwGdBdCeZyYwxYw#e$rTejdEej ZdFZGdGdHeZdRdIZGdJdKeZGdLdMeZGdNdOeNZYywxYw)S)absolute_importN)StringIO)FileType)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecZt|tr|jd}t|S)Nutf-8) isinstanceunicodeencode_quote)ss =/opt/hc_python/lib/python3.12/site-packages/distlib/compat.pyr r s$ a !!Aay) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalse) TextIOWrapper)rrr r rr r r) rr rrrr r!r"r#r$)rrr) filterfalse)match_hostnameCertificateErrorc eZdZy)r,N)__name__ __module__ __qualname__rrr,r,]s rr,cg}|sy|jd}|d|dd}}|jd}||kDrtdt|z|s!|j |j k(S|dk(r|j dn{|j d s|j d r%|j tj|n4|j tj|jd d |D]&}|j tj|(tjd d j|zdztj} | j|S)zpMatching according to RFC 6125, section 6.4.3 http://tools.ietf.org/html/rfc6125#section-6.4.3 F.rN*z,too many wildcards in certificate DNS name: z[^.]+zxn--z\*z[^.]*z\Az\.z\Z)splitcountr,reprlowerappend startswithreescapereplacecompilejoin IGNORECASEmatch) dnhostname max_wildcardspatspartsleftmost remainder wildcardsfragpats r_dnsname_matchrM`sD  #Ahab )NN3' } $ #>bIK K88:!11 1 s? KK   (H,?,?,G KK (+ , KK (+33E7C DD KK $ (jjD!11E92==Iyy""rc |s tdg}|jdd}|D]*\}}|dk(s t||ry|j|,|sG|jddD]2}|D]+\}}|dk(s t||ry|j|-4t |dkDr.t d |d d j tt|t |dk(rt d |d |d t d)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. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDsubjectAltNamer1DNSNsubject commonNamer4z hostname z doesn't match either of , z doesn't match rz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrMr:lenr,r@mapr8)certrDdnsnamessankeyvaluesubs rr+r+s$>? ?hh',JCe|!%2&  xx 2."%JCl*)%:" . #&/ x=1 "$,diiD(8K.L$NO O]a "$,hqk$;< <#$FG Gr)SimpleNamespaceceZdZdZdZy) ContainerzR A generic container for when multiple values need to be returned c :|jj|yN__dict__update)selfkwargss r__init__zContainer.__init__s MM  (rN)r.r/r0__doc__rhr1rrr`r`s   )rr`)whichchd}tjjr ||rSy|.tjj dtj }|sy|j tj}tjdk(rtj|vr |jdtjtjj ddj tj}tfd|Drg}n|Dcgc]}|z }}ng}t}|D]m}tjj|} | |vs'|j| |D]1} tjj!|| } || |s-| ccSoycc}w) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. ctjj|xr8tj||xr tjj | Srb)ospathexistsaccessisdir)fnmodes r _access_checkzwhich.._access_checks;GGNN2&X299R+>Xrww}}UWGXCX YrNPATHwin32rPATHEXTc3xK|]1}jj|j3ywrb)r9endswith).0extcmds r zwhich..s)H399;'' 4s7:)rmrndirnameenvironrUdefpathr6pathsepsysplatformcurdirinsertanysetnormcaseaddr@) r}rsrnrtpathextfilesr|seendirnormdirthefilenames ` rrjrjsY Z 77??3 S$'  <::>>&"**5Dzz"**% <<7 "yy$ Aryy)jjnnY399"**EG HHH.56gssg6EEuCgg&&s+Gd"!$G77<<W5D$T40#  % 7s F/)ZipFile __enter__) ZipExtFileceZdZdZdZdZy)rcN|jj|jyrbrc)rfbases rrhzZipExtFile.__init__s MM  /rc|Srbr1rfs rrzZipExtFile.__enter__Krc$|jyrbcloserfexc_infos r__exit__zZipExtFile.__exit__ JJLrN)r.r/r0rhrrr1rrrrs 0  rrceZdZdZdZdZy)rc|Srbr1rs rrzZipFile.__enter__#rrc$|jyrbrrs rrzZipFile.__exit__&rrcJtj|g|i|}t|Srb) BaseZipFileopenr)rfargsrgrs rrz ZipFile.open*s'##D:4:6:Dd# #rN)r.r/r0rrrr1rrrr!s   $rr)python_implementationcdtjvrytjdk(rytjj dryy)z6Return a string identifying the Python implementation.PyPyjavaJython IronPythonCPython)rversionrmrr;r1rrrr3s8 S[[  77f  ;; ! !, /r)Callablec"t|tSrb)rr)objs rcallablerEs#x((rrmbcsstrictsurrogateescapect|tr|St|tr|jtt St dt|jzNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper.filenames rfsencoderYsN h &O ) ,??; : :9 N3345 5rct|tr|St|tr|jtt St dt|jzr) rrrdecoderrrrr.rs rfsdecoderbsN h *O % (??; : :9 N3345 5r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)c|ddjjdd}|dk(s|jdry|dvs|jdry |S) z(Imitates get_normal_name in tokenizer.c.N _-rzutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)r9r>r;)orig_encencs r_get_normal_namerssXsm!!#++C5 '>S^^H5 : : >>E Frc6 jjdd}d}fd}fd}|}|jtr d|dd}d}|s|gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS#t$rdY|wxYw) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFrc2 S#t$rYywxYw)Nr) StopIteration)readlinesr read_or_stopz%detect_encoding..read_or_stops" z!   s  c |jd}tj |}|syt |d} t|}r?|jdk7r+ d}t|dj}t||d z }|S#t$r"d}dj|}t|wxYw#t$r0d|z}t|dj|}t|wxYw) Nrz'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr)line line_stringmsgmatchesencodingcodec bom_foundrs r find_cookiez$detect_encoding..find_cookies. '#kk'2  '' 4G' 3H 'x(::('7&c**AGG$&%c**F"O?& '?''..sH=C!#&&  ' '#.9C"#&&:@@ (,C!#&& 'sB B7 +B479C0Trz utf-8-sig)__self__rAttributeErrorr;r) rrdefaultrrfirstsecondrrs ` @@rrr~s" ((--H   % N   H %I!"IE!GB; u% eW$ $UG# #v& eV_, ,''O H sB BB)r=)r)unescape)ChainMap)MutableMapping)recursive_reprcfd}|S)zm Decorator to make a repr function return fillvalue for a recursive call ctfd}td|_td|_td|_tdi|_|S)Nct|tf}|vrSj| |}j||S#j|wxYwrb)id get_identrdiscard)rfr[result fillvalue repr_running user_functions rwrapperz=_recursive_repr..decorating_function..wrapperscT(IK/Cl*(( $$S)2!.t!4$,,S1!M%,,S1s A Ar/rir.__annotations__)rgetattrr/rir.r)rrrrs` @rdecorating_functionz,_recursive_repr..decorating_functionsW"u  "&-]L%I"")-"C#*=*#E *1-2CR+I'rr1)rrs` r_recursive_reprrs  ,' &rceZdZdZdZdZdZddZdZdZ d Z d Z e d Z ed Zd ZeZdZedZdZdZdZdZdZy)ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. c.t|xsig|_y)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)rfrs rrhzChainMap.__init__s T *rdDIrct|rb)KeyErrorrfr[s r __missing__zChainMap.__missing__ s 3- rcr|jD] } ||cS|j|S#t$rY(wxYwrb)rrr)rfr[mappings r __getitem__zChainMap.__getitem__#sQ99"% ##  s * 66Nc||vr||S|Srbr1rfr[rs rrUz ChainMap.get-s #t 49 8 8rcVttj|jSrb)rVrunionrrs r__len__zChainMap.__len__0s%{su{{ rcVttj|jSrb)iterrr rrs r__iter__zChainMap.__iter__4s  TYY/0 0rc@tfd|jDS)Nc3&K|]}|v ywrbr1)r{mr[s rr~z(ChainMap.__contains__..8s3Asaxsrrrs `r __contains__zChainMap.__contains__7s333 3rc,t|jSrbrrs r__bool__zChainMap.__bool__:styy> !rc tdj|djtt|jS)Nz{0.__class__.__name__}({1})rS)rr@rWr8rrs r__repr__zChainMap.__repr__=s.077diiD$)) 457 7rc:|tj|g|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablers rrzChainMap.fromkeysBst}}X556 6rcx|j|jdjg|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rr4N) __class__rcopyrs rr"z ChainMap.copyGs3!4>>$))A,"3"3"5F !" F Frc<|jig|jS)z;New ChainMap with a new dict followed by all previous maps.r!rrs r new_childzChainMap.new_childMs!4>>"1tyy1 1rc:|j|jddS)zNew ChainMap from maps[1:].r4Nr$rs rparentszChainMap.parentsQs"4>>499QR=1 1rc(||jd|<y)Nr)r)rfr[r\s r __setitem__zChainMap.__setitem__Vs %DIIaL rct |jd|=y#t$rtdj|wxYw)Nr(Key not found in the first mapping: {!r})rrrrs r __delitem__zChainMap.__delitem__YsF LIIaL% L>EEcJLL Ls$7cn |jdjS#t$r tdwxYw)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.)rpopitemrrs rr.zChainMap.popitem`s< Fyy|++-- FDEE Fs4c |jdj|g|S#t$rtdj|wxYw)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rr+)rpoprr)rfr[rs rr0z ChainMap.popgsV L'tyy|''3d33 L>EEcJLL Ls "$Ac>|jdjy)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrs rr2zChainMap.clearos IIaL   rrb)r.r/r0rirhrr rUrrrrrr classmethodrr"__copy__r%propertyr'r)r,r.r0r2r1rrrr s  +   9  1 4 "   7  7  7  7 G 2  2  2 & L F L !rr)cache_from_sourcecP|jdsJ|d}|rd}||zSd}||zS)Nz.pyTco)rz)rndebug_overridesuffixs rr6r6xsD}}U###  !&N Ff}Ff}r) OrderedDict)r)KeysView ValuesView ItemsViewceZdZdZdZej fdZejfdZdZdZ dZ ddZ d Z d Z d Zd Zd ZdZdZeZeZefdZddZddZdZdZeddZdZdZdZdZ dZ!y)r<z)Dictionary that remembers insertion orderct|dkDrtdt|z |j|j |i|y#t$rgx|_}||dg|ddi|_Y6wxYw)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. r4z$expected at most 1 arguments, got %dN)rVr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rfrkwdsroots rrhzOrderedDict.__init__s 4y1} F #D !*++  DMM4 (4 ( " %'' dt,Q  s A!A*)A*cz||vr-|j}|d}|||gx|d<x|d<|j|<||||y)z!od.__setitem__(i, y) <==> od[i]=yrr4N)rBrC)rfr[r\ dict_setitemrFlasts rr)zOrderedDict.__setitem__sO${{Aw7;T36GGQG$q'DJJsO sE *rch||||jj|\}}}||d<||d<y)z od.__delitem__(y) <==> del od[y]r4rN)rCr0)rfr[ dict_delitem link_prev link_nexts rr,zOrderedDict.__delitem__s9 s #(, s(; %Iy#$IaL$IaLrc#ZK|j}|d}||ur|d|d}||uryyw)zod.__iter__() <==> iter(od)r4rNrBrfrFcurrs rrzOrderedDict.__iter__<;;D7Dd"1g Awd"&++c#ZK|j}|d}||ur|d|d}||uryyw)z#od.__reversed__() <==> reversed(od)rrNrOrPs r __reversed__zOrderedDict.__reversed__rRrSc |jjD]}|dd= |j}||dg|dd|jjt j|y#t$rY!wxYw)z.od.clear() -> None. Remove all items from od.N)rC itervaluesrBr2rr)rfnoderFs rr2zOrderedDict.clearsp  JJ113DQ4{{t,Q   " JJt "  sAA** A65A6c|s td|j}|r|d}|d}||d<||d<n|d}|d}||d<||d<|d}|j|=tj ||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrr4r)rrBrCrr0)rfrIrFlinkrLrMr[r\s rr.zOrderedDict.popitems 455;;DAw G # ! #QAw G #Q# ! q'C 3HHT3'E: rct|S)zod.keys() -> list of keys in od)rrs rkeyszOrderedDict.keys : rc2|Dcgc]}|| c}Scc}w)z#od.values() -> list of values in odr1rs rvalueszOrderedDict.valuess)-.#DI. ..s c6|Dcgc] }|||f c}Scc}w)z.od.items() -> list of (key, value) pairs in odr1rs ritemszOrderedDict.itemss#045S$s)$5 55sct|S)z0od.iterkeys() -> an iterator over the keys in od)rrs riterkeyszOrderedDict.iterkeysr]rc#(K|D] }|| yw)z2od.itervalues -> an iterator over the values in odNr1rfks rrWzOrderedDict.itervalues s1g sc#,K|D] }|||f yw)z=od.iteritems -> an iterator over the (key, value) items in odNr1res r iteritemszOrderedDict.iteritemss$q'l"sct|dkDrtdt|fz|s td|d}d}t|dk(r|d}t|tr|D] }||||< n9t |dr|j D] }||||< n|D] \}}|||< |j D] \}}|||< y) aod.update(E, **F) -> None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v rz8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rr1r4r\N)rVrrrhasattrr\ra)rrErfotherr[r\s rrezOrderedDict.updates4y1}!7:=d)!GHH NOO7DE4yA~Q%& C %c DI!' :: v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)rfr[rrs rr0zOrderedDict.pop6s; d{cI $--'sm#NrNc"||vr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr1r s r setdefaultzOrderedDict.setdefaultCs!d{Cy DINrc|si}t|tf}||vryd||< |s|jjd||=S|jjd|j d||=S#||=wxYw)zod.__repr__() <==> repr(od)...r4()())r _get_identr!r.ra)rf _repr_runningcall_keys rrzOrderedDict.__repr__Js| " $x-H=(&'M( # ,%)^^%<%<?"(+$(>>#:#:DJJLI!(+M(+sA0)A00A5c|Dcgc] }|||g }}t|j}ttD]}|j|d|r|j|f|fS|j|ffScc}w)z%Return state information for picklingN)varsr"r<r0r!)rfrfra inst_dicts r __reduce__zOrderedDict.__reduce__Ysy+/04aaa\4E0T )I+-( a&) 9==>>E9, , 1sA9c$|j|S)z!od.copy() -> a shallow copy of od)r!rs rr"zOrderedDict.copycs>>$' 'rc,|}|D]}|||< |S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r1)rrr\dr[s rrzOrderedDict.fromkeysgs# A# Hrct|tr:t|t|k(xr!|j|jk(Stj ||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rr<rVrar__eq__rfrks rrzOrderedDict.__eq__rsS %-4yC%=#zz|u{{}<=;;tU+ +rc||k( Srbr1rs r__ne__zOrderedDict.__ne__|su}$ $rct|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)r=rs rviewkeyszOrderedDict.viewkeyss D> !rct|S)z an object providing a view on od's values)r>rs r viewvalueszOrderedDict.viewvaluess d# #rct|S)zBod.viewitems() -> a set-like object providing a view on od's items)r?rs r viewitemszOrderedDict.viewitemss T? "r)Trb)"r.r/r0rirhrr)r,rrUr2r.r\r_rarcrWrhrerDobjectrmr0rorr{r"r3rrrrrrr1rrr<r<s3 )"8<7G7G +150@0@ %    2  / 6    #  ">8#+   , - (     , %  " $ #rr<)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cNtj|}|std|zy)Nz!Not a valid Python identifier: %rT) IDENTIFIERrBrT)rrs rrrs)   Q @1DE ErceZdZdZdZddZy)ConvertingDictz A converting dictionary wrapper.ctj||}|jj|}||ur/|||<t |t t tfvr||_||_ |Srb) rr  configuratorconvertrrConvertingListConvertingTupleparentr[rfr[r\rs rr zConvertingDict.__getitem__f$$T3/E&&..u5FF""S [a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)r|cfgcFt||_||j_yrb)rconfigr)rfrs rrhzBaseConfigurator.__init__s(0DK'+DKK $rc|jd}|jd} |j|}|D]}|d|zz } t||}|S#t$r |j|t||}YDwxYw#t $r=t jdd\}}td|d|}||c|_ |_ |wxYw)zl Resolve strings to objects using standard import and attribute syntax. r3rr4NzCannot resolve z: ) r6r0importerrr ImportErrorrrrT __cause__ __traceback__) rfrrusedfoundrKetbvs rresolvezBaseConfigurator.resolves 7736LMF[[F#(;;=KD%FD%0$1M Ms B Bc<t|tr t|}|S)z0Utility function which converts lists to tuples.)rrrrs ras_tuplezBaseConfigurator.as_tuplems%&e LrN)r.r/r0rir<r?rrrrrr staticmethod __import__rrhrrrrrrr1rrrrs %"**%MN!rzz/2  bjj!23 " #9: " 8, !    + , . '! F :  rr)r4)rqrb) __future__rrmr<shutilrsslr version_infor basestringrrrtypesr file_type __builtin__builtins ConfigParser configparserrrr r r urllibr r rrrrrrurllib2rrrrr r!r"r#r$r%httplib xmlrpclibQueuequeuer&htmlentitydefs raw_input itertoolsr'filterr(r*iostrr) urllib.parseurllib.request urllib.error http.clientclientrequest xmlrpc.client html.parser html.entitiesentitiesinputr+r,rTrMr^r`rrjF_OKX_OKzipfilerrrjrBaseZipExtFilerr sysconfigr NameErrorcollections.abcrrrrgetfilesystemencodingrrtokenizercodecsrrr?rrhtmlr=cgir collectionsrrreprlibrrimportlib.utilr6r<threadrru dummy_thread_abcollr=r>r?rlogging.configrrIrrr0rrrrr1rrrs:' A!;LI+"'LLGGG <<< (%I+5 4LI-???CCC /FF!$%&*I% F`G4D )2@H+ ; $G4 ^  $+ $ .)H 5{{H{{HBl((^BQ& |$$HL!$\ 0H#'Tc<< CV^G : /#b(Gm^GF))F))>"'')<>L  ")())5,#++-8Kf % 55-5Dj(' 45I Z(!j(`J!* '= ' ''@e!>e!KJ!^  F#92 989 ;;    x#dx#F#Va0"$$7J60 % E6EyasVG75H>H"H8:I!I/J!J4(K K2 L&'L6.M=7HHHH"H54H58"II!I,+I,/J?J*J10J14%KK K/.K/2 L#>LL# LL#LL#"L#& L32L36M:<MM: MM:MM: M M: M(%M:'M((M:9M:=AOOPK!3::$__pycache__/manifest.cpython-312.pycnu[ >gX7@dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ ejeZej dej"Zej d ej"ej&zZej*dd ZGd deZy) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode) convert_pathManifestz\\w* z#.*?(?= )| (?=$)cneZdZdZddZdZdZdZddZdZ d Z d Z dd Z dd Z dd ZdZy)rz A list of files built by exploring the filesystem and filtered by applying various patterns to what we find there. Nc"tjjtjj|xstj|_|j tj z|_d|_t|_ y)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfrs ?/opt/hc_python/lib/python3.12/site-packages/distlib/manifest.py__init__zManifest.__init__,sV GGOOBGG$4$4T5HRYY[$IJ ii"&&(  U cddlm}m}m}gx|_}|j }|g}|j }|j}|r|}tj|} | D]} tjj|| } tj| } | j} || r|jt| g|| sp|| ry|| |ryy)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrrpopappendr listdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermodes rfindallzManifest.findall;s 32#%% yyii||5DJJt$E77<<d3wwx(||4=OOHX$67T]74=N rc|j|js*tjj |j |}|j jtjj|y)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrr r r"rraddr)ritems rr.z Manifest.addVsK t{{+77<< 40D rww''-.rc4|D]}|j|y)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r.)ritemsr/s radd_manyzManifest.add_many`s D HHTNrc6fdtj}|rz Manifest.sorted..add_dirns[ HHQK LL+Q /DII~GGMM!, Y...f%rc3ZK|]#}tjj|%ywN)r r r9).0r s r z"Manifest.sorted..}s>vtrww}}T*vs)+)rrr r dirnamesortedr")rwantdirsresultr:f path_tupler>s` @rrDzManifest.sortedis  &TZZ 5Dbggooa01 dNF>v>>@>/9 j)>@ @@s0#Bc0t|_g|_y)zClear all collected files.N)rrr)rs rclearzManifest.clearsU  rc|j|\}}}}|dk(r2|D],}|j|drtjd|.y|dk(r|D]}|j |dy|dk(r2|D],}|j|drtjd|.y|d k(r|D]}|j |dy|d k(r3|D]-}|j|| rtjd ||/y|d k(r|D]}|j || y|dk(r+|jd| stjd|yy|dk(r+|j d| stjd|yyt d|z)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludeglobal-includeFz3no files found matching %r anywhere in distributionglobal-excluderecursive-include)rz-no files found matching %r under directory %rrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr7warning_exclude_patternr)r directiveactionpatternsthedir dirpatternpatterns rprocess_directivezManifest.process_directives04/D/DY/O,&* Y #,,WT,BNN#?I$y #%%gd%;$' '#,,WU,CNN$>?FH$ ' '#%%ge%<$* *#,,WV,DNN$89@&J$ * *#%%gf%=$w ((j(AA)+Bw ((j(A -.8:B ##f,. .rc,|j}t|dk(r|ddvr|jdd|d}dx}x}}|dvr8t|dkrtd|z|ddDcgc] }t |}}n|d vrFt|d krtd |zt |d}|ddDcgc] }t |}}n=|d vr+t|dk7rtd |zt |d}ntd|z||||fScc}wcc}w)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rr)rLrNrOrPrQrRrSrTrLN)rLrNrOrPrz$%r expects ...)rQrRz*%r expects ...)rSrTz!%r expects a single zunknown action %r)r9leninsertrr)rrYwordsrZr[r\ dir_patternwords rrUzManifest._parse_directivesh ! u:?uQx0B B LLI &q*...6K : :5zA~&:VCEE8=QRyAyt T*yHA A A5zA~&@6IKK"%(+F7|j |}tdkDr&|jr|jsJd}tjtjj|jd} |tdkr0|j d} |j |dt|  } nX|j |} | jr| jsJ| t|t| t|z } tj} tjdk(rd} tdkrd| z| j| d|zfz}n[|tt|tz }|| | | d||}n(|r&tdkr d| z|z}n| |t|d}tj|S) aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). )rarr=r5N\z\\^z.*) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionr-endswithescaper r r"rrbr) rr^rMrrjstartr=endrlr empty_pattern prefix_rers rrhzManifest._translate_pattern4s '3'zz'** V # ,,S1;;C@ME1c ))'2J'!,,U3 8K8KC8PPPJyydii45  &( $ 0 0 4  ,,V45Is=7I6IJ  ,,V4  ++E2y7I7I#7NNN%c%j#i.3s82KL &&Cvv~&( 4Z#((I48:4E4G+HH (E C Oc#h4NO 27y#2Cs"VV17JG rr@)F)TNF)__name__ __module__ __qualname____doc__rr+r.r2rDrJr_rUrVrXrhrxrrrr&sc #6/@, >.H-5^=A"''R=A"'(?C$)5&nr)rrloggingr rusysr5rcompatrutilr__all__ getLoggerrr7rvM_COLLAPSE_PATTERNS_COMMENTED_LINE version_inforwobjectrrrrrs    ,   8 $BJJz2440"**1244"$$;?""2A&ZvZrPK!,iviv#__pycache__/version.cpython-312.pycnu[ >g\ dZddlZddlZddlmZddlmZgdZeje Z Gdde Z Gd d e ZGd d e Zej d ej"ZdZeZGddeZdZGddeZej ddfej ddfej ddfej ddfej ddfej ddfej ddfej d d!fej d"d#fej d$d%ff Zej d&dfej d'dfej d(dfej ddfej d)dffZej d*Zd+Zd,Zej d-ej"Zd.d.d/d.d0ddd1Zd2ZGd3d4eZ Gd5d6eZ!ej d7ej"Z"d8Z#d9Z$Gd:d;eZ%Gd<d=eZ&Gd>d?e Z'e'eeee'ee!d@e'e$e&edAZ(e(dBe(dC<dDZ)y)Ez~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesparse_requirement)NormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemeceZdZdZy)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__>/opt/hc_python/lib/python3.12/site-packages/distlib/version.pyr r s)rr cdeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zed Zy)Versionc|jx|_}|j|x|_}t |t sJt |dkDsJy)Nr)strip_stringparse_parts isinstancetuplelen)selfspartss r__init__zVersion.__init__sH779$ q"jjm+ e%'''5zA~~rctd)Nzplease implement in a subclassNotImplementedErrorr!r"s rrz Version.parse%s!"BCCrcTt|t|k7rtd|d|yNzcannot compare z and )type TypeErrorr!others r_check_compatiblezVersion._check_compatible(s' :e $$FG G %rcV|j||j|jk(SNr/rr-s r__eq__zVersion.__eq__,s# u%{{ell**rc&|j| Sr1r3r-s r__ne__zVersion.__ne__0;;u%%%rcV|j||j|jkSr1r2r-s r__lt__zVersion.__lt__3s# u%{{U\\))rcL|j|xs|j| Sr1r9r3r-s r__gt__zVersion.__gt__7s"KK&<$++e*<==rcJ|j|xs|j|Sr1r;r-s r__le__zVersion.__le__:{{5!7T[[%77rcJ|j|xs|j|Sr1)r<r3r-s r__ge__zVersion.__ge__=r?rc,t|jSr1)hashrr!s r__hash__zVersion.__hash__AsDKK  rcN|jjd|jdS)Nz('z') __class__rrrDs r__repr__zVersion.__repr__Ds!^^44dllCCrc|jSr1rrDs r__str__zVersion.__str__G ||rctd)NzPlease implement in subclasses.r&rDs r is_prereleasezVersion.is_prereleaseJs!"CDDrN)rrrr$rr/r3r6r9r<r>rArErIrLpropertyrOrrrrrsW DH+&*>88!DEErrc |eZdZdZdddddddd d Zd Zd Zd ZedZ dZ dZ dZ dZ dZdZy)MatcherNc ||kSr1rvcps rzMatcher.TQUrc ||kDSr1rrTs rrXzMatcher.UrYrc||k(xs||kSr1rrTs rrXzMatcher.Va1foAorc||k(xs||kDSr1rrTs rrXzMatcher.Wr\rc ||k(Sr1rrTs rrXzMatcher.Xa1frc ||k(Sr1rrTs rrXzMatcher.YsqAvrc||k(xs||kDSr1rrTs rrXzMatcher.[r\rc ||k7Sr1rrTs rrXzMatcher.\r_r)<><=>======~=!=ct|Sr1rr(s rrzMatcher.parse_requirementas  ##rc,|j td|jx|_}|j |}|std|z|j |_|j j |_g}|jrw|jD]h\}}|jdr+|dvrtd|z|ddd}}|j|n|j|d}}|j|||fjt||_ y) NzPlease specify a version classz Not valid: %rz.*)rgrjz#'.*' not allowed for %r constraintsTF) version_class ValueErrorrrrnamelowerkey constraintsendswithappendrr)r!r"rclistopvnprefixs rr$zMatcher.__init__ds    %=> >779$ q  " "1 %_q01 1FF 99??$ ==A::d#-(*:<>*?@@"#3BB&&r*"&!3!3A!6B b"f-.'El rcFt|tr|j|}|jD]q\}}}|jj |}t|tr t ||}|s&|d|jj}t|||||rqyy)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z not implemented for FT) rrrnr _operatorsgetgetattrrHrr')r!versionoperator constraintrzfmsgs rmatchz Matcher.matchs g| ,((1G,0KK (Hj&##H-A!\*D!$#+T^^-D-DF)#..Wj&1-8rcd}t|jdk(r&|jdddvr|jdd}|S)Nrr)rgrh)r r)r!results r exact_versionzMatcher.exact_versionsC t{{ q T[[^A%6-%G[[^A&F rct|t|k7s|j|jk7rtd|d|yr*)r+rpr,r-s rr/zMatcher._check_compatibles7 :e $ UZZ(?$FG G)@rc|j||j|jk(xr|j|jk(Sr1)r/rrrr-s rr3zMatcher.__eq__s5 u%xx599$D )DDrc&|j| Sr1r5r-s rr6zMatcher.__ne__r7rcXt|jt|jzSr1)rCrrrrDs rrEzMatcher.__hash__sDHH~T[[ 111rcN|jjd|jdS)N()rGrDs rrIzMatcher.__repr__s>>22DLLAArc|jSr1rKrDs rrLzMatcher.__str__rMr)rrrrnr|rr$rrPrr/r3r6rErIrLrrrrRrROslM# "--$%-$ J$#:* HE&2BrrRz^v?(\d+!)?(\d+(\.\d+)*)((a|alpha|b|beta|c|rc|pre|preview)(\d+)?)?(\.(post|r|rev)(\d+)?)?([._-]?(dev)(\d+)?)?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$cn|j}tj|}|std|z|j }t d|dj dD}t|dkDr$|ddk(r|dd}t|dkDr |ddk(r|dsd}nt|ddd}|dd}|d d }|d d }|d }|dk(rd}n |d|ddf}n|dt|df}|dk(rd}n |d|ddf}n|dt|df}|dk(rd}n |d|ddf}n|dt|df}|d}nVg} |j dD]5} | jrdt| f} nd| f} | j| 7t | }|s |s|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %sc32K|]}t|ywr1int.0rUs r z_pep_440_key..s6!5AQ!5r.r )NNr)ar)z)_)final) rPEP440_VERSION_RErr groupsrsplitr risdigitru) r"mrnumsepochprepostdevlocalr#parts r _pep_440_keyrs  A"A %&?!&CDD XXZF 6!56 6D d)a-DHMCRy d)a-DHM !9F1IcrN# 1+C !A;D B-C 2JE l q6>a&!)Ca&#c!f+%C | 7?7A:D7CQL(D l q6>a&!)Ca&#c!f+%C }KK$D||~3t9~4y LL %e  CC   $T3 --rc:eZdZdZdZegdZedZy)raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b ct|}tj|}|j}t d|dj dD|_|S)Nc32K|]}t|ywr1rrs rrz*NormalizedVersion.parse..s$J5ISV5Irrr)_normalized_keyrrrrr_release_clause)r!r"rrrs rrzNormalizedVersion.parsesN #  # #A &$$JVAY__S5I$JJ r)rbrVrcrc@tfdjDS)Nc3FK|]}|s|djvyw)rN) PREREL_TAGS)rtr!s rrz2NormalizedVersion.is_prerelease..!s#F[A1Q44+++[s!!)anyrrDs`rrOzNormalizedVersion.is_prereleasesFT[[FFFrN) rrrrrsetrrPrOrrrrrs-" 23K GGrrct|}t|}||k(ry|j|syt|}||dk(S)NTFr)str startswithr )xyns r _match_prefixr$sC AA AAAv <<? AA Q43;rc \eZdZeZddddddddd Zd Zd Zd Zd Z dZ dZ dZ dZ dZy)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)rircrdrerfrgrhrjc|rd|vxr|jd}n!|jd xr|jd}|r0|jjddd}|j|}||fS)N+rrr)rrrrn)r!rrrz strip_localr"s r _adjust_localzNormalizedMatcher._adjust_local>sy Z/FGNN24FK )//33Jr8JK %%c1-a0A((+G ""rc|j|||\}}||k\ry|j}dj|Dcgc] }t|c}}t || Scc}wNFrrrjoinrrr!rrrzrelease_clauseipfxs rrzNormalizedMatcher._match_ltLg"00*fM j #33hh71A78 #...8Ac|j|||\}}||kry|j}dj|Dcgc] }t|c}}t || Scc}wrrrs rrzNormalizedMatcher._match_gtTrrc8|j|||\}}||kSr1rr!rrrzs rrzNormalizedMatcher._match_le\&"00*fM*$$rc8|j|||\}}||k\Sr1rrs rrzNormalizedMatcher._match_ge`rrc\|j|||\}}|s||k(}|St||}|Sr1rrr!rrrzrs rrzNormalizedMatcher._match_eqdsB"00*fM+F #7J7F rc0t|t|k(Sr1)rrs rrz"NormalizedMatcher._match_arbitraryls7|s:..rc^|j|||\}}|s||k7}|St|| }|Sr1rrs rrzNormalizedMatcher._match_neosE"00*fM+F 'w ;;F rc|j|||\}}||k(ry||kry|j}t|dkDr|dd}dj|Dcgc] }t |c}}t ||Scc}w)NTFrrr)rrr rrrrs rrz#NormalizedMatcher._match_compatiblews"00*fM j  Z $33 ~  "+CR0Nhh71A78Wc**8sA6N)rrrrrnr|rrrrrrrrrrrrrr/sU%M"  ! J #//%%/ +rrz[.+-]$z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}rz\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cv|jj}tD]\}}|j||}|sd}tj |}|sd}|}n|j djd}|Dcgc] }t|}}t|dkr |jdt|dkr t|dk(r||jd}nDdj|ddDcgc] }t|c}||jdz}|dd}dj|Dcgc] }t|c}}|j}|r tD]\}}|j||}|s|}nd|vrdnd}||z|z}t|sd}|Scc}wcc}wcc}w) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rrNr-r)rrq _REPLACEMENTSsub_NUMERIC_PREFIXrrrrr ruendrr_SUFFIX_REPLACEMENTS is_semver) r"rpatreplrrzsuffixrseps r_suggest_semantic_versionrs WWY__ F" Tv&#  f%A A$$S)"()&Q#a&&)&kAo MM! &kAo v;! AEEGH%FXXvabz:z!s1vz:;fQUUWX>NNFBQZF626a3q6623 .ICWWT6*F. f_c##& V  M/* ;2sF,<F1=F6c t||S#t$rYnwxYw|j}dD]\}}|j||}t j dd|}t j dd|}t j dd|}t j dd |}t j d d |}|j d r|d d}t j dd |}t j dd|}t j dd|}t j dd|}t j dd|}t j dd|}t j dd|}t j dd|}t j dd|}t j dd|}t j dd |} t||S#t$rd}Y|SwxYw)!aSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. ))z-alphar)z-betar)rr)rr)rrV)z-finalr)z-prerV)z-releaser)z.releaser)z-stabler)rr)rr) r)z.finalr)rrzpre$pre0zdev$dev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?rrUrNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$rz\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1)rr rqreplacererr)r"rsorigrs r_suggest_normalized_versionrs"  "    B& d ZZd # & " %B " %B )7B 7B -x .get_partsMs$$QWWY/A $$Q*A!BQ%&3& AaA a 0  h rr r rz*final-00000000)rpoprur)r"rrrWs r _legacy_keyrLs F q\ << 8|y!8JJLy!8VBZ:5 VBZ:5 a =rc"eZdZdZedZy)r ct|Sr1)rr(s rrzLegacyVersion.parsegs 1~rcd}|jD]/}t|ts|jds&|dks,d}|S|S)NFr r T)rrrr)r!rrs rrOzLegacyVersion.is_prereleasejsDA1l+ S0Aa(l  rNrrrrrPrOrrrr r fsrr cheZdZeZeejZded<ejdZ dZ y)r rriz^(\d+(\.\d+)*)c||kry|jjt|}|stj d||y|j d}d|vr|j ddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrrr) numeric_rerrloggerwarningrrsplitr)r!rrrzrr"s rrzLegacyMatcher._match_compatible|sz Z  OO ! !#j/ 2 NN018* F HHJqM !8a #AWa((rN) rrrr rndictrRr|rcompilerrrrrr r ts7!Mg(()J*Jt-.J )rr zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$c,tj|Sr1) _SEMVER_REr)r"s rrrs   A rcd}t|}|s t||j}|ddDcgc] }t|c}\}}}||dd||dd} }|||f|| fScc}w)Nc||f}|S|ddjd}t|Dcgc]%}|jr|jdn|'c}}|Scc}w)Nrrr )rrrr)r"absentrr#rWs r make_tuplez!_semantic_key..make_tuplesf 9YF  abEKK$EeLe!))+AGGAJ1> !F ^^A&F rr1)rrrr$r9r;r>r@rrrr2r2s# <rr2c|Sr1rr(s rrXrXsr) normalizedlegacysemanticrBdefaultc@|tvrtd|zt|S)Nzunknown scheme name: %r)_SCHEMESro)rps rrrs% 82T9:: D>r)*rloggingrcompatrutilr__all__ getLoggerrrror objectrrRrIrrrrrrrrrrrr rrr r r!rr,r r r2rGrrrrrOs   # 4   8 $ j .Ef.EbafaHBJJ FGIttM B.J!G!GHT+T+pRZZ2RZZ g&RZZ"RZZ &RZZ&'/RZZ"#U+RZZ C RZZ"#W-RZZ+,RZZ v&  RZZ r"RZZ #RZZ S!RZZ C RZZ "**-.+\lf 0"$$7    4 G )G)4RZZ:;=44A -*(g($g$$F$P 1B ;=K8IJm_79  |,rPK! S$__pycache__/database.cpython-312.pycnu[ >gdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z gd Z!ejDe#Z$d Z%d Z&d eddde%dfZ'dZ(Gdde)Z*Gdde)Z+Gdde)Z,Gdde,Z-Gdde-Z.Gdde-Z/e.Z0e/Z1Gdd e)Z2d%d!Z3d"Z4d#Z5d$Z6y)&zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter) DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.json INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc"eZdZdZdZdZdZy)_CachezL A simple cache mapping names and .dist-info paths to distributions c.i|_i|_d|_y)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generatedselfs ?/opt/hc_python/lib/python3.12/site-packages/distlib/database.py__init__z_Cache.__init__.s  cz|jj|jjd|_y)zC Clear the cache, setting it to its initial state. FN)r"clearr#r$r%s r'r+z _Cache.clear6s'  r)c|j|jvrO||j|j<|jj|jgj |yy)z` Add a distribution to the cache. :param dist: The distribution to add. N)r#r" setdefaultkeyappendr&dists r'addz _Cache.add>sN 99DII %#'DIIdii II 2 . 5 5d ; &r)N)__name__ __module__ __qualname____doc__r(r+r2r)r'r r )sr+r?r%s r' clear_cachezDistributionPath.clear_cacheis$  r)c#Kt}|jD]}tj|}||j d}|r |j sS/T Z8(,QVVT::/.DC!C^CNN32#MM# "3MBB Cs]BI*A H 4H 7I*8#H G>)CH 7I*>H H  I'A I"I*"I''I*c|jj }|jxr|jj }|s|r|j D]I}t |t r|jj|/|jj|K|rd|j_|rd|j_yyy)zk Scan the path for distributions and populate the cache with those that are found. TN)r>r$r=r?rx isinstancerr2)r&gen_distgen_eggr1s r'_generate_cachez DistributionPath._generate_caches {{,,,##EDOO,E,E(E w113d$9:KKOOD)OO''- 4 (, %,0)r)cZ|jdd}dj||gtzS)ao The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: string-_)replacer`r^)clsr"versions r'distinfo_dirnamez!DistributionPath.distinfo_dirnames,&||C%xxw(<77r)c#FK|js|jD]}|y|j|jjj D]}||j r.|jjj D]}|yyw)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r@rxr}r>r#valuesr=r?r0s r'get_distributionsz"DistributionPath.get_distributionss""113 4  " ((//1 2   OO00779DJ:!sBB!cd}|j}|js+|jD]}|j|k(s|}|S|S|j ||j j vr|j j |d}|S|jr4||jj vr|jj |d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr@rxr.r}r>r"r=r?)r&r"resultr1s r'get_distributionz!DistributionPath.get_distributionszz|""11388t#!F 4  "t{{'''))$/2 ""tt/C/C'C--d3A6 r)c#Kd}|" |jj|d|d}|j D]q}t |dst jd|&|j}|D];}t|\}}| ||k(s|S||k(s%|j|s7|qsy#t$rtd|d|wxYww)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string N ()zinvalid name or version: , provideszNo "provides": %s) rAmatcher ValueErrorrrhasattrrdrerrmatch) r&r"rrr1providedpp_namep_vers r'provides_distributionz&DistributionPath.provides_distributions   \,,..D'/JK**,D4, 0$7==!A$:1$=MFE!T>"&J!!T>gmmE.B"&J!"- \&DRY'Z[[ \s.C !B.AC  C C $ C .C  C cf|j|}|td|z|j|S)z5 Return the path to a resource file. zno distribution named %r found)r LookupErrorget_resource_path)r&r" relative_pathr1s r' get_file_pathzDistributionPath.get_file_paths;$$T* <>EF F%%m44r)c#K|jD]@}|j}||vs||}| ||vs ||(|jD]}|Byw)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)rexportsr)r&categoryr"r1rndvs r'get_exported_entriesz%DistributionPath.get_exported_entries(s_**,D A1}hK#qyg XXZ(-s$A A$A)NFrD)r3r4r5r6r(rFrIproperty cache_enabledrKrxr} classmethodrrrrrrr7r)r'rrHse-(#$/1CDM ,C\1&88*,4&"P5 r)rceZdZdZdZ dZ dZedZeZ edZ edZ dZ edZ ed Zed Zed Zed Zd ZdZdZdZy)rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. Fc||_|j|_|jj|_|j|_d|_d|_d|_d|_t|_ i|_ y)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) rRr"rr.rlocatordigestextrascontextrX download_urlsdigests)r&rRs r'r(zDistribution.__init__Msb ! MM 99??$''      U r)c.|jjS)zH The source archive download URL for this distribution. )rR source_urlr%s r'rzDistribution.source_url^s }}'''r)c:|jd|jdS)zX A utility property which displays the name and version in parentheses. rrr"rr%s r'name_and_versionzDistribution.name_and_versiongs !IIt||44r)c|jj}|jd|jd}||vr|j ||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. rr)rRrr"rr/)r&plistss r'rzDistribution.providesns<  &&DLL 1 E> LLO r)c|j}t||}tjd|j||t |j ||j|jS)Nz)%s: got requirements %r from metadata: %r)rrS) rRgetattrrdrer"rXget_requirementsrr)r&req_attrmdreqtss r'_get_requirementszDistribution._get_requirementszsT ]]H% @$))XW\]2&&uT[[dll&STTr)c$|jdS)N run_requiresrr%s r'rzDistribution.run_requires%%n55r)c$|jdS)N meta_requiresrr%s r'rzDistribution.meta_requires%%o66r)c$|jdS)Nbuild_requiresrr%s r'rzDistribution.build_requiress%%&677r)c$|jdS)N test_requiresrr%s r'rzDistribution.test_requiresrr)c$|jdS)N dev_requiresrr%s r'rzDistribution.dev_requiresrr)ct|}t|jj} |j |j }|j}d}|jD]*}t|\}} ||k7r |j| }|S|S#t $r=tjd||jd}|j |}YwxYw#t $rYwxYw)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. +could not read version %r - using name onlyrF)rrrRrQr requirementr rdrisplitr.rrr) r&reqrnrQrr"rrrrs r'matches_requirementz Distribution.matches_requirements c "DMM001 +nnQ]]3G{{A215MFE~  u-  %' + NNH# N99;q>DnnT*G  + +  s$B9CACC C%$C%c~|jrd|jz}nd}d|jd|jd|dS)zC Return a textual representation of this instance, z [%s]rMz)rr"r)r&suffixs r'__repr__zDistribution.__repr__s4 ??t.FF-1YY fMMr)ct|t|urd}|S|j|jk(xr4|j|jk(xr|j|jk(}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typer"rr)r&otherrs r'__eq__zDistribution.__eq__sc ;d4j (F ii5::-w$,,%--2OwTXTcTcglgwgwTwF r)ct|jt|jzt|jzS)zH Compute hash in a way which matches the equality test. )hashr"rrr%s r'__hash__zDistribution.__hash__s.DIIdll!33d4??6KKKr)N)r3r4r5r6build_time_dependency requestedr(rr download_urlrrrrrrrrrrrrr7r)r'rr;s " I5"(( L 55   U 6677887766BN Lr)rc0eZdZdZdZdfd ZddZxZS)rz] This is the base class for installed distributions (whether PEP 376 or legacy). NcHtt| |||_||_y)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr(r# dist_path)r&rRr#rS __class__s r'r(z"BaseInstalledDistribution.__init__s# '7A r)c$| |j}|tj}d}ntt|}d|jz}||j }t j |jdjd}||S)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str rMz%s==ascii) hasherhashlibmd5rrbase64urlsafe_b64encoderstripdecode)r&datarprefixrs r'get_hashz"BaseInstalledDistribution.get_hashs& >[[F >[[FFWf-FT[[(F$$&))&188>EEgN((r)rD)r3r4r5r6rr(r __classcell__rs@r'rrs F )r)rceZdZdZdZdfd ZdZdZdZe dZ dZ d Z d Z d Zdd Zd Ze dZddZdZdZdZdZej0ZxZS)ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). sha256cg|_tj|x|_}|t d|z|rH|j r<||j jvr$|j j|j}n||jt}||jt}||jt}|t dtd|tj|j5}t!|d}dddt"t$|O||||r'|j r|j j)||jd}|du|_t,jj/|d}t,jj1|rJt3|d5}|j5j7d } ddd j9|_yy#1swYxYw#1swY,xYw) Nzfinder unavailable for %szno z found in rNrOr top_level.txtrbutf-8)modulesrrYrmrr@r>r#rRrZr r r rarbrcr rrr(r2rosr`existsopenreadr splitlines) r&r#rRrSrmrnrurfrrs r'r(zInstalledDistribution.__init__s (88>> f >84?@ @ 3%%$#**//*Azzt,55H   -.AyKK 78yKK 89y 8I4!PQQ##AKKM2f#F8D3 #T3HdCH 3%% JJNN4 KK $$ GGLL / 77>>! a!vvxw/??,DL 32s>G67 H6G?H cVd|jd|jd|jdS)Nz|jd}tj|j5}t |5}|D] \}}||k(s |ccdddcdddS ddddddt d|z#1swYxYw#1swY#xYw)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. rr Nz3no resource file with relative path %r is installed)r rarbrcrKeyError)r&rrnruresources_readerrelative destinations r'rz'InstalledDistribution.get_resource_path{s  & &{ 3    .&&)-=-=)Hk=0***)/ .-=*/ &(567 7 *)/ .s5 BBB B'B)BB BBc#>K|jD]}|yw)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r&rs r'list_installed_filesz*InstalledDistribution.list_installed_filess '')FL*sctjj|d}tjj|j}|j |}tjj|d}|j d}t jd||ryt|5}|D]}tjj|s|jdrdx} } nVdtjj|z} t|d5} |j| j} ddd|j |s|r1|j |r tjj||}|j!| | f|j |r tjj||}|j!|ddfddd|S#1swYxYw#1swY|SxYw)z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. rMr creating %sNz.pycz.pyoz%dr)rr#r`dirname startswithrrdinforisdirr]getsizerrrrelpathwriterow) r&pathsrdry_runbasebase_under_prefix record_pathwriterr# hash_valuerfps r'write_installed_filesz+InstalledDistribution.write_installed_filessfb)wwtyy) OOF3ww||D"%,,X6  M;/  { #v77==&$--8H*I(**J"''//$"77DdD)R%)]]2779%= *??4(->4??SYCZ77??46Dz4 89%%d+ ggook4@ OO["b1 2!$"*)$"s&0A)G6 G*9B'G6*G3 /G66Hchg}tjj|j}|jd}|j D]T\}}}tjj |s tjj ||}||k(rMtjj|s|j|dddftjj|sttjj|}|r||k7r|j|d||f|sd|vr|jddd}nd }t|d 5} |j| j|} | |k7r|j|d || fd d d W|S#1swYdxYw)  Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rrTFr=rrNrr)rr#r(rr$isabsr`rr/isfilestrr,rrrr) r& mismatchesr1r3r#r5r actual_sizerr actual_hashs r'check_installed_filesz+InstalledDistribution.check_installed_filessi wwtyy),,X6 &*&?&?&A "D*d77==&ww||D$/{"77>>$'!!44"?@%!"''//$"78 K4/%%tVT;&GHj(!+!1!1#q!9!!<!%dD)Q&*mmAFFHf&E &*4&--tVZ.UV*)#'B* *)s ;F''F1 ci}tjj|jd}tjj|rt j |dd5}|j j}dddD]C}|jdd\}}|dk(r"|j|gj|?|||<E|S#1swYSxYw) a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rrnrencodingNr:r namespace) rr#r`r<codecsrrrrr-r/)r&r shared_pathrlinesliner.rHs r'shared_locationsz&InstalledDistribution.shared_locationssggll499h7 77>>+ &[#@A++-A!ZZQ/ U+%%%c2.55e<"'F3K   A@s $CCc tjj|jd}tj d||ryg}dD]@}||}tjj ||s+|j |d|B|jddD]}|j d|ztj|d d 5}|jd j|ddd|S#1swY|SxYw) aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rr&N)rlibheadersscriptsrr:rEr7z namespace=%srrrC ) rr#r`rdr*r+r/getrFrwrite) r&r/r0rGrHr.r#nsrs r'write_shared_locationsz,InstalledDistribution.write_shared_locationssggll499h7  M;/ BC:Dww}}U3Z( T23C))K,B LL", --[[cG < GGDIIe$ %==s !C99Dc|tvrtd|d|jtj|j}|td|jz|j |S)N#invalid path for a dist-info file: rzUnable to get a finder for %s) DIST_FILESrr#rrYrZ)r&r#rms r'r z+InstalledDistribution.get_distinfo_resourcese z !"15tyy$BC C**4995 >"#BTYY#NO O{{4  r)c |jtjdk\r}|jtjdd\}}||jjtjdk7r)t d|d|j d|jd|tvrt d |d |jtjj|j|S) a Returns a path located under the ``.dist-info`` directory. Returns a string representing the path. :parameter path: a ``'/'``-separated path relative to the ``.dist-info`` directory or an absolute path; If *path* is an absolute path and doesn't start with the ``.dist-info`` directory path, a :class:`DistlibException` is raised :type path: str :rtype: str rNzdist-info file z does not belong to the rz distributionrUr) rZrseprr#rr"rrVr`)r&r#rs r'rz'InstalledDistribution.get_distinfo_files 99RVV  !%)ZZ%7%< " d499??266#:2#>>&9=tyy$,,(XYY z !"15tyy$BC Cww||DIIt,,r)c#NKtjj|j}|jD]e\}}}tjj |s tjj ||}|j |jsb|gyw)z Iterates over the ``RECORD`` entries and returns paths for each line if the path is pointing to a file located in the ``.dist-info`` directory or one of its subdirectories. :returns: iterator of paths N)rr#r(rr;r`r))r&r1r#rrs r'list_distinfo_filesz)InstalledDistribution.list_distinfo_files7sqwwtyy)$($5$5$7 D(D77==&ww||D$/tyy) %8s BB%B%cXt|txr|j|jk(SrD)rzrr#r&rs r'rzInstalledDistribution.__eq__Gs"5"78TTYY%**=TUr))NNF)r3r4r5r6rr(rrrrrrrrr$r7rArJrSr rr\robjectrrrs@r'rr sF-B\3.    &7( D!F42!-8 VHr)rcpeZdZdZdZiZd fd ZdZdZdZ dZ dZ d d Z d Z ejZxZS) raCreated with the *path* of the ``.egg-info`` directory or file provided to the constructor. It reads the metadata contained in the file itself, or if the given path happens to be a directory, the metadata is read from the file ``PKG-INFO`` under that directory.Tcd}||_||_|rf|jrZ||jjvrB|jj|j}|||j |j nX|j|}|||j |j |r'|jr|jj|tt|/|||y)NcJ||_|j|_||_yrD)r"rr.r)rnrs r'set_name_and_versionz:EggInfoDistribution.__init__..set_name_and_versionYsAFGGIAEAIr)) r#rr@r?rRr"r _get_metadatar2rrr()r&r#rSrerRrs r'r(zEggInfoDistribution.__init__Ws    3%%$#..2E2E*E~~**4099H x}}h6F6F G))$/H !x}}h6F6F Gs))""4( !41(D#Fr)cd}dfd}dx}}|jdrKtjj|rtjj |d}tjj |d}t |d}tjj |d} tjj |d }|| }nIt j|} t| jd jd } t | d } | jd } | jdjd}| jd}n|jdrtjj|rhtjj |d} || }tjj |d}tjj |d }t |d}ntd|z|r|j||U|Stjj|r4t|d5} | j!jd}ddd|sg}n|j#}||_|S#t$rd}YwxYw#1swY8xYw)Ncg}|j}|D]}|j}|s|jdrtj d||St |}|stj d|d|j rtj d|js|j|jdjd|jD}|j|jd|d|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedrc3&K|] }d|z yw)z%s%sNr7).0cs r' zQEggInfoDistribution._get_metadata..parse_requires_data..s$GAVaZrr) rstripr)rdrirr constraintsr/r"r`)rreqsrHrIrnconss r'parse_requires_dataz>EggInfoDistribution._get_metadata..parse_requires_dataps DOO%Ezz|??3'NN#SUYZK&d+NN#H$O88NN$34}}KK'99$G$GGDKKQVVT :;'(Kr)cg} tj|dd5}|j}ddd|S#1swY|SxYw#t$rY|SwxYw)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rnrN)rFrrIOError)req_pathrqr6rss r'parse_requires_pathz>EggInfoDistribution._get_metadata..parse_requires_pathsb D [[38B.rwwy9D9K 9K K s+A =A AA A AArUzEGG-INFOzPKG-INFOrN)r#rQz requires.txtrzEGG-INFO/PKG-INFOutf8rOzEGG-INFO/requires.txtzEGG-INFO/top_level.txtrrTz,path must end with .egg-info or .egg, got %rr)r]rr#r+r`r zipimport zipimporterrget_datarruradd_requirementsrrrrr)r&r#requiresrwtl_pathtl_datar meta_pathrRrvzipfrPrrrss @r'rfz!EggInfoDistribution._get_metadatams; : ! ' == ww}}T"GGLLz2GGLLJ7 #8D77<<>:'',,q/:.x8!,,T2"4==1D#E#L#LV#TU#GHE$==)@AD"mm,DELLWUG24;;w3GHH]]; 'ww}}T"77<<n=.x8ww||D*5'',,t_=T(;H"$,.2$34 4   % %h / ?"rww~~g'>'4(Affhoog6G)G((*G 3$#H$$)(s$AJ)# J:) J76J7:KcVd|jd|jd|jdS)Nzr3r#rs r'rAz)EggInfoDistribution.check_installed_filess ggll499.CD 77>>+ &"779 a;&ww~~d+%%tXtU&CD : r)c d}d}tjj|jd}g}tjj|rt j |dd5}|D]}|j }tjjtjj|j|}tjj|s(tjd||jdrtjj|r|j|||||f d d d |j|d d f|S#1swYxYw) z Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) ct|d} |j}|jtj|j S#|jwxYw)Nr)rrcloserr hexdigest)r#rcontents r'_md5z6EggInfoDistribution.list_installed_files.._md5sLT4 A &&( ;;w'113 3 s AA#c@tj|jSrD)rstatst_size)r#s r'_sizez7EggInfoDistribution.list_installed_files.._sizes774=(( (r)rrnrrCzNon-existent file: %sr'N) rr#r`rrFrronormpathrdrir]r+r/)r&rrr3rrrIrs r'r$z(EggInfoDistribution.list_installed_filess 4 )ggll499.CD  77>>+ &[#@AD::>!,'>B::&67$77==+ q$q'58&<=A MM;d3 4 A@s+CE0/"E00E9c# Ktjj|jd}tjj|rd}t j |dd5}|D]}|j }|dk(rd}|rtjjtjj|j|}|j|js|r|| dddyy#1swYyxYww) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths rTrnrrCz./FN) rr#r`rrFrrorr))r&absoluter3skiprrIrs r'r\z'EggInfoDistribution.list_distinfo_filessggll499.CD 77>>+ &D[#@AD:: "z " [label="z"] z" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rOz} )rQritemsrr/r")r&rskip_disconnected disconnectedr1adjsrrs r'to_dotzDependencyGraph.to_dotxs  *+--335JD$4yA~&7##D) $ u$GGTYY TYZ[GG 5::FG !%6!S%6%: GG/ 0 GG. / GG% &$*+ % GGEN r)c :g}i}|jjD] \}}|dd||< g}t|jddD]\}}|r |j|||=|sn|jD]$\}}|Dcgc]\}}||vs ||fc}}||<&tj d|Dcgc]}|j d|jd c}|j||t|jfScc}}wcc}w)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. NzMoving to result: %srr) rrlistr/rdrer"rrkeys)r&ralistkr to_removerrns r'topological_sortz DependencyGraph.topological_sorts''--/DAqtE!H0IU[[]+A.1$$Q'a/ 1/0Gqtq!AY4FQFqGa& LL/[d1e[dVWqvvqyy2Q[d1e f MM) $tEJJL)))H1es DD;#D cg}|jjD]%\}}|j|j|'dj |S)zRepresentation of the graphrO)rrr/rr`)r&rr1rs r'rzDependencyGraph.__repr__sH--335JD$ MM$... /6yy  r)rD)r)T) r3r4r5r6r(rrrrrrrrr7r)r'rr/s5  - + F3 !>*<!r)rc0t|}t}i}|D]m}|j||jD]K}t |\}}t j d||||j|gj||fMo|D]}|j|jz|jz|jz}|D]s} |j| } | j"}d} ||vr8||D]0\}} | j%|} | s|j'|| | d} n| rb|j)|| u|S#t$r=t jd| | j!d}|j|} YwxYw#t$rd} YwxYw)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %srrFT)rrrrrrdrer-r/rrrrrr rirr.rrr)distsrQgraphrr1rr"rr}rrmatchedproviderrs r' make_graphrs F  EH t$A215MD' LL6gt L   b ) 0 0'4 A%%(:(::T=P=PPSWSdSddC / ..-;;DGx)1$%GX& ' g 6tXs;"&*8!!$,16 L-+ /LcRyy{1~ ...  /3& %&s%D>7F>AFF F F c:||vrtd|jzt|}|g}|j|}|rN|j }|j ||j|D]}||vs|j ||rN|j d|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested 1given distribution %r is not a member of the listr)rr"rrpopr/)rr1rdeptodorsuccs r'get_dependent_distsrs 5 -/3yy 9: : u E &C   d #D  HHJ 1 &&q)D3 D!* GGAJ Jr)c||vrtd|jzt|}t}|j|}td|D}|rn|j d}|j ||j|}|D]3}|d}||vs ||vs|j ||j|5|rn|S)aRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested in finding the dependencies. rc3&K|] }|d yw)rNr7)rkts r'rmz%get_required_dists..s"TqtTrnr)rr"rrXrrr2r/) rr1rrrrlr pred_listpreds r'get_required_distsr s 5 -/3yy 9: : u E %C    %D "T" "D  HHJqM  ((+ DQA|   D!   Jr)c |jdd}tdi|}||_||_|xsd|_t |S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summaryr7)rr r"rrr)r"rkwargsrrs r' make_distr(sHjj$=>G  F BBGBJ55BJ  r))r:)7r6 __future__rrrFrarloggingrr_r;ryrMrrcompatrrrr rRr r r r utilrrrrrrr__all__ getLoggerr3rdrCOMMANDS_FILENAMErVr^r`r rrrrrrfrgrrrrrr7r)r'rs '   )8ff    8 $(*,h [Rbdl m  p vp fVL6VLr4) 4)n@5@F Z3Zz'$K!fK!\1h4: r)PK! M M#__pycache__/scripts.cpython-312.pycnu[ >gHPddlmZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z m Z m Z ddlmZddlmZmZmZmZmZmZej.eZdj5Zej8d Zd Zej>d k(sej>d k(ryej@d k(rjejCd ddZ"ee"jGdDcic]4}|j>jIdr|j>|jJ6c}Z&dZ'e'Z(Gdde)Z*ycc}w))BytesION)ZipInfo) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executable get_platformin_venva s^#!.*pythonw?[0-9.]*([ ].*)?$z# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) ntjava..execd|vr[|jdr4|jdd\}}d|vr|jds|d|d}|S|jdsd|z}|S)N z /usr/bin/env r"z "z"%s") startswithsplit) executableenv _executables >/opt/hc_python/lib/python3.12/site-packages/distlib/scripts.pyenquote_executablerGsx j   1)//Q7 Ck!+*@*@*E*-{;  ((-#j0 cHeZdZdZeZdZddZdZe jjdrdZ dZ dZdd Zd ZeZd Zd Zd ZdZddZdZedZej6dZej:dk(sej:dk(rej<dk(rdZddZ ddZ!y) ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. Nc||_||_||_d|_d|_t j dk(xs(t j dk(xrt jdk(|_td|_ |xs t||_ t j dk(xs(t j dk(xrt jdk(|_ tj|_y)NFposixr)rX.Yr) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr _fileop_is_ntsys version_info)selfr%r&r'dry_runfileops r__init__zScriptMaker.__init__ds$$*  G+[F1B1ZrxxSZGZ K( 6g!6 ggoQ"''V*;*PD@P ,,rc|jddr`|jrTtjj |\}}|j dd}tjj ||}|S)NguiFpythonpythonw)getr1r*pathrreplacejoin)r4roptionsdnfns r_get_alternate_executablez%ScriptMaker._get_alternate_executablersV ;;ue $WW]]:.FBHi0Bb"-Jrrc t|5}|jddk(cdddS#1swYyxYw#ttf$rtj d|YywxYw)zl Determine if the specified executable is a script (contains a #! line) z#!NzFailed to open %sF)openreadOSErrorIOErrorloggerwarning)r4rfps r _is_shellzScriptMaker._is_shell{sR  *%771:-&%%W% 2J? s# 7+ 7477%AAc|j|r3ddl}|jjj ddk(r|Sd|zS|j j dr|Sd|zS)Nrzos.nameLinuxz jython.exez/usr/bin/env %s)rMrlangSystem getPropertylowerendswith)r4rrs r_fix_jython_executablez"ScriptMaker._fix_jython_executablesk~~j)99##// :gE%%%z1 1!!#,,\:!!$z1 1rctjdk7rd}nQttddrd}n=t |t |zdz}tj dk(rd}nd}d |vxr||k}|r d |z|zd z}|Sd }|d |z|zdzz }|dz }|S)a Build a shebang line. In the simple case (on Windows, or a shebang line which is not too long or contains spaces) use a simple formulation for the shebang. Otherwise, use /bin/sh as the executable, with a contrived shebang which allows the script to run either under Python or sh, using suitable quoting. Thanks to Harald Nordgren for his input. See also: http://www.in-ulm.de/~mascheck/various/shebang/#length https://hg.mozilla.org/mozilla-central/file/tip/mach r#Tcross_compilingFdarwini s#! s #!/bin/sh s '''exec' s "$0" "$@" s' ''' )r*r+getattrr2lenplatform)r4r post_interpsimple_shebangshebang_lengthmax_shebang_lengthresults r_build_shebangzScriptMaker._build_shebangs 77g !N S+U 3 #N!_s;/??!CN||x'%("%("#:5aNN`<`N Z'+5=F  $F lZ/+=O OF j F rcd}|jr|j}d}n/tjs t}nt rJt j jtjddtjdz}nt jdk(rJt j jtjddtjdz}n^t j jtjddtjd tjd}|r|j||}tjjd r|j|}|r t!|}|j#d }tjd k(r d |vr d|vr|dz }|j%||} |j'd |d k7r |j'||S|S#t($rt+d|zwxYw#t($rt+d|d|dwxYw)NTFscriptszpython%sEXErBINDIRr:VERSIONrutf-8cliz -X:Framesz -X:FullFramess -X:Framesz,The shebang (%r) is not decodable from utf-8z The shebang (z-) is not decodable from the script encoding ())rris_python_buildr rr*r=r?get_pathget_config_varr+rCr2r_rrUrencoderedecodeUnicodeDecodeError ValueError)r4encodingr`r@enquotershebangs r _get_shebangzScriptMaker._get_shebangs ??JG**,')J Yi&8&8&CZR[RjRjkpRqEqrJww$ WW\\)*B*B8*L*4 8P8PQV8W*XZ  WW\\,,X6$-$<$  W NN7 # w  Xx(w" WKgUV V W& X DKX"WXX Xs#H:H*H'*Ic|jt|j|jj dd|jzS)Nrr)module import_namefunc)script_templatedictprefixsuffixr)r4entrys r_get_script_textzScriptMaker._get_script_textsB##d<>'*4<<NN#>H ..w E==LL44gY?   W %C&%&!NN$9:*W4Fww~~f- &)IIgv.LL227LILL"34 &)$sD!A5I#II BL.LL L LLLL-cPt}d|jvr|j|d|jvr"|j||jdd|jvr>|j||j|jdd|jd|S)NrXrr$rr)r.r/addr3variant_separator)r4r+rds rget_script_filenamesz ScriptMaker.get_script_filenames<s   JJt  $--  JJt'8'8';< = DMM ! JJdD,B,BDDUDUVWDXZ^ZkZklmZno p rcxd}|r9|jdg}|r%ddj|z}|jd}|jd||}|j |jd}|j |j }|r|jddrd } nd } |j||||| y) Nrinterpreter_argsz %srrkr@r9Fpywr)r<r?rqrxrrr+r) r4rrr@r`argsrwscript scriptnamesrs r _make_scriptzScriptMaker._make_scriptFs ;;126Dsxx~-"kk'2 ##G['#J&&u-44W=// ; w{{5%0CC ;CHrcd}tjj|jt |}tjj|j tjj |}|js3|jj||stjd|y t|d}|j}|stjd|ytj!|j#dd}|rd}|j%dxsd } |sh|r|j+|jj-|||j.r|jj1|g|j3|ytj5d ||j |jj(st7|j\} } |j9d |j;| } d vrd } nd} tjj |} |j=| g| |j?|| |r|j+yy#t&$r|j(sd}YWwxYw)NFznot copying %s (up-to-date)rbz%s is an empty file (skipping)s r\Trrzcopying and adjusting %s -> %srspythonwrr) r*r=r?r%r r&rr(r0newerrJrrFreadlinerK FIRST_LINE_REmatchr>grouprIr5close copy_filer-rrinforseekrxrrG)r4rradjustrf first_linerr`rulinesrwrrs r _copy_scriptzScriptMaker._copy_scriptVsdoo|F/CD'',,t0@0@0HIzz$,,"4"4VW"E LL6 ?   4VT"A J?H!'' (:(:7E(JKE#kk!n3  LL " "67 3}} 00';   W % KK8&$// R<<''"1!**"=%q ++HkB+CCGG$$W-""A39cJ E <<A s= I--J J c.|jjSrr0r5)r4s rr5zScriptMaker.dry_runs||###rc&||j_yrr)r4values rr5zScriptMaker.dry_runs$ rrctjddk(rd}nd}tdk(rdnd}|||d}|tvrd |d t}t |t|S) NP6432z win-arm64z-armrrzUnable to find resource z in package )structcalcsizerWRAPPERSDISTLIB_PACKAGErt)r4kindbitsplatform_suffixr+msgs rrzScriptMaker._get_launchersas#q((4+(Ef2O#'?D8#o/ o%D> !rctg}t|}||j|||S|j||||S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. r)r rr)r4 specificationr@rrs rmakezScriptMaker.makesM  / =   mY 7   eY  @rcZg}|D]#}|j|j||%|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r4specificationsr@rrs r make_multiplezScriptMaker.make_multiples2  +M   TYY}g> ?,r)TFN)rNr)"__name__ __module__ __qualname____doc__SCRIPT_TEMPLATEr}rr7rCr2r_rrMrUrerxr_DEFAULT_MANIFESTrrrrrrrpropertyr5setterr*r+r,rrrrrr!r![s&OJ - ||v&  2"H@D\!H$5&nI 0d$$ ^^%% ww$277f,T1A "& rr!)+iorloggingr*rerr2rzipfilercompatrrr resourcesr utilr r r r rr getLoggerrrJstriprcompilerrr+r,rsplitriteratorrTbytesrr_enquote_executableobjectr!)rs0rrs 77gg   8 $ uw!& => "77d?rww&(RXX-=ooc1-a0O(11"55A 66??6 " 5H ")d&d7s9D#PK!X^^!__pycache__/index.cpython-312.pycnu[ >g=QddlZddlZddlZddlZddlZddlZ ddlmZddl m Z ddl m Z mZmZmZmZmZddlmZmZej,eZdZdZGd d eZy#e$r ddl mZYMwxYw) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)zip_dir ServerProxyzhttps://pypi.org/pypipypiceZdZdZdZddZdZdZdZdZ d Z d Z dd Z dd Z dd Z ddZdZ ddZ ddZddZdZdZddZy) PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc|xst|_|jt|j\}}}}}}|s|s|s|dvrt d|jzd|_d|_d|_d|_ttjd5}dD]+} tj| dg||} | dk(r | |_n-dddy#t$rYBwxYw#1swYyxYw) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. )httphttpszinvalid repository: %sNw)gpggpg2z --versionstdoutstderrr) DEFAULT_INDEXurlread_configurationr rpassword_handler ssl_verifierrgpg_homeopenosdevnull subprocess check_callOSError) selfrschemenetlocpathparamsqueryfragsinksrcs > OO  88JK>>(FM*24 (D !QI"[[+557 y1;;=  $ # "$*   RWW--h7CD h%668& LL/277+;+;H+E!# $ MM"''//(3 4%%aggi7  )))" !&%s$G9 H9HHc|jtjj|st d|ztjj |d}tjj |st d|z|j|j|j}}t|j}dd|fd|fg}d||fg}|j||} |j| S)a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r)rI doc_uploadr]versionr)rAr!r)isdirrrlrrKr]rr getvaluerMrO) r&rPdoc_dirfnr]rzip_datafieldsrrRs r0upload_documentationz!PackageIndex.upload_documentation!s  ww}}W%"#87#BC C WW\\'< 0ww~~b!"?R#78 8 x'7'7g7#,,.+4.9g"68T8,-%%fe4  ))r6c|jdddg}| |j}|r|jd|g|jd||gtj ddj ||S)a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. rbrcrdrez--verifyrgrh)rrrirZr[rl)r&signature_filename data_filenamerqr5s r0get_verify_commandzPackageIndex.get_verify_command=shxxZ8  }}H  JJ X. / J 2MBC ^SXXc]3 r6c|js td|j|||}|j|\}}}|dvrtd|z|dk(S)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailable)rrz(verify command failed with error code %sr)rrrr)r&rrrqr5r/rrs r0verify_signaturezPackageIndex.verify_signatureUsoxx"$12 2%%&8-&.0!--c2FF V "#MPR#RS SQwr6c n|d}tjdnKt|ttfr|\}}nd}t t |}tjd|zt|d5}|jt|} |j} d} d} d} d} d | vrt| d } |r || | |  |j| }|snD| t|z } |j||r|j|| d z } |r || | | X |j! ddd dk\r | krt#d | | fz|rB|j%}||k7rt#d |d|d|tjd|yy#|j!wxYw#1swY}xYw)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrzDigest specified: %swbi rzcontent-lengthzContent-Lengthrz1retrieval incomplete: got only %d out of %d bytesz digest mismatch for z : expected z, got zDigest verified: %s)rZr[ isinstancelisttuplegetattrrr rOrinfointrlenr|rr\rr)r&rdestfiledigest reporthookdigesterhasherdfpsfpheaders blocksizesizerblocknumblockactuals r0 download_filezPackageIndex.download_filems, >H LL. /&4-0!'/ww/1H LL/&8 9(D !S##GCL1C ((* #w.w'789DxD9HHY/E CJ&DIIe$ .MH!"8Y= 5": 19"C,   '')F&7=x7=v(GHH LL. 7  5" !s%2F+BFF+F((F++F4cg}|jr|j|j|jr|j|jt|}|j |S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrYrr r )r&reqhandlersopeners r0rOzPackageIndex.send_requestsX  OOD11 2    OOD-- .x({{3r6c g}|j}|D]^\}}t|ttfs|g}|D];}|j d|zd|zj dd|j df=`|D]4\}} } |j d|zd|d| dj dd| f6|j d|zdzdfdj |} d |z} | tt| d } t|j| | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"rUr6z&Content-Disposition: form-data; name="z "; filename=""s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrrirrlstrrrr)r&rrpartsrkvaluesvkeyrnvaluebodyctrs r0rMzPackageIndex.encode_requests==IAvftUm4  H$@wHHW% '(  %* C5 LL x!"(&/  %*  eh&.45||E" . 9!#d)n txxw//r6ct|trd|i}t|jd} |j ||xsd|dS#|dwxYw)Nr]g@)timeoutandr\)rr r rsearch)r&termsoperator rpc_proxys r0rzPackageIndex.searchs[ e\ *UOE#6  !##E8+rsq ' ;;&   8 $'  _!6_!'&'sA A.-A.PK!ܒ$__pycache__/__init__.cpython-312.pycnu[ >gqddlZdZGddeZ ddlmZejeZ e jey#e$rGddej ZYEwxYw)Nz0.3.9c eZdZy)DistlibExceptionN)__name__ __module__ __qualname__?/opt/hc_python/lib/python3.12/site-packages/distlib/__init__.pyrr sr r) NullHandlerceZdZdZdZdZy)r cyNrselfrecords r handlezNullHandler.handle r cyrrrs r emitzNullHandler.emitrr cd|_yr)lock)rs r createLockzNullHandler.createLocks DIr N)rrrrrrrr r r r s   r r ) logging __version__ Exceptionrr ImportErrorHandler getLoggerrlogger addHandlerrr r r!sh  y  #   8 $+-   goo  sAAAPK!AقWW __pycache__/util.cpython-312.pycnu[ >gz(ddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZ ddlZddlZddlZddlZddlZddlZ ddlZddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/e j`e1Z2e jfdZ4e jfdZ5e jfd Z6e jfd Z7e jfd Z8e jfd Z9e jfd Z:e jfdZ;dZdZ?dZ@didZAdZBdZCdZDejdZFejdZGejdjdZHGddeIZJdZKGddeIZLd ZMGd!d"eIZNe jfd#e jZPd$ZQdkd%ZRdld&ZSd'ZTd(ZUd)ZVd*ZWe jfd+e jZYe jfd,ZZdkd-Z[e jfd.Z\d/Z]d0Z^d1Z_d2Z`d3Zad4ZbGd5d6eIZcGd7d8eIZdGd9d:eIZed;Zfdmd<Zgd=Zhd>ZiGd?d@eIZje jfdAZke jfdBZle jfdCZmdDZdEZner6ddFlmoZpmqZqmrZrGdGdHe$jZsGdIdJepZoGdKdLeoe&ZtGdMdNe%jZuerGdOdPe%jZvGdQdRe%jZwdSZxGdTdUeIZyGdVdWeyZzGdXdYeyZ{GdZd[e'Z|Gd\d]eIZ}d^Z~Gd_d`eIZdaZdbZdcZdddedfdgZdhZy#e$rdZYFwxYw#e$rddlZY=wxYw)nN)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)c@dfdfdfd|S)ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). ctj|}|r*|jd}||jd}||fS|s t d|d}|dvrt d|zdj |d}|dd}|g}|r|d|k(rn|d|k(r|j ||dd}nZtj|}|st d|z|j |jd||jd}|rdj|}t d|z|j |dj|}|ddj}||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqoqpartsss ;/opt/hc_python/lib/python3.12/site-packages/distlib/util.py marker_varz parse_marker..marker_var@st   Y ' XXZ]F!!%%'(+I:y  978 8! A~!":Y"FGGq"%B!!" ICEQ<1$q\R'LL$ )!" I$**95A)*G)*STTLLA/ )!%%'( 3IGGEN!";a"?@@ LLOWWU^F!!" ,,.Iy  ct|rQ|ddk(rI|ddj\}}|ddk7rtd|z|ddj}||fS|\}}|rRtj|}|sn:|j d}||j d}|\}}|||d}|rR|}||fS)Nr(r)unterminated parenthesis: %soplhsrhs)r'r" MARKER_OPrr r!)r(r*r8r)r7r9markerr0s r/ marker_exprz!parse_marker..marker_exprds 1, &y}';';'= > FI|s"!"@9"LMM!!" ,,.Iy  ( 2NCOOI.XXZ]%aeegh/ !+I!6YC8Fy  r1c|\}}|rCtj|}|s ||fS||jd}|\}}d||d}|rC||fS)Nandr6)ANDrr!)r(r8r)r9r<s r/ marker_andz parse_marker..marker_andwss$Y/Y )$AI~"!%%'(+I(3NCs37C I~r1c|\}}|rCtj|}|s ||fS||jd}|\}}d||d}|rC||fS)Norr6)ORrr!)r(r8r)r9r@s r/r;zparse_marker..markerss#I.Y#AI~"!%%'(+I' 2NCc#6C I~r1) marker_stringr;r@r<r0s @@@@r/ parse_markerrF6s%"!H!&   -  r1c |j}|r|jdrytj|}|st d|z|j d}||j d}dx}x}x}}|r|ddk(r|jdd}|dkrt d|z|d|} ||dzdj}g}| rtj| }|st d | z|j|j d| |j d} | sn,| dd k7rt d | z| ddj} | r|sd}|r|dd k(r|ddj}tj|}|st d |z|j d}t|} | jr | jst d|z||j dj}nd} |ddk7r | |\}}n|jdd}|dkrt d|z|d|} ||dzdj}tj| r | | \}} nntj| }|st d| z|j d} | |j dj} | rt d| zd| fg}|r7|ddk7rt d|z|ddj}t!|\}}|r|ddk7rt d|z|s|}n'|ddj#|Dcgc]}d|z c}}t%||||||Scc}w)z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %sctj|}d}|rg} |jd}||jd}tj|}|st d|z|jd}|j ||f||jd}|r|ddk7rn<|ddj}|sn&tj|}|st d|z|sd}||fS)z| Return a list of operator, version tuples if any are specified, else None. Nrzinvalid version: %srKrinvalid constraint: %s) COMPARE_OPrr r!VERSION_IDENTIFIERr"r$r') ver_remainingr)versionsr7vs r/ get_versionsz'parse_requirement..get_versionss $$]3!HXXZ](5aeegh(? .44]C "-.Cm.S"TTHHJqM Q0(5aeegh(? , a0@C0G!(5ab(9(@(@(B  -!&,,]; "-.F.V"WW%&$#'..r1r3r4r5rNz~=;zinvalid requirement: %szunexpected trailing data: %s , z%s %s)nameextras constraintsr;url requirement)strip startswithrrr"r r!findr'r$ NON_SPACErschemenetlocrOrPrFr&r)reqr(r)distnamerY mark_exprrRuriir.trT_rSrscons r/parse_requirementrls  I  ,,S1#A - 9::xxz!}H!%%'(#I*..F.Y.CYq\S( NN3 " q56BC C aNa!ef%,,.   #A!"7!";<< MM!((*Q- (!%%'( Ats{!"@1"DEE!" AF Q<3 !!" ,,.I *A!"3i"?@@((*Q-C A HH!"3c"9::!!%%'(+224I /@|s"&29&=#)NN3*q5%&Dy&PQQaN%a!ef-446 ##A&".q/KHa*003A)*BQ*FGG 1 A!%%'( **,A)*BQ*FGG!%q {H Q<3 7)CD DabM((* +I6 9Yq\S(89DEE   $))h,OhsWs]h,O"P Q (6xPY_bpr ss-Ps M0 cd}i}|D]\}}}tjj||}t|D]}tjj||} t| D]m} ||| } ||j | d!||| } |j tjj djd} | dz| z|| <o|S)z%Find destinations for resources filesc |jtjjd}|jtjjd}|j |sJ|t |dj dSN/)r#ospathsepr^lenr')rootrrs r/ get_rel_pathz)get_resources_dests..get_rel_paths`||BGGKK-||BGGKK-t$$$CIJ&&s++r1Nrp)rqrrr&rpopr#rsrstrip)resources_rootrulesrv destinationsbasesuffixdestprefixabs_baseabs_globabs_path resource_filerel_pathrel_dests r/get_resources_destsr s,L#fdnd3f Hww||Hf5H!(O ,^X F < $$]D9+Hh?H#||BGGKK=DDSIH2:S.82KL/,&$ r1cttdrd}|Stjttdtjk7}|S)N real_prefixT base_prefix)hasattrsysrgetattrr*s r/in_venvr&s:sM" MwsM3::FF Mr1c\tj}t|ts t |}|SN)r executable isinstancerrrs r/get_executabler0s&^^F fi (&! Mr1c||} t|}|}|s|r|}|r$|dj}||vr |S|rd|||fz}:)Nrz %c: %s %s)r lower)prompt allowed_chars error_promptdefaultpr.cs r/proceedrBsaA  aL WA ! AM! H A|V#<< r1crt|tr|j}i}|D]}||vs||||<|Sr)rrsplit)dkeysr*keys r/extract_by_keyrRsA$ %zz| F !8C&F3K Mr1cHtjddk\rtjd|}|j }t |} t j|}|ddd}|jD]8\}}|jD] \}}|d|}t|} | J| ||<":|S#t$r|jddYnwxYwd} tj} | | |nR#tj$r<|jt!j"|}t |}| | |YnwxYwi}| j%D]=} ix|| <}| j| D] \} }| d|}t|} | J| || <"?|S) Nrutf-8 extensionszpython.exportsexports = cbt|dr|j|y|j|y)N read_file)rrreadfp)cpstreams r/ read_streamz!read_exports..read_streamps$ 2{ # LL IIf r1)r version_infocodecs getreaderreadr jsonloaditemsget_export_entry Exceptionseekr ConfigParserMissingSectionHeaderErrorclosetextwrapdedentsections)rdatajdatar*groupentrieskrSr.entryrrrrXvalues r/ read_exportsr\s a*!!'*62 ;;=D d^F  &!|$%56yA$llnNE7 1!"A&(+(((" (-   Aq  " " $B B  1 1  t$$B  F{{} ""s g88C=KD%!5)A$Q'E$ $$!GDM ) Ms&A,B;;CC4 C>>A E  E c(tjddk\rtjd|}t j }|j D]\}}|j||jD]}|j |j}n|jd|j}|jr!|ddj|jd}|j||j||j|y)Nrrr:z [rWrJ)rrr getwriterrrr add_sectionvaluesr}rflagsr&setrXwrite)rrrrrSrr.s r/ write_exportsrs a*!!'*62  " " $B 1 qXXZE||#LL$||U\\:{{!"DIIekk$:; FF1ejj! $  HHVr1c#Ktj} |tj|y#tj|wxYwwr)tempfilemkdtempr rmtree)tds r/tempdirrs6    B b bsA 2A A  A c#Ktj} tj|dtj|y#tj|wxYwwr)rqgetcwdchdir)rcwds r/rrs: ))+C      A!AA!AA!c#Ktj} tj|dtj|y#tj|wxYwwr)socketgetdefaulttimeoutsetdefaulttimeout)secondsctos r/socket_timeoutrsF  " " $C&  )   %  %rceZdZdZddZy)cached_propertyc||_yr)func)selfrs r/__init__zcached_property.__init__s  r1Nc||S|j|}tj||jj||Sr)robject __setattr____name__)robjclsrs r/__get__zcached_property.__get__s: ;K #3 2 2E: r1r)r __module__ __qualname__rrrDr1r/rrs  r1rctjdk(r|S|s|S|ddk(rtd|z|ddk(rtd|z|jd}tj|vr2|j tjtj|vr2|stjStj j|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put 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. rprzpath '%s' cannot be absolutezpath '%s' cannot end with '/')rqrs ValueErrorrcurdirremoverrr&)pathnamepathss r/ convert_pathrs vv} {c7(BCC|s88CDD NN3 E ))u  RYY ))u  yy 77<< r1cteZdZddZdZdZdZddZddZdZ d Z d Z d Z d Z dd ZdZdZdZdZy) FileOperatorcP||_t|_|jyr)dry_runrensured _init_record)rrs r/rzFileOperator.__init__s u  r1cNd|_t|_t|_yNF)recordr files_written dirs_createdrs r/rzFileOperator._init_records  UEr1cT|jr|jj|yyr)rradd)rrrs r/record_as_writtenzFileOperator.record_as_writtens" ;;    " "4 ( r1cTtjj|s+tdtjj |ztjj|sytj |j tj |j kDS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)rqrrexistsrabspathstatst_mtime)rsourcetargets r/newerzFileOperator.newersmww~~f%"#=PV@W#WX Xww~~f%wwv''"''&/*B*BBBr1c|jtjj|tj d|||j sd}|rhtjj|rd|z}nCtjj|r$tjj|sd|z}|rt|dztj|||j|y)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirrqrrdirnameloggerinforislinkr isfilerr copyfiler)rinfileoutfilecheckmsgs r/ copy_filezFileOperator.copy_file s 01 &8||C77>>'*+g5CWW^^G,RWW^^G5L4w>C 'D!DEE OOFG , w'r1Nctjj|rJ|jtjj |t j d|||jsN| t|d}ntj|d|} tj|||j|j|y#|jwxYw)NzCopying stream %s to %swbwencoding)rqrrisdirrrrrropenrr copyfileobjrr)rinstreamrr! outstreams r/ copy_streamzFileOperator.copy_streams77==))) 01 -xA|| $/ "KKxH  """8Y7! w'!s CC%cf|jtjj||jsZtjj |rtj |t|d5}|j|ddd|j|y#1swYxYw)Nr) rrqrrrrr rr#rr)rrrrfs r/write_binary_filezFileOperator.write_binary_file)sp -.||ww~~d# $dD!Q " t$"!s ;B''B0cF|j||j|yr)r*encode)rrrrr!s r/write_text_filezFileOperator.write_text_file2s tT[[%:;r1crtjdk(s&tjdk(rtjdk(r}|D]w}|jrtj d|&tj |j|z|z}tj d||tj||yyyy)Nposixjavazchanging mode of %szchanging mode of %s to %o) rqrX_namerrrr st_modechmod)rbitsmaskfilesr)modes r/set_modezFileOperator.set_mode5s 77g "''V"3G8K<<KK 5q9GGAJ..5=DKK ;QEHHQ% 9L"3r1c(|jdd|S)Nimi)r8)r.r)s r/zFileOperator.Asqzz%'Cr1ctjj|}||jvrtjj |s|jj |tjj |\}}|j|tjd|z|jstj||jr|jj |yyyy)Nz Creating %s)rqrrr rr rrrrrrmkdirrr)rrrrr)s r/rzFileOperator.ensure_dirCswwt$ t|| #BGGNN4,@ LL  T "77==&DAq OOA  KK , -<<{{!!%%d+-A #r1ct|| }tjd|||js|s|j ||r&|sd}n!|j |sJ|t |d}i}|rIttdr9t|tjstjj}||d<tj||dfi||j||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT)r rrrrr^rtr py_compilerr> CHECKED_HASHcompiler) rrroptimizeforcerhashed_invalidationdpathdiagpathcompile_kwargss r/ byte_compilezFileOperator.byte_compileOs!$H 5 -tU;|| 4/#H??6222#CKL1HN"wz;P'Q!"5z7U7UV*4*H*H*U*U'6I23   tUHd Mn M u% r1ctjj|rAtjj|rtjj |sot j d||jstj||jr+||jvr|jj|yyytjj |rd}nd}t j d|||jstj||jr+||jvr|jj|yyyy)NzRemoving directory tree at %slinkfilezRemoving %s %s)rqrrr r"rrdebugrr rrrrr)rrrr.s r/ensure_removedzFileOperator.ensure_removedbs 77>>$ ww}}T"277>>$+? >$'AA -q$7||IIdO;;t111**11$72! r1cd}|srtjj|r'tj|tj} |Stjj |}||k(r |S|}|sr|Sr)rqrrr accessW_OKr)rrrr*parents r/ is_writablezFileOperator.is_writablewsnww~~d#41  WW__T*F~ D r1cr|jsJ|j|jf}|j|S)zV Commit recorded changes, turn off recording, return changes. )rrrr)rr*s r/commitzFileOperator.commits7 {{{##T%6%66  r1c|jst|jD]7}tjj |s#tj |9t|jd}|D]n}tj|}|r@|dgk(sJtjj||d}tj|tj|p|jy)NT)reverse __pycache__r) rlistrrqrrr rsortedrlistdirr&rmdirr)rr)dirsrflistsds r/rollbackzFileOperator.rollbacks||$,,-77>>!$IIaL. $++T:D 1  ]O333aq2BHHRL  r1FTr)FFNF)rrrrrrrrr'r*r-r8set_executable_moderrIrNrSrUr`rDr1r/rrsW " )C&(" (%< &D ,&8* r1rc|tjvrtj|}n t|}||}|S|jd}t ||j d}|D]}t ||}|S)N.r)rmodules __import__rrrw) module_name dotted_pathmodr*r-rs r/resolverksyckk!kk+&% M !!#&eiil+AVQ'F Mr1cFeZdZdZedZdZdZejZ y) ExportEntryc<||_||_||_||_yrrXrr}r)rrXrr}rs r/rzExportEntry.__init__s    r1cBt|j|jSr)rkrr}rs r/rzExportEntry.valuest{{DKK00r1c pd|jd|jd|jd|jd S)Nz rors r/__repr__zExportEntry.__repr__s$04 4;; UYU_U_``r1ct|tsd}|S|j|jk(xrO|j|jk(xr4|j|jk(xr|j |j k(}|Sr)rrmrXrr}r)rotherr*s r/__eq__zExportEntry.__eq__sw%-F ii5::-0$++2M0RVR]R]afamamRm0jjEKK/  r1N) rrrrrrrsrvr__hash__rDr1r/rmrms1 11aHr1rmz(?P([^\[]\S*)) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? ctj|}|sd}d|vsd|vrtd|z|S|j}|d}|d}|j d}|dk(r|d}}n'|dk7rtd|z|j d\}}|d } | d|vsd|vrtd|zg} n,| j d D cgc]} | j } } t|||| }|Scc} w) NrIrJzInvalid specification '%s'rXcallablerrrrrK)ENTRY_REsearchr groupdictcountrr]rm) specificationr)r*rrXrrcolonsrr}rr)s r/rrs1 &A  - 3-#7"$*,9$:; ;. M) KKMy}C Q;!4FF{&(.0=(>??!ZZ_NFF'  =m#sm';&(.0=(>??E(- C(89(81QWWY(8E9T6659 M:sC*c|d}tjdk(r2dtjvr tjj d}ntjj d}tjj |r=tj|tj}|s/tjd|n tj|d}|s*tj}tjd |tjj||S#t$rtjd|d d }YqwxYw) a Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. z.distlibnt LOCALAPPDATAz $localappdata~z(Directory exists but is not writable: %sTzUnable to create %s)exc_infoFz#Default location unusable, using %s)rqrXenvironrr expandvars expanduserr"rPrQrwarningmakedirsOSErrorrrr&)r}r*usables r/get_cache_basers~ ww$>RZZ7##O4##C( ww}}V6277+ NNEv N  KK F !!#s XXd^FHHV Mr1cdd}d}t|D]\}}t|trd}n|J|S)NTF) enumeraterr)seqr*rgr.s r/is_string_sequencerDsA F A#1!\*F  == Mr1z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cd}d}t|jdd}tj|}|r$|j d}|d|j }|rft |t |dzkDrLtjtj|dz|}|r|j}|d|||dzd|f}|:tj|}|r#|j d|j d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None NrV-rz\br) rr#PYTHON_VERSIONr{rstartrtrerescaper!PROJECT_NAME_AND_VERSION)filename project_namer*pyverr)ns r/split_filenamerTs F Ex ((c2Hh'A JQWWY'H L(9A(== HHRYY|,u4h ? Abq\8AEF#3U:F ~ $ * *8 4 WWQZU2F Mr1z-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$ctj|}|std|z|j}|dj j |dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'rXver)NAME_VERSION_RErrr|r]r)rr)rs r/parse_name_and_versionrrsV a A G!KLL A V9??  " " $ah ..r1ct}t|xsg}t|xsg}d|vr|jd||z}|D]}|dk(r|j||jdr8|dd}||vrtj d|z||vsQ|j|c||vrtj d|z|j||S)N*rrzundeclared extra: %s)rrrr^rr) requested availabler*runwanteds r/ get_extrasrs UFIO$IIO$I i)  8 JJqM \\# uHy(5@A6! h' !59: JJqM Mr1cti} t|}|j}|jd}|jdstj d||St jd|}tj|} |S#t$r"}tjd||Yd}~|Sd}~wwxYw)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %srz&Failed to get external data for %s: %s) r rgetr^rrMrrrrr exception)r[r*respheadersctreaderes r/_get_external_datars FKs|))+ [[ (}}/0 LLCR H M /V%%g.t4FYYv&F M KA3JJ MKsAB 0B B7B22B7z'https://www.red-dove.com/pypi/projects/cn|djd|d}tt|}t|}|S)Nrrpz /project.jsonupperr_external_data_base_urlr)rXr[r*s r/get_project_datars2"&q'--/4 8C )3 /C  $F Mr1cp|djd|d|d}tt|}t|S)Nrrpz /package-z.jsonr)rXversionr[s r/get_package_datars0%)!W]]_dG DC )3 /C c ""r1c$eZdZdZdZddZdZy)Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cdtjj|stj|tj|j dzdk7rt jd|tjjtjj||_ y)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rqrrr"rr r2rrr normpathr|)rr|s r/rzCache.__init__smww}}T" KK  GGDM ! !D (Q . NN>"%);IIbMWW]]2&MM"% ( '""2& 'sBCC98C9Nrb)rrr__doc__rrrrDr1r/rrs <B r1rc0eZdZdZdZddZdZdZdZy) EventMixinz1 A very simple publish/subscribe system. ci|_yr) _subscribersrs r/rzEventMixin.__init__s r1c|j}||vrt|g||<y||}|r|j|y|j|y)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)rrr$ appendleft)revent subscriberr$subssqs r/rzEventMixin.addsK     -DKeB *% j)r1ch|j}||vrtd|z||j|y)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)rrr)rrrrs r/rzEventMixin.remove s:    1E9: : U :&r1cLt|jj|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. rD)iterrr)rrs r/get_subscriberszEventMixin.get_subscriberss" D%%))%455r1cg}|j|D] } ||g|i|}|j |"tj d|||||S#t$rtjdd}YPwxYw)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)rrrrr$rM)rrargskwargsr*rrs r/publishzEventMixin.publishs..u5J "5:4:6: MM% 6  FtU[]cd    !EF s A A54A5Nrb) rrrrrrrrrrDr1r/rrs *( '6r1rcXeZdZdZdZd dZdZdZdZdZ e dZ e d Z y ) Sequencerc>i|_i|_t|_yr)_preds_succsr_nodesrs r/rzSequencer.__init__:s  e r1c:|jj|yr)rr)rnodes r/add_nodezSequencer.add_node?s r1c8||jvr|jj||rt|jj |dD]}|j||t|j j |dD]}|j||t |jjD]\}}|r |j|=t |j jD]\}}|r |j |=yy)NrD)rrrrrrrYr)rredgesrr.rrSs r/ remove_nodezSequencer.remove_nodeBs 4;;  KK  t $ r23 At$4r23 D!$4T[[..011 A2T[[..011 A2 r1c||k7sJ|jj|tj||jj|tj|yr)r setdefaultrrr)rpredsuccs r/rz Sequencer.addRsPt|| tSU+//5 tSU+//5r1c||k7sJ |j|}|j|} |j ||j |y#t$rtd|zwxYw#t$rt|d|wxYw)Nz%r not a successor of anythingz not a successor of )rrKeyErrorrr)rrrpredssuccss r/rzSequencer.removeWst|| FKK%EKK%E H LL  LL   F=DE E F  H4FG G HsA "A& A#&Bc^||jvxs||jvxs||jvSr)rrr)rsteps r/is_stepzSequencer.is_stepds- #Qtt{{':Qddkk>QRr1c|j|std|zg}g}t}|j||r|j d}||vr(||k7rr|j ||j|nO|j ||j||jj|d}|j||rt|S)Nz Unknown: %rrrD) rrrr$rwrrrrextendreversed)rfinalr*todoseenrrs r/ get_stepszSequencer.get_stepsgs||E"]U23 3u E88A;Dt| 5=MM$'MM$' d# b1 E" r1cdggiig|jfdD]}|vs|S)Nrcd|<d|<dxxdz cc< j| |}|D]>}|vr |t|||<%| vs*t|||<@||k(rHg} j}|j|||k(rn(t |} j|yy#t$rg}YwxYwNrr)r$rminrwtuple) r successors successorconnected_component componentgraphindex index_counterlowlinksr*stack strongconnects r/rz3Sequencer.strong_connections..strongconnects'*E$K*1-HTN !  !  LL  "4[ ( H,!),%($)9L%MHTN%'&)$y9I%JHTN(~t,&(# % I'..y9 D(  ""56  i(-   sC CC)r) rrrrrrr*rrs @@@@@@@r/strong_connectionszSequencer.strong_connectionssW  ! )! )FD8#d# r1c dg}|jD]0}|j|}|D]}|jd|d|d2|jD]}|jd|z|jddj|S)Nz digraph G {z z -> rUz %s;} )rr$rr&)rr*rrrrs r/dotz Sequencer.dots{KKDKK%E tT:; KKD MM'D. )  cyy  r1Nra) rrrrrrrrrrpropertyrrrDr1r/rr8sP ' 6 HS 211f ! !r1r).tar.gz.tar.bz2.tar.zip.tgz.tbz.whlcp  fd}tjjt d}|d|j drd}nP|j drd}d}n:|j drd}d }n$|j d rd }d }nt d |z |dk(r.t |d }|rW|j}|D] }|| n7tj|}|r|j}|D] }|| |dk7rftjddkrP|jD]=} t| jt r| jj#d| _?d} | |_|j'|r|j)yy#|r|j)wwxYw)Nc,t|ts|jd}tjj tjj |}|jr|tjk7rtd|zy)Nrzpath outside destination: %r) rrdecoderqrrr r&r^rsr)rrrdest_dirplens r/ check_pathzunarchive..check_pathsm$ *;;w'D GGOOBGGLL48 9||H%4BFF):;a?@ @*;r1)rr zip)rrtgzzr:gz)rrtbzzr:bz2rtarrzUnknown format for %rrrrc tj||S#tj$r}tt |d}~wwxYw)z9Run tarfile.tar_filter, but raise the expected ValueErrorN)tarfile tar_filter FilterErrorrstr)memberrrexcs r/extraction_filterz$unarchive..extraction_filters? +))&$77&& + S** +sA?A)rqrrr rtrrrnamelistr,r#getnamesrr getmembersrrXrr#r2 extractallr) archive_filenamer$formatrr&archiver7namesrXtarinfor2r%s ` @r/ unarchiver<sAwwx(H x=DG ~  $ $%5 6F  & &': ;FD  & &'; <FD  & &v .FD47GGH H' U?.4G((*!Dt$"ll#3T:G((*!Dt$" U?s//2Q6 #--/!',, :#*<<#6#6w#?GL0 +%6!8$  MMO 7 MMO sB2F =F F5ctj}t|}t|d5}t j |D]d\}}}|D]Y}tj j||}||d} tj j| |} |j|| [f ddd|S#1swY|SxYw)z*zip a directory tree into a BytesIO objectrN) ioBytesIOrtrrqwalkrrr&r) directoryr*dlenzfrur]r6rXfullrelr~s r/zip_dirrF s ZZ\F y>D  !#!3 D$ww||D$/45kww||C.t$ "4  M  Ms A=B44B>)rKMGTPcveZdZdZd dZdZdZdZdZe dZ e dZ d Z e d Z e d Zy )ProgressUNKNOWNcj|||k\sJ|x|_|_||_d|_d|_d|_y)NrF)rcurmaxstartedelapseddone)rminvalmaxvals r/rzProgress.__init__$s>~6!111$$48   r1c|j|ksJ|j||jksJ||_tj}|j||_y||jz |_yr)rrQrPtimerRrS)rcurvalnows r/updatezProgress.update,sbxx6!!!xx6TXX#555iik << DL-DLr1cN|dk\sJ|j|j|zy)Nr)r[rP)rincrs r/ incrementzProgress.increment6s"qyy DHHtO$r1c<|j|j|Sr)r[rrs r/rzProgress.start:s DHH r1c`|j|j|jd|_yNT)rQr[rTrs r/stopz Progress.stop>s# 88  KK ! r1cJ|j |jS|jSr)rQunknownrs r/maximumzProgress.maximumCs#xx/t||=TXX=r1c|jrd}|S|jd}|Sd|j|jz z|j|jz z }d|z}|S)Nz100 %z ?? %gY@z%3d %%)rTrQrPr)rr*rSs r/ percentagezProgress.percentageGsf 99F  XX F DHH,-DHH1DEA\F r1c|dkr |j|j|jk(rd}|Stjdtj |}|S)Nrz??:??:??z%H:%M:%S)rQrPrrXstrftimegmtime)rdurationr*s r/format_durationzProgress.format_durationRsM Mtxx/488txx3GF  ]]:t{{8/DEF r1c||jrd}|j}nd}|jd}n{|jdk(s|j|jk(rd}nPt |j|jz }||j|jz z}|dz |jz}|d|j |S)NDonezETA rrrz: )rTrSrQrPrfloatrl)rrrhs r/ETAz Progress.ETA[s 99F AFxx"txx488';$((TXX-.TXX((Udll*!4#7#7#:;;r1c|jdk(rd}n&|j|jz |jz }tD]}|dkrn|dz}d|fzS)Nrgig@@z%d %sB/s)rSrPrUNITS)rr*units r/speedzProgress.speedns] <<1 Fhh)T\\9FD} f FVTN**r1N)rd)rrrrdrr[r^rrbrrergrlrprtrDr1r/rMrM!suG.% >><<$ + +r1rMz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$ctj|rd}t||ztj|rd}t||zt |S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBr{r_CHECK_MISMATCH_SET_iglob) path_globrs r/rrsQ##I.Ky))!!),Fy)) ) r1c#Ktj|d}t|dkDrXt|dk(sJ||\}}}|jdD](}tdj |||fD]}|*yd|vrt |D]}|y|jdd\}}|dk(rd}|dk(rd}n"|j d}|j d }tj|D]W\}}} tjj|}ttjj ||D]} | Yyw) NrrrKrz**rerrp\) RICH_GLOBrrtryr& std_iglobr'rqr@rrr) rzrich_path_globrrr}itemrrradicaldirr6rs r/ryrys8__Y2N >Q>"a'77',VIIcNDrwwf'=>? @# y !), -(oodA6OFG|"}"..-!...$&GGFO c5ww''- dG!<=BH>%4sE E) HTTPSHandlermatch_hostnameCertificateErrorceZdZdZdZdZy)HTTPSConnectionNTc,tj|j|jf|j}t |ddr||_|jtjtj}ttdr#|xjtjzc_ t |ddr&|j|j|j i}|j"rQtj$|_|j)|j"t tddr|j|d<|j*|fi||_|j"r]|j,rP t/|j j1|jt2j5d|jyyy#t6$rE|j j9tj:|j j=wxYw) N _tunnel_hostF OP_NO_SSLv2 cert_file)cafileHAS_SNIserver_hostnamezHost verified: %s)rcreate_connectionhostporttimeoutrsock_tunnelssl SSLContextPROTOCOL_SSLv23roptionsrload_cert_chainrkey_fileca_certs CERT_REQUIRED verify_modeload_verify_locations wrap_socket check_domainr getpeercertrrMrshutdown SHUT_RDWRr)rrcontextrs r/connectzHTTPSConnection.connects{++TYY ,BDLLQDt^U3   nnS%8%89GsM*3??2t[$/'' FF}}&)&7&7#--T]]-C3 5104 F,-+++D;F;DI}}!2!2"499#8#8#:DIIFLL!4dii@"3}(II&&v'7'78IIOO%s4AGAH)rrrrrrrDr1r/rrs  r1rc eZdZddZdZdZy)rcJtj|||_||_yr)BaseHTTPSHandlerrrr)rrrs r/rzHTTPSHandler.__init__s  % %d +$DM ,D r1cxt|i|}|jr"|j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr)rrrr*s r/ _conn_makerzHTTPSHandler._conn_makers8%d5f5F}}"&--&*&7&7#Mr1c |j|j|S#t$r5}dt|jvrt d|j zd}~wwxYw)Nzcertificate verify failedz*Unable to verify server certificate for %s)do_openrrr/reasonrr)rrcrs r/ https_openzHTTPSHandler.https_opensc ||D$4$4c:: .#ahh-?*,469hh,?@@  s A0AANrb)rrrrrrrDr1r/rrs -    r1rceZdZdZy)HTTPSOnlyHandlerctd|z)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrcs r/ http_openzHTTPSOnlyHandler.http_opens,.123 3r1N)rrrrrDr1r/rrs 3r1rceZdZddZdZy) TransportcR||_tjj||yr)rrrrrr use_datetimes r/rzTransport.__init__ s $$T<8r1c|j|\}}}|jr||jdk7r#||_|tj|f|_|jdSr) get_host_info _connection_extra_headersrHTTPConnection)rrhehx509s r/make_connectionzTransport.make_connection sd((. 2t44+;+;A+>#>"$D #W%;%;A%>>D ""r1NrrrrrrrDr1r/rrs 9#r1rceZdZddZdZy) SafeTransportcR||_tjj||yr)rrrrrs r/rzSafeTransport.__init__s"DL  # # , ,T< @r1c|j|\}}}|si}|j|d<|jr||jdk7r%||_|t j |dfi|f|_|jdS)Nrrr)rrrrrr)rrrrrs r/rzSafeTransport.make_connections ..t4MAr6 $ F9 ##tt/?/?/B'B&(##')@)@D)SF)S#S ##A& &r1NrrrDr1r/rrs  A 'r1rceZdZdZy) ServerProxyc |jddx|_}|Ht|d}|jdd}|dk(rt}nt }|||x|d<}||_tjj||fi|y)Nrrrhttps)r transport) rwrrrrrrrrr)rrfrrrartclsrhs r/rzServerProxy.__init__*s!'It!<< w  c]1%F!::na8L $ &*7&N NF; !DN&&tS;F;r1N)rrrrrDr1r/rr(s|d}tjddk\rtjd|}||_nt |dd|_t j|jfi|j|_y)Nrrrrrrr) rrrrrrcsvrr)rrrs r/rzCSVReader.__init__\st v H%F"a'2))'26: DK#F6NC8DKjj> > r1c|SrrDrs r/__iter__zCSVReader.__iter__grr1ct|j}tjddkr8t |D]*\}}t |t r|jd||<,|SNrrr)nextrrrrrrr#)rr*rgrs r/rzCSVReader.nextjsYdkk"   A  "$V,4!$ 2 $ G 4F1I- r1N)rrrrrr__next__rDr1r/rrZs ?Hr1rceZdZdZdZy) CSVWriterc t|d|_tj|jfi|j|_y)Nr)rrrwriterr)rrrs r/rzCSVWriter.__init__ws-C( jj> > r1ctjddkr=g}|D]4}t|tr|j d}|j |6|}|j j|yr)rrrrr,r$rwriterow)rrowrrs r/rzCSVWriter.writerow{s`   A  "AdI.;;w/DC S!r1N)rrrrrrDr1r/rrus ?"r1rc`eZdZeej Zded<dfd ZdZdZdZ xZ S) Configurator inc_convertinccftt| ||xstj|_yr)superrrrqrr|)rconfigr| __class__s r/rzConfigurator.__init__s$ lD*62'BIIK r1c fd |jd}t|sj|}|jdd}|jdd}|rt|Dcgc] } | c}}|Dcgc]}t |s| ||f}}t |}||i|} |r+|j D]\} } t| |  | | Scc}wcc}w)Nc.t|ttfr't||Dcgc] }| c}}|St|tr0d|vrj |}|Si}|D]}||||<|Sj |}|Scc}wN())rrYr typedictconfigure_customconvert)orgr*rrrs r/rz.Configurator.configure_custom..converts!dE]+ aa!8a'!*a!89MAt$19!2215FM  F$+AaDMq MaM"9sBrrez[]rD)rwryrkr rrrsetattr) rrrpropsrrrrrr*rrSrs ` @r/rzConfigurator.configure_customs  JJt { QA 3%zz$# d3d'!*d34D28K&QKN!WVAY'(&KeD#F#  171:.& 4Ks%C#?C(C(c|j|}t|tr$d|vr |j|x|j|<}|Sr)rrrr)rrr*s r/ __getitem__zConfigurator.__getitem__sCS! fd #(,(=(=f(E EDKK v r1ctjj|s*tjj|j|}t j |dd5}tj|}ddd|S#1swYSxYw)z*Default converter for the inc:// protocol.rrr N) rqrrisabsr&r|rr#rr)rrr)r*s r/rzConfigurator.inc_converts^ww}}U#GGLLE2E [[g 6!YYq\F7 7 s "BB r) rrrrrvalue_convertersrrrr __classcell__)rs@r/rrs5,==>+U(@ r1rc$eZdZdZddZdZdZy)SubprocessMixinzC Mixin for running subprocesses and capturing their output Nc ||_||_yr)verboseprogress)rr r s r/rzSubprocessMixin.__init__s   r1cr|j}|j} |j}|sn{| |||nn|s tjj dn.tjj |j dtjj|jy)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nrer) r r readlinerstderrrr#flushr)rrrr r r.s r/rzSubprocessMixin.readers ==,,!A#G$JJ$$S)JJ$$QXXg%67   "  r1c Ztj|ftjtjd|}tj|j |j df}|jtj|j |jdf}|j|j|j|j|j|jdd|S|jrtjjd|S)N)stdoutrr)rrrzdone.mainzdone. ) subprocessPopenPIPE threadingThreadrrrrwaitr&r r rr)rcmdrrt1t2s r/ run_commandzSubprocessMixin.run_commands   S [ [TZ [   T[[(7K L    T[[(7K L       == $ MM'6 *\\ JJ  Y 'r1)FN)rrrrrrrrDr1r/rrs!* r1rcLtjdd|jS)z,Normalize a python package name a la PEP 503z[-_.]+r)rsubr)rXs r/normalize_namers  66(C & , , ..r1c(eZdZdZdZddZdZdZy) PyPIRCFilezhttps://upload.pypi.org/legacy/pypiNc|=tjjtjjdd}||_||_y)Nrz.pypirc)rqrrr&rrr[)rrr[s r/rzPyPIRCFile.__init__s8 :bgg005yAB r1ci}tjj|jr|jxs |j }t j}|j|j|j}d|vr |jdd}|jdDcgc]&}|jdk7s|j(}}|gk(r d|vrdg}|S|D]}d|i}|j|d|d<d|j fd |jfd fD]2\}} |j||r|j||||<.| ||<4|dk(r ||j dfvr|j |d<|d|k7s|d|k7si}|Sd |vred }|j|dr|j|d}n |j }|j|d|j|d |||jd }|Scc}w)N distutilsz index-serversrrr"serverr repositoryrealm)rNz server-loginr)rrr'r&r()rqrrr rr[DEFAULT_REPOSITORYrRawConfigParserrrrrr] DEFAULT_REALM has_option) rr*r'rr index_serversr&_serversrrs r/rzPyPIRCFile.read s# 77>>$-- ()$*8F C#+"*F!3-3ZZ -Kz*/;D & 6: >",$!//  Ols 0H HcZtj}|j}|j||j ds|j d|j dd||j dd|t|d5}|j|dddy#1swYyxYw)Nr"rrr) rr*rr has_sectionrrr#r)rrrrrr)s r/r[zPyPIRCFile.updateBs--/ ]] B!!&)   v & 6:x0 6:x0 "c]a LLO]]s B!!B*NN)rrrr)r+rrr[rDr1r/r!r!s:M 3j r1r!cJt|jjS)zG Read the PyPI access configuration as supported by distutils. )r[)r!r[rrs r/ _load_pypircr4Os %)) $ ) ) ++r1c`tj|j|jyr)r!r[rrr3s r/ _store_pypircr6VsL7r1ctjdk(rsdtjj vrydtjj vrydtjj vrytj Sdtj vrtj dStjd k7sttd stj Stj\}}}}}|j jd d }|jd djd d}|dddk(r|d|S|dddk(rB|ddk\rd}dt|ddz |ddfz}ddd}|d|tjzz }n|dddk(r ddl m }|S|dd d!k(rJd!}tjd"tj }|j#|}|rJ|j%}n9|dd d#k(r1ddl} dd$lm} | j/| j1|||\}}}|d|d|S#t,$rddl} Y?wxYw)%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'. ramd64 win-amd64z(arm) win-arm32z(arm64)z win-arm64_PYTHON_HOST_PLATFORMr/unamerprrVrirNlinuxsunosr5solarisz%d.%sr32bit64bit)ilz.%saix) aix_platformcygwinz[\d.]+darwin) sysconfig)rqrXrrrplatformrrr<r#intmaxsize _aix_supportrFrrBASCIIrr _osx_supportr%rJ ImportErrorget_platform_osxget_config_vars) osnamerreleasermachinebitnessrFrel_rer)rPrJs r/get_host_platformrY`s0( ww$ ckk'') ) ckk'') )  ))+ +||"**,zz122 ww'W!5||13 -VT7GW\\^ # #C ,Fooc3'//S9G bqzW!'** w  1: FWQZ1!4gabk BBG$+IG uws{{33 3G u -~ x Irxx0 LL ! ggiG x   +$0#@#@AZAZA\^dfmov#w ' 22    sH>> I Iwin32r9r:)x86x64armctjdk7r tStjj d}|t vr tSt |S)NrVSCMD_ARG_TGT_ARCH)rqrXrYrr_TARGET_TO_PLAT)cross_compilation_targets r/ get_platformrbsG ww$ ""!zz~~.BC6 "" 3 44r1r1)rrbra)r collectionsr contextlibrglobrr~r>rloggingrqr@rrrrQrrr,rrrdummy_threadingrXrrcompatrrr r r r r rrrrrrrrrrrrr getLoggerrrrBrrPrOr:rCr?r`r%rFrlrrrrrrrcontextmanagerrrrrrrrrkrmVERBOSErzrrrrrrrIrrrrrrrrrrrrrARCHIVE_EXTENSIONSr<rFrrrMr}rwrxryrrrrrrrrrrrrrrrrr!r4r6rYr`rbrDr1r/ros'  #    ( 222222   8 $ RZZ) * RZZ 34 RZZ5 6 BJJD E RZZ bjj BJJ{ # rzzEF W!tytx4$  ,^&   && f   6w6wt &4 2::::  '>&(R" & &2::'89;?,-4"**9: / 8*D# )F)XCCRF!F!ZUAH $ &W+vW+| BJJ~ & " #?@ bjj!568\\ '11B'T3<3 # ## #' //'"<)''<2$ f 6"",5#5p+f+\/"JJZ,8P3h   5O= C('(s#M6N6NN NNPK!ܯ]""!__pycache__/wheel.cpython-312.pycnu[ >g˫ddlmZddlZddlZddlZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlmZmZmZdd l m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*dd l+m,Z,m-Z-e j\e/Z0da1e2ed rd Z3n2ejhjkd rdZ3nejhdk(rdZ3ndZ3ejldZ7e7sdejpddzZ7de7zZ9e3e7zZ:e*jwddjwddZ<ejldZ=e=r6e=jkdr%e=jwddj}ddZ=n dZ?e?Z=[?e jde je jzZCe jde je jzZDe jdZEe jdZFd ZGd!ZHe jd"k(rd#ZJnd$ZJejpdd%krddlKZKn dZKddlLZMddlNZMd&ZOd'ZPGd(d)eQZReRZSGd*d+eQZTd,ZUd-ZVeVZW[Vd/d.ZXy)0)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir get_platform)NormalizedVersionUnsupportedVersionErrorpypy_version_infoppjavajycliipcppy_version_nodotz%s%spy-_.SOABIzcpython-cdtg}tjdr|jdtdk(rt j dd}|dkrqtjd}|d}|r|jd|d kr@tjd }|d k(s|$t jd k(r|jd dj|S)Nr#Py_DEBUGdr%) WITH_PYMALLOCTm)r.r.Py_UNICODE_SIZEiu) VER_SUFFIXrget_config_varappend IMP_PREFIXsys version_info maxunicodejoin)partsviwpmuss [^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/c|SNos rBrKfsrDcB|jtjdS)NrE)replaceosseprIs rBrKrKhs2663/rDr.ctr%tjDcgc]}|d c}StjjScc}w)Nr)imp get_suffixes importlib machineryEXTENSION_SUFFIXES)ss rB _get_suffixesrWrs@ !..010!011""5552s Actrtj||Stjj ||}tjj |}|t j|<|jj||SrG) rQ load_dynamicrSutilspec_from_file_locationmodule_from_specr:modulesloader exec_module)namepathspecmodules rB _load_dynamicrdysg d++~~55dDA006" D ' rDc,eZdZdZdZdZddZdZy)Mounterc i|_i|_yrG) impure_wheelslibsselfs rB__init__zMounter.__init__s rDcX||j|<|jj|yrG)rhriupdate)rkpathname extensionss rBaddz Mounter.adds$'18$ $rDc|jj|}|D]!\}}||jvs|j|=#yrG)rhpopri)rkrorpkvs rBremovezMounter.removes<''++H5 DAqDII~IIaLrDNc.||jvr|}|Sd}|SrG)ri)rkfullnameraresults rB find_modulezMounter.find_modules& tyy F F rDc |tjvrtj|}|S||jvrtd|zt ||j|}||_|j dd}t|dkDr |d|_|S)Nzunable to find extension for %sr)rr) r:r]ri ImportErrorrd __loader__rsplitlen __package__)rkrxryr>s rB load_modulezMounter.load_modules s{{ "[[*F tyy(!"Ch"NOO"8TYYx-@AF $F OOC+E5zA~%*1X" rDrG)__name__ __module__ __qualname__rlrqrvrzrrHrDrBrfrfs%!  rDrfceZdZdZdZdZddZedZedZ edZ e d Z d Z e d Zd Zdd ZdZdZdZddZdZdZdZdZdZdZddZdZdZddZy) Wheelz@ Class to build and install from Wheel files (PEP 427). )rrsha256Nc||_||_d|_tg|_dg|_dg|_tj|_ | d|_ d|_ |j|_ ytj|}|rQ|j!d}|d|_ |dj#d d |_ |d |_|j|_ ytj$j'|\}}t(j|}|st+d |z|r$tj$j-||_ ||_ |j!d}|d|_ |d|_ |d |_|d j'd|_|dj'd|_|dj'd|_y)zB Initialise an instance using a (valid) filename. r5noneanyNdummyz0.1nmvnr(r'bnzInvalid name or filename: %rr&r)biar)sign should_verifybuildverPYVERpyverabiarchrNgetcwddirnamer`versionfilename _filenameNAME_VERSION_REmatch groupdictrMrasplit FILENAME_RErabspath)rkrrverifyr1infors rBrlzWheel.__init__s # W 8G yy{  DI DL!]]DN%%h/A{{2 J #Dz11#s; $T  !%$&GGMM($;!%%h/*,:ctjj|j|j}|j d|j }d|z}tjd}t|d5}|j|ttg}d}|D]U} tj||} |j| 5} || } t| }|r dddn dddW|st#ddj|z ddd|S#1swY5xYw#t $rYwxYw#1swYSxYw)Nr' %s.dist-infoutf-8r)fileobjz8Invalid wheel, because metadata is missing: looked in %sz, )rNrar=rrr`rcodecs getreaderr get_wheel_metadatarr posixpathopenrKeyError ValueError) rkroname_verinfo_dirwrapperzffnsryfnmetadata_filenamebfwfs rBmetadatazWheel.metadatas577<< dmm<"ii6!H,""7+ Xs #r  # #B '+,DECF(1x(D%!23r$R[!)"!5!! 43"4 "9;?99S>"JKK+$0 43  '$0 sT6%D5'D&DD&#D5&D&.!D5D# D&& D2/D51D22D55D?c0|jd|j}d|z}tj|d}|j |5}t j d|}t|}dddt|S#1swYtSxYw)Nr'rWHEELr) r`rrr=rrrrdict)rkrrrrrrmessages rBrzWheel.get_wheel_metadatas"ii6!H,%NN8W= WW& '2*!!'*2.B'+G(G}(G}s 'BBctjj|j|j}t |d5}|j |}ddd|S#1swYSxYw)Nr)rNrar=rrr r)rkrorrys rBrz Wheel.info#sO77<< dmm< Xs #r,,R0F$ $ s AA'ctj|}|ru|j}|d|||d}}d|jvrt}nt }t j|}|rd|jdz}nd}||z}||z}|S|jd}|jd} |dks|| kDrd} n|||dzd k(rd } nd} t | z|z}|S) Nspythonw rD  rr%s ) SHEBANG_RErendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) rkdatar1rshebangdata_after_shebangshebang_pythonargscrlfterms rBprocess_shebangzWheel.process_shebang*s   T " %%'C*.t*d34j'GW]]_,!0!/!''0Aahhjn,$t+G//D 5!B5!BAvb26?g-"D D!D(4/D rDc| |j} tt|}||j }t j|jdjd}||fS#t$rt d|zwxYw)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64urlsafe_b64encoderstripdecode)rkrrhasherrys rBget_hashzWheel.get_hashHs  I QWi0F$$&))&188>EEgN&   Q"#Ci#OP P Qs A--Bct|}|j|ddft|5}|D]}|j| dddy#1swYyxYwNr5)listr8rwriterow)rkrecords record_patharchive_record_pathwriterrows rB write_recordzWheel.write_recordSsKw-+R45 { #v$$ # #s AAcg}|\}}|D]q\}}t|d5} | j} dddd|j z} tjj |} |j || | fstjj|d}ttjj|d}|j||||j ||fy#1swYxYw)Nrbz%s=%sRECORD) rreadrrNragetsizer8r=to_posixr) rkrlibdir archive_pathsrdistinforappfrrsizes rB write_recordszWheel.write_recordsZs!("EBa!vvxt}}T22F77??1%D NNB- . # GGLL8 , bggll8X6 7 '1b)b!W%s C..C7 ct|dtj5}|D].\}}tj d|||j ||0 dddy#1swYyxYw)NwzWrote %s to %s in wheel)r zipfile ZIP_DEFLATEDloggerdebugwrite)rkrorrrrs rB build_zipzWheel.build_zipjsN XsG$8$8 9R&A 62>B': 9 9s 4AA#c  |i}ttfddd}|dk(rd}tg}tg}tg}nd}t g}dg}d g}|j d ||_|j d ||_|j d ||_ |} |jd |j} d| z} d| z} g} dD]N}|vr |}tjj|s.tj|D]\}}}|D]}t!tjj#||}tjj%||}t'tjj#| ||}| j)||f|dk(s|j+drt-|d5}|j/}ddd|j1}t-|d5}|j3|ddd Q| }d}tj|D]\}}}||k(r]t5|D]F\}}t!|}|j+ds#tjj#||}||=n|sJd|D]y}t!|j+drtjj#||}t'tjj%||}| j)||f{tj6|}|D]l}|dvst!tjj#||}t'tjj#| |}| j)||fnd|xs |j8zdt:zd|zg}|j<D] \}}}|j)d|d |d |"tjj#|d}t-|d5}|j3dj#|dddt'tjj#| d}| j)||fd } t?| | !} |jA|| f| | tjj#|jB|jD}!|jG|!| |!S#1swYxYw#1swYxYw#1swYxYw)"z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Nc |vSrGrH)rJpathss rBrKzWheel.build..xs qEzrD)purelibplatlibrrfalsetruerrrrrr'%s.datar)rheadersscriptsr.exerwb .dist-infoz(.dist-info directory expected, not found)z.pycz.pyo)r INSTALLERSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %szTag: rr cH|d}|jd}d|vr|dz }||fS)NrrEri')count)trns rBsorterzWheel.build..sorters21B Ar!U r7NrD)key)$rr IMPVERABIARCHrgetrrrr`rrNraisdirwalkr r=relpathrr8endswithrrrr  enumeratelistdir wheel_versionrrsortedrrrr )"rkr rr+libkeyis_pure default_pyver default_abi default_archrrdata_dirrrr rarootdirsfilesrrrprrrridnwheel_metadatarrrrros" ` rBbuildz Wheel.buildpsO <Df13IJKAN Y G#HM%K 6LG"GM!(K!7LXXg}5 88E;/HHV\2 v"ii6x'!H, 2C%:Dww}}T")+%D$#$RWW\\$%;<WW__Q5%bggll8S"&EF%,,b!W5)+AJJv4F!%a!'(vvx"/#'#7#7#=D!%a! ! "/$*7 2(!# D$t|'t_EAr!"B{{<0#%77<<b#9 G -  K!KKxB<(()9:GGLLr*bggooa67$$b!W- "/* 8$BCCRWW\\(B78bggll8R89$$b!W-  #m&It7I7I J #k 1 !G +  !% E3  ! !UC"F G!* GGLL7 + !S\Q GGDIIn- . bggll8W5 6b!W%  }&9  Hh/G77<< dmm< x/M"/"/V\s$:S' 0S4 !T'S1 4S> T c$|jdS)zl Determine whether an archive entry should be skipped when verifying or installing. )rEz /RECORD.jws)r()rkarcnames rB skip_entryzWheel.skip_entrys 455rDc |j}|jd}|jdd}|jdd}tjj |j |j }|jd|j} d| z} d| z} tj| t} tj| d} tj| d }tjd }t|d 5}|j| 5}||}t|}d d d d j!dd}t#|Dcgc] }t%|c}}||j&k7r|r||j&||ddk(r|d}n|d}i}|j|5}t)|5}|D] }|d}|||< d d d d d d tj| d}tj| d}tj| dd}t+|} d| _t.j0 }!g}"t3j4}#|#|_d |_ |j;D]}$|$j }%t=|%t>r|%}&n|%jAd }&|jC|&rF||&}|dr)tE|$jF|dk7rtId|&z|drj|dj!dd\}'}(|j|%5}|jK})d d d |jM)|'\}*}+|+|(k7rtId|%z|r+|&jO||frtPjSd|&|&jO|xr|&jUd },|&jO|rC|&j!d d\}*}-}.tjj ||-tW|.}/n1|&| |fvrtjj |tW|&}/|,s |j|%5}| jY||/d d d tjd!k(r&tjZ|/|$j\d"z d#z|"j_|/|sS|drNt|/d$5}|jK})|jM|)'\}*}0|0+k7rtId%|/z d d d |!s|/jUd&s | ja|/|'}1|"j_|1tjjgtW|%}2tjj |#|2}3|j|%5}| jY||3d d d tjj!|/\}4}2|4|_|ji|2}5| jk|5|"jm|5|rtPjSd*d }6nd }7|jnd }|d+k(rtj| d,}8 |j|85}tq|}9d d d i}7d-D]}:d.|:z};|;9vs ix|7d/|:z<}<|9|;jsD]Y}=|=jtd0|=jv}>|=jxr!|>d1d2j |=jxzz }>|>|<|=j<[nZ |j| 5}||}t{j||jd4}7|7r|7jd5}7d d d |7r|7jd7i}?|7jd8i}@|?s@r|jdd}Atjj|As td9A|_|?jD].\};}=|;d:|=}B|ji|B}5| jk|50@rFd;di}C@jD]/\};}=|;d:|=}B|ji|BC}5| jk|51tjj || }t|}6t|}|d=|d=||d<<|6j||}|r|"j_||6j|"|d=||6tj|#cd d d S#1swYxYwcc}w#1swYDxYw#1swYIxYw#1swYxYw#1swYxYw#1swYGxYw#tb$rtPjed(d)YwxYw#1swYxYw#1swY xYw#tb$rtPjed3YGwxYw#1swYUxYw#tb$rtPjed6YywxYw#tb$r'tPjd>| jwxYw#tj|#wxYw#1swYy xYw)?a~ Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. If kwarg ``bytecode_hashed_invalidation`` is True, written bytecode will try to use file-hash based invalidation (PEP-552) on supported interpreter versions (CPython 3.7+). The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. warnerlib_onlyFbytecode_hashed_invalidationr'rrrrrrNz Wheel-Versionr)rzRoot-Is-Purelibrrrstreamrr5r)dry_runTr%size mismatch for %s=digest mismatch for %szlib_only: skipping %srrEposixirzdigest mismatch on write for %sz.py)hashed_invalidationzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txt)consoleguiz %s_scriptszwrap_%s:z [%s],zAUnable to read legacy script metadata, so cannot generate scriptsrpzpython.commandsz8Unable to read JSON metadata, so cannot generate scripts wrap_consolewrap_guizValid script path not specifiedz = rMlibprefixzinstallation failed.)JrDr$rNrar=rrr`rrrrrr rrrtupleintr+rrrecordr:dont_write_bytecodetempfilemkdtemp source_dir target_dirinfolist isinstancer rr=str file_sizerrr startswithrrr(r copy_streamchmod external_attrr8 byte_compile Exceptionwarningbasenamemakeset_executable_modeextendrrvaluesrSsuffixflagsjsonloadr%ritemsr rwrite_shared_locationswrite_installed_filesshutilrmtree exceptionrollback)Drkr makerkwargsrDr?r@bc_hashed_invalidationrorr2r metadata_namewheel_metadata_name record_namerrbwfrrwvr7 file_versionrrrreaderrrdata_pfxinfo_pfx script_pfxfileopbcoutfilesworkdirzinfor< u_arcnamekindvaluerr(r is_scriptwherer6outfile newdigestpycrworknamer8 filenamesdistcommandsepepdatar rtr-rurVconsole_scripts gui_scripts script_dirscriptoptionssD rBinstallz Wheel.installsI "--H%::j%0!',JE!R77<< dmm<"ii6x'!H,!x1IJ 'nnXw?nnXx8 ""7+ Xs #r,-S\+B/.)//Q7B "!5"Q#a&"!56L 2 22t))<8()V3y)y)G%b)V%F%(  &*& !~~h3H ~~h3H")R@J"'2F FM,,,BH&&(G 'E #E ] '[[]E#nnG!'95$+ $+NN7$; y1 !),C1v#eoo"6#a&"@.046?0@AA1v&)!fll3&: eWWW-#%779D.$(MM$$= 6!U?"248:A4B#CC I$8$8(H9M$N % 5""$'',,uU|\"=M"N%)!>/9E,(7(=(=(?167);,1JJv,> & : :9 E)@ ++0$-,7,=,=,?DAq:;Q-?F05 670KI$*$>$>y$I-@  VX6A03D!KEi(i(#)E%L33E7CA *..xx'R  g&M$ #--"6*)&%R.-*.-"5!4$-Y!'/HSW XY.-0"- )6"NN,566 "8!7 )F"NN,EFFN   !78!   g&M$ #sh9d(&h9d Ah91 d >dd Bh9-B7g,$d-5Dg,d:#A%g,9e g,g,"$eAg,!e;4B.g,#f4 ffA;fg,g'Af:'g/E3g,"h9d  h9d d  d* %h9-d7 2g,:e ?g,e g, e84g,7e88g,;f g,f ff73g,6f77g,:g ?gg)%g,(g))g,,0hhh66h99ictQtjjt t ddt jddz}t|atS)Nz dylib-cachez%s.%sr%) cacherNrar=rr^r:r;r)rkbases rB_get_dylib_cachezWheel._get_dylib_cachesH =77<< 0#m2DgPSP`P`acbcPdFdeD$KE rDc tjj|j|j}|j d|j }d|z}tj|d}tjd}g}t|d5} |j|5}||} tj| } |j} | j|jd} tjj| j | } tjj#| stj$| | j'D]\}}tjj| t)|}tjj+|sd}nptj,|j.}t0j0j3|}|j5|}t1j0|j6}||kD}|r|j9|| |j;||f dddddd|S#1swYxYw#t<$rY!wxYw#1swY|SxYw) Nr'r EXTENSIONSrrF) use_abspathT)rNrar=rrr`rrrrr rrnror prefix_to_dirrr%makedirsrprrstatst_mtimedatetime fromtimestampgetinfo date_timeextractr8r)rkrorrr<rryrrrrprrS cache_baser`r'destr file_timer wheel_times rB_get_extensionszWheel._get_extensionss77<< dmm<"ii6!H,..<8""7+ Xs #r WWW% B!%2J 113E"00E0RF!#ejj&!AJ77==4 J/)3)9)9); g!ww||J W8MN!ww~~d3&*G(* (>(>I(0(9(9(G(G (RI#%::g#6D)1):):DNN)KJ&09&??5'$ #--*)&%8*)K$ #sy"I.4H;I.# I0II B9I.)I..I"?"I."I.;I I.I II I."I+ 'I..I7c d}d}tjj|j|j}|j d|j }d|z}tj|d} t5} t|d5} i} | jD]} | j}t|tr|}n|jd}|| k(r9d|vrtd |z| j| | tjj| t!|}|| |< d d d | |\}}|| fi|}|r || |\}}|r||k(r ||||1t#j$d d | \}}tj&|nWtjj)|std|ztjj||j}t+| j-}tjj| |}||f}|j/|| ||j1|||t3j4||d d d |S#1swYLxYw#1swYSxYw)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. cxdx}}|dt}||vrd|z}||vr||}t|j}||fS)NrEz %s/PKG-INFOra)rrr)path_maprrrar s rB get_versionz!Wheel.update..get_version~sS! !Gd%'?@C("#h.h}"-55D= rDc d} t||jd}|dkrd|z}nZ||dzdjdDcgc] }t|}}|dxxdz cc<|d|ddj d|D}|rSt| }||_ |jt}|j|| t jd ||yycc}w#t $rt jd |Y|wxYw) Nr'rz%s+1rr)r+c32K|]}t|ywrG)r^).0r7s rB z7Wheel.update..update_version..s>Uu!s1vusz0Cannot update non-compliant (PEP-440) version %rr)ralegacyzVersion updated from %r to %r) rrrrUr=rrrrrr(rr )rraupdatedr7rVr>mdrs rBupdate_versionz$Wheel.update..update_versionsG 4!'*LL%q5$w.G-4QUV_-B-B3-GH-GSV-GEH"INI)0!chh>Uu>U6UVG4($ '?@d62  < !%&  sj6 g'R D#  0* 06?p_rDrcddl}|j}g}|ddk(rP|djdD].}|j|j r t |nd0t |}|S)Nrglibcrr))platformlibc_verrr8isdigitrUrT)rverryrVs rB_get_glibc_versionrsc    C F 1vQc"A MMAIIK#a&Q 7#v MrDc J Gdd}ttjjddDcgc]#}|tjj|%}}g}t D]8}|j ds|j|jddd:|jtdk7r|jd t|jdg}tg}tjd k(rtjd t}|r|j!\}} } } t#| } | g} | d vr| jd | dvr| jd| dvr| jd| dvr| jd| dvr| jd| d k\r:| D]*} |d| d| d| }|tk7s|j|,| dz} | d k\r:t%|D]\}}t'|}g}|d k(r|}t(dk(r<|j*dk\r-dt'|jz}||vr|j||D]Q}|D]H} |jdj-t(|f|| f|dk7s3tjj dsS| j/dd} t1}t3|dk(s~|dk\r,|jdj-t(|f|d| zf|dk\r,|jdj-t(|f|d | zf|d!k\r,|jdj-t(|f|d"| zf|jdj-t(|f|d#|d d|dd| fKTt%|D]k\}}t'|}|jdj-t(|fdd$f|d k(s@|jdj-t(|d fdd$fmt%|D]c\}}t'|}|jdj-d%|fdd$f|d k(s<|jdj-d%|d fdd$fet5|Scc}w)&zG Return (pyver, abi, arch) tuples compatible with this Python. ceZdZdZdZy)!compatible_tags.._Versioncx||_||f|_djt|t|f|_yr)major major_minorr=r^string)rkrminors rBrlz*compatible_tags.._Version.__init__s2DJ %u~D ''3u:s5z":;DKrDc|jSrG)rrjs rB__str__z)compatible_tags.._Version.__str__s ;; rDN)rrrrlrrHrDrB_Versionrs  <  rDrrz.abir)r%rrrdarwinz(\w+)_(\d+)_(\d+)_(\w+)$)i386ppcfat)rrx86_64fat3)ppc64rfat64)rrintel)rrrrr universalr(r#)r.r%rr5linuxlinux_)r%z manylinux1_%s)r% zmanylinux2010_%s)r%zmanylinux2014_%s manylinux_rr&)ranger:r;rrrWr`r8rsortr"rr#rrerrrUr)r^r9rr=rMrrset)r minor_versionversionsabisrlryarchesr1r`rrrmatchesrrVr7version_objectradd_abislimited_api_abirr>s rBcompatible_tagsr sW#3#3#3#9#92rBBM !!''7B  D/   V $ KK S!,Q/ 0" IIK f} AsKK FVF ||x HH0$ 7 '(xxz $D%JEfG&u%00v&**w'))w'BB{+1*$E)-ueUCADy a(%  1*'x0>n% 6H  ."<"<"F#c.*>*>&??Oh.0C rww G'<=sDIJ&=S\\%<%n% rww G45vuEF 6 MM277J #;n% rwwg/?@ 6 MM277D'!*#56F G 1 v;es(R ct|ts t|}d}|t}|D]7\}}}||jvs||jvs%||j vs4d}|S|S)NFT)r]rCOMPATIBLE_TAGSrrr)wheelrryrrrs rBrrBsj eU #e  F |S$ %++ #"2tuzz7IF  M  MrDrG)Y __future__rrrremailrrrnloggingrNrrrsr:rXrr5rrcompatrr r r r databaser rrrrrZrrrrrrrrrrrrr getLoggerrrrhasattrr9rr`r7r6r;rr!rMr#r"rrCcompile IGNORECASEVERBOSErrrrrrrOrrQimportlib.machineryrSimportlib.utilrWrdobjectrfrrrr r rrHrDrBrsa( #   +CC+QQ888?   8 $  3#$J\\V$J\\UJJ %Y % %&8 9 #**2A..J z j ~c3'//S9iw'3>>* % ++j$ ' - -c 21 5C$ -Cbjj]]RZZ ! "**]]RZZ ! RZZ) * BJJ@A66S=H/HA C6 "f"J  _ F_ D`F"# rDPK!XbCC%__pycache__/resources.cpython-312.pycnu[ >gD*.ddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZej eZdaGddeZGdd eZGd d eZGd d eZGddeZGddeZedee j8eiZ ddlZeeejD<eeejF<eeejH<[dZ&iZ'dZ(ejRe*dZ+dZ,y#e $rddl!ZY]wxYw#e e%f$rYF WW\\$))T-?-?-GNFggoof-G77==) G$77>>&) h5&$'1GGHNN+( v ( s 4DD&N)__name__ __module__ __qualname__rrr, __classcell__rs@rr r s2 rr ceZdZdZy) ResourceBasec ||_||_yr-)rname)rrr6s rrzResourceBase.__init__Hs  rN)r.r/r0rrrrr4r4Gsrr4cJeZdZdZdZdZedZedZedZ y)Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. Fc8|jj|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_streamrs r as_streamzResource.as_streamUs{{%%d++rcLt tatj|Sr-)cacher r,r;s r file_pathzResource.file_path^s =!OEyyrc8|jj|Sr-)r get_bytesr;s rr'zResource.byteses{{$$T**rc8|jj|Sr-)rget_sizer;s rsizez Resource.sizeis{{##D))rN) r.r/r0__doc__ is_containerr<rr?r'rDrrrr8r8MsO L, ++**rr8c eZdZdZedZy)ResourceContainerTc8|jj|Sr-)r get_resourcesr;s r resourceszResourceContainer.resourcesqs{{((..rN)r.r/r0rFrrKrrrrHrHnsL//rrHceZdZdZej j drdZndZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZeej*j,ZdZy)ResourceFinderz4 Resource finder for file system resources. java).pyc.pyoz.class)rOrPc||_t|dd|_tjj t|dd|_y)N __loader____file__)modulegetattrloaderr r r!r)rrUs rrzResourceFinder.__init__s6 flD9 GGOOGFJ$CD rc@tjj|Sr-)r r realpathrr s r _adjust_pathzResourceFinder._adjust_pathsww%%rct|trd}nd}|j|}|jd|jt j j|}|j|S)N//r) isinstancer'splitinsertrr r rr[)r resource_nameseppartsr)s r _make_pathzResourceFinder._make_paths] mU +CC##C( Q "u%  ((rc@tjj|Sr-)r r r$rZs r_findzResourceFinder._findsww~~d##rcd|jfSr-)r rrs rrzResourceFinder.get_cache_infosX]]""rc|j|}|j|sd}|S|j|r t||}n t ||}||_|Sr-)rerg _is_directoryrHr8r )rrbr r)s rfindzResourceFinder.finds\}-zz$F !!$'*4?!$ 6FK rc.t|jdSNrb)r%r ris rr:zResourceFinder.get_streamsHMM4((rczt|jd5}|jcdddS#1swYyxYwrn)r%r read)rrr+s rrAzResourceFinder.get_bytess' (-- &!668' & &s1:cTtjj|jSr-)r r getsizeris rrCzResourceFinder.get_sizeswwx}}--rcfd}ttj|jDcgc] }||s |c}Scc}w)NcJ|dk7xr|jj S)N __pycache__)endswithskipped_extensions)r+rs rallowedz-ResourceFinder.get_resources..alloweds,&8JJt667,8 9r)setr listdirr )rrryr+s` rrJzResourceFinder.get_resourcess< 9rzz(--8G8!GAJA8GHHGs AAc8|j|jSr-)rkr ris rrFzResourceFinder.is_containers!!(--00rc#XK|j|}||g}|r|jd}||jrh|j}|jD]M}|s|}ndj ||g}|j|}|jr|j |J|O|ryyyw)Nrr^)rlpoprFr6rKrappend)rrbrtodornamer6new_namechilds riteratorzResourceFinder.iterators99]+  :D88A;(($MME ( 2 2$'+H'*xx '>H $ ( 3 -- KK."'K!3  s B$B*'B*N)r.r/r0rEsysplatform startswithrxrr[rergrrlr:rArCrJrF staticmethodr r r"rkrrrrrMrMvsy ||v&7-E & )$# ).I 1!/M(rrMcReZdZdZfdZdZdZdZdZdZ dZ d Z d Z xZ S) ZipResourceFinderz6 Resource finder for resources in .zip files. cFtt| ||jj}dt |z|_t|jdr|jj|_ntj||_t|j|_ y)Nr_files) rrrrWarchivelen prefix_lenhasattrr zipimport_zip_directory_cachesortedindex)rrUrrs rrzZipResourceFinder.__init__ss /7++%%c'l* 4;; )++,,DK#88ADKDKK( rc|Sr-rrZs rr[zZipResourceFinder._adjust_paths rc||jd}||jvrd}nj|r)|dtjk7r|tjz}t j|j |} |j |j |}|s-tjd||jj|Stjd||jj|S#t$rd}YiwxYw)NTFz_find failed: %r %rz_find worked: %r %r) rrr rcbisectrr IndexErrorloggerdebugrWr()rr r)is rrgzZipResourceFinder._findsDOO$% 4;; FRBFF*bff} djj$/A A11$7 LL.dkk6H6H I  LL.dkk6H6H I   s-C'' C54C5cl|jj}|jdt|zd}||fS)Nr)rWrr r)rrr(r s rrz ZipResourceFinder.get_cache_infos4$$}}QV_-.t|rcL|jj|jSr-)rWget_datar ris rrAzZipResourceFinder.get_bytess{{##HMM22rcJtj|j|Sr-)ioBytesIOrAris rr:zZipResourceFinder.get_streamszz$..233rcX|j|jd}|j|dS)N)r rrrs rrCzZipResourceFinder.get_sizes+}}T__-.{{4 ##rc.|j|jd}|r)|dtjk7r|tjz }t |}t }t j |j|}|t |jkr|j|j|s |S|j||d}|j|jtjdd|dz }|t |jkr|S)Nrrr) r rr rcrrzrrraddr`)rrr plenr)rss rrJzZipResourceFinder.get_resourcess}}T__-. DH& BFFND4y MM$**d +#djj/!::a=++D1  1 de$A JJqwwrvvq)!, - FA #djj/!  rc||jd}|r)|dtjk7r|tjz }tj|j|} |j|j |}|S#t $rd}Y|SwxYw)NrF)rr rcrrrr)rr rr)s rrkzZipResourceFinder._is_directorysDOO$% DH& BFFND MM$**d + ZZ]--d3F  F  sA<< B  B )r.r/r0rErr[rgrrAr:rCrJrkr1r2s@rrrs5 )$ 34$  rrc(|tt|<yr-)_finder_registrytype)rW finder_makers rregister_finderr2s%1T&\"rcX|tvr t|}|S|tjvr t|tj|}t |dd}| t dt |dd}t jt|}|t d|z||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packagerRzUnable to locate finder for %r) _finder_cachermodules __import__rVrrr,r)packager)rUr rWrs rrr9s -w' M #++ % w W%vz40 <"$89 9t4'++DL9  "#Cg#MN Nf%!' g Mr __dummy__c&d}tj|tjj |}t j t |}|r:t}tjj|d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. NrT) pkgutil get_importerrpath_importer_cacher,rr _dummy_moduler r rrSrR)r r)rWrrUs rfinder_for_pathrUsuF   $ $ ( ( .F  ! !$v, /F '',,tR0" Mr)- __future__rrrloggingr rrtypesrrTrutilrrr getLoggerr.rr>r objectr4r8rHrMrr zipimporterr_frozen_importlib_external_fi ImportError_frozen_importlibSourceFileLoader FileFinderSourcelessFileLoaderAttributeErrorrrr ModuleTyperrrrrrrsR(   88   8 $ )E)X6 *|*B/ /W(VW(tKK^ J ,  (0.<S))*'5S^^$1?S--. 2 2!  [!12 ] ('( ^$  s0%C;).D ; DD DD DDPK!y$__pycache__/locators.cpython-312.pycnu[ >gR ddlZddlmZddlZddlZddlZddlZddlZ ddlZddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlmZm Z m!Z!ddl"m#Z#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-dd l.m/Z/m0Z0dd l1m2Z2m3Z3ejhe5Z6ejnd Z8ejnd ejrZ:ejnd Z;dZGdde?Z@Gdde@ZAGdde@ZBGdde?ZCGdde@ZDGdde@ZEGdde@ZFGd d!e@ZGGd"d#e@ZHeHeDd$d%&d'(ZIeIjZJGd)d*e?ZKy#e $rddl ZY]wxYw),N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)MetadataMetadataInvalidError)cached_property ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.org/pypic|t}t|d} |j|dS#|dwxYw)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. @timeoutclose) DEFAULT_INDEXr list_packages)urlclients ?/opt/hc_python/lib/python3.12/site-packages/distlib/locators.pyget_all_distribution_namesr/'sD  { c *F##%wws 4Ac"eZdZdZdZexZxZZy)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. cd}dD] }||vs||}n|yt|}|jdk(r>t|j|}t |dr|j |n||<t j||||||S)N)locationurireplace_header)rschemer get_full_urlhasattrr6BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersnewurlkeyurlpartss r.r;zRedirectHandler.http_error_302@s&Cg~ ' > F# ??b S--/8Fw 01&&sF3% "11$RsGTTN)__name__ __module__ __qualname____doc__r;http_error_301http_error_303http_error_307rEr.r1r16sU&8FENE^nrEr1ceZdZdZdZdZdZdZedzZddZ dZ d Z d Z d Z d Zee eZd ZdZdZdZdZdZdZdZdZddZy)LocatorzG A base class for locators - things that locate distributions. )z.tar.gzz.tar.bz2z.tarz.zipz.tgzz.tbz)z.eggz.exe.whl)z.pdfN)rPci|_||_tt|_d|_t j|_y)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher7rr1openermatcherr Queueerrors)r<r7s r.__init__zLocator.__init__fs9  #?#45  kkm rEc@g}|jjsb |jjd}|j||jj |jjsb|S#|jj$rYwxYw)z8 Return any errors which have occurred. F)rVemptygetappendEmpty task_done)r<resultes r. get_errorszLocator.get_errorsys++##% KKOOE* a  KK ! ! # ++##% ;;$$  s,BBBc$|jy)z> Clear any errors which may have been logged. N)r`r<s r. clear_errorszLocator.clear_errorss rEc8|jjyN)rRclearrbs r. clear_cachezLocator.clear_caches rEc|jSre_schemerbs r. _get_schemezLocator._get_schemes ||rEc||_yreri)r<values r. _set_schemezLocator._set_schemes  rEctd)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. Please implement in the subclassNotImplementedError)r<names r. _get_projectzLocator._get_projects""DEErEctd)J Return all the distribution names known to this locator. rprqrbs r.get_distribution_nameszLocator.get_distribution_namess""DEErEc|j|j|}|S||jvr|j|}|S|j|j|}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. )rRrtrc)r<rsr^s r. get_projectzLocator.get_projectsy ;; &&t,F T[[ [[&F      &&t,F &DKK  rEc6t|}tj|j}d}|j d}|j |j }|rt t||j}|jdk(d|jv||||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. TrPhttpszpypi.org) r posixpathbasenamepathendswithdownloadable_extensionsr$r# wheel_tagsr7netloc)r<r,tr} compatibleis_wheelis_downloadables r. score_urlzLocator.score_urls SM%%aff- $$V,"++D,H,HI &uXHJG#Z188%;_hXbdlmmrEc|}|r^|j|}|j|}||kDr|}||k7rtjd|||Stjd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rloggerdebug)r<url1url2r^s1s2s r. prefer_urlzLocator.prefer_urlsk %B%BBw~ 7tD  3T4@ rEct||S)zZ Attempt to split a filename in project name, version and Python version. )r)r<filename project_names r.rzLocator.split_filenamesh 55rEcd}d}t|\}}}}} } | jjdrtj d|| t j | } | r| j\} } nd\} } |}|r |ddk(r|dd}|jdr t|}t||jstj d |n|d }n||j|}|rw|j|j|jt||||| d fd j!|j"Dcgc]}d j!t%|dd!c}d}n|j|j*stj d|nt-j.|x}}|j*D]}}|j|s|dt1| }|j3||}|stj d|n.|\}}}|r |||r|||t||||| d fd}|r||d<n|r | r| |d| z<|Scc}w#t&$rtj)d|Y4wxYw)a See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned. c0t|t|k(Sre)r )name1name2s r. same_projectz:Locator.convert_url_to_download_info..same_projects!%(N5,AA ArENzegg=z %s: version hint in fragment: %r)NN/rPzWheel not compatible: %sTr5z, .)rsversionrr,python-versionzinvalid path for wheel: %szNot downloadable: %sz No match for project/version: %s)rsrrr,r %s_digest)rlower startswithrr HASHER_HASHmatchgroupsrr#r$rrsrrrjoinpyverlist Exceptionwarningrr|r}lenr)r<r,rrr^r7rr~paramsqueryfragmalgodigestorigpathwheelincludevrextrrsrrs r.convert_url_to_download_infoz$Locator.convert_url_to_download_infosq B4 wrEcd}t|}|td|zt|j}|j |j x|_}t jd|t|j|j|j}t|dkDrg}|j} |D]?} | dvr |j| sn%|s| | js|j!| At|dkDrt'||j(}|r t jd ||d } || }|r|j*r|j*|_|j-d ij- t/|_i} |j-d i} |j0D]}|| vs| || |<| |_d|_|S#t"$rt j%d|| Y= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)rrrzerror matching %s with %rr)rCzsorted list: %srrr)rrr!r7rT requirementrrtyperFryrsr version_classr is_prereleaser[rrsortedrCextrasrZr download_urlsr)r<r prereleasesr^rr7rTversionsslistvclskrdsdr,s r.locatezLocator.locateZs k * 9"#@;#NO ODKK(!' !>> w '$w-2H2HI##AFF+ x=1 E((D++"==+&d1g.C.C!LLO5zA~u&**5 .6)!'* xx ! #+<<#;#?#?#OF Ai,B++"9WAcF,FN  )!NN#>Ks7G G54G5)default)F)rFrGrHrIsource_extensionsbinary_extensionsexcluded_extensionsrrrWr`rcrgrkrnpropertyr7rtrwryrrrrrrrrMrEr.rOrOVsP0$ J/*<$& k; /F FF " n,6 DL..6rErOc.eZdZdZfdZdZdZxZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c ^tt| di|||_t |d|_y)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. r&r'NrM)superrrWbase_urlrr-r<r,kwargs __class__s r.rWzPyPIRPCLocator.__init__s, nd,6v6 !#s3 rEcHt|jjSrv)rr-r+rbs r.rwz%PyPIRPCLocator.get_distribution_namess4;;,,.//rEciid}|jj|d}|D]8}|jj||}|jj||}t |j }|d|_|d|_|jd|_ |jdg|_ |jd|_ t|}|s|d } | d |_ |j| |_||_|||<|D]L} | d } |j| } |d j#|t%j'| | |d | <N;|S) NrTrrsrlicensekeywordssummaryrr,rr)r-package_releases release_urls release_datarr7rsrrZrrrrrrrrrrr) r<rsr^rrrdatarrrr,rs r.rtzPyPIRPCLocator._get_projectsP,;;//d;A;;++D!4D;;++D!4Dt{{3H LHM#IH #xx 2H  $R 8H #xx 2H )DAw&*5k#"..t4 #  q  Du+C!--d3F6N--a7;;C@-3F9%c* !!* rErFrGrHrIrWrwrt __classcell__rs@r.rrs 40 rErc.eZdZdZfdZdZdZxZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c Ltt| di|t||_y)NrM)rrrWrrrs r.rWzPyPIJSONLocator.__init__s! ot-77$S) rEctdrvzNot available from this locatorrqrbs r.rwz&PyPIJSONLocator.get_distribution_names""CDDrEciid}t|jdt|z} |jj |}|j j }tj|}t|j}|d}|d|_ |d|_ |jd|_|jdg|_|jd |_t#|}||_|||j<|d D]} | d }|j&j)||j+| |j,|<|d j/|jt1j)||j+| |d |<|d j3D]\} } | |jk(rt|j} |j| _ | | _ t#| } || _| || <| D]} | d }| j&j)||j+| | j,|<|d j/| t1j)||j+| |d |< |S#t4$rE}|j6j9t;|t<j?d|Yd}~|Sd}~wwxYw)Nrz%s/jsonrrrsrrrrrr,rreleaseszJSON fetch failed: %s) rrr rSopenreaddecodejsonloadsrr7rsrrZrrrrrrrrrrritemsrrVputrr exception)r<rsr^r,resprrrrrrinfosomdodistr_s r.rtzPyPIJSONLocator._get_projects,dmmYt%<=1 9;;##C(D99;%%'D 4 A-BV9D6lBGiBJ),BJ((:r2BK),BJ#DDL!%F2:: & 5k""&&s+$($4$4T$: S!v))"**ce<@@E)-)9)9$)?y!#& "#$J-"5"5"7bjj(dkk277% $S) $ "'w!Du+C''++C0)-)9)9$)?EMM#&6N--gsu=AA#F-1-=-=d-CF9%c* "#88  9 KKOOIaL )   4a 8 8  9sI.J K(#:K##K(rrs@r.rrs *E 5rErc"eZdZdZej dej ejzejzZ ej dej ejzZ dZ ej dej Z e dZy)Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)c||_|x|_|_|jj |j}|r|j d|_yy)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr,_basesearchgroup)r<rr,rs r.rWz Page.__init__sH  #&&  JJ  dii ( GGAJDM rEz[^a-z0-9$&+,/:;=?@.#%_\\|-]cd}t}|jj|jD]}|j d}|dxs!|dxs|dxs|dxs |dxs|d}|d xs |d xs|d }t |j |}t|}|jjd |}|j||ft|d d}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cZt|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r,r7rr~rrrs r.cleanzPage.links..clean3s48@ 5FFD&%vvuT{FE4PQ QrEr5rel1rel2rel3rel4rel5rel6rrurl3c<dt|jdzS)Nz%%%2xr)ordr)rs r.zPage.links..?swQWWQZ/HrEc |dS)NrrM)rs r.rzPage.links..CsadrET)rCreverse) r_hreffinditerr groupdictrrr _clean_resubrr)r<rr^rrrelr,s r.linksz Page.links+s R ZZ((3E#AV9]& ]QvY]!F)]qy]TUV\T]CF)5qy5AfIC$---C3-C..$$%H#NC JJSz "4NDA rEN)rFrGrHrIrecompileISXrr rWr!rr$rMrEr.r r  s BJJ TTBDD[244  E BJJ? ME ' 9244@IrEr ceZdZdZej dddZdfd ZdZdZ dZ e jd e jZd Zd Zd Zd ZdZe jdZdZxZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. c\tjt|jS)N)fileobj)gzipGzipFilerrbs r.rzSimpleScrapingLocator.Qs$-- ;@@BrEc|SrerMr0s r.rzSimpleScrapingLocator.Rs!rE)deflater.nonec dtt| di|t||_||_i|_t|_tj|_ t|_ d|_ ||_tj |_tj |_d|_y)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FNrM)rr+rWrrr( _page_cacher_seenr rU _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplockplatform_check)r<r,r(r;rrs r.rWzSimpleScrapingLocator.__init__Us #T3=f=$S)  U %#&__& !( #rEcg|_t|jD]T}tj|j }d|_|j|jj|Vy)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsranger;r<Thread_fetchdaemonstartr[)r<irs r._prepare_threadsz&SimpleScrapingLocator._prepare_threadspsV  t''(A   4AAH GGI MM  # )rEc|jD]}|jjd|jD]}|jg|_y)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)rCr8rr)r<rs r. _wait_threadsz#SimpleScrapingLocator._wait_threads}sBA NN  t $A FFH rEc"iid}|j5||_||_t|jdt |z}|j j|jj|j tjd||jj||jj|j|`ddd|S#|jwxYw#1swY|SxYw)Nrz%s/z Queueing %s)r?r^rrrr r7rfr6rJrrr8rrrL)r<rsr^r,s r.rtz"SimpleScrapingLocator._get_projects, \\ DK $D $--t)<=C JJ       " " $  ! ! # % ]C0""3'##%""$  ""$ s%A5DA C/D/DDDz<\b(linux_(i\d86|x86_64|arm\w+)|win(32|_amd64)|macosx_?\d+)\bc8|jj|S)zD Does an URL refer to a platform-specific download? )platform_dependentr )r<r,s r._is_platform_dependentz,SimpleScrapingLocator._is_platform_dependents&&--c22rEc0|jr|j|rd}n|j||j}tj d|||r3|j 5|j|j|ddd|S|S#1swY|SxYw)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s) r@rPrrrrr>rr^)r<r,rs r._process_downloadz'SimpleScrapingLocator._process_downloads   4#>#>s#CD44S$:K:KLD 13= ))$++t< t  s "B  Bct|\}}}}}}|j|j|jz|jzrd}n|j r|j |jsd}nm|j |jsd}nO|dvrd}nH|dvrd}nA|j|rd}n-|jddd} | jdk(rd}nd}tjd |||||S) z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. F)homepagedownload)httpr{ftp:rr localhostTz#should_queue: %s (%s) from %s -> %s) rrrrrr:rrrPsplitrrr) r<linkreferrerr#r7rr~_r^hosts r. _should_queuez#SimpleScrapingLocator._should_queues )1%aA ==//$2H2HH4KcKcc dF  )GF$$T]]3F 0 0F 3 3F  ( ( .F<<Q'*Dzz|{* :D#xQWX rEc |jj} |r|j|}| |jjM|jD]\}}||j vs |j j ||j|sE|j|||r2tjd|||jj||jj|sy#t$rYwxYw#t$r.}|jjt|Yd}~_d}~wwxYw#|jjwxYw)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)r8rZget_pager]r$r7rrRr_rrrrrrVr)r<r,pager[r#r_s r.rFzSimpleScrapingLocator._fetchs...$$&C +==-D| ((*&*ZZ ctzz1% $ t 4(,(>(>t(DI[I[\`begjIk$*LL1Fc$R$(NN$6$6t$< &0((*/$8% $% .  ! -- .((*sTD D0A1D!D D  D D  D E$E=E EE E&c$t|\}}}}}}|dk(r=tjjt |rt t |d}||jvr(|j|}tjd|||S|jddd}d}||jvrtjd|||St|d d i } tjd ||jj||j } tjd|| j!} | j#dd} t$j'| r| j)} | j+} | j#d}|r|j,|}|| } d}t.j1| }|r|j3d} | j5|} t9| | }||j| <||j|<|S#t6$r| j5d} YHwxYw#t:$r0}|j<dk7rtj?d||Yd}~ed}~wt@$r^}tj?d|||jB5|jjE|dddn #1swYnxYwYd}~d}~wtF$r!}tj?d||Yd}~d}~wwxYw#||j|<wxYw)a Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). filez index.htmlzReturning %s from cache: %srXrrNzSkipping %s due to bad host %szAccept-encodingidentity)rAz Fetching %sr'z Fetched %sz Content-Typer5zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosr~isdirr rrr6rrrZr9rrSrr(rrZHTML_CONTENT_TYPErgeturlrdecodersCHARSETr rr UnicodeErrorr rr?rrr>rr)r<r,r7rr~r]r^r^r=rrA content_type final_urlrencodingdecoderrr_s r.razSimpleScrapingLocator.get_pages)1 %aA V  l4.@ A,s+\:C $"" "%%c*F LL6V DT Q<<Q'*DFt& =sDIJ Gc,=z+JK!3LL4;;++C+FDLLs3"iikG#*;;~r#BL(..|<$(KKM #yy{#*;;/A#B#&*mmH&=G#*4=D#*#NN<8'(wwqzH:#';;x#8D"&dI!66<((3-3D$$S)  ,:#';;y#9D:!Ivv}(()?aH2$$%;S!D++D1$ E$$%;S!DDE-3D$$S)sC>H5H)H5H2/H51H22H55 K;>&I)$K>) K;5#KJ=4 K=K K K> K;K61K>6K;;K>>Lz]*>([^<]+)>rEc iid}tj|jD]\}}}|D]}|j||stjj ||}t ddttjj|dddf}|j||}|s|j|||jr|S|S)Nrrdr5) rfwalkr{r~r~rrr rzrrry) r<rsr^rootdirsfilesfnr,rs r.rtzDirectoryLocator._get_project\s,!#!7 D$&&r40dB/B$fb,rwwr?R2SUWY[]_%`aC<> "8 rEc t}tj|jD]\}}}|D]}|j ||stj j ||}tddttj j|dddf}|j|d}|s|j|d|jr|S|S)rvrdr5Nrs) rrfrr{r~r~rrr rzrrry)r<r^rrrrr,rs r.rwz'DirectoryLocator.get_distribution_namesjs!#!7 D$&&r40dB/B$fb,rwwr?R2SUWY[]_%`aC<> "8 rE) rFrGrHrIrWr~rtrwrrs@r.rwrw>s"? rErwceZdZdZdZdZy) JSONLocatora This locator uses special extended metadata (not available on PyPI) and is the basis of performant dependency resolution in distlib. Other locators require archive downloads before dependencies can be determined! As you might imagine, that can be slow. ctdrrqrbs r.rwz"JSONLocator.get_distribution_namesrrEc iid}t|}|r|jdgD]}|ddk7s|ddk7rt|d|d|jd d |j }|j}|d |_d |vr|d r d|d f|_|jdi|_|jdi|_|||j<|dj|jtj|d |S)Nrrptypesdist pyversionsourcersrrzPlaceholder for summary)rr7r,rr requirementsexportsr) rrZrr7rrr dependenciesrrrrr)r<rsr^rrrrs r.rtzJSONLocator._get_projects,% "-=G+tK/@H/L!f!%i)-)=V)W(, 5]] $U  t#X#($x."9DK"&((>2">#xx 26 '+t||$v))$,,>BB4;O%.& rEN)rFrGrHrIrwrtrMrEr.rr|sE rErc(eZdZdZfdZdZxZS)DistPathLocatorz This locator finds installed distributions in a path. It can be useful for adding to an :class:`AggregatingLocator`. c ^tt| di|t|tsJ||_y)zs Initialise an instance. :param distpath: A :class:`DistributionPath` instance to search. NrM)rrrW isinstancerdistpath)r<rrrs r.rWzDistPathLocator.__init__s/ ot-77($4555  rEc |jj|}|iid}|S|j|d|jt|jgid|jtdgii}|S)Nrrr)rget_distributionrrr)r<rsrr^s r.rtzDistPathLocator._get_projects{}}--d3 < R0F  dLL#t&7"8LL#tf+ F rE)rFrGrHrIrWrtrrs@r.rrs !rErcxeZdZdZfdZfdZdZeejjeZ dZ dZ xZ S)AggregatingLocatorzI This class allows you to chain and/or merge a list of locators. ch|jdd|_||_tt|di|y)a Initialise an instance. :param locators: The list of locators to search. :param kwargs: Passed to the superclass constructor, except for: * merge - if False (the default), the first successful search from any of the locators is returned. If True, the results from all locators are merged (this can be slow). mergeFNrM)rrlocatorsrrrW)r<rrrs r.rWzAggregatingLocator.__init__s1ZZ/     $0:6:rEcltt| |jD]}|jyre)rrrgr)r<rrs r.rgzAggregatingLocator.clear_caches+  $35}}G    !%rEcB||_|jD] }||_ yre)rjrr7)r<rmrs r.rnzAggregatingLocator._set_schemes }}G"GN%rEc0i}|jD]}|j|}|s|jr|jdi}|jdi}|j ||jd}|r1|r/|j D]\}} ||vr||xx| zcc<| ||<|jd} |s| s| j ||j d} n(d} |D]!}|j j|sd} n| s|}|S|S)NrrTF)rryrrZupdaterrTr) r<rsr^rrrrdfrrddfounds r.rtzAggregatingLocator._get_projects}}G##D)A::"JJvr2E$jjB7GMM!$F+B$)KKMDAq Bw "1 ()1 %2  I.B2 '*||+ $ %!"A#||11!4(, %"#!" Q%P rEct}|jD]} ||jz}|S#t$rY&wxYwr)rrrwrr)r<r^rs r.rwz)AggregatingLocator.get_distribution_namessL}}G '88::%  '  s 2 >>)rFrGrHrIrWrgrnrrOr7fgetrtrwrrs@r.rrs:; " # gnn)); 7F*X rErzhttps://pypi.org/simple/r&r'legacyrc>eZdZdZd dZdZdZdZdZdZ d d Z y) DependencyFinderz0 Locate dependencies for distributions. Ncj|xst|_t|jj|_y)zf Initialise an instance, using the specified locator to locate distributions. N)default_locatorrr!r7)r<rs r.rWzDependencyFinder.__init__.s& 1/  !4!45 rEcttjd||j}||j|<||j||j f<|j D]]}t|\}}tjd||||jj|tj||f_y)z Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. zadding distribution %szAdd to provided: %s, %s, %sN) rrrC dists_by_namedistsrprovidesrprovidedrrr)r<rrsprs r.add_distributionz!DependencyFinder.add_distribution6s  -t4xx#'4 +/ D$,,'(A215MD' LL6gt L MM $ $T35 1 5 5wo FrEcftjd||j}|j|=|j||j f=|j D]Z}t|\}}tjd||||j|}|j||f|rN|j|=\y)z Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. zremoving distribution %sz Remove from provided: %s, %s, %sN) rrrCrrrrrrremove)r<rrsrrss r.remove_distributionz$DependencyFinder.remove_distributionEs  /6xx   t $ JJdll+ ,A215MD' LL;T7D Q d#A HHgt_ %MM$' rEc |jj|}|S#t$r2|jd}|jj|}Y|SwxYw)z Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). r)r7rTr"rZ)r<reqtrTrss r. get_matcherzDependencyFinder.get_matcherWs[ 0kk))$/G  ' 0::<?Dkk))$/G  0s7AAc|j|}|j}t}|j}||vr5||D]-\}} |j |}|s|j ||S|S#t $rd}Y'wxYw)z Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. F)rrCrrrr"r) r<rrTrsr^rrproviderrs r.find_providerszDependencyFinder.find_providersgs""4({{== 8 %-d^!"#MM'2EJJx( &4 /"!E"sA// A=<A=c|j|}t}|D]@}|j|}|j|jr0|j |B|r"|j d||t |fd}|S|j||j|=|D]5}|jj|tj |7|j|d}|S)a Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. cantreplaceFT) reqtsrrrrr frozensetrrr) r<rotherproblemsrlist unmatchedrrTr^s r.try_to_replacezDependencyFinder.try_to_replaces& 5!E A&&q)G==!1!12 a   LL-5)I:NO PF  $ $U + 5! %%h6::1=  ! !( +F rEci|_i|_i|_i|_t |xsg}d|vr!|j d|t gdz}t |tr|x}}tjd|nE|jj||x}}|td|ztjd|d|_ t }t |g}t |g}|rd|j}|j} | |jvr|j!|n'|j| } | |k7r|j#|| ||j$|j&z} |j(} t } |r'||vr#dD]}d |z}||vs | t+|d |zz} | | z| z}|D]}|j-|}|stjd ||jj||}||s|jj|d}|*tjd ||j/d |fn|j|j0}}||f|jvr|j/||j/||| vr5||vr1|j/|tjd|j2|D]x}|j} | |jvr4|jj5|t j/|Q|j| } | |k7sf|j#|| |z|rdt |jj7}|D]8}||v|_|j8stjd|j2:tjd|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:)z:test:z:build:z:dev:zpassed %s as requirement)rzUnable to locate %rz located %sT)testbuilddevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %r unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)rrrrrrrrrrrrr requestedrrCrr run_requires meta_requiresbuild_requiresgetattrrrrname_and_versionrvaluesbuild_time_dependency)r<r meta_extrasrrrrtodo install_distsrsrireqtssreqtsereqtsrCr_ all_reqtsr providersrnrrrs r.findzDependencyFinder.finds4   ++, K    u % 3=> >K k< 0& &D5 LL3U ;<<..{ .T TD5|&'<{'JKK LLu -5D6{UG 88:D88D4---%%d+**40D=''eX>&&););;F((FUFt}43C AK''$ 0C"DD4&0I //2  LL! $ 2 24 8 A: //5(C#))dDJJ%%'(D)-])BD &)) BDDYDYZ  '/hrEre)NF) rFrGrHrIrWrrrrrrrMrEr.rr)s-6 G($ 0%NirErre)Lr.iorrloggingrfr|r%r< ImportErrordummy_threadingrtr5rcompatrrrr r r r r rrr:rrrrdatabaserrrrrrutilrrrrrrrr rr!r"rr#r$ getLoggerrFrr&rr'rkrhr*r/r1objectrOrrr r+rwrrrrrrrMrEr.rs    ( jjjj??4HHH8'   8 $bjj./ "**2BDD 9BJJ?@'  F)F@zfzz /W/dEgEP767ttGtn;w;|%'%PgBWWx%4cB    fvfq ('(sE55 FFPK!-D  w64-arm.exenu[MZ@ !L!This program cannot be run in DOS mode. $Lơ---F-F3-F-X-X-X-F---X-XW--?-X-Rich-PEdb" "5@`'PTp @T8.textl `.rdata֑@@.dataH%@ @.pdata p (@@.rsrcTV4@@.reloc@@B@AT_{1"@1@G>c2 __S[cks{CsP@uXAw`ByhC{pDa(@@?{EsDkCcB[ASƨ_S[cks{CsP@uXAw`ByhC{pDa(@@?{EsDkCcB[ASƨ_ T!_ "Tb6 ` b6 ` b6"@9b9_BTBcT! BT? @aT @`T L$ L!@!`` Ld LB"Tb06 @" A$B&C!!@!``b dfcBbTb06 L` Lb(6 L`Lb 6 pL`pLb6 p `p b6 ` b6 ` b6"@9b9_!!_ T6!c ` ` 6!c ` ` b6"_8b8_BTBT!BT? @aT @T! @L!$ @L!!c` Lcd LBT!&C$Bc" A @!!fdb `BbT06!c @L` L(6!c @L`L 6!@c@ p@L`pL6! c p@ `p 6!c ` ` 6!c ` ` b6"_8b8_{S[cks!@SP@UXAW`BYhC[pD](@?@BsFkEcD[CSB{A_@xb 4@7 @`T,@_?Tt@Lqn"&"4@| ՠtLqn"&5@`N!Npn&BR@_!@ˢ$@x4!T$@x5ѠA_`7? #T @T,@_?Tc@ˠt@Lqn"&4!˥? CT#CtLqn"&4caT!@T! ˥ˠtLqn"&b4$@xB4!TA_c@ˢ$@x"4!TclT_@8 4 @@T,@_? Tp@L1n"&4@|pL1n"&5@a N!N0n&B R_֥Ѡ_!@ˢ@8B4!T ?@#T @T,@_?lTc@ˠp@L1n"&4!˥?@CT#DpL1n"&B4caT! @T!@˥ˠpL1n"&4@84!T_c@ˢ@84!TclT_C1@c1_@1@c0TC_ {C{A_Q @s/3CT_t1@?@?T_ NNNN_Tf ib8 * $! )&&&&&&&&&&&&&&&&@q @! @! _@q @! @ _@q @! A9_@q @! _@q @! _@q @ _@q A9_@q _H@ qL@qL_R_TIE)@LTB@_H @TAB@qLIF     )@!LTB@B_+T@LBT__@lTChhb8c`(($TJ ) @ $Z_@(@Tc  `$Z_D@(D@Tc `$Z_@8(@8`$Z_@(@Tc  `$Z_D@(D@Tc `$Z_$@x($@xTc`$Z_@8(@8`$Z_@(@Tc  `$Z_D@(D@Tc `$Z_$@x($@xc`$Z__@(@Tc  `$Z_D@(D@c `$Z_@(@c  `$Z_@(@Tc  `$Z_@8(@8`$Z_@(@Tc  `$Z_$@x($@xc`$Z_@(@Tc  `$Z_$@x($@xTc`$Z_@8(@8`$Z__+TB(($!T_ !T(($aT_ aTBjTB_@mTB @(@TB lT TB chhb8c`J ) @ $Z_c  `$Z_ΐ|ؚtl\J(_S {@q{ @S¨_S[{@q{@[ASŨ_S {@q{ @S¨_S {(9@?5BA(M@?(]@?R  "wRR#?{ @S¨_ S {(9@?5B(M@?(]@?R "wRR#?{ @S¨_ { `5 OU@ R? {Ĩ_{`5oU@ R?{Ĩ_S[c{9* n[( q"ѓ{cB[ASè_S[{! !)Cґ qA @BRR @V R|@ @Q?q3* @ !M@$@c @h%h~@ j3$n R K?q @4*R @!0}h&@cj@h%~@ j3D)R @( sB(* @ !bbB`5iQ @?q!R @ !bJhBҁ4s"T @O {è@[ASè_S[{RR/@2R?44R$C@* @~S5 @a"c @@2R?5ca"ҏ `4R @|q2{è@[ASè_{qTQqT(B`(H@R!R y @I? R{_{qAR?uARR?5F(iA?HAeA!RRRRRR?mARRR?aA?{ĨA_{a@?ր4qaT@T@"R!R? R{A__S{ S7  {S_S[c{R  R @R TS TTS TTdT@ T@ ?@@?@`?R Q R N XTE@ ?ҿWTE@@?ҿVTE@`? (TA@?E@ ?ֈ HTA@?E@@?h HTA@?E@`?{cB[ASè_{S[C <S_q$(@T+@t}@ _ T(+ b vtbbT҈@hT`Cs"TQ \)@ R?Q qTI@?Cz[BSA{è_S[C"{CQ@?1V( @VDR!R?֠4#@ RAq@TRAh@RVD!R 2 @i?}}}}}}1@?g@rT@ ?@@?@`?A ` [a Vg@G2g[Y@R$R?ր55@?1@*RCRR? CR!@@VD?;@@y8!(@!R?a EA@@?=@@R?e@@? U@#@?S[{YA ?s`@y4q@TR$ 5ZA `"?s"8 ~Aqb@y4R `4 RRa .@x4R* @5h@y4R* `5h.@xh5`@yR `4ys A@yqTh@yqys !9`4>@yqTh@yq`@y4R `4ys h@y4R* `4h.@xh5{@[ASè_S[c{@?@yqATqJR RAm1 @y4R* `4.@xh5)%@ R?ֈ@y |@q`T )  Rz)x H(9~@j BT 8?5qT?)qT CTѿa--@K9 RcR R?!*qh~!Tci)xc3@y4R*D `4h.@xh5h@y!q R*7 `4h.@xh5h@y!qR** `4h.@xh5C  @A!|5 ! UA?֨>@yqTARy ҨQA ?yh4(-x5y-h4H-x5yLh4(-x5y+h4H-x5H A*AKt"IA!""{C@R`>C_{R{_C@`>C_{@R* RS4/a2Z54'GSH4k5R{A_R{R{_{yV{_S { RS( 4RC9dSBNq` Th5(RB!! a }`4RBA  YHRB4RC9*qh@SH4s@}A?AR`?eh@Sh4`@Ob<S*d*pS4T58R R* *eS4C@9H5(*{¨ @S¨_R?R=*7*#{{_{`4 !9 @H_hK ȩ5`T!9H_hK ȩ5;R{_ R{ Hy9q)R)I99Sh5RNS5R R{_S{z9*h5qT4s5A9594R A9 )9 )*) * (R:9 R{S_֠R{IR (@y kT,=@*, RH@ kATH1@y-qT ),()@y a) @y,) _ @TI @A)TH @  A)TJ jR H%@h6R RRR{¨_{S445!9ȿ;{A_{y9S)SH45**X R{A_{ ()GaT* A9Hq`{A_{Z{_S{@sXAT c ?@) (? @ |@)ʨ ? @ |@)ʨ ?#@C@ @H  @?X( {èS_ 2-+3-+R_ R_R_A:(! :_{@ @  {_@q___`>_{C}C}}}}}1 ?O@@yrHR {Ȩ_ּ{a ?֠@yIR k!T<@ R (I@? kaTH1@y-qTH@9qTH@h4 RR{_.(A S{@)h@ kTh@q!Ti"@H(K q T?kTR{S_ֲ@csm @S[{a.5.!!BTt@~A?ր?#T{[AS¨_S[{.5.!!BTt@~A?ր?#T{[AS¨_)Eq_@y-<S54|= A  `N `N+>N7)>N S%Ț*`TIh 86<`N0:n>N1 `N(>N  H!Q qS%ɚ( @T  J(>N )(}@Ӊ H AIh5F N |=  `NsnR `N1 `NN>N/>N7 SI>NJ%Ț(>N  ( `T  ki _ k+T-T(}@ $(!Q qSJ%ɚHI?TT K}@ Ap<`NsnNQ:n(>NHR `NH>Nh H>N )(}@i H+Aj@y_ k`_S[ck#{f@@ ˨@h6 y@52A9HJ@?qZ@ R jT@kBTR4@_C(T @_C("T@4@q T*@"C( c*`7qmT@) kThA`S 4sA}A?!R`?@"R @ C(@@"@@!C(h? @@kTRB@@˟ kT *R4 *@_C(#T @_C(T@r`T R4R4R4R+@B(T @B("T@@ kT @ @ kTk kT * kT @@4B(@z!T *@J @ R"C)@ * @ k *T R{è#@kCcB[ASŨ_csm{Sh5RSh5 R{_{Sh5 R{_S{C9@ kT@qT @  K qT@ @4@)@@ 6 @4@4@ @}A?`?{èS_ csm  {{_{ {_;@T_{`{_lS[{@1aT8 ?֨*@ ? T@  ?`5 @ ȳ ?4(hz@  ? * ?{[AS¨_{ ( ?1T;  ?֠4(hz RR{A_{`@1T! ?h R{A_{=( RR ?4 HiO R IiR{_S[{jO4=sQ`R ?jO Qj35 R{@[ASè_S{ 3RA{¨S_U{@TR*N*S{R"Lvh@*H6"R*gh@;rTh@(9~@j@ , F @yk ҩ!h@"9Oi@;?rT_q!Tyk!*@96yk!*96a@gh@; SH5JRh@;6 _qATA{S_S[ck#{*~@ ;F @h{z +! (Ix9q6h@h5L }@h@*i@h9U 7V>ԩ֚>BR*aT`@*h@;Sh4 S?q*HH#R*raT!lTh@;S4h@;!Sh5@o"h{z @)! *@9 6 S?q*HHV> ֚(֚  {¨#@kCcB[ASŨ_{S[ck Ҫs/h@*h5Ii"@ R*)*I@ 3F@hzuWA"!@%hzu"I@? AT@@ R# ?4R*`@B( T#,A(# _ BTH95qT_ "TH9)qTJS8J)kJT#H@CkDcC[BSA{Ũ_H *S_q( T *Aӟ %@x)qkaT` 郈 8J)q_ aT_ֲn!S[c{ e!s @tTuWRRRW# RR\8x"828B8R8*I *9?qcT!Tl!{cB[ASè_S[{@t T?ֵ"aTP!{[AS¨_S[c{* @qcT(R} R{¨cB[ASè_RRl!ҿ E k+TzsH z3RR!*E s  |@*F)@yj ! iA(S[c{*7EkbTh~@ 6F@zu "*@_TqT34qT qaT`@ !  ?zuR"4(Ry{cB[ASè_ |@*F)@yj ! ia(S[c{R RqTs6!3 HE IufS*~@ F +yj(Rh9R!*{¨cB[ASè_@T@9H6A ?ֈ@9(6a ?ֵ@"  ɚ ~@ F  @ Hyli! (R(9Hyli! -sS[{*S7EkTh~@ 5F@zt "I@96H@ TqT34qT qaT`@ !  ?֨zt R"*(R{@[ASè_{1T(R 7EkT |@*F)@yj +! i@9i6`@(RV{_S[ck{hOh5@R qiR(h}@GhRh`Gh 7tR 9RR`!GF@j(ziI!+@h  HTy"sbQ5R{kCcB[ASĨ_ |@ ! _S[{F#A"tRG`jh?#Gijh @?s"Q5G{[AS¨_A a S {*T8R{¨ @S¨_h@y4@y5*RC!# @"R*M$s @*# @{ RR R`@R{A_S{Rh@;5 S4"*" `6`@`7"*{S_S{ 3Rc{¨S_h@;1 Sh4"q*r*{ <SR?k3<S`T?qTEA yix  C'y"R#yK R#4#@y R{¨A__S[c{*\%@A}A?*`?{cB[ASè_ @hG*)3-ʚS*R @GjlR K ,Ț( ʨ-ʚ_S { *SIR{¨ @S¨_֟ qT*K**S{_q Th@; R jTh@;rTh@qT`@; |@*F)@yj +! i9)7h955"RҐ@h@ (ˋ )ӟ kThӟkT j"@  ?lTh@( THhi@ R(KhR{S_S {h@*;5 S5R8jRI_)yI5;*Sh5qTRc!h@hi@;( S4jRI_)uI5; h@;)R qTh@;!Sh5@Rh"`@;*.@TR{ @S¨_!|@O{$@TR2RbyJHiix(%xh4!сyHR @RR{_@@@@y4*@y * 4 * *kT-@x *i5i4,@x5@yH4)@y *)4 @y * * kT-@x*h55,@xh5$x @@_{SRA`H@{_{S[c9R?T5 @x9c9SW kCyS9OS#*V6Ts5 @T73bTWs69 @@Tj(8SBZ@9S4@HC yI*cC[BSA{Ĩ_t @!T38{S[cRn@T5 @x9c9SW kC9yS9OS#*V6Ts5 @T73bTWs6y @@Tz(xSB@9S4@HC yI*icC[BSA{Ĩ_t @!T3xS {TxRRB3hTBhT R#uRB3Rҹ*{ @S¨_S {TNRRB3~hTBhT Rn#uRB3Rҏ*{ @S¨__qT_ qDLz T_4q T(S QR? j RR__q@T_ qTH0QqiT(<S ~ QR? jT RR_ 0B `@,BA h $ R 8@q @zTQ8B5>*I *( qTh +$@ 9 $@) $ K P $@H$_ 0B ` ,BB( h $ R 8@q @zTQ8B5>*I *( =SqTh *K=S $@h(y$@ $ A P$@ $_ 0B `@,BA h $R O|@8@q @TQ8O>+Ϛi ( LqT ,$@ 9 $@) $ K P $@H$_ 0B ` ,BB(O|@ h $R 8@q @TQ8O>+Ϛi (=S L=SqT *L=S $@(y$@ $ A P$@ $_S[{*q7RmT*s@1TskT{@[ASè_S[{*q7RmT>Sw@1TskT{@[ASè_{b9($@h}A5 )@im!a"`H@h D@i @#`@aBQ#i@(C72*R(jb9{A_(@ }@9*@L94* *? kT8*h5 4h94RS Q? j`Th8h5i*9_qT*8_qT(_ k,h885_-@ 9@Sh8?qT@ 8Sihx7Sh8?qAT 9?q }@m @*9j98 *8*5_S[{ @ u@BR@C ! @` @qT@ @?T RRh@h5U4u{¨[AS¨_S[{ @r u@BR@C ! @`d @qT@ @?T RRh@h5U4u{¨[AS¨_S{h6Bhh@FR}hrD ir? qTR.b j*@i 7l9 S?iqT}@ +}ӊhijR  h.@) *}Kitk.!q TqhTi (I8( RS4a9b`F:~)h~)9R94/qTa[)j@ @* K!kl_l66h2@ Kj6 2i2(R:q`Taj@ @* K!kh_ qh:)i:S4h@ 9i9h@i5 ih.@qGzThrD ir? qT`*@{S_֩S{h6Bhh@RMzhrD ir? qTR._ j*@iJ 7k@yRh =S?iqTh }ӉLii Rh.@ ) *}Litl.!q TqhT (I8( *RbjR9 *`:~)h~)9R94d/qTa)j@ @* K!kl_l66h2@ Kj6 2i2(R:q`Taj@ @* K!kh_ qh:)i:%S4h@ @yiyh@5 ih.@qGzThrD ir? qT`*@{S_֬9qTqTq`TqTqT0@ 2 0@ 2 0@ 20@ 20@ 2 0 R_@yqTqTq`TqTqT0@ 2 0@ 2 0@ 20@ 20@ 2 0 R_{a9R9?1Th@ @*@KaxhR4b`h@ 8i9h5RyR R{A_{ 9?qT@ 7R ,S`?9qaT@h 7 R ,R]RT<@(5?qTT?%qT?1q@T?QqT?qT @(9qT( )R=IR;R<9 R6 @*9_qT(9qaTJR_q!T(9qTjR( < $HaQ S?qTiX(%Ț6)RR?qT?q T?qT?q!TRRR  @(9qT( RiR < R{_  { @y?qT@ 7R ,9Sa?9qaT@ 7 R ,VRRU<@(5?qTT?%qT?1q@T?QqT?qT @(@yqT(  )R>IR<R<: R7 @*@y_qT(@yqaTJR_q!T(@yqTjR( < %RH =S?qTHX%ɚ6)RR?qT?q T?qT?q!TRRR  @(@yqT(  RiR < R{_ S {h9 Q_qT (Y ( R$!h2@ 2i2ARROi2@(Sh4(2h2R"RRR RhRi")^S 4hA9H 5l2@Cy  9S4Sh4Rl6hRS4RC9+m9RS aQ? jTSh4.RRS QR* N55CRhi)8aqTqRAT RGhi)8k i6@ *hR@r)K4KTc*R`8dBc*C`Ti2@( S4( S5c*R`(Rh*@(7h2@ S4c*R` RR{¨ @S¨_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy{S[h@y Q_qhT (Y ( R[$!h2@ 2i2ARR i2@(Sh4(2h2R"RRR RhRi")S 4hA9( 5k2@  yhS4hSh4Rk6hRhS4Ry*l@yRaQ jThSh4-R RQR  M55R(y*xaqTqRAT R (y*xJ i6@ *hR@r)K5KTc*R`tdBc*i2@( S4( S5c*RrRGh*@(7h2@ S4c*Re RRi[BSA{è_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxS {j@ @* K!ku_@b>@a9`@t&@yS4(RhR9)}S Hh&I(85H)R9iR R{ @S¨_S {j@ @* K!ku_@b>@a@y`@t&@yS4(RhR9)}S Hh&I(85H)R9iR R{ @S¨_S{Ch2@4Rj:@ 2i2J6hA9R Q? jRR*j: *5h9qT RqaTt:*RHu}@`b`S(5h2Bh@h.BA uQi:ib(B(h&j@ @* K!kp_a2Ba@h.BAӡ@abcb h.B#H"Ag"@ e9f:@ h2@ S4h:@5a@`&@hA9R Q? jTh2@ S5a@`&@j&@K9qTh2@Jj& 2i2K9h%Q S?qTX(%Țh79qTh2@kRk9 yi2K9 k4(85( hR RC{¨S_ !S{Ch2@4Rj:@ 2i2J6h@yR Q? jRR*j: *5h@yqT RqaTt:*RHu}@`bS(5h2Bh@h.BA uQi:ib(B(h&j@ @* K!kp_a2Ba@h.BAӡ@abcb h.B#H"Ag"@ e 9f:@] h2@ S4h:@5a@`&@]h@yR Q? jTh2@ S5a@`&@,j&@K9qTh2@Jj& 2i2K9h%Q S?qTX(%Țh79qTh2@kRky yi2K9 k4(85( hR RC{¨S_ !{b>@a9`@j@S4 @* K!kc_xa2B@abh.BAd@`B 4(Rh9ib(B, @* K!kh89(RhRib(B R(h&{A_S {5RuR9j@ @* K!kb>@a@y`@t_xibS5(BC9Cc@G9 h@ 6u9(B(yib(B RuR(h&{¨ @S¨_S[c{j>@*XS_-q(TI(I8( t@6 Sh@4 !i)85}@7 !i5_83tj@@V S 4 @* K!khx}@% @* K!ku_xtj@@ S @* K!ku_tj@@ S 4 @* K!ku @* K!ku_҉@(S4)2j:@6(Rh:(yA}@`b@ yR9"**Tr*@ S4hR@4h&@ 9?q Th&@ R i&*9hR@ iR RRR{cB[ASè_ֱS[c{j>@*XS_-q(Ti(I8( t@6 Sh@4 !i)85}@7 !i5_83tj@@V S 4 @* K!khx}@% @* K!ku_xtj@@ S @* K!ku_tj@@ S 4 @* K!ku @* K!ku_҉@(S4)2j:@9Rj6y:(yA}@`bA@ yyR9"**T*@ S4hR@4h&@ @y?q Th&@ R i&*yhR@ iR RtR R{@cB[ASĨ_ְS{j@ @* K!kt_4j>@_-qTi(I8( j* h*@hRyyh99(Rh9 RCRR{S_S {@ @* K! G) s_9@15&S4(&3(R~@R9P (&3~@*R R{ @S¨_S {@ @* K! G) s_@y@15&S4(&3(R~@R9 *(&3 RqTh94 S@ @*@KkxrhkTR R{ @S¨_ @I@ THa@94H@ IH@a@9H@ I @H @ I @H@9 @ Rh@ i_ @I@ THa@94H@ IH@a@9H@ I @H @ I @H@y @ Rh@ i_{SVChRA94hR@qMTu&@R&@xd@#F5@b4dBc#`DhR@kT h*bR@dBa&@c`6 RC5@SA{è_S[{hRA95hR@qMTu&@Rc@#yCh@ *qmT#@yb`hR@6kT h*bR@dBa&@c`8 R{¨[AS¨_S[{*4@*@ T(a@94h@  H @~@12@H@ I@H @ I @Ha@95Thh@ i{@[ASè_S[{*4@*@ T(a@94h@  H @~@1@H@ I@H @ I @Ha@95Thh@ i{@[ASè_S[ck{7R9sTiT @a1T @qT " @Oh81AT!T @qT  691T HR R{kCcB[ASĨ_S[ck{7R9sTiT] @q1TR @qTN "K @_h1xAT!T< @qT8  6y1T1 HR. R{kCcB[ASĨ_S{ @[h@@ |@*F)@ yj)! *@96:* (R@*{¨S_{1T  (R7EkT |@*F)@yj )! *@9J6S)Ccs  (Rr{è_S {*aTR@qaTH!C97 qATHB96 R@RT* ?5 ?**~@ F @(yk I! ?94* R{ @S¨_{ ? ? R{_!_A_S[{`Rt R R"S)4(yh4) ( A6AY RR`5SvR`R*{[AS¨_RS {I3yh4(-x5(i@A(y h4H-x5H ˿"T`@xuxqT`4i@h@  { @S¨_R#R{ R@;{_{S[c RRl$cTy@@@yJ4RH =S?eqhTHy.@x*5RUR R*5 HR @G~@Ty HR]@R= A? T<LT|DӠs/sRRhsB R @@*@ R4* HRTRh_R kaT`B*[cC[BSA{Ĩ_S{C_co@94 @HC yI{èS_C߈CbR%@x+$@xHQeqIhQLieqhK5l4BB_{}Ah5D RA{_S[{- R=VsR9C @h@(&@xqBT @ ylx6h@il8ScA@<S&@xqBT @ ylx6h@ il8 Sc1@ <S K5t4sѓ@94 @HC yI{è@[ASè_S[ck#{ Rn{è#@kCcB[ASŨ_ֳ ؚTTR3 ؚTh@; R j`Ti"@ R  Rh@; R j Tw@4 77BT*_C7 Ta@~@ӂ  aR +h@B7j@ZC7 KHA7ih~@B)T{@ W4I5>   K_C7CTh@hf@* 4@7 |@Z @@ O1T@Z(@9i"@  TRJQ HRzjRI_)2I5jRI_)2I5;@ ؚlS[{ uTR# R{¨@[ASè_,<S[{*sj@K_  T(AkT? T @ T Ra(AaT[w@v@"q TI+A?)A? T@I v@ kT@T  kT  kTI  kT  k*!T(R4R%RR"hRtRHRTRRR kT kTI kT  k*TRR RRRRHRTRh}A?*R?v}A?*?wR{@[ASè_֑1@_1_ @h@*)*-ʚ___S{ @h@*)3-ʚsR}A?`?{S_ @ RIi K,ɚ h_S[c{((v"R8qTqUR@  8h9s8* 4@  9h9s545q`T&qT8R9(4q`T%qT94v"(@ R )9+R R8JqqTqTJ749qaTq RJ}S*4JQsw9s@  *59 45qIzTK4`99s 4@  9h9s@  s9s@  V(@ ){@cB[ASĨ_{bTB> š?T)|  )T !  {A_S[{*u 4QqTR$RSe RV(3@sh9H5c,A"kR R0cq!T@t QH C *4 @   @ H@ h@)i Җ  R*{è[AS¨_S[{!`@h@HN@4t@@RRR|@vAE @*RR@4R b @`@Z {[AS¨_S{@hRs /`R< : *{S_S{@hR<s Z`R  *{S_S[{9 4q)h4H85H8H5  94i4H85H?qT! u`5" h@ @  {@[ASè_RS[{@y Ҩ4qk h4(-x5( A* @y5` 3@y4= =Sh4(-x5( A7_qTAu u`5" h@ @ Ҋ ҇ {@[ASè_RҡS{@@`TSh@m @i {S_S{@@`TSh@W @S {S_S{!`"@Sh@< @8 @Sh@0 @, {S_S{ @H?Ri@9?qhT)4t4?qaTq *@4ss?qTh@8*5{S_S[{( *Cӿv@~A?ր?sT{@[ASè_S[{`Tu@~A?֠?ր5TR{[AS¨_S{ @ `@ {¨S_S {E95)R ;Ո@ @5 @K(@ `TI3-˚}A?R`?!?qTp@ @5 A  @ @5(R9 @)R 9{ @S¨_k_csm{*)b5a ?֠@yIR k!T<@ R (I@? kaTH1@y-qTH@9qTH@h4*3cC9SC#HRIR)sGy@4{ĨA_*{*qT1@ @*!SJ5A ?ֈa * ?* * ?S{ ( *CR ?4 @a ?}A?*`? @ ?{¨S__"RARR"RRR}RARz @@ RIk K T ,˚* ʊ_gRRh{{RR J;R{_{@Qur!T0@qT!(;RaRR{_|@?@q- F@yl !*@9+9OT? @q T(@@Qyr@T?AqTH2(9(Ryl%H9 H2(9HRH(9H2(9yl%_9o5Rk5RqR(R _S[{ @ C9'г"`Tɂ h@ T - `s"@ {è[AS¨_)R ;_{SCcCRR){¨_{*ZCJR)RrI1 Ts4q`T qTRz y2H  *{A_A;_{qTR_ H_@ 5;*{__S{ @? *@` *{¨S_S{ @- y*@N *{¨S_S[c{@ @- @@* ʩ@V-˚* ʩ @N-˚* M-˚ TC @(  U#TTuҼ @  *C 胊kT @@ RJ KR @*-ʚK  @ RI K@.ɚ  !I@ R+ @J K -ʚ@+ H@ R  @HK@-Ț+ H@ {cB[ASè_S[ck#{@ @k?L@i@* i@U-Κ* ʩ? T-ΚHT {"џT@`T  ʙhA3-Κ?`?@L@+@h@  h@M-Κ  K-Κ`XT    T=L@@ @,@H@ @*@L R{#@kCcB[ASŨ_!{ScCIRHR){è_`  @@ T@ R_{ScC'HRIR){Ĩ_ ( R_{! R{_{ R{_{@6  R{A_{RS{_S{jDH_QH 5;(5`DBTBh R{S_{`D`D` @ `@ R{A_{AS{_{S4GH RAS{_{  @h}A?`?"{$@T RRb9JHi8(8h4!с9HR@RR{_{`R )AH6`>`RO7 66R?kT R_RS[c{h@*wSRb4 QqTCy@R@-49m @S ix69 lq2q `TqT,49l Ru4BqaTB S?%qhTQ ~ S?eqhT^Q S?eqQITh4HR9RkS aQ? jTqRlѵl49 kTxl@lt9lRqU5> KB S?%qhTQ ~ S?eqhT^Q S?eqQIT1@TkT kT k KziTR" Rh@7* 9lh49kT=7@9y4 @HC yIi@ih@(R1**HS4'HRw7@964 @HC yIi@ih@(R4 @HC yIi@ih@(W6K@94 @HC yIi@ih@(*{è@cB[ASĨ_S[c{@*uSRo4 QqTC@R3@y( @%@x*R!@52qhQR jT@%@xzrRTqTqbThQp R k Tq TqbThQgq TqbThQa%q# T%qbTh%Q['qc T'qbTh'QU)q T)qbTh)QO+q T+qbTh+QI-q# T-qbTh-QC1qcT1qbTh1Q=3qT3qbTh3Q75qT5qbTh5Q1B9q#Tj9qbThB9Q+B;qcTj;qbThB;Q% KqTqbThQp R k Tq TqbThQgq TqbThQa%q# T%qbTh%Q['qc T'qbTh'QU)q T)qbTh)QO+q T+qbTh+QI-q# T-qbTh-QC1qcT1qbTh1Q=3qT3qbTh3Q75qT5qbTh5Q1B9q#Tj9qbThB9Q+B;qcTj;qbThB;Q%hA>CRl3h}A?`?{S_ %{h:h:CRQh}A?`? R{A_S[ck#{Ch;*h!;*C R*.9h}A?;@*** ? Rh *** ?C{#@kCcB[ASŨ_S{ha;h;C `Rh}A?`?ha ?{S_S{h;h;*C Rh}A?*?h * ?{S_S{h{ƨ[AS¨_{SC9Cc#R) R)sGC@9@q@ {Ĩ_S{i@;( q!T?rTh.@ Kkq-TIa@*k TjRI_)2I5; h@; S4jRI_)yI5;R{S_{R`5h@;- S4c`5R{A_ R{h@;5 S4h@;S4`@mjR (I_) I5;~{A_{RC@h  R{¨A_|P;_S[{G)ᏹa( ѶT@Sh@;5 S(5kRh_ 2i 5;7h*7} _h  _RR_jRI_)2I5;^{[AS¨_S {C @y A ,@x?qT5R?q`T?qT?q!T3`RR*3!RJR RRRR)RDRREҨ@y** 4MqTTq TqTqTq@T9qTIqa T5s2s2=rTs22'R4f5&R37j3305s2/Rq$QqTqTqTqTq TqTr`Ts2rTs2 5Jy5J2.RqraTs2s`6 Rs2)R?q  5 q@y.@xqT5@yH4R@ @{¨ @S¨_h>b~ 5(@y(-@xqTq!T4 @y.@xqTh?5h2IhA?5h2  h?`5h2jixqT H-@xqT5c9S {*&#@9h5@0R*CB5HO@ IjRI_) *I5;@~h{è @S¨_hA {CH@  @@{¨_S{ @@ @*E@I_)I5;`@9{¨S_S{ @h@@`J@0`J@DT T@H5J@{¨S_S{ @@ @@!@@@`@{¨S_S{ @@ @ E@_Q 5;5A@T`@{¨S_{cR#c#RR)'+R'R (/h A@C @AK@(E@iRIyy@ y@pC{Ũ_{O{A_{RRRR) @hA?T 7@8@4@-@1@1@.@5@+@%@(@)@%@=@"@A@@AScCssC:{Ĩ_S{J@kDJ@T T@H5Js{S_S {h ?*РB1 T}TB`4y ҬB҇5B~>h * ?{ @S¨_nS{ЀB1TG@TB[4y wBRҜM5BI ҏ{S_?S {h ?*РB1 TTB&`4y BBg5BZh * ?{ @S¨_{"1aTRR R{_{`B1Th R{A_S {hT(hE R ?`h`4w4ER?R{ @S¨_{A #RC{¨_{A #RCҞ{¨_S { 95 yKCl@*R( @ kaT' q (@s@9hy R@9H4 @HC yI-@9c4@# @qTkKT @!R% @5( @(T94 @@#R @!R 5?HRR{è @S¨_ҡS {#y @TSR7sh{@TRR+@)R @ kT#@yc-S`qmT@@#@yqT@TRHR@R@94@HC yI{Ĩ @S¨_tu9S(Rh*S#RCR 4@5S`RH ?qT@TRHRZ@R{Di@?TI C?jaT`{A_{Di@?TI C?jaT `{A_S[ck#{CK@9qS*l.(T|HR@R@HtaT@*R* `49 R}&  R*iSKA 9 9Rh9@sRIS6y_)LRT{9@@8(Rh9ws t5R@}@ @(9(9@ @IRҟqmT@ +@h%š =S+j=S_qiTH =SHQj9=s!DӔQ6b7@S4kRl9S Q? jaT{8Tq@T i9h8h8qT*RsB49RqHkSk Ai9@l Ht ?*?hRh9_9 T }H ɚ  9 aT_ T H ɚ  i9k D J TIH ɚ  i9kH i99R@94@HC yIC{è#@kCcB[ASŨ_S[{*  `@_C1CS*@[@*Cqqן  H %`49 +@RC***{¨@[ASè_S[ck{*qhŸ %)wS*STpHR@R{èkCcB[ASĨ_CO64@q*qmTH9 h4(85(  @r@RqaT9q Th9@h9(}@ @*9j8@ 33 Hi"1#) 5` w4Rh9@ 9?q T@ Qm6 Kz9qkT}( `h 9+}l}K R h 9)qkT}( `h9+}l}K  h9 Kh9 h9? qT9qTb&@94 @HC yIRRz QgfffS[c{C*S@Rw4HQkT@q**H_i388@qTRh9s@q,T5@ 9(R?q@TR4h4t h9h4(85(tx9t(qT9h4(85(@}@ @*99@6Kq VzԢt4h9h4(85(`4~@R@94 @HC yIR{ècB[ASè_S[c{@*C?}C*S*S@c@*C*q@3Q `49@ Q?1$UzT kTh8587@$RC*\ 7@&RC***{¨@cB[ASĨ_{)S(*T9R{_4R98@TcшS R-ySNQo ,yk9 h4H85H 臟  +  yk`5RRҏS_{@W< *@K%ךs=S5"q7*n5@h @*%ךL=S!qiT RT(!ך * _@TqTK @*%ךKS)L` qT34@qTs4@HR{_AS¨_S[{C*RZRwT+qTQ qRHT&RG7@tT@aT R   aTRs(*K`2S*]SD 2[@{qlTQyrTqTq+@ * *  :qTqT+@ **  +@} *J#@**q'@   ˁ`49+@R*_ +@ * *  C{¨[AS¨_֨@)D @? _{}A54R A{@_T{_S {sR*R#U{@TC@@**!Rw5RQ@94 @HC yI{è @S¨_S[c{C*q**Ta~@k***%C{cB[ASè_{<SR#y kaTR%c#@yqTh @ ykx6@@ik8S@ @%RK#RC R `5#@y'@y@94@HC yI{Ĩ_S{3R*{S_h@;5 S(4h@;1 S5h@;SjR4I_)2I5;I_)2I5;h@; R jaTh@h[b"@a@f`qTq RR+jRI_) *I5;h@;rTB1`T>1T:*7~@) F @)yk H% ( @9IR  qTjRI_)2I5;h"@qaTh@;S4h@;!Sh5Rh"h@j@ QiH@@9hbT_S[{*4h@94` @_9~N95h@hh@94` @S9@$R` qqh9i 5h @yR!R*|@5H ?ֶ@%i@ iTh@94` @*9R` qqh9i5d @ *!R*|@I(hR{[AS¨_S {*4h@94` @9~R@y5h@hh@94` @9 R` qqh9i5h @9RR*n|@5H ?Qr@'i@ iTh@94` @9R` qqh9i@5d @ *R*F|@I(hR{@ @S¨_S[ck#{:RRq@HSRRCC9G9K96@i*t5Ȏ@hWB(C( C탉 ҭj@H9 h4(85(  T"H WB T˂@H9h4(85(I!@5@wk4"TR1 *C@'T"*{Ĩ#@kCcB[ASŨ_R:S[c{9h4(85(4 TR{@cB[ASĨ_!h5b 5i@?T`@Ҁұ`i@ (iC  TҪ@R* `" i i@5h@ !iRR{S[c# X 9Q S?qhTi&Ț7xT 9?qATTy(Q S?qTh&Țh6)R R?qKc9@)R @ k!Tc@94@HC yI"Ruc@954@HC yI"R4@HC yIRC@RqRH R ?T1*^&@)7C39@)R @ k!T@94@HC yI"R5@954@HC yI"R4@HC yIR3+@q9qT9h4qaT94*35A9h4H  ?֠5"@  +C T!@ aeRA9h4Ha  ?cB9h4C@* Y#@cC[BSA{Ũ_ 4S {*h@9H49~8@y5h@hh@9H49aHR@R9+h @9RR*C |@)H ?&G@h@?Td @*R*-|@I(hR{ @S¨_{S H! T|@Ӣ RC ?5H ?R)SS##9@)R @ k!Tc@94@HC yI"Rkc@954@HC yI"R4@HC yIRC{#@ SA{¨_S[{ @t@ @*E@Aa'@ " RR" RRh@ @*E@Le@%h% Th}TT@ @*@H_QH 5;(5@ @ @A@T@ @@*@hE@H@*@KE@i_)i5;@Q{¨[AS¨_qTq`TqTHA>q H>H=H=_{*Cf?  1T(R( I( 1!T(R( I( ?*1T(R( @ @@94 @HC yI*{èA_S{b" RRF AhaB) R ˟His8)Qh85fhe  Rhii8JQ(85{S_{ `@(Rk TH! C ? 4R(8qT R[@99[4*@9qTI(8 kiT(-@85e@R  R!Rғg@ RaA R R)g@ RaA R@Rof,R R%@x6iB,Kig8(a@92(a9 6iB,Kif8(a@92(a9 RKi/8JQ5  R RhQeqTh}QjB(nSIa@9(2Ha9 hQeq(Th}QjB(Ia@9(2iHa9.SRh e9kQ5 @{¨_S[{*6SS*%@*E@ @ kaTRE@ERE@**1TR*{Ĩ[AS¨_V5z@ E@H_QH 5;5@E@(A@T(R@E@I*C_jT'RR)ScCqV4@ @IS {CI?jTJ@hF@RF@@Th_Qh 5;5A`T@Fi_)i5;ՠR{ @S¨_5S{h9h5'(Ah )Ah&@cB!R](R(9 R{S_{n'{_{S[ɿCv*4! R U}@Ө~ iv?k@ TJ_q#TRk@ TH Ȁ>S ?ր4(RkaTh:y pH! * ?֠4ub" RR@t qT@9(4(@94+@9kHT Kj Jj8kQ2J*8Jk5(-@8(5)R)Ji8?q2J)8cT`@)R` Ri J59wb" RRA! ҎRB2 j@9j4h@9(4_kTMqBTJm8Jig8(*J-8h@9_kTj-@85Q5(Rt)* `l2R*kQJyhx%xk5 RC8@[BSA{Ĩ_S {*C**=@jS* e@9?jaT4@@ jx*  Rj5R R@94 @HC yI{è @S¨_*҃RRRkTRK%qTTR(%h7qaTRӚRkT(՛RkiTh֛RkTRk`T(RkAT!Ha RKqR釟kHTRK%qTTRH%7qӚRkT(՛RkITh֛Rk)TRkT(Rk`T!xR?q?qi4GHA S[{H ?U@y4 =h4(-x5( A*k h@y5h 7A*RRR|@**RR`4Ha  ?{@[ASè_S {H ?t#@y4 =h4(-x5( A*k h@y5h 5AӦsHa  ?{ @S¨_S[ck{*WRR lV`TT@@y(@TT@4G T@(@ATT4h Z҃@(T@4 P@yT@A@5@ yyx?q$@z`T@C˕@Hzu[x5zu(@((@h+JT z54ˡ ?T?T6 }TW4yh4(-x5(A AuR !5(HAq?x  ? 5HR @  @RR*{¨kCcB[ASĨ_RS[{{[AS¨_h@ H@) ti@(y h4H-x5H AAҡj3js b@5i@Rm{ 1@*@K @7C@Rq@T R{¨_H J RRq(H _S{A%`@@@T`@@@T`@@@T`@@@T`@@@T{`"@"@@Tv`&@&@@Tq`6@6@@Tl`:@:@@Tg`>@>@@Tb`B@B@@T]`F@F@@TX`J@J@@TS{S_S{A%`@@@TC`@@@T>` @ @@T9`.@.@@T4`2@2@@T/{S_S {(@ҟ @sT{ @S¨_{```BA``@`@`@``b`B`A`B `RA`VA`ZA`^A{A_bRII @y 4(@y_kT!) @y(@y K_{S[ck+=****Nt5H@ @q)R(R!R**'*v5R;~@ A? T<LT|D/s/sRmRhsBR)**!R*`4HA ** ?*Rh_R kaT`BsHc@94J@HC yI*_+@kDcC[BSA{ƨ_ @I_)I5; p@I_)I5; x@I_)I5; t@I_)I5; @I_)I5;Ո ! RH_ TL@_)5;H^L__)5;JkQk5@US[{i~@iA%?Thr@@h5`z@@5`~@r`v@@5`~@`r@`~@h@@5h@h@h@`@`@2!vtR_T@@5@^_@H5"Q5{@[ASè_֠H# T pH_H 5;*_{sH#Th^A;Ո5{A_֠H# T pH_QH 5;*_ @I_)QI5; p@I_)QI5; x@I_)QI5; t@I_)QI5; @I_)QI5;Ո ! RH_ TL@_)Q5;H^L__)Q5;JkQk5@_S{gCI?j`TJ@SRDB R{S_S{@aTt@5 `T{S_S[{U ՚TRҵ~nUTR{[AS¨_{H! ?ֈ {_ֈ  R_S[{@TWv@~A??S4sBT`TTs"h_u@~A?R?sBh"TR R{@[ASè_S[{TVu_~A?R?sBT R{[AS¨_ֈ_S{SH}A?`?`4 RR{S_{R @+HE*S-˚R{A_S{ @ @+HE*T-˚`@{¨S_qTq T<q`TTqTXq`T(! (a((_{SCcChRiR){¨_ֈ(_S[c{*R3RC9"q,T`T qTqTq T$.q@T>qTVQqT*!5{è@@cB[ASĨ_֩@H)C*(@kT)A? aT R:7!RC9s4`R*@4(@ V-˚`T.qT"R%6@"qT@R"qTH -C@  Ki1CH _T_JA(@s4`R!aTR"qaT(}A?a@R?(}A?*?֟.qhT"R%6"qTs4`R`R{1T>(R7EkT |@*F)@yj )! *@9@*(RR{_S[c{UH(RtR }H 6}~@|iw 4`6Qk-T |"(ih7qT }|JH> ihR{cB[ASè_S{ @-h@@ |@*F)@ yj)! *@9 6( ?`4R ( ?*(R@R*{¨S_{1T(R7EkT |@*F)@yj )! *@9J6S)Ccs(R<{è_{S[ck+g*~@:F@H{y xC"3" (@/hC")( ?#iC@RR @'T~@)F+R{9_ k8R T+yh R h-"*94qKT@q TH{y"*@9 8. K6Tch"c *,i8kQH85 Rq-Tch8I J_k)8kT H{yQ  &k_9M5cHRq)R8@`TQi@98(kTq*RIRX@#CTs6*I{y & l@9qT& j9B 9hR 9h99_j9HS x6@v TB1T"1 T#@ҥR*Rs* 4(!/@ s* ? 43@@jK@T k T+qTR3y(! s"Rc ? 4@4@@TF'@@RT H{y Ji8 )&j9}@_ T ! RmT H{y"+ Ji8j9}@_ TH{y " *9J{y* h@92h9( ? @CB94?@HC yI@*J+@kDcC[BSA{ƨ_{S[5/(Os/ |@ *F)@yj RtB")! 7@TccRc1bTi9s?)qT 9! 8 TK (! C*c ?@4@)@ ?kCTT( ? @@/(s/@[BSA{Ĩ_{S[/(s/ |@ *F)@yj RtB")! 6@%cRтc1bTi@ys ?)qT y! %x Tc  A(! CzSc ?@4@)@ ?kCTcT( ? @@/(s/[BSA{è_{S[ck+O(ҳs/ |@*F)@yj vB")!  9@"T(!cR*cBTi@ys ?)qaTy %x T AҥR#cR R*4R4#A4ȢKC?@4@ kTiKT( ?@ @O(s/Q+@kDcC[BSA{ƨ_S[c{** 1TYa(R,7Ek"Th~@F8@ {w)#*@96*{w)#*@97G(R:*****.6(R{¨@@cB[ASĨ_{S[ck+**43R~@;F@h{z "T9 S?qHTU7H@9(6BR**4h{z"*9*6bH@ @h{z"*9*4h{z"( @ ?4T4qBz TyB5 RRT&@x*} " k!T* *q!TRt <S5qT)T( ? @C2**h{z"I964qT q!T** ****8@@ (! * ?5( ?3(@) @HI @@h5@4qT(RsRdWbh{z"*@906h9iq TpRcUKR>+@kDcC[BSA{ƨ_S {SWRR{¨ @S¨_ue4trAT****C*@44i*F)@ yj*! I@9(H9`@T4u*S[ck{*~@*F9)@yj *)! *96uj!TC5@ jATs2i ?@q:RXRT(A@Qyr`T(@QyrT(AQyrT9 3*(`Rh  qT99 r T9 07@ R RR kT R kT R k! T @ 4 qTq Tq! T3R4bRC*q`Az1T@qT qTkaT9*BR*?R*:T@7~S=R kTRߟR k!TRA*$`T9R*`TS49RqT qTߟRSRsR4RC4bK*1T k TR{¨kCcB[ASĨ_R@S[{*9r**R TqT q T] 6 r`TRRR h?qT?yr`T?qT?qT? qTIRRiR?qT?q T?q T8h@ R)Ri BqTqTqTqTqT$  R khRHR(RR Rh)86h92h9x7HjTC5@!@qTh9a2h9@6IJ(** j87(RhT06h@j@ 2ii@H2h*2j`6h@ 2ih6h@ 2i(6h@ 2 6h@ 2i{¨@[ASè_RV @S{*i~@*F yj)@)!  R+@9jaTK86BR?T@ qT@"R#yC*#@yq ZzT*[ 1TR*#@TR{¨S_S[ck#{****?@H%@cJ @1h%j Tw}@ 1!TlrR(RG@+RF)Ks* C@[#*E*(  ?kE) D)T7@ R( kT6(6y E*#* ?aT *Fyj)@*! I@9(+iH9(?@(  ?`5( ?* *F)@yj*! I@9(H9)( ?5RqTc92 qTc92c9@N Ҹ2*Fc9yj)@)!  89KFykI@)! ?936@*4@*gc@C9H%@J @C*h%j @*u4*}@ F @(yk C9K! i9KFykI@,! @9(ASJ*S R h J9 jTs6 *Fyj)@+! i@9(2h9 R kT6(  ?( z D)E*# ?aT( ?t *Fyj)@+! i@9(h9@r  *Fyj)@)! R{Ȩ#@kCcB[ASŨ_***%R{*CWhqT@@ sx R@94 @HC yI{èA_{Cs T@R kR)Siy{¨A_S[ck#{@6yҚRh9h5"h9h5Bh 9q"CF T`@kTIT A@QR)J*yR U3.xy UA ҟyHR{¨#@kCcB[ASŨ_uҖh9h5"h9h5Bh 9q @TAT{_ .a59?`raT9?PrT* R?<rTR(KqTJ R?( rATkTj R ( a2i 8!|Slh*9@__HR{_S {**5h9qෟ& @5h9qTTiU4(9(8qT5h_8 RqTh9qTq RaT qTh9qTq R@TR{ @S¨_S[{iRRDa_q9H ?)T\SRXR*3R@v9u9h4R8BQ_q T97@**SH4(969(8qT(9h9qT@  jH9 h4(85( aBR{[AS¨_S[C@H4'@4 QQ 5*@_qT@C[AS¨_5@J5> ( q藟 C[AS¨_ ҟ1T }@  xiK N>h ΚQ }@ 1Th` )q(RKRh C[AS¨_ kT K k *Th}@ H}@.xi xikTJQ_ kkQTBT 4Q .xjQ 5xj(R RZJK S?qTRK4&!.*"qT Q +xjh%*ҥQ% 7}@Ӧ kT|@ xiRQI xiQ  xj4@%֚! q(!ԚOT Q  xjh%  *@C> Ú@Ƚ }@өT` %@@?T~@ӯ}@j}@ _Ti ? J )T R'4}@ *xiH-* `  xl_ kH Kk%x,k#TA$IT R4Ҩ }@ H xl+xhk(A+  x,O`ӃT*}@QQe6@ *_kTH}@ x)@J_kCT 4kQi xij5 k5C[AS¨_C[AS¨_{S[ck+,*c@7R}qaT9c9@RRRR(it)@`T+@6H1?Th@aT(R   aTRhs(*Kh2qT qT q`TqTH!253RH2H1H1@5Rh@g t)R_)@9 @3(RLRJ)T dl`* )ZR x(Kyrq)RHR+KqcT3XRR, 4 R33YjYj kA TJ_ qATQQ }S'RK)(!ƚQ3hQ(Yh*RR%* ZHIK K S_qZ ?q T k藟  6 qHTQQkT K Q kT3NYhR? kT3YiR  %(!J*3jY,Qk`TK@O@R43?Y( kTO@KRKRQQ }S'RK)(!ƚQ3hQ(Yh*RR%* ZHIK K S_qZ ?q T k藟  6 qHTQQkT K Q kT3NYhR? kT3YiR  %(!J*3jY,Qk`TK@O@R43?Y( kTO@KRKq Ts%XRR[ c 4 Rs%3YjYj kTJ_ qATZ(RIKR K S_qZ ? q'V qTRKQ?1T(Q? kT3JYi R kT3hYhRHy3hY))Q?1`TK@O@KȆRKt~S~~Rh)R)!*IY4}~s_0hT6q Z*RHIKR K S_qZ ?q'V qTRKQ?1T(Q? kT3JYi R kT3hYhRH}3hY))Q?1`TK@O@KR9RbiBBHU!7~`YS4IR?q Q).3 Rt @9u@9~ӈ Gi@yH ~ @ gC?qTC5RqTw4 R RsYk} A)Y+kkI`!T4BqTsIY(BBR RqT *@"}~_0sT59R HRBB34q T 4 R RsYk} A)Y+kkI`!T?k'?ksc1?ksb1?k$1qRR4fXn5kT?Y.1R*Re4qTkTY- LXg+Xmk} A/=*A+  )X-7@ET/4q TkTY-HYm A/IY-/`E/5q TkT*}~_0sTī9RHR6BB)R4 @I9K5@HS uS* Z  K4H!1iQ Yi 4_qT4 R R sYk} A)Y+kkI`!T)4BqTsIY(B"4 R R3M҈Yk} A)Y+kkI`!T)!4K@qT3IY(K@KKH`Sw4IRq Q).3 Rt @9u@9~ӈ ;i@yH ~ @ [C?qTC5RKq`TV4 R R3Yk} A)Y+kkI`!Ti4K@qT3IY(K@KO@RKRqT *K3@"}~_03T)9RHRgI)S4q T 4 R R3Yk} A)Y+kkI`!T?k'?k3c1?k3b1?k$1qRR4fXn5kTY.2R*R4qTkTY- LXg+Xmk| A+, *A/  )X-7@ETO4q@ TkTY-iYm}@ A)jY-O`E5q TkTK~~_03T9RHR+K@O@(RH4 @IK5S uS* X K K4H!1iQ Yi4_qT4 R R 3Yk} A)Y+kkI`!TI4K@q"T3IY(K@KK@KK93c#<@(qT)RBi9s4 R RsNҨYk} A)Y+k kI`!T)4BqTsIY(B9sz5Qh9s@@7_k  #@ ?A*H}@)145TK@ N4 R R3 XYk} A)Y+kkI`!T)4K@qT3IY(K@KK93Ac#K@ R*Kq9h} k `ӊ}SHuS L k KjH}STqhJ-8Q1T9%)(T@99q@9h4c*,+@kDcC[BSA{ƨ_R?ʚ;S {sR@RDR{ @S¨_ֿSTRRTSR+*{{_S[c{C*q**T~@*qTa~@*44***kh} y* HRC{cB[ASè_{jHO! I|`ҥh@jRI_)2I5;R I_)2I5;hrhHRh"h@h{A_{S[ck+ R+@kDcC[BSA{ƨ_vY?T(ci# 7 ֚*_!HTTT~A? ?qt”TTH9kщi8i*8I8kT@HA}~At? ?qT_Tjh8I9H9i8L~A? ?qT_TLH9kщi8i*8I8k~A? ?qTTH9kщi8i*8I8kTBT~A? ?qT (T~A? ?qT;˿)ThA? ?qTTTlH9kщi8i*8I8k7 @TIT(}A? ?4 ; ThA? ?4 @ W@ T_Twk{#7T9Txk{#_bT,7kѵ"W{# +@x@#{AR c9"9RR{_LTi8h84)щ i8h84)iJJJ9iT8 R9HR@R{R }@?BT?i*8qKT)@9i4-R+C( iil8!H *)@8hi,8)5 @9i4+R( )Cj!(il8_jT @8)5{_`S{RSSTC@ @h5` kkџ Th@9 e@9I7h @j @@94 @HC yI{èS_{S[ck+_CC*Eq***Ta~@kw5@ @Hs@*R)RRqA**A*x5R A? RT<LT|DIs/CtRB **!R* 4R***U 49P66 4kTD@****u59~ A? T<LT|D s/CsRGRhsB***[4*R*5R*5h_R kaT`BNR_R kaTBF*_CC+@kDcC[BSA{ƨ_D@*h_R kT`B2S[c{C****@****#@94@HC yIC{è@cB[ASĨ_{Sq{_{R6 h E ( R ?{_S[{$HTvE R ?ր4- 4ER?֠eR{[AS¨_{#y4S!RC`4#@yR{¨_S[c{"R**BR T TMT!d1RR*@ R*"*1TRs *mT@1T @qTR@i!*dRR*@T*!a ? 5R ( ?*@R*j*{cB[ASè_{ChA)j .?.?(G?g [H @y5@987OqQh qaTLR h qaTlRhqTRR)R K(! Q+  * L@9 SK@ S? qAzT kT 8qaT  * T? T)KKL y SI yRhKqiTADq"TR R(R) (yhkTOq__vHRCI{_{*Ax   jTRR9`_RR0`-R{A_{``R{A_{`@`@IC @5@h@ kT@Rh@ k@T R{¨A_{ C5 @C@h(25R R{¨A_f )L T@`T %RR#RH/&RaR;@TERRCR X X Tn`t \8pp \ \ \+qf }`r;g;{y*sz | \8 yOT \RX yBXu+qR }yK]Yg^`g^;"Tz \gR1:p.fRn2\ 2lȵm}\l ~\b(-Lgt+KiQ}@8b HA2u rymH::uP\VQU\q\st\KT7 yBUymFW\t wfY*u_VX }yc]Rg^`K^_ V]4x?Q#Ib?ƺ??^?AG;BIb?WUUUUU?B.?_D; R J}S rTPq T`qTpq `R R@RRr R_qRqR**qKRI*q**} SK * j *K*`*_(D;*r R_qRqOR**qJ*}SK * j *@ *_rTq TqT q  D; }@(X+Sjq Iq q *q @Iq * qI)* H D_`? r(D; X S KqjqHK qiq *I)D_`(94Th85_{s`DTH ( RdRbRR ?`{A_hD T _S[{AwD ** ?*5 ?qTD T ?H ( RdRbRR ?A * ?**{@[ASè_|S H2rKh2rjH2rKh2rjH 2rK rTPq T`qTpqTk2k2k2rh2`_*RjRTSH2rKh2rjH2rKh2r`L86 2_(D;}@(D{, *D; R J*,**  N*k T mSH2rKh2rjH2rKh2rjH2 rKrTq TqT qTk 2k 2k 2h2rRj @*DՋ{_S {*6@6 Ҥsz6H6@Ҟsz 6P6Ҙsz6X6u 6ґsz 6`6Ҍszq{ @S¨_{S[c#'yX (@`****bpg*5 qT@iR;(3#C**)"S(44@mm@Ac#`5*&@*"@5@V'@#@cC[BSA{Ũ_Mg_RS[c{  @** @? 6 @H@ 2I6 @H@ 2I6 @TH@ 2I6 @H@ 2I6 @H@ 2Ih@ @ HӨ @)*iJ*, J h@ @ I @)*iJ*, J h@ @ JӨ @ )*iJ*, J h@ @ K @)*iJ*, J h@ @ LӨ @)*h3 6 @H @ 2I 6 @H @ 2I 6 @H @ 2I 6 @H @ 2I 6 @H @ 2I h@  r`T_Pq`T_`qT_pq!T @H@ 2 *RJR @(@H3( @H@ uI @@ J*+-h J @H!@ 2I! @h!@V4 mi! @@P @ha@ 2ia @Ha@ mIa @@QQ)R( 3h! @@0 @Ha@ 2Ia @)Rha@( 3ha @@1)Z C"RR* ? @H @ 6h@ wiH @6h@ viH @6h@ uiH @6h@ tiH @6h@ siH@ r T?qT? qT? qTh@ j )h@(jhIh@ hi4PQ@Q)@{¨cB[ASè_ {qTQqT[HRX(R{_(D;}@ *D_D; R J!*-)|@|@  i D_(D; }@K+D_(D;}@_<@ R (I)@yL @y( a4 I@?@)TH@  ?@)Tk kJT_S{T`5R aˀ`R$@h* R{S_@yIR kaT<@ R (I@? kTH1@y R-q@TR_{h@ @+u(kj}@I*@! R{_!594  |j7p= S %Ț N2 NI>N*`TIH>N )I87(}@` Hw }@H S %Ț 1 )>N*TH }@Ӏ IilA< N0:n>N1 N(>N }S(>N +j}SA*AV4 N|=   N4n1 Nr N,>NO>N 7 S)>NJ%ȚH>N-  (!Q qSJ%ɚOL ҆RkL ki _ kcTl>Nk>NJ86ki  K H <4n Nq NR N+>N/>NM>NL>N) (!ʚ * KډR) K HQ(!Ț * `TI  K(}@ H__ BT@8!k`TBт_t3 @3.1 (>N ?qT(}@ _ @1gJ _A cT6 N_TpE@ir = mAn6n0=+A76nJT6n6nNN1N2:nH>N(_T_A#TpN_A"T_!Tp@3.1 (>N ?qT(}@` 53;nh>N(:n>Nh N  N :n>N N  N>Nh >N )(}@ 1 N(>Nh (>N )(}@i A J!k!h@8!k`TJъh__{(@@ {_a{@ @? k{_a{ ȨC@94( @c)ȱc*H@ kaTc( @?qTc(ȩ!@ kTc( !@ kTc(i!@ kT5c()3@.p ձS?S ߈{A_a csm !"{ @4 {_a{R* {_a{@ @| ՠ @ {_a{ @@ {_a{`R  {_a{ @@ {_a{@@$ {_a{@@ {_a{@ {_a{R {_a{ @@گ {_a{@@ {_a{R {_a{R {_a{R {_a{C@94`R {_a{@H4@@4i*Fh)@ yj*! I@9(H9`@c {_a{@ @R r? k{_a+"+:+T+p+~+++++++,",2,B,Z,h,x,,,,,,,,11111x1d1R18111--- .$.:.X.l.z........ /"/4/@/R/^/r////////00,0:0D0V0h0x000000000---L-:-&--\-l-&@4@83@3@Q@u@#@@@R@J@J@B@@@Ȫ@ت@ @ @ @ @ $@0@ @@ P@X@ h@ x@ @@@@@@@@@@@ī@ȫ@̫@Ы@ԫ@ث@ܫ@@@@@@@@@@@@ @@@@@ @$@(@,@0@4@8@<@@@ P@ `@h@x@@@@ج@@@8@X@#@@ ȭ@@&@0@@@D@P@`@#@@ @@Ю@@%@$@@%h@+@@ @"@(8@*h@@ @@ @@ذ@@@0@@ȫ@ܫ@@@@@P@__based(__cdecl__pascal__stdcall__thiscall__fastcall__vectorcall__clrcall__eabi__swift_1__swift_2__ptr64__restrict__unalignedrestrict( new delete=>><<!==!=[]operator->*++---+&->*/%<<=>>=,()~^|&&||*=+=-=/=%=>>=<<=&=|=^=`vftable'`vbtable'`vcall'`typeof'`local static guard'`string'`vbase destructor'`vector deleting destructor'`default constructor closure'`scalar deleting destructor'`vector constructor iterator'`vector destructor iterator'`vector vbase constructor iterator'`virtual displacement map'`eh vector constructor iterator'`eh vector destructor iterator'`eh vector vbase constructor iterator'`copy constructor closure'`udt returning'`EH`RTTI`local vftable'`local vftable constructor closure' new[] delete[]`omni callsig'`placement delete closure'`placement delete[] closure'`managed vector constructor iterator'`managed vector destructor iterator'`eh vector copy constructor iterator'`eh vector vbase copy constructor iterator'`dynamic initializer for '`dynamic atexit destructor for '`vector copy constructor iterator'`vector vbase copy constructor iterator'`managed vector copy constructor iterator'`local static thread guard'operator "" operator co_awaitoperator<=> Type Descriptor' Base Class Descriptor at ( Base Class Array' Class Hierarchy Descriptor' Complete Object Locator'`anonymous namespace'(null)(null)   mscoree.dllCorExitProcess0@@h@@:@:@p@@(.@X.@@@(@@@@@:@@:@`@@:@x@H@:@        ! 5A CPR S WY l m pr  )   Y* @@ @`@@@`@@@ @`@@@P@@@@ @0@x@api-ms-win-core-datetime-l1-1-1api-ms-win-core-fibers-l1-1-1api-ms-win-core-file-l1-2-2api-ms-win-core-localization-l1-2-1api-ms-win-core-localization-obsolete-l1-2-0api-ms-win-core-processthreads-l1-1-2api-ms-win-core-string-l1-1-0api-ms-win-core-synch-l1-2-0api-ms-win-core-sysinfo-l1-2-1api-ms-win-core-winrt-l1-1-0api-ms-win-core-xstate-l2-1-0api-ms-win-rtcore-ntuser-window-l1-1-0api-ms-win-security-systemfunctions-l1-1-0ext-ms-win-ntuser-dialogbox-l1-1-0ext-ms-win-ntuser-windowstation-l1-1-0advapi32kernel32ntdllapi-ms-win-appmodel-runtime-l1-1-2user32api-ms-ext-ms-AreFileApisANSICompareStringExFlsAllocFlsFreeFlsGetValueFlsSetValueInitializeCriticalSectionExLCMapStringExLocaleNameToLCIDAppPolicyGetProcessTerminationMethodccsUTF-8UTF-16LEUNICODE ((((( H   !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~ ((((( H ( 0@@@@@@@@@@@@@@@@INFinfNANnanNAN(SNAN)nan(snan)NAN(IND)nan(ind)e+000@@@@@@@@@@@@@@ @@@@@ @$@(@,@0@4@8@@@H@T@\@@d@l@t@@@@@@@@@@@@@@@ @(@0@@@P@`@x@@@@@@@@@@@@@@@@(@@@P@@`@p@@@@@@@@@@8@P@SunMonTueWedThuFriSatSundayMondayTuesdayWednesdayThursdayFridaySaturdayJanFebMarAprMayJunJulAugSepOctNovDecJanuaryFebruaryMarchAprilJuneJulyAugustSeptemberOctoberNovemberDecemberAMPMMM/dd/yydddd, MMMM dd, yyyyHH:mm:ssSunMonTueWedThuFriSatSundayMondayTuesdayWednesdayThursdayFridaySaturdayJanFebMarAprMayJunJulAugSepOctNovDecJanuaryFebruaryMarchAprilJuneJulyAugustSeptemberOctoberNovemberDecemberAMPMMM/dd/yydddd, MMMM dd, yyyyHH:mm:ssen-USja-JPzh-CNko-KRzh-TWuk@@@@@ @(@0@ 8@ @@ H@ P@ X@`@h@p@x@@@@@@@@@@@@@@ @!@"@#@$@%@&@'@) @*(@+0@,8@-@@/H@6P@7X@8`@9h@>p@?x@@@A@C@D@F@G@I@J@K@N@O@P@V@W@Z@e@@@@ @@0@@@P@`@ P@ p@ @ @@@@`@@@@@@@ @0@@@P@`@p@@ @!@"@#@$@%@&@'@)@* @+0@,@@-X@/h@2x@4@5@6@7@8@9@:@;@>@?@@(@A8@CH@D`@Ep@F@G@I@J@K@L@N@O@P@R@V @W0@Z@@eP@k`@lp@@@p@@ @ @ @@@@@ @8@,H@;`@>p@C@k@ @ @ @ @ @ @ @; @k 0@@@P@`@ p@ @ @@;@@@@ @ @ @ @;8@H@ X@ h@ x@@;@@ @ @@;@ @ @ (@; 8@$H@ $X@ $h@;$x@(@ (@ (@,@ ,@ ,@0@ 0@ 0@4@ 4(@ 48@8H@ 8X@<h@ <x@@@ @@ D@ H@ L@ P@|@|@arbgcazh-CHScsdadeelenesfifrhehuisitjakonlnoplptroruhrsksqsvthtruridbesletlvltfavihyazeumkafkafohimskkkyswuzttpagutateknmrsamnglkoksyrdivar-SAbg-BGca-EScs-CZda-DKde-DEel-GRfi-FIfr-FRhe-ILhu-HUis-ISit-ITnl-NLnb-NOpl-PLpt-BRro-ROru-RUhr-HRsk-SKsq-ALsv-SEth-THtr-TRur-PKid-IDuk-UAbe-BYsl-SIet-EElv-LVlt-LTfa-IRvi-VNhy-AMaz-AZ-Latneu-ESmk-MKtn-ZAxh-ZAzu-ZAaf-ZAka-GEfo-FOhi-INmt-MTse-NOms-MYkk-KZky-KGsw-KEuz-UZ-Latntt-RUbn-INpa-INgu-INta-INte-INkn-INml-INmr-INsa-INmn-MNcy-GBgl-ESkok-INsyr-SYdiv-MVquz-BOns-ZAmi-NZar-IQde-CHen-GBes-MXfr-BEit-CHnl-BEnn-NOpt-PTsr-SP-Latnsv-FIaz-AZ-Cyrlse-SEms-BNuz-UZ-Cyrlquz-ECar-EGzh-HKde-ATen-AUes-ESfr-CAsr-SP-Cyrlse-FIquz-PEar-LYzh-SGde-LUen-CAes-GTfr-CHhr-BAsmj-NOar-DZzh-MOde-LIen-NZes-CRfr-LUbs-BA-Latnsmj-SEar-MAen-IEes-PAfr-MCsr-BA-Latnsma-NOar-TNen-ZAes-DOsr-BA-Cyrlsma-SEar-OMen-JMes-VEsms-FIar-YEen-CBes-COsmn-FIar-SYen-BZes-PEar-JOen-TTes-ARar-LBen-ZWes-ECar-KWen-PHes-CLar-AEes-UYar-BHes-PYar-QAes-BOes-SVes-HNes-NIes-PRzh-CHTsr@BP@,@@q@P@`@p@@@@@@@@@@@C @0@@@8@)P@h@k@!@c@@D@}@@@E@@G@ @@H(@@@(@I8@H@@AX@0@h@J8@x@@@@@@@@@@@K(@8@@@ H@X@h@x@@@@@@@@@@@(@8@H@X@h@@#x@e@@*@l @&@hH@ @L`@.@sP@ @@@@M@@@>(@@78@X@ H@Nh@/X@t@h@x@Z`@ @O0@(@j@@ah@@Pp@@@Qx@@RX@-@rx@1@x@:@@@?(@8@S@2H@y@%X@g@$h@fx@H@+@m@@=@@;@p@0@@w@u@U@@@T(@@8@@6H@~@X@V@h@Wx@@@@@@X@@Y@<@@@v@@@[@"(@d8@H@X@h@x@@@@\@@@@@@@@]@3(@z@@8@@8H@@9X@@h@^x@n@@_@5@|@ @b@@`@4@@{(@'@i@o@(@8@H@X@h@x@F@paf-zaar-aear-bhar-dzar-egar-iqar-joar-kwar-lbar-lyar-maar-omar-qaar-saar-syar-tnar-yeaz-az-cyrlaz-az-latnbe-bybg-bgbn-inbs-ba-latnca-escs-czcy-gbda-dkde-atde-chde-dede-lide-ludiv-mvel-gren-auen-bzen-caen-cben-gben-ieen-jmen-nzen-phen-tten-usen-zaen-zwes-ares-boes-cles-coes-cres-does-eces-eses-gtes-hnes-mxes-nies-paes-pees-pres-pyes-sves-uyes-veet-eeeu-esfa-irfi-fifo-fofr-befr-cafr-chfr-frfr-lufr-mcgl-esgu-inhe-ilhi-inhr-bahr-hrhu-huhy-amid-idis-isit-chit-itja-jpka-gekk-kzkn-inkok-inko-krky-kglt-ltlv-lvmi-nzmk-mkml-inmn-mnmr-inms-bnms-mymt-mtnb-nonl-benl-nlnn-nons-zapa-inpl-plpt-brpt-ptquz-boquz-ecquz-pero-roru-rusa-inse-fise-nose-sesk-sksl-sisma-nosma-sesmj-nosmj-sesmn-fisms-fisq-alsr-ba-cyrlsr-ba-latnsr-sp-cyrlsr-sp-latnsv-fisv-sesw-kesyr-syta-inte-inth-thtn-zatr-trtt-ruuk-uaur-pkuz-uz-cyrluz-uz-latnvi-vnxh-zazh-chszh-chtzh-cnzh-hkzh-mozh-sgzh-twzu-za Tc-^k@tFМ, a\)cd4҇f;lDِe,BbE"&'O@V$gmsmrd'c%{pk>_nj f29.EZ%qVJ.C|!@Ί Ą' |Ô%I@T̿aYܫ\ DgR)`*! VG6K]_܀ @َЀk#cd8L2WBJa"=UD~ $s%rс@b;zO]3AOmm!3VV%(w;I-G 8NhU]i<$qE}A'JnWb쪉"f37>,ެdNj5jVg@;*xh2kůid&_U JW {,Ji)Ǫv6 UړǚK%v t:H孎cY˗i&>r䴆["93uzKG-wn@  _l%Bɝ s|-Ciu+-,W@zbjUUYԾX1EL9MLy;-"m^8{yrvxyN\lo};obwQ4Y+XW߯_w[R/=OB R E]B.4o?nz(wKgg;ɭVl H[=J6RMq! EJjت|Lu<@rd 6x)Q9%0+L ;<(wXC=sF|bt!ۮ.P9B4Ҁy7P,=87MsgmQĢR:#שsDp:RRN/M׫ Ob{!@fu)/wdq=v/}fL3. iLs&`@< q!-7ڊ1BALlȸ|Rabڇ3ah𔽚j-6zƞ) ?IϦw#[/r5D¨N2Lɭ3v2!L.2>p6\BF8҇i>o@@w,=q/ cQrFZ**F΍$'#+GK ŎQ1VÎX/4Bycg6fvPbag ;s?.❲ac*&pa%¹u !,`j;҉s}`+i7$fnIoۍut^6n16B(Ȏy$dAՙ,C瀢.=k=yICyJ"pפldNnEtTWtøBncW[5laQۺNPqc+/ޝ"^̯p?m- }oi^,dH94X<H'W&|.ڋu;-Hm~$P  %-5 > H R ] i u -C Y p        %  d'@Bʚ;01#INF1#QNAN1#SNAN1#IND??Xt?0 ?A??m?'?~?R?+M?0??ZR???'??$?\g?A)??@L?a???Ȇ?9??3?G?#??@D?M??@2?j?@Bt?@?X?R%?@>r?r? ?T??@_?01?^y?? ?(N??`??a?@?? -*?k?@@??B.?y|6>gsh>ƈ[^>/T,X>0S:zb>|si\a>酲j%M>zz[>ܥY#4o>wHn>G2k>)l>YHȆ>0AvVL>3/c>v ka>zzk>RUWk>q9a>de>B!Ѳm>dNpm>6/EiU>[ >$'<>F(o>BĮ^>&qN]k>YWm>bj ;>L!\>G[%_f>PHIZ>w_FGm>{]>`hj>>duo>3>ҾC`>\_>h_=N>qCF>WN@l>^b @>L-n>4b>\ngd>Z=@pn>6ނBg>?xb>8rZ>Oc>m>Bĩ*Vc>LHT>z\P>[0>'>m>[a>"߹oI>bAe>USY>kX>,HR>log10CONOUT$user32.dllMessageBoxTimeoutAMessageBoxTimeoutWFatal Error in LauncherFatal Error in LauncherrbFailed to open executableUnable to find an appended archive.Unable to read from file#!PATHEXT;PyLauncherSTATICJob creation failedJob information querying failedJob information setting failedmaking stdin inheritable failedmaking stdout inheritable failedmaking stderr inheritable failedUnable to create process using '%ls': %lscontrol handler setting failedFailed to get exit code of process.exe/usr/bin/envExpected to find a command ending in '.exe' in shebang line: %lsExpected to find whitespace after '/usr/bin/env': %lsUnable to find executable in environment: %lsExpected terminating double-quote for executable in shebang line: %ls<launcher_dir>\Terminating quote without starting quote for executable in shebang line: %lsFailed to find shebangExpected to find terminator in shebang lineExpected to decode shebang line using UTF-8Expected to find '#' at start of shebang lineExpected to find '!' following '#' in shebang lineExpected to find executable in shebang lineExpected to find arguments (even if empty) in shebang lineExpected to be able to allocate command line memory"%ls" %ls "%ls" %lsbZb b 8@@@N@RSDS=IפU+C:\Users\Vinay\Projects\simple_launcher\ARM64\Release\w64-arm.pdbGCTL.textHs.text$mnP.text$x.idata$5.00cfg.CRT$XCA.CRT$XCAA.CRT$XCZ.CRT$XIA .CRT$XIAA(.CRT$XIAC0.CRT$XICH.CRT$XIZP.CRT$XPAX.CRT$XPXh.CRT$XPXAp.CRT$XPZx.CRT$XTA.CRT$XTZt.rdata.rdata$zzzdbg.rtc$IAA.rtc$IZZ.rtc$TAA.rtc$TZZ .xdata'<.idata$2(.idata$3(.idata$4+.idata$6@ .dataJ8.bssp .pdataP.rsrc$01PQ.rsrc$02*Ȃ*Ȃ*،@،90Ȅ،BȂ&@tȂ&@@ -@(@hP\@Ђ$?P4x5Px555Px5 @4p?X78x8 @@@'@"@"!@@".P(@"?dBxBxBB@9@@0@ JɆȂ,JɆȂ,@0@ JɆȂ,JɆȂ,@@9H)@8!@ ɊȆB ɊȆBb0ɈȄ،P @"? FLF@VP$@Ȃ&? OlO̒O@P̒.P @Ȃ&?P4@Ȃ$?̎lDD0Ȅ، *P@Ȃ&?D`@@ɆȂ*J@?@Ȃ&R@G@Ȃ&5@0@CP>@Ђ$?L p"?d!pȂ$? lp"?dp"?8Dd ?H`` FpцȂ(?\ГNpцȂ(?TГp?̒5pȂ$?01p"?;pȂ$?4p?@@Ђ$;@6@Ђ$.@*@"p"?xdp"?Phdp"?dp"?ds@E@Ђ$/7*52@ @@@ɆȂ(=`$@ @"h`Ђ$@@ɆȂ*d@@цȂ(PшȄ،B0،J`$0Ȅ،2P-@Ђ$?X\@+@Ȃ$0،VpȂ$?8d@@ɆȂ(:@@Ȃ$o0 ɈȄ،P@"?,,xp?/0P%@цȂ(?D2233p"?L0h0d-p"?4l5 FpцȂ(?t??Г0 ɈȄ،40 ɈȄ،N0Ȅ،L0Ȅ،_0 ɈȄ،6P @Ђ$?CC@@@Ȃ&@@ɆȂ(j@F@ɆȂ**@@Ђ$gP V ɈȄ،@=Ȃ$P  ɈȄ،8@@+P'،P ɈȄ،r0،NP D шȄ،p"?@@ @@ @@@BB c(-*z-*-+"+:+T+p+~+++++++,",2,B,Z,h,x,,,,,,,,11111x1d1R18111--- .$.:.X.l.z........ /"/4/@/R/^/r////////00,0:0D0V0h0x000000000---L-:-&--\-l-GetStartupInfoWSetConsoleCtrlHandler.SetInformationJobObjectAQueryInformationJobObjectSearchPathW-SetHandleInformationGetCommandLineWGetStdHandle$AssignProcessToJobObjecttGetModuleFileNameWGetTempPathWMultiByteToWideCharFormatMessageWaGetLastErrorLoadLibraryAWaitForSingleObjectExCloseHandleKSetStdHandle SetCurrentDirectoryWGetProcAddressCreateJobObjectA`ExitProcessCreateProcessWFreeLibraryOGetFileType=GetExitCodeProcessKERNEL32.dllPeekMessageWWaitForInputIdlevCreateWindowExWDestroyWindowPostMessageWGetMessageWUSER32.dll=PathCombineWPathRemoveFileSpecWOStrStrIWSHLWAPI.dllDQueryPerformanceCounterGetCurrentProcessIdGetCurrentThreadIdGetSystemTimeAsFileTimebInitializeSListHeadnSetUnhandledExceptionFilterxGetModuleHandleWRtlUnwindEx1SetLastErrorFlsAllocFlsGetValueFlsSetValueFlsFree3EnterCriticalSectionLeaveCriticalSection_InitializeCriticalSectionExDeleteCriticalSectionYRaiseExceptionjReadFileGetCommandLineAWriteFileGetCurrentProcessTerminateProcesswGetModuleHandleExW#SetFilePointerExGetConsoleModegReadConsoleWDHeapAllocHHeapFree^InitializeCriticalSectionAndSpinCountTlsAllocTlsGetValueTlsSetValueTlsFreeLoadLibraryExWCompareStringWLCMapStringWGetStringTypeWwFindClose}FindFirstFileExWFindNextFileWIsValidCodePageGetACPGetOEMCPGetCPInfoWideCharToMultiByte8GetEnvironmentStringsWFreeEnvironmentStringsWSetEnvironmentVariableWGetProcessHeapFlushFileBuffersGetConsoleOutputCPCreateFileWMHeapSizeKHeapReAllocSetEndOfFileWriteConsoleW2-+] f     @@D@D@D@D@D@PI@p@@@B@D@C abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`y!@~ڣ @ڣ AϢ[@~QQ^ _j21~I@ Z@ Z@ Z@ Z@ Z@ Z@ Z@ Z@ Z@I@Z@Z@Z@Z@Z@Z@Z@..uKDPH,d8p@`  #|#`#$#''0'P'' ']x]P  !`!f!Qe8$ eH%]%&]a&UbP'fH)0*,-e /,2<23 383X34(4h55P6]6P7 89aX8Ea8Ia89b8:5:Y`;};0<e<e?iA=A%BBB C@CXDyaDEaEUpEmeE`FebGIKfLeLPMfN@Pe0QQ!RuS`TaaTbXUUyXVXWW bX- ZH[A[]4^H_pcmecmePdafdfdhg5bi)bla@mopectdPwwxz|a}c~5f=bxP@deeEЊE|P@Eh5UbxMȓAe( ȗ x e]bQ؝qaH}b@yb< L (UbUbbxbqex]ئ x @h \ AQ 1`ЬapMЭ !`f Iix=A`H-xMa]b`]a%E0$!hH!Hȸaax))P!cix!gIi!Eb`aapyme%ieb@Yaimbqbpqbhiue!!"a`bea(ia," P"h(-`X|""0""-a`mbH`"8p"M(9a`-`0-``u"MaMaPqi8#fg,#pL#h1dYf`@X#hd#p# #X ###8$aHb$$$P#qb!#8(%eP \$P"p$@#E`#-b$bh%Q%a&$)Qe+Ia,$-yb-(.1h.e(/a/Qb/$00 %01`01$3}4f4@%5(6%:%0<%`=%>`%?%(C&DL&F<&`I8JNaa@OIO`&0QRRQ0T& X&it&hjjfHkak&p&p&qbHr'Puu!vMhv0w=`pwf y$'zyah{1a{e|]eae4'=0T'،9Px  ̒  D dГ  4X x  0&@t'0x 8Pehf 0 @P8(`hp%h(h}( @...GGGWWWiiiuuu ̀ ww ww||wwwwwwwwfwwwww|fwwwwwwffwwwwwwffwwwwwfflwwffffffwfffffflwffffffwffffff|ffffffffR\Ilffl)ffح2L18Ϥ"A< ΣTπU  ؀ ???????( 444MMMSSSzzzp p{p{ffkof_fffk_fff[f}UUUfL4UUU_kJqO_~'[U_Uwwwww{~( @%%%+++000===AAAIIIMMMQQQVVVYYY]]]~dFgggjjjmmmrrruuu}}}u?z=~;gEkCoAr@:IbpƏKУk(,1?5<\CKQsU[cbð/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq_______CCBABADL*(%$""&GABJIIDDJC??AD_-(''%$GG#_DIJIIJIIIDIJDD_+)(''%GG _JMCEJ?ABAECA?BA_,+)('%%"!_IM@AJACDCIDI____.,++>________JMJJJJJJJJJF_..,+)('%$"! #GIMCEJJJI?J__...,+(('%$"! &_JM?AJJJJCJ__...,+)(''%$" _IMJJJJJJJJ_K=...,++(''%$! _JMCDJJJJAJ_K_______L*%$"!_I_?AMNJJEJ_ L'%$"_I_MMMMMMJJ_ _('%%_I_CEMIJJMEM _(''*_I_?BMDJEMDMF _)(-LI_MMMCMMMMM_________< ____I_CEM1;MACDMEJM__I_?A_D1@IJJMJMM_FF_I__6_@/EMMMNMM_FF_I_C80EJDMJCJFF?:AA20?_M_MIEM______MIC4BC/ N______MMMMJIDAI_9/ HJJMMJMMMJ??BAI_A7503 IJMMCBCBA44CCI___BAO;6___C_MJIDIDMI_CI___O; @__C_C?J?AJI_?A_DJJI@ O_CM?;I?JI_________H9MAIJJIJI_CD_____JJI73C;IJIJI_?AMDJJDIMJIE5:JIJI__________MMIA:IJJJJJJJJJJJJJJJJMJ???( 444MMMRRRYYY~eGuuu}}}x>iErCE~7?HVbx/!P7pLcyϏ1Qq/Pp",6@J[1qQq/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq!%///* !*/"(%%'%/) /!#''////+/+"*(/ / !%(/ ( (*/ (///) */   )*  /"///// /+/// # + !%//  +"*+'#+//+'!%*++$++!+! !!!<(0`  !!$& &"   WܱNj+<<:5pi$!!!4888&SNJFB=950,(%%%5ǎVRNIEѹ|Jq?o@ZUQMID@<73/+&"-Ɍ444"ք̴wq?]YUPLHC?;72.*%!"""4888&dya\XTPKGC>:61-)% OÑ%%%5ʎA{;ys`\WSOJFB>951,($(9|:z;xq?o@mAkBiCgCdDuZ;73.*Ǒ%%%5̎È>89}:{;yq?o@mAjBhCfD~dEuZ?:625Оa789}:{;yr>p?n@lAjBhCfD}dEB>:5^ό555"܄ѳ„7789}:{;xr?p@n@lAjBgCeDFA=9"""4;;;&ŌC89~9|:z;xr?p@mAkAiBgCIELɑQQQJnnn~~~Įq?o@mAkBiCHHH"""vvv9~:{;yq?o@mAkB:::'''___sssttt8Ϧuǣvyp?n@lA888T---6fffnddd%%%"""OOOSSSċDҧuʤv{;yr?p?xM<<r?̷999VVV###)))444ѳ͝b@~9|:z;}Cg˶Ӎ󑑑ZZZlll;;;!!!""")))___&&&2:::ppp{{{___WWWWWW:::!!!"""***www"""4888&,̑999ԖJJJ|||lll:::"""BBBXXX|||$$$6,uuuKKKCCC@@@...www* Ҍ666"KKKaaaLLLWWW@$"""4;;;&nnnfff!!!$$$999444]ttt|ȇɑ&&&5ЎvvvmmmVVV{{{OOOڥaaaCCCpppό555"ބ|||MMMfff"""4;;;&\\\Ǒ%%%5Ύݧܦ͌555"ۄۥ"""4:::&ڤÑ%%%5ˎܤׇ ww?ww??ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwwwwwwwwwwwwwww?ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwww?wwwwwwww( @ !!!0\\\JeeeQ666D555A0$ vH<602\7qڴvvvj&&&D1"gLF@;5?кVQKE?9(aV[UPJD>82-uuun{{{j`ZTOVo@lAb_YSMGB<60+%<aVmt>q?n@bb^XRLFA;5/)$Ywwwn}}}j~Cv=s>p?bba]WQKE@:4.(+{;xbba[VPJD?93-'aV~:{;xr?o@lAiBfD}dE|cE|cEiB<61?9}:z;w=t>q?n@kAiCfD}cE|cE}dFGA;=aVңi89|:yq?n@kBhCeD|cE|cELF@mzzznjʓP8~9{;yp?mAjBgCeD|cEPJ\¯mAjBgC~dEaV}:z;xq?n@lAiCJJJőPyq?n@~YVVV???wwwiiiΡkA|;y>>3@@@y~~~obbb000kkk@@@---U<<<&&&[[[6uuusssWWWIII$$$&&&qqqlllg|||s4bbbhhhƑUUU000QQQ}}}---{bbb(iiiLLLBBBaVggg+++NNN|||nj]]]tttkkkrrrwwwӦaVӦzzznjӦˉ ?????(  C﫫oIਨS=?_QF4aZмoEcaXMB70~Iq?c`VK@58z;u=qv>3Eyn@iB~dE}dFGHYYYuuuġ=xmAhC}dE}eGS444|||gC}cEMMM~>q?kAiGRRR¢Gu=xKʺ~AAAAAAAAAAAAAAAA ( h00 %   h4VS_VERSION_INFO?fStringFileInfoB080904b0JCompanyNameSimple Launcher User^FileDescriptionSimple Launcher Executable2 FileVersion1.1.0.140InternalNamew32.exej#LegalCopyrightCopyright (C) Simple Launcher User8OriginalFilenamew32.exe@ProductNameSimple Launcher6 ProductVersion1.1.0.14DVarFileInfo$Translation   (08@X`hУ 0@P`pФ 0@P`pХ 0@P`pЦ 0@P`pЧ 0@P`pШ 0@P`pЩ 0@P`pdȦЦئ (0HXhpx (08@HPX`hpx (08@HPX`hpx (08@HPX`hpxȩЩة (0@HPX`hpxȪЪت (08@HPX`hpxȯد(8HXhxȠؠ(8HXhxȡء(8HXhxȢآ(8HXhxȣأ(8HXhxȤؤ(8HXhxȥإ(8HXhxȦئ(8HXhxȧا(8HXhxȨب(8HXhxȩة(8HXhxȪت(8HXhxȫث(8HXhxȬج(8HXhxȭح 0@P`pЪ 0@P`pЫ 0@P`pЬ 0@P`pЭ 0@P`pЮ 0@P`pЯ 0@P`pР 0@P`pС 0@P`pТ 0@P`pУ 0@P`pФ 0@P`pХ 0@P`pЦ 0@P`pЧ 0h@@H(HhPX`hpxȩЩةPK!``w32.exenu[MZ@ !L!This program cannot be run in DOS mode. $qe5a65a65a664a6.{6a6.{6:a6.{6Ca6<60a65`6ja6.{64a6.{64a6.{64a6Rich5a6PELw'\  C2@@ <@P0 p@`.textں `.rdata,.@@.data6@.rsrcP@R@@.relocP@BUVh<@L@t%Aut6hH@VH@t%Ath jhh@uj V@3^]UVh<@L@x%Aut6h\@VH@x%Ath jhhp@uj V@3^]UA3ʼnE}u4EPu hhPPej@M3] UA3ʼnE}u4EPu hhPGPj@M3 UMW3FPAPQ1 tA ;uHE+D0ϋ_]U,VWh@E3hhAP}}j 3;h@Q0jWuuE$UE;}}WuuhuhjSS9 ;t+EjY}E~VEEYE;}}WuuuVjuu3;h@uPfE+EjEYu}E ,MMj)MuuuWjS3;@VPf @$f;u]TEy3jPuJuWjSe3;VP$Df@f;tH;sEuEY_^U Vj.u3uYYtVhpAhVuV@ttFqWh @EPEPuuI;uIEP0@Wu VhpAhPuV@uEPWV ;u3Fuf Y_^UV@&jjjVPuPT@u D@uF^]U}up%At jP @3@]UA3ĉ$ESVW3WWD$<@؍D$PjpD$xPj S4@t |$pu3@3h8@P$$0YYjpD$tPj S @hX@PjD^VD$4WPNt$(5@@jPD$d$x@PYYjPD$h$@PYYjPD$l$@PYYjhe@D$\P@D$PD$,PWWWjWWt$4W@;u=D@WQ$RQPWh(@$Pt$h@Wt$D$$Sp%A$@t$X@jt$@D$Pt$,@h$@PYYt$@UQSVW=P@H@Su׋t>FEft"tjPAYYu Su׋uӅt ]]j hT@S 3ɅShp@QG{ftjPYYt3@3Sh@P ftjPYYuf?tjPYYuf9ujPYYt3fW/Sh@jXpAPf;"u&3f>"Sh @P3f jhh@S tf{"t3f>"Sh@PA ft&jPYYt3fjPYYt fuE 0_^[U0A3ʼnESVW@f8"tj j"YQP8YYu Dž4@$pjP^YYt fu牵WhAVj0@f=hA"t DžjA3ɍf BAP3h@P.Y3Y;s t tA;r3h@PYYWP+VSjh8@33;h@P3fuYYf9tjPQYYtf9u3f>#hH@P{YYj_jP YYt f;u3f>!hx@PHYYjP YYt f;u荅PVS3h@P39h@Pj[SWhh@G$uvhhAhP! PT@f"u+j[G j"P 3Wh @P3f_PPPX@ǍPffu+Hffu+Hffu+ȋPffu+jt1V3h@PWhH@VVS 0S&; Auj h0@3}3];;u73{3u ;;t3f9>;tE;u ɉ}f9;u jEPhA! PuVSEE E=ulYËUVuuj^0/$huu  t3[^]ËUEfU f;tfuf9t3]ËUh@l@th@PH@tu]ËUuYu@j"Yj"YËV%Vv%VV[%VF%V;#V$#^ËUVu3utу;u r^]ËU=6Ath6A+Yt u6AY4+h@hh@YYuTVWhH@*`@d@Y;stЃ;r=6A_^th6A+Yt jjj6A3]j hP@0j!Ye3@9A AEA} 56A5p@֋؉]Ѕth56A֋}ԉ]܉}؃};rKX$9t;r>7֋E$56A֋56A9]u9Et]܉]ЉE؋}ԋ]E@}@sEtЃEE@}@sEtЃEE }u)AjYu}tjYBËUjju ]ËUjju ]jjj jjjz ËUy,u*Yh̋U}t-uj5At@uVD@PY^]ËUQeVEPu uh, u9Ett M^ËUEVF ucE$FHlHhN; At p AHpu(6F;x AtF p AHpu.FF@puHpF  @F^]U3SW9E]u"} tVuM0ExuA+;Ar Zw Ar Zw MtDft?f;t8EPP5EPP5Mt ftf;t+}^tMap_[ËU= AVuy39Euu8cM t+Ar Zw Ar Zw Mt ftf;t+juu u^]ËUS]woVW=Au)j (hYYt3@Pj5Ax@u&j ^9$At S YuR0K0_^SY7 3[]̋D$ StRT$3ۊ\$ t 2trt2urWߋ_t 2t@u[Ãr 3˿~3σtJ2t#2t2t 2t_B[ÍB_[ÍB_[ÍB_[ËUEt8uPY]ËUQQA3ʼnESV3W;u2j^0,uV5YY;Er3fՋE @;u)f9tAr Zw ff9u3SSjVWPS5ȃM;u*9Ms3fj"];~Cj3Xr7D =wM5;tPY;t M؅u = 놋E QSjVWp4tSuV j*YSYƍe_^[M3{ËUuMMEPu n}YYtMapËUju u ]ËUEPjuuu u]ËUMS] VW}M]t}tuK3_^[Ëut 39Ev!t SjQ= t39Ew}F }tFEEF tDFt=;r;}W6uu =)~>}+߃)}};]r\}t3;v uu+ ;w;Ew[PuV<YP; t{tdE+)E$V4YtR}t"MEFKME&E} tu ju< "N +3uN j hp@3u9ut/9ut*9uu-} tu Vuj< %3u Yuuuuu uEEEu YËUuuu juZ]ËUQf9Eu3øf9EsE AAEPjEPj|@u!EEM #ËUQEuM3Vu t Muu$3Wft.>u ftf;t fuf>t fuf9MtEBuu?v E?EuEuuPUE;tV;|BMx EEEPS9.YYt"MxEEPS.YYtE39]fD~^_[ËU}u]S]VuWuu9u u3t} uuuu;v*8CSVhNh@uIi8"u]_8TWVhNh@h3ɃfL~u}u38"u')y3fu" _^[]ËUujuuu u]ËUVuF u g}F uVE eYVFF YyF ttuFuu V5YPz93Ƀ A^]j h@ 39Eu8  ?ut tuuiYeVu u EE Ey uYËU=6AV5Au3wWu.95AtgJAIy aIuK5AtA}t;u*IY(PIY;vf EP@3956Au VVjV@MZf9@tu6<@@PEu f9@u܃t@v39@MujSYLujBYu2yjY@6AwNAMyjY+Kyj YjY;tPYJEtMj YQPVh@pE9uuP&M.E MPQIYYËeE܉E}uP ,EE# [NU((A $A AA5A=Af@Af 4AfAf Af%Af-A8AE,AE0AE<AxA0A,A A $AAA@pAj$NYj@h@@=pAujNYh @P@øAá6AVj^u;}ƣ6AjP NYY&AujV56AMYY&AujX^3ҹA&A  A|j^3ҹ AW%At;tu1 BA|_3^A=AtZN5&AdYËUVuA;r"pAw+Q N Y V@^]ËUE}P[ E H Y]ËE P@]ËUEA;r=pAw` +P9 Y]à P@]ËUME }` Q Y]à P@]ËU4A3SVu EUUUf> tat0rt#wt)3a 3ۃM M3AWf;y@St  tRHtCt- t!9EE @@EE ljE}utE nTtZtEHt0 tuE G}u;eE1}u% UEut3 ؃f}j _f9>tjVh@UT f9>tf>=uuf9>tjh@Vh u Ajh@VI u "jh@V* uf> t3f9>tahuE SuP{St3 EDAMH M x8xxH_^[jh0@S33}jY]3u;56A&A9t[@ uHuAFwFPY&A4V7YY&A@ t PVYYF둋}cj8HY &A;tNh&A P@&Au4Y&A P@&A<}_ ;tg ___OE ~Ë}jYËUEHA]ËU(A3ʼnES]WtSHYjLjPp*0 ffffffEMDž0IM M@j@P@uu tS!GYM_3[<ËVjVj V@P@^ËU5HAp@t]uuuu u3PPPPPËUE3;͐AtA-rHwj X]Ë͔A]DjY;#] uAà uAà ËUVMQY0^]h;@d5D$l$l$+SVWA1E3PeuEEEEdËMd Y__^[]Q̋US] Vs35AWEE{t N3 8N F3 8E@fMUS[ EMt_I[LDEEtEx@GE؃u΀}t$t N3 8*N V3 :E_^[]EɋM9csmu)=&At h&A tUjR&AM UE 9X thAWӋE MH t N3 8N V3 :EH*9S OhAWASVWT$D$L$URPQQh=@d5A3ĉD$d%D$0XL$,3p t;T$4t;v.4v\ H {uhCOCOd_^[ËL$At3D$H3Uhp pp> ]D$T$UL$)qqq( ]UVWS33333[_^]Ëj_N33333USVWjRhF>@Q莌_^[]Ul$RQt$ ]VW3PA<AuA8h0@t F$|3@_^Ã$A3S@VAW>t~t WW&Y A|ܾA_t ~uPӃ A|^[ËUE4A@]j hP@3G}39Au j hYYu4A9tmjAY;u] 3Pj XY]9u+hW@uWY( ] >WYE Ej )YËUEV4A>uP#YujkY6@^]jhp@C@xte3@ËeEeLh@@@AËUEAAAA]ËUE @V9Ptk u ;rk M^;s9Pt3]5Ap@j h@Y3}}؋] KtjY+t"+t+tY+uC}؅uTAAUw\]YpQÃt2t!Ht=빾AAAA AAEPp@E3}9Euj9EtPCY3Et tuO`MԉG`u>OdMGdu, @M܋ @ @9M}Mk W\DEEuwdSUY]}؃}tjYSUYt tuEԉG`uEЉGd3ËUEA]ËUEA]ËUEA]ËU5Ap@tuYt3@]3]j@@V5$A@u5Ap@V5$A@^á AtP5Ap@Ѓ A$AtP@ $Avjh@h$@l@uF\8@f3G~~pƆCƆKCFhPAj \Yevh@E>j ;Y}E Flu AFlvlYE3Guj $Yj YËVWD@5 AЋuNhjv=YYt:V5 A5Ap@ЅtjVYY@N V8Y3W@_^ËVujY^jh@uF$tPYF,tPYF4tPYFPu6:YYt/P4@6Au=@׉Vף6AE3_^[ËVjj 9YYV@6A6AujX^Ã&3^j h@euYEE E"ËUuYH]ËV @ @W;stЃ;r_^ËV(@(@W;stЃ;r_^ËVW3(A@(A(r_^ËUMMZf9t3]ËA<8PEu3ҹ f9H‹]̋UEH<ASVq3WDt} H ;r X;r B(;r3_^[]̋Ujh @h;@dPSVWA1E3PEdeEh@*tTE-@Ph@Pt:@$ЃEMd Y_^[]ËE3ҁ9‹ËeE3Md Y_^[]ËU3M; @t @r3]Ë@]ËUA3ʼnESVuWV3Y;ljE| AD;FG;v}>uЋuE}urlj{CijC C AZf1f0JuL@;v~0C@IuCC Ss3ȋ {95ATM_^3[rjh`@MX}_huqE;CWh /Y؅Fwh#SuYYEuvh@uFh=PAtPY^hS=@Fpp Aj +YeCACAC A3E}fLCf EA@3E=} LpA@3E=}xA@5x A@ux A=PAtPMYx ASE0j Y%u PAtSYUeEÃ=6AujVY6A3ËUSV5@W}W֋tP֋tP֋tP֋tP֍_PE{t At tPփ{t CtPփMu֋P_^[]ËUW}SV5@W֋tP֋tP֋tP֋tP֍_PE{t At tPփ{t CtPփMu֋P^[_]ËUSVu3W;to=8Ath;t^9uZ;t9uPv FYY;t9uPUEYY=2YY;tD9u@-P+P+P=x At9uPAYY~PEt At;t 9uPY9_tG;t 9uPYMuVqY_^[]ËUW} t;Et4V0;t(W8jYtV>Yu AtVsY^3_]j h@p AFpt"~ltpluj Yj (Ye5 AlVYYYEEj !YuËUf9ESVu MuN3;uEHfwf Kjf9Esu~YEYt, URjURPQEtE8]tMap^[ËU SW3j3Y}]9]u&}Vu ;t;ukE;w}uEuEBuuPuUE;t5;|"MxEEPSYYtE39]\>^_[ËU}uo]S]VuWuu9u u3t} u2"uuu;v*8CSVhE@uG8"uY8PWVhE@D>u}u8"u%yu"I_^[]ËUujuuu u]ËUE~ PuYYuuPuu u@]ËU39E vMf9t @;E r]QL$+ȃ YPQL$+ȃ YPUQVu V# E F Yu N /@t "S3ۨt^NF F F ^] u, ;t @;u u YYuVkYYF WF>HN+IN;~WPu gX EM F yM tt%A A@ tjSSQ5P#ƒt%FM3GWEPu W E9}t N E%_[^ËUVuu~!F @t F F u VTXYFvvVdYPg FF uQV:Yt0V.Yt$WV!V<%AYY_ A@$W@t3%>uN@ uNhF P@t,F N@Ch5%A@3_[^ÃUVuVRYuG MWuju P@uD@3t P7Y%AD0 _^]jh@0]u x;%Ar Gҋ<%AD0tSVRYeD0tuu S EJ R ME EË]SRYËU@ @txtPuLYYf;u]]ËUQC @VEt {uE C'} ~5EM PE>Yu?*uj?~Y} Ѓ?uE^ËUxA3ʼnES]Vu3Wu} Qu+t `p 3;tf; jY9x BfXw@3k 0@j^;O $s@3 ƒ tHt4+t$+t   f*u+f T k ʍDЉ9 - f*u%  k ʍDЉƒItQht@ltwf?lu 6uf4um3uf2uOdFi=o4u+x"XRDžYƒd1StAt+tZ+t+ Dž@Dž0 0u u [u AQPJYYtFF9|X++3F tBPƅPPHyf6t:Ht3t+DžAP"Ypegitnnt$otbV[Gx t ffDž@Dž ދCSufguWDžK;~ȁ~7]VlYt Dž5p@CPPWP5@AЋtuPW5LAYYfguuPW5HAYY?-uGWDž$s{+Dž'Dž|j0XfQfWW t@tCC@Ct3҉@t|s؃ځu3} Dž9~ u! t-RPWSF0؋9~N뽍+Ft^tƀ80tS0+~,WPVYP> ;uF yF N _Ff^[]ËUVuu V5Y/V|YtF @tVdP-HYY3^]jh@V3}}jY}3u;56A&A98t^@ tVPVbYY3BU&AH t/9UuPJYtE9}utP/Yu E܉}F3uࡤ&A4VkYYE}EtEjmYjYËUS]u3}u Vu uW;vjuME@uJU+2Ar Zw Ar Zw Kt ftf;t+7SVSuhP.Gu;}tE`p}tMap_^[ËU= AV}uM t߾9uvi_u+Ar Zw Ar Zw Mt ftf;t+juu u,^]ËUEffu+EH]ËUQQSV5A3ۉ]W;tP=8@SSjPSS׉E;tAjP YYE;t0uPj6SSׅt*ESPFYYx;u3_^[Ã9]turYV5AW3uf=tGV9YtFfuSjGW2 YYAue5A5Vf>=Yxt"jWYYtAVWPͶ uI4~f>u5AҦ%A#6A3Y[_^5A謦%A3PPPPP4̋V@3;u3^f9tf9uf9uS+ƍXWSYu V@_[^SVW UVuWV?YtP%Au u u@Dtj?j?YY;tV?YPX@u D@3V?%AYD0t WY3_^]jh@']u x;%Ar >ҋ<%AD0tSM?YeD0t SYEI ME EË]S?YËUVuF ttv迤f 3YFF^]ËUE8csmu*xu$@= t=!t="t=@u3]hz@@3ËUV2N\UW9t ;r;s9t3tPu3u `3@M S^`N`Hj$Y~\d9 |~d=u Fd~=u Fdn=u Fd^=u FdN=u Fd>=u Fd.=u Fd=u Fd=uFdvdjY~d`QY^`[_^]ËVW39=6Au56Au/@< wt.t$<"u 3ɅPDYtFF< wFu_^Ã=6AuV5AW3u<=tGVvYtujGWmYY=Atˋ5AS3VE>=YXt"jS?YYt?VSP uG>u5A%A'6A3Y[_^5A%A3PPPPPv̋UQMS3VU 9Et ]EE>"u39E"FE<tBU PFCYt} t M E FU Mt2}u t utBe>< t< uFN>}t EE3C3FA>\t>"u&u}t F8"u 339EEtIt\BuU tU}u< tK< tGt=Pt#BYt M E FM E  BYtFU FVtBU ME^[t ËU S3VW96Au%h(AVS,A @6A5A;tE8uuUEPSS} E =?sJMsB;r6PrY;t)UEPWV}E HA5A3_^[ËU SV@3;u3wf93tf90uf90uW=@VVV+V@PSVVE׉E;t8PYE;t*VVuPuSVVׅu uYuS@E S@3_^[ËUAeeSWN@;t t УAeVEP @u3u@3@3@3EP@E3E3;uO@u G 5A։5A^_[Ã%%AËUVW3u蹠Yu'90AvV$@;0Avuʋ_^]ËUVW3ju u u'90AvV$@;0AvuË_^]ËUVW3u u?YYu,9E t'90AvV$@;0Avu_^]ËUVW3uu u+@ u,9Et'90AvV$@;0Avu_^]jh(@蝸3ۉ]jMY]j_};=6A}T&A9tE@ tP}YtE|(&A P@&A4補Y&AGE E\jYËU4S3EV]܈]]E ]t ]E E]EPAYEuE@u9EtME+ùtCHt(Ht I,j^0жMEt EuE@UEjY+t7+t*+t+t@u9UEEE E]E#¹W;3t(;t$;t=tT=u-ETEKEB=t4=t$;t)gJj^0_^[EEEEt A#MxE@tMMMt } t M tMs5;u!͵ 谵襵`E=(@juuEPuuu ׉E;upM#;u+Et%ejuEuPuuu ׉E;u76%AD0 D@P7Y Efu@uD6%AD0 D@VYuX@u踴 렃uM@ uMu62Ѓ%AYYMLЃ%AD$ MeHMuEtpjS6 ;u78tP6ejEP6 uf}uǙRP6; ;tjj6r ;tE(@@}uE#u M EE#;tD=t)=@t"=t)=@t"=t=@uEM#;u EEE3E@}E#=@=tq;yE;nvv+[E3HHGEjjWW6" tWWW6"#ƒ;jEP6/ ;vtj}uXEE;iWjWW6%" JWWW6"#;E%=u6Yj^0u_=uWj6 ;E>WW6n Ej[+PD=P6) ;݃ %AD$2M0 %AD$M ʀ}u!Etȃ %AD M#;u~EtxuX@juEjPuE%Pu (@;u4D@Pȃ %AD 6.Y6 %AEUSSSSSjhH@̰3}3u;;udj^0Y39};t9}tE%@tʉ}uuu uEP\EEE;t荰3u9}t(9}t %AD 6J/YËUjuuuuu !]ËU}u3]ËU MMtft f;u +]USVWUjjh@uL?]_^[]ËL$At2D$H3趏UhP(RP$R]D$T$SVWD$UPjh@d5A3PD$dD$(Xp t:|$,t;t$,v-4v L$ H |uhDID_뷋L$d _^[3d y@uQ R 9QuSQA SQAL$ KCk UQPXY]Y[tjY Atjh@j4 jaUWVu M};v;r=|%AtWV;^_uO8ur)$P@Ǻr $d@$`@$@t@@č@#ъFGFGr$P@I#ъFGr$P@#ъr$P@IG@4@,@$@@@ @@DDDDDDDDDDDDDD$P@`@h@t@@E^_ÐE^_ÐFGE^_ÍIFGFGE^_Ðt1|9u$r $@$@IǺr +$@$@@$@L@F#шGr$@IF#шGFGr$@F#шGFGFGV$@I@@@@@ȏ@Џ@@DDDDDDDDD D DDDD$@@@@(@E^_ÐFGE^_ÍIFGFGE^_ÐFGFGFGE^_ËU}u"]uj5A,@]jY̋L$t$tNu$$~Ѓ3ƒtAt2t$tt͍AL$+ÍAL$+ÍAL$+ÍAL$+ËU$A3ʼnEESEE VWE肱e=8AEu}h<@@؅=H@h0@Sׅ5@Ph @S8APh @S<APh@S@AP֣HAth@SP֣DADAM5p@;tG9 HAt?P5HA֋؅t,t(ׅtMQj MQjPӅtEu M 3<A;Et)Pօt"ЉEt@A;EtPօtuЉE58Aօtuuuu3M_^3[ËUVuWt} u?j^0_^]ËMu3f݋f:tOut+f ftOu3ufj"Y몋UUS]VWuu9U u3_^[]Åt} u貧j^0V݅u3fЋMu3fԋƒu+fft'Ou"+ fftOtKuu3fy3uM jPfDJXdf#j"YjUMx~ uA]áA A]苦]ËUA3ʼnEUS3VW;~EI8t@;u+H;}@E]9]$u E@E$58@39](SSuuPu$֋};u3R~Cj3Xr7D?=w;tPcY;t E]9]tWuuuju$օ5@SSWuuu ։E;Mt)E ;9EPuWuuu };~Bj3Xr6D?;w];thP覌Y;t 3;t?uWuuuu օt"SS9] uSSu uuWSu$@EW蝍Yu蔍EYe_^[M3艅ËUuMu(Eu$u uuuuu P$}tMapËUQQA3ʼnES3VW]9]u E@E58@39] SSuuPu֋;u3~<w4D?=w;tPgY;t ؅t?PjS WSuujuօtuPSu |@ESgEYe_^[M3\ËUuMu$Euuuuu P}tMapËUVucv'vv vvv6v v$v(v,؇v0Їv4ȇvv8踇v<谇@v@襇vD蝇vH蕇vL荇vP腇vT}vXuv\mv`evd]vhUvlMvpEvt=vx5v|-@ ݆҆dž輆豆覆蛆萆腆z@laVK@5* ݅҅Dž@ 蹅讅装蘅荅 肅$w(l,a0V4K8@<5@*DH@LPTX\ڄ`τ^]ËUVutY;8AtP謄YF;<AtP蚄YF;@AtP舄YF0;hAtPvYv4;5lAtVdY^]ËUVuF ;DAtP>YF;HAtP,YF;LAtPYF;PAtPYF;TAtPYF ;XAtPYF$;\AtP҃YF8;pAtPYF<;tAtP讃YF@;xAtP蜃YFD;|AtP芃YFH;AtPxYvL;5AtVfY^]UV3PPPPPPPPU I t $uI t $s ^ËUUVWt} u@j^03Eu+ @tOuu j"Y3_^]̋T$L$u<:u. t&:au% t:Au t:au uҋ3Ðt:u ttf:u t:au tUV3PPPPPPPPU I t $u t $sF ^A @tyt$Ix  QPYYu ËUQC @VEt {uE >'} ~0EM E>u?*u˰?~} Ճ?uE^ËUA3ʼnES] Vu3W}uZu+賛t `pa F @u^VY Attȃ %AA$uttȃ%A@$q3;g C9 B@Dž GW @} DžjugucDžW9~~=]VYt Dž5p@GPPSP5@AЋtuPS5LAYYguuPS5HAYY;-uCS*stHH[Dž'Dž5Qƅ0Dž t@tGGG@t3҉@t|s؃ځu3} Dž9~ u!u t-RPWS80؋9~N뽍E+Ftct΀90tX0@@If8tu+(u AI8t@u+@t5t ƅ-t ƅ+ tƅ Dž++ u% OtPYYt.u%˰0Otヽtu~qPjEPPu69t.EPsYYu#PEYY|2t) Ot߃tuYt3dt t `pM_^3[qÍI@ޟ@@l@@Ġ@ @<@QL$+#ȋ%;r Y$-UQQE VuEEWVEY;u NjJuMQuP@E;uD@t PYϋ%AD0 EU_^jhh@]܉]Eu葏 v Ëx;%Ari N ы<%AL1tPYeD0tuuu uE܉U ]܉]E E܋UVu<YËUWA3ʼnEE VuW34809}u3;u8eS%AL8$$?tu'Mu! 詍D8 tjjjVV>YDR@l39H P44@3;`;t 8?P0@4 3,9E#@?g $3 ǃx8tP4UM`8jEPKP Yt:4+M3@;jDSPT C@jSDP0 n3PPjMQjDQP C@@=j,PVEP$4@ @089,j,PjEP$E 4@,08<t<u!33Ƀ @D<t<uRDYf;DI8t)j XPDYf;D80E9@8T4D83ɋD8?D49M3+4H;Ms&CA u 0 @F@FrՋH+j(PVHP$4@C(8;;+4;El%?49MH@+4jH^;MsCΉ u0j [f @@fƁ@rH+j(PVHP$4@i(8;a+4;EGK4,9Mu,@+4jH^;Ms;,,΃ uj [f@@fƁ@r3VVhU QH++PPVh@;j(P+P5P$4@t (; D@D;\,+48;E ?Q(Qu448@t(D8 D@D8ulDt-j^9Du' /0?D3Y1$D@t48u3$ 8+0[M_3^Qhjh@]u資 蘇 x;%Ar茇 q ҋ<%AD0tS#YeD0tuu Sn E  ME E膇Ë]SkYËUDAhFYMAt I AI AAAAa]ËUEu芆 3]Åx;%Aro ދȃ %AD@]ËUA3ʼnESVu F @W6V]Y At.VLYt"V@V<%A0YYÊ@$$<VYt.VYt"VV<%AYYÊ@$$<VƭYt.V躭Yt"V训V<%A螭YY@t]uEjPEP4t]39}~0NxL=AD=VP YYtG;}|fE Fx Ef EVP*YYM_^3[WeáA39TAËUSVu 3;t9]t8uE;t3f3^[uMiE9XuE;tf8]tE`p3@ˍEPPYYt}E~%9M| 39]RuQVj p8@EuM;r 8^t8]fMapZԃ*8]tE`p;39]PuEjVj p8@:뺋Ujuu u]ËUu MhEMA%}tMapËUjuYY]VD$ u(L$D$ 3؋D$d$ȋd$Gȋ\$T$ D$ ud$ȋD$r;T$ wr;D$v N+D$T$3+D$T$ ؃ʋӋًȋ^UEVWxY;%AsQ<%A<u5=AS] utHtHuSjSjSj8@3[ ' _^]ËUMS3VW;|[; %AsS<%AD0t6<0t0=Au+tItIuSjSjSj8@ 3虁 衁_^[]ËUEu腁 j ]Åx;%Ara F Ջ %ADt͋]j h@_}4%AE39^u5j Y]9^uhF P@u]FE09]t%AD8 P@E 3ۋ}j 豄YËUEȃ %AD P@]jh@虀M3}j 胄Yuaj 1Y}}؃@;4%Au%A;Fu[~u8j Y3C]~uhF P@u]Fe(}u^ S@FtS@@냋}؋uj 诃YÃ}uF+4%Au}uyG,j@j YYEta %A%A ;s@@ `@E}σ%ADWYuME E[j YfQSuƒt7$ffAfA fA0fA@fAPfA`fApHuЅt7tIfIHut3tIJutAHu[XËۃ+3RӃtAJutIKuZUj <@|%A3jh@6~]u} x;%Ar} ]}ڋ<%ADtSlYeDt1SYP@@u D@Ee}t`}MC} ME E}Ë]SYËUVu~ Vu进YYE~ Pu諛YYttPuVuu uD@+ujX 3D^]ËUV5A$WPu菸 ux=tftu֋+A^]Ë+AUQW3υtL9t @9uV@jPYYuuj `Yt+P 7Yu&E^_ËUEV3u;u{{SW];tej=Sk]YY;tU;tQ3f9wEA;Au 6A;uxA9u t3;t/褹A辸yW.tN_{_[^9u;ujYA;tډ095AujYA;t0A;t+}u}FY;9346_3Y9EMM39u twj[SuaYPhYY;tZuuEYPW)o E3ɍGfM#QWh@uMXz*W_Y9utu^EY0ENG49u?NjW5A^ 5A+9uuY;}ߍG;=?zPj5A ;aU qM1AVVVVVxuJ^EY03+UuM^E MUTu}tMA#E3t3@}tMapËUjjuj]ËU}u u C`Y]Vu u u]Y3MW0uFVuj5Ad@u^9$At@VxYtvVhYx 3_^]xD@PFxY~xD@P.xYʋUM S3;vj3X;EsIx 3AMVW9]t uYVuYYt;s+VjS _^[]ËUSVW3jSSu]]E#ƒUtYjSSu#ʃtAu }+;Sj\@Px@Euyw nw_^[huYYE| ;rPuu t6+xӅuϋuuuYYuj\@Pt@3 w8u v u;q|;skSuu u#ƒDu+YP`@HE#‰Uu)v vD@u#uSuuu5#ƒ3US] Vu%A ΊA$Wy@tPtBt&tu=I L1$⁀'I L1$₀a I L1$!_^[u]%@]ËUEuyuujX]Ë `A3]WƃуtefofoNfoV fo^0ffOfW f_0fof@fonPfov`fo~pfg@foPfw`fpJutItfofvJut$t vIuȃt FGIuX^_]ú++Q‹ȃt FGIut vHuY USVu 3W};u;v E;t3{E;tvtj^0sVuM8YE9XfEf;v6;t;v WSV踜 s*s8]tMap_^[;t&;w sj"^0Is8]tE`pyE;t8]HN++ˉN~WPu  EN F =M tt%A A@ tSjjQ#ƒt-F]fjEPu ]f] E9}t N %_[^ËUS39]u3AVWu­pjVV ;tuVWe u SSSSS@p3_^[]UWVSM tMu} AZ I& t' t#:r:w:r:w:u u3:t rً[^_3PPjPjh@h,@(@AáAt tPX@̋D$L$ ȋL$ u D$S؋D$d$؋D$[%@$:Vr(8Pb 2DXt2BN\jt(4FTf (6BRdt~Y3@G@S@μ@${@@ 4@w'\MCorExitProcessmscoree.dll AxAccsUTF-8UTF-16LEUNICODEKERNEL32.DLLFlsFreeFlsSetValueFlsGetValueFlsAllocruntime error TLOSS error SING error DOMAIN error R6033 - Attempt to use MSIL code from this assembly during native code initialization This indicates a bug in your application. It is most likely the result of calling an MSIL-compiled (/clr) function from a native constructor or from DllMain. R6032 - not enough space for locale information R6031 - Attempt to initialize the CRT more than once. This indicates a bug in your application. R6030 - CRT not initialized R6028 - unable to initialize heap R6027 - not enough space for lowio initialization R6026 - not enough space for stdio initialization R6025 - pure virtual function call R6024 - not enough space for _onexit/atexit table R6019 - unable to open console device R6018 - unexpected heap error R6017 - unexpected multithread lock error R6016 - not enough space for thread data R6010 - abort() has been called R6009 - not enough space for environment R6008 - not enough space for arguments R6002 - floating point support not loaded @8@ @ @@@@@@@@@@@P@@H@ @!@x@y@z@@l@Microsoft Visual C++ Runtime Library ...<program name unknown>Runtime Error! Program: HH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSunHH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSun  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ((((( H h(((( H H  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~  GetProcessWindowStationGetUserObjectInformationWGetLastActivePopupGetActiveWindowMessageBoxWUSER32.DLL(null)(null)EEE50P( 8PX700WP `h````xpxxxxEEE00P('8PW700PP (`h`hhhxppwppCONOUT$user32.dllMessageBoxTimeoutAMessageBoxTimeoutWFatal Error in LauncherFatal Error in LauncherrbFailed to open executableUnable to find an appended archive.Unable to read from file#!PATHEXT;Job information querying failedJob information setting failedstdin duplication failedstdout duplication failedstderr duplication failedUnable to create process using '%ls': %lsFailed to get exit code of process.exe/usr/bin/envExpected to find a command ending in '.exe' in shebang line: %lsExpected to find whitespace after '/usr/bin/env': %lsUnable to find executable in environment: %lsExpected terminating double-quote for executable in shebang line: %ls<launcher_dir>\Terminating quote without starting quote for executable in shebang line: %lsFailed to find shebangExpected to find terminator in shebang lineExpected to decode shebang line using UTF-8Expected to find '#' at start of shebang lineExpected to find '!' following '#' in shebang lineExpected to find executable in shebang lineExpected to find arguments (even if empty) in shebang lineExpected to be able to allocate command line memory"%ls" %ls "%ls" %lsHA@RSDS~M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq_______CCBABADL*(%$""&GABJIIDDJC??AD_-(''%$GG#_DIJIIJIIIDIJDD_+)(''%GG _JMCEJ?ABAECA?BA_,+)('%%"!_IM@AJACDCIDI____.,++>________JMJJJJJJJJJF_..,+)('%$"! #GIMCEJJJI?J__...,+(('%$"! &_JM?AJJJJCJ__...,+)(''%$" _IMJJJJJJJJ_K=...,++(''%$! _JMCDJJJJAJ_K_______L*%$"!_I_?AMNJJEJ_ L'%$"_I_MMMMMMJJ_ _('%%_I_CEMIJJMEM _(''*_I_?BMDJEMDMF _)(-LI_MMMCMMMMM_________< ____I_CEM1;MACDMEJM__I_?A_D1@IJJMJMM_FF_I__6_@/EMMMNMM_FF_I_C80EJDMJCJFF?:AA20?_M_MIEM______MIC4BC/ N______MMMMJIDAI_9/ HJJMMJMMMJ??BAI_A7503 IJMMCBCBA44CCI___BAO;6___C_MJIDIDMI_CI___O; @__C_C?J?AJI_?A_DJJI@ O_CM?;I?JI_________H9MAIJJIJI_CD_____JJI73C;IJIJI_?AMDJJDIMJIE5:JIJI__________MMIA:IJJJJJJJJJJJJJJJJMJ???( 444MMMRRRYYY~eGuuu}}}x>iErCE~7?HVbx/!P7pLcyϏ1Qq/Pp",6@J[1qQq/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq!%///* !*/"(%%'%/) /!#''////+/+"*(/ / !%(/ ( (*/ (///) */   )*  /"///// /+/// # + !%//  +"*+'#+//+'!%*++$++!+! !!!<(0`  !!$& &"   WܱNj+<<:5pi$!!!4888&SNJFB=950,(%%%5ǎVRNIEѹ|Jq?o@ZUQMID@<73/+&"-Ɍ444"ք̴wq?]YUPLHC?;72.*%!"""4888&dya\XTPKGC>:61-)% OÑ%%%5ʎA{;ys`\WSOJFB>951,($(9|:z;xq?o@mAkBiCgCdDuZ;73.*Ǒ%%%5̎È>89}:{;yq?o@mAjBhCfD~dEuZ?:625Оa789}:{;yr>p?n@lAjBhCfD}dEB>:5^ό555"܄ѳ„7789}:{;xr?p@n@lAjBgCeDFA=9"""4;;;&ŌC89~9|:z;xr?p@mAkAiBgCIELɑQQQJnnn~~~Įq?o@mAkBiCHHH"""vvv9~:{;yq?o@mAkB:::'''___sssttt8Ϧuǣvyp?n@lA888T---6fffnddd%%%"""OOOSSSċDҧuʤv{;yr?p?xM<<r?̷999VVV###)))444ѳ͝b@~9|:z;}Cg˶Ӎ󑑑ZZZlll;;;!!!""")))___&&&2:::ppp{{{___WWWWWW:::!!!"""***www"""4888&,̑999ԖJJJ|||lll:::"""BBBXXX|||$$$6,uuuKKKCCC@@@...www* Ҍ666"KKKaaaLLLWWW@$"""4;;;&nnnfff!!!$$$999444]ttt|ȇɑ&&&5ЎvvvmmmVVV{{{OOOڥaaaCCCpppό555"ބ|||MMMfff"""4;;;&\\\Ǒ%%%5Ύݧܦ͌555"ۄۥ"""4:::&ڤÑ%%%5ˎܤׇ ww?ww??ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwwwwwwwwwwwwwww?ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwww?wwwwwwww( @ !!!0\\\JeeeQ666D555A0$ vH<602\7qڴvvvj&&&D1"gLF@;5?кVQKE?9(aV[UPJD>82-uuun{{{j`ZTOVo@lAb_YSMGB<60+%<aVmt>q?n@bb^XRLFA;5/)$Ywwwn}}}j~Cv=s>p?bba]WQKE@:4.(+{;xbba[VPJD?93-'aV~:{;xr?o@lAiBfD}dE|cE|cEiB<61?9}:z;w=t>q?n@kAiCfD}cE|cE}dFGA;=aVңi89|:yq?n@kBhCeD|cE|cELF@mzzznjʓP8~9{;yp?mAjBgCeD|cEPJ\¯mAjBgC~dEaV}:z;xq?n@lAiCJJJőPyq?n@~YVVV???wwwiiiΡkA|;y>>3@@@y~~~obbb000kkk@@@---U<<<&&&[[[6uuusssWWWIII$$$&&&qqqlllg|||s4bbbhhhƑUUU000QQQ}}}---{bbb(iiiLLLBBBaVggg+++NNN|||nj]]]tttkkkrrrwwwӦaVӦzzznjӦˉ ?????(  C﫫oIਨS=?_QF4aZмoEcaXMB70~Iq?c`VK@58z;u=qv>3Eyn@iB~dE}dFGHYYYuuuġ=xmAhC}dE}eGS444|||gC}cEMMM~>q?kAiGRRR¢Gu=xKʺ~AAAAAAAAAAAAAAAA ( h00 %   h PAPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPAD0 000&0+0@0P0^0d0k0x00000001T1t1111122 3[333333354J4V4o4|4444455'5<5Y5v55555555666)6.6@6N6S6666S7^77778'8N8888888 9.9>9999:":3:T:x::,;J;h;x;;<<<< >>$>*>;>t>~>>>>>>??? <0080M0X0y1"2Q2W2f23777u99:Q>#>;>>0<000000 111-151@11111Y2_2e2k2q2w2~22222222222222222 333$3*303F3M3T3Z3t33333333334444>4d4444455677>77777'878a8r8888888999:D:K:X:^:::::!;>;;li>p>z>>>>>>>>???0?T???@\00I0O0T0b0g0l0q000001 1D1I1P1U1\1a1o1111g2v22222222222223 333&3,393C3I3S3u33333 4&4,4B4Z4445'5_5g5555555555566 666*6/646:6>6D6I6O6T6c6y66666666666666671787@777777778e8j888888h9m99999):<:N::::::::";/;D;u;;; <5?;?H?R?`?i?s???????Pp0M0001"1k111n2z2222222233%3.333B3i33334R44455W6q666889::; <<????``R0_041>112N2v2394_4e4444475A5l55555666Y6_666667A7Z8E9]99<= ?L?x??px13333344 44445a5677"8_8n8888888:9h99999":J:%;+;<<<<<$=.=o=z====`?q?y??????0@0000000001-151@1`1i1u1111122L2U2a2z222222247555555 6K6k6@9b99999:(:K::|;;;e<<<< =<=T=[=c=h=l=p===========>J>P>T>X>\>>>>>>>>?G?y??????????????h0n0171B1H1X1]1n1v1|111111111111222L23334J445-6P66::: ;;B;T;f;x;;;;;;;;<>?8????@23z555 67Y:]:a:e:i:m:q:u:::;3;o;;*<<,=L=<>e>>,01122^2}23L3t33V4y44445h5666/7U8h8y88889$9w9999:.:9:g:u:~::: ;1;>;f;;;;<<< =+=a=k==">V>f>(?.?:?C?V?????Hg0001'1112>2V2@3G333%4R44i57777849;9p:v:{::::Hl1p1t1x1|11111::; ;;;$;,;4;<;D;L;T;\;d;l;t;|;;;;; ??TH0h000001$1(1H1h1111111124282X2x222223 3@3`333333400(5,5054585<5@5D5H5L5x9x:|:::::::::::::::::::::::::::::::::;;; ;;;;; ;0;4;8;<;@;D;H;L;P;T;X;\;`;d;h;l;p;t;x;|;;;;;;;;;;;;;;;;;;;;;;;;8<>@>D>H>L>P>T>X>\>h>l>p>t>x>|>>>>>>PK!w64.exenu[MZ@ !L!This program cannot be run in DOS mode. $Hv&ǔv&ǔv&8Ǖv&Ǐǵv&Ǐv&Ǐǝv&ǝǑv&ǔv'v&ǏǕv&ǏǕv&ǏǕv&Richv&PEdu'\"  7@@x<P d@.text `.rdata78@@.data@0@.pdata  $@@.rsrcPR0@@.reloc@@BLISMCMK SWHHHH3H$0LʺICHL$0DB3HD$ 5!H 8HHMHu,HtJHH HMHu H#LHT$0A3D$( f|$ й7̅LISMCMK SWHHHH3H$0LʺICHL$0DB3HD$ uQH *lHHLHu,HtJHH@HLHu H#LRHT$0A3D$( f|$ йkH\$Ht$WH 1HH3LLBILHt1HA;IDII+LD9Ht$8HH\$0H _H\$Ht$H|$ UATAUAVAWHH@LLHAHM8E3Le8` A̅HxHM8ED$3HM8WHM8LcAAHE3LM8E|$AIDIHHHtHMED$HHcI+HHM8AHAHE3YLM8DIHHHxAHHHHMHA薊HcHH+HyEHM8E3EH+LM8LII;AHH.AEf;uMfHM8AHE3LM8LIIAHCHHN\+M;r@fA9t M+M;sMHM8`!L\$@II[0Is@I{HIA_A^A]A\]H\$UVWH03HW.H|$` H-AHt-AE3H3H|$(Hl$ }LHT$hHL$XHT$hHL$XuRHL$X$ALH3H|$(Hl$ %u3LD$`H[JHuHL$X H\$PHH#H0_^]H\$Ht$WH@HHH#D$0LHLH׉t$(d$ 1؅u DHt$XH\$PH@_H(u VHt3H(H\$H|$UH$H H'H3HpH33LEAHHD$P HHD$ Kt|$Pu3H%M0LEA HH_3HL$pDBhCOD$phHUHH"HUHoHHUHJHH EL\$XL\$HHD$pE3HD$@Hd$8Hd$0d$(E3H3D$ uE3Hd$0HMpAD3DL$(HL$ LMpHvL3lD$hHT$XHˉZFHL$`HL$XsHL$XHT$PH|L$PH\$Hl$Ht$WATAVH HHnHE3AHHtDKft+f"t%AuH2HKPHHuHt IHHA H AH!L0HwftA4uAH5LHft AuHfD9&t Au HfD9#u AtfD#HH AHHLHf?"u)f;"AH LnfD#HHHH3AH t f"tf;"AH4L% ft%A-tfD#At HfuH]H\$@Hl$HHHt$PH A^A\_HHXHpHxUATAUAVAWH8HHH3H"f98tOHH3DfHu L-#LhAetIAEfuHX9A3f9=C9t L589 L519HHpfA4V(P#H:HHHHHH;s9 t9 t HH;rHHH@7HD$P+LAԹDD$(HD$ ΅HHcZft|PH|$Pf9t$PtAVt Hf97uf?#HA't Hfuf?!HAt HfuHT$@HHt$@HHLL|$@MHH [DIu|L7H`$H`/SfA9T$u*IL$ Z[HHMHf7HcH`HMDL3IIIɍPfIHLAIfIHHLIfIHHLIfHI\HH;HH@ƋLl$8Lt$0L QLHHL|$(Ld$ Q HIH({ffH; auHfuHH\$Ht$WATAUH0Hd$ EHHE3AHu%'%3AHtAfD9*t!HHD$PHu V%fD9.u"C%H HL$ %3LEHH}HHHH\$XHt$`H0A]A\_@SH ILHHu$c$$AHIHHt3$H [ f;tHfuf;uH3@SH H MHtH+HRHtH [@SH ̹.'̹"&@SH M*HH*H!H)H)Hr'HH [E'H;s-H\$WH HHHHtHH;rH\$0H _H\$WH 3HHH;suH HtHH;rH\$0H _H\$WH H=2PtH 'Pj/tP.HH c~uZH ?.-H7H=8HHtHH;rH=OtH O.tE33APO3H\$0H _H\$Ht$DD$WATAUAVAWH@ED%=""D%"H (OHHD$0HH O|HHD$ LHt$(LHD$8HH|$ H;rpI(H9uH;r_H<H,(HH N"HH NL;uL;tLH\$(HH\$0LHD$8HHD$ HH HH Etp#Eu&!W#AAH\$pHt$xH@A_A^A]A\_E33fE3APX33DBK̺3D9@SH /p-E3APHt7SH LH p/3u H? H [@SH d$@LD$@0HHu9D$@tT Ht J L$@HH [@SH HAHu'HCHHHHKH;tup;HHrH9CtHC \u y2HCHCuCHH [HHXHhHpHx ATH@E3IHHAMHuYHtHL$ IL\$ E9cu?H+>fAr fZwf fAr fZwf HHt@ft;f;t4HT$ :HT$ :HHHt ftf;t+D8d$8t HL$0H\$PHl$XHt$`H|$hH@A\H(3LL9Z-uwMtzHuYH(HtL+C fAr fZwf AfAr fZwf IIt ftf;t+ȋH(E3UH(H\$Ht$WH HHw|HHEH ,Hu ,E*[H \,L3HHu,9o,tH#t f [ H_#F 3H\$0Ht$8H _Mt 8tHIuIHH#@UAUAVH@Hl$0H]0Hu8H}@LeHHb H3HEE3MHHHuYo<H;rfD3IEHtTALúDt$(Lt$ .<Lcu?z*nfAr fZwf fHfD93u3II;sfD3/"]~g3HBHHrXKL$Hw1HAH;w HH(<H+H|$0Ht)HHtHIHu /IEALËHDd$(H|$ (;tLHHv e*HO9uHMH3OH]0Hu8H}@LeHHeA^A]]H\$WH@HHHL$ ILD$ HH|$8t HL$0H\$PH@_E3LMK H8IC(ICIc[H8H\$ UVWATAUAVAWH LLHL$hHMMHHT$pMtMtMu'h3H\$xH A_A^A]A\_^]H$Ht3HIL;v)HtL3IH<HHt3HIL;wIIG HtDO$ADL$`HXG At^LcwEtP I;DBEL;LHHL$hlFD)wALt$hH+HHL$pDL$`LH+Lt$hEI;rhEt 3I;v AEA HDID+ DI;EGAH;woHEELt$hI֋DtkH+vH <tXHL$pHt'ADO$HIHDL$`Lt$hHL$pHHt L3I:"5O H+3HI(OIHHXHpHxL` AUH0IMHLMt`Mt[H\$`Hu"Ht L3[:&/HuH\$ LMHINHHH3H\$@Ht$HH|$PLd$XH0A]H8LL$ MLH@H8fL$SH f;u3Ef;sHXH&LL$@HT$0D3ɅtL$@#H [H(E3MLMu-3HtHu5IHu-IfE9tEfD;tHDfEufD9t HfuH+IfE9tEfD;tHDfEufD9u HfD9ufDHH;I IDH(HHXHhHpHx ATAUAVH HHuZZB{Lc}c3ADBFxҋSu +s;L0+ktDNj֋!B@ōEH\$0Hl$8Ht$@H _H\$Ht$HL$WH A؋H3Hu-t tuH DËHH H\$8Ht$@H _H\$Ht$WH =j=HHHu3H9tuGTHSy 2RuWHHtKHtFHQHH Ht3QH;vH fH\$ E3E333 H\$@Ht$HH|$PLd$XH0A]@SH E3LHtHt MufD`H [I+AfBIftHuHufE"3H\$WH HHur FAt:LHˋTH:KSyHK(Ht lHc(cH\$0H _H\$HL$WH Hك3Hu w &A@ta.H5HH\$8H _H\$WHHL$0AMZH=fD9t31HcHǁ8PEu f9Hu3ۃv 9É$|u"= u&u"= u<:y 8H9dYH= `Xy MUy )tTD$lT$pA DEL3HHH;w2HH*H+HHHH?Ld kH [HK0H [H%@SH Hڃ}2 kH [HJ0H [H%ǴHH;r5HH;w)qH+H*HHHH?LH0H%} rHJ0H%cH\$Hl$Ht$ WATAUAVAWH05E3IE~ EHLEEEfD9:u HfD9;tAat0rt#wt-3C AA  HAfȃSytjA+ tGt>t' tuEEЃ@@@E|@uvpEubEA cTtOt K 4@t ""3t{HCHKC{C u/3H0H;t%H`H;u }duHdC+HS+kHBHC$ȉC~Dŋ cW K?t#tHHHHHkXH H $A t3ҋDBuZHHKD$0HT$0Db;D$0H\$8Hl$@Ht$HH _ffHIrSIII@rHكtL+HHMI?Iu9MIItfffHHIuMt HIu@fffffIs0HHQHQH@HQHQIHQHQHQufDHHQHQH@HQHQIHQHQHQu $TH\$Ht$WH HHuUA@t AA uaHAHH# DG$HWGGu_Ht6HtDl18AEAADm`tu ШtL`ШtA;AB؋(LHuw MH3DBUL LK ^L\0@K ^IA D0HL0 A:AK ^AAIVE`DD0 EtbK ^L09A:tQtM K ^AHE`DD09Au.K ^L0:A:tt K ^HE`ADD0:K ^LMDH 1H|$ χHcU܅|H;qLDK ^D05At A> uL0d0IcIMIHEL;A AE<A:t HIHEHL;sIE8 uI~LK ^LMHUXH 1AIH|$ u quf9}taLٔK ^D0Ht}X tD#K ^EXD1 ;I;u }X u +MHAHS}X LtLxD#HL;m K ^D0@uL0 AEHDE+}`EHuHI;rHB8`At B`Auv*u;uHcH]K ^D0Ht;HÈL0 |K ^HÈD19uK ^HÈD1:HcH+MHAHcRELmPA+DMƉD$(3ҹLl$ Du;Ë]HJ ^@E|0HҺ t fA9uL0d0IcIMIHE`L;eA AEf.fA;tfHI HE`HL;sIEf9u ILK ^LMHUH 1AIH|$ NuԂ9}L4K ^D0Ht; f9Ut@fD#EK ^D1 EK ^D19K ^T0:LI;u f9Uuf7MHHDBP Lf9Ut LfD#HL;m`"K ^D0@uL0 AEfHDE+]LmPM;tI&AD܋YɁu Amu뵋,38 HXA_A^A]A\_^[]H\$Ht$L$WATAUAVAWH ALHcu^3ۉ5 3ۅ;=LLIL=AMkXKBL tiAuW_KBD tDIՋ C`w H\$XHt$`H A_A^A]A\_H(HuBAH(H\$Ht$WH IIHMu3VHuILt$PPE3҅D$@EZ EtfD$lA@A A0T$LDt MI9A rIEtLt$PA@tMFEFA@tMcFEFLt$PA@t MyIADu A rEy A;ODt$pIHH#ʉL$LυMt 3IIcHLB09~AƈHLt$PH|$H+HDDt D8+HAD+ufD;u?A;AO|$HA;~']HcYHEHhH؋D|$HDIH ILt$PAHcHEtHMHL$0MDωL$(HMLHD|$ AtEuH ޺sHUHйgfD;uuH sHUHп-@8;uAHH$E3D-Dl$DAt+fD$\At fD$\x|$L |$L Dt$XHt$xE+D+A uLL$@LAHELL$@HL$\LƋHD$ AtAuLL$@0LAhEufE~aHAHELMHL$`Lc HME3Lc~%HT$xL$`LD$@IE3҅Ht$x-Ht$xT$@#HELL$@LAHHD$ 5E3ҋT$@x_AtYLL$@ LALt$PE3A T$@HEHSH|$HE3LUT$@A 5Lt$PA AŃItPhtCl;tXwA fA9XuIA AE AfA86ufAx4uIAfA83ufAx2uIAdfA9ifA9{ofA9luHfA9_A fA9RfA9HDT$hHT$xLD$@AD$D$E3fA*u(A>IXLt$P|$Ht$H Aō|HЉ|$HADT$HfA*u,AIXLt$PD$XA؉D$XD$X AōDHЉD$XAA;t>#t2+;t#-;t0;XuWAQAFA@A9A3DUDT$lDT$XDT$LEt$HDT$D|$HDL$hLEXE(fEEtAu=D8Ut HMHH3%H$0HA_A^A]A\_^]E3D8]t HEH\$Ht$WH A3H$<u?At69+y~-LHSDNjF;uCyCK HKcHt$8H H\$0H _@SH HHu H [4gt C@tHP3H [H\$Ht$H|$ATAUAWH0D33N3A\$ ;LcHOJ<thJBt^oH/J At3Au6A;t#Ɖt$$EuAtA;AD|$(HJ蘹pOADH\$PHt$XH|$`H0A_A]A\ù H\$Hl$Ht$WHP3IHHMu3HuۿhHtIwHL$0IsL\$0AKuGH+fAr fZwf  fAr fZwf HHt ftf;t+GDLǺt$(H\$ Ou'5@8l$HTHD$@C@8l$Ht HL$@H\$`Hl$hHt$pHP_H(E3LD9 uxHu˾XH(HtIwL+AfAr fZwf  fAr fZwf HIt ftf;t+H(H(DHHfuH+HHH\$Hl$WH0Hd$@HdHHtud$(Hd$ DL33jHctxHϺ HD$@HtaLD33ɉ|$(HD$ jt:HL$@3NxHHHu3H\$HHl$PH0_HL$@Ht HL$@軜HHXHhHpHx ATH0HE3AHuf=tHH\CfuGHc HH^HtHfD9#tSHf;=pt.HcH HHtxLHHŭuQHHcHCfD9#uH1HݛL%"L'M3H\$@Hl$HHt$PH|$XH0A\E3E333Ld$ HH 苛L%H\$Hl$Ht$WH j3HHtLf9tHf9uHf9u+ǃHcHE HHtLHH'HHSjHH\$0Hl$8Ht$@H _H\$WH Hc9u ǃ*9u ǃ9ǺD‰AЉ LIIAH3H\$0Hl$8Ht$@H _H\$WH 39=u HlHwHHD؀; w ;t3t);"u 3 LtHH< w HÊuHH\$0H _H\$Hl$Ht$WH0=uH3Hu<=tHH\uGHcHH-HtHa;tPH;=pt.HcHHHtsLHHr#uKHHcH؀;uH HH%H'.3H\$@Hl$HHt$PH0_Hd$ E3E333.H zqH%mHHXHhHpHx ATAUAVH Ll$`MIAeLHAHtLI3;"u3@"HË9AEHtH3HËIJtAEHtHH@tu@ t@ uHt GH3;; t; uH;MtI<$IA3H;\t;"u6utHC8"uH 33҅Ht\HAEutOu< tG< tCt7lIHttHÈHAEH tHAEAEHYHtHAEMtI$$AH\$@Hl$HHt$PH|$XH A^A]A\H\$Ht$ WH0=uH=,A3HbHH=nHt;uHHD$HLL$@E33HHD$ Hct$@HH;s\HcL$HHsQHH;rHHHHt8LHD$HLL$@HHHD$ gD\$@H=A3DH\$PHt$XH0_HHXHhHpHx ATH@aE3HHHfD9 tHfD9#uHfD9#uLd$8H+Ld$0HL3DK3Dd$(Ld$ aHctQH+HHtALd$8Ld$0DKL33ɉl$(HD$ Gau HߑIHaH H a3H\$PHl$XHt$`H|$hH@A\H\$WH H˞Hd$0H2-+H;t HHvHL$0`H\$0`DI3 `DI3`HL$8DI3`L\$8L3HL#H3-+L;LDL>IL<H\$@H _̃%1HHXHhHpHx ATH =3HAH蔓HHu(t$,`=fDD;AAGA;uHl$8Ht$@H|$HHH\$0H A\HHXHhHpHx ATH 3HHAE3HHHHu*9v"_DD;AAGA;uHl$8Ht$@H|$HHH\$0H A\HHXHhHpHx ATH 3HHAHH,EHHu/Ht*9iv"_DD;QAAGA;uHl$8Ht$@H|$HHH\$0H A\H\$Hl$Ht$WATAUH 3IHALLHIsEHHu/Ht*9ܿv"^DD;ĿAAGA;uHl$HHt$PHH\$@H A]A\_H\$Ht$WH03O苲_\$ ;}eHcHH<tPH At;tlj|$$|1HH H0]H H ZLI$돹 H\$@Ht$HH0_H\$LD$HL$UVWATAUAVAWHH3AAHEDg}@}XH}Et}ADeDHMG)u@u9EtE AA#At[tAt8`8 6­H$HĀA_A^A]A\_^]D@tuA@EM`DuAt-t#tt@uE;A AA׋ƹU#AtFA;t9=t*=t=t,=t(=t;t$EA AEṀMAtn"EhADȉM@@tAUĉMDu sA ȉM@ t @tM9u!8 ҬǬHE@DEHMPEH|$0D$(LMADd$ `[HEHA#;uC@t9EDEHMPAH|$0D$(LMADd$ Du [HEHu:Hc L5HHHkXIƀdYC8HfZuKHc L5pHHHkXIƀdXȋHMXu觫 A;uA@ uAHU 5Hc L5HAHE IHkXD|Hc HHHkXIƀd8A$HEEAtu EŃGEȃu&8tM G HUAf}Muf}uHcUȋ @tċ E33tAE"@@u E#u  #;tC=t)=@t"=t(=@t!=t=@uDEX#;u DmX@}XA@D}}Aǹ#=@ =tp;{ErE;vAv-A]MXDFE E3V%Ht̋ E33E%H HUAwA;tua}u D@DEXE=u >=u E3APDmX E332=EtxE;A E3$H E33l$Hu>EA IcEHTE+-DE;D}AHc DeXHAHHkXIƀd8Dd8HcHƒHHkXI Ƌƀd8D8@8}u @tHc HHHkXIƀL A#;AHMTEDEHMPH|$0D$(ALMD$ AVHu5TݧLcIAHMkXIBd n2rHcHʃHHkXI H -E3E333H|$ 5H\$WH@d$03H|$pHu触3Htك|$xtAtDL$(DD$ DLHHL$0؉D$4|$0t,t!HcHHH0HkXH€dE3rjH\$PH@_H8ADL$`ELD$(HL$ DAIH8Mu3ftf;u HHIu +H(軩Ht 輩%tA@AH轄ffLH+Irat6t  IȈHtf IfHt  IHMIuQMItH HHIuIMuI@ HIuIffffffffffffI sBH LT H HALQHD LT IHALQuIqffffHr  D @HuH@L LT L LQLL LT LILQLL LT (H@LILQLL LT LILQuIIq $fffffffffffIIrat6t HɊ IȈtHf Ift H IMIuPMItHH IHuIMuIHɊ IȈuIffffffffffffI sBHD LT H HALQHD L IHALuIsfffffHw H D @uH@LL LT LILQLL LT LILQLL LT H@LILQLL L LILuIIq $H(HunHH(LH 3H(H%Q̹RffHHHtfHt_uI~IHMHLHI3I#tHPtQtGHt9t/Ht!tt uHDHDHDHDHDHDHDHD@SUVWATAUAVHPHڍH3HD$HALL蔧3H9SHH iOHHHiHNHzHNHiHHMHNH`iHHMHNH iHHΰMHwNLHŰHt"HhHMHONHHHLH;tbL;t]HMH mHMLHt#~4AMLHIŃ?u;*uLHձ?у;uD#H\$@Hl$HHt$PH A]A\_H\$UVWATAUAVAWH$0HHv{H3H3HHL$pHT$hHMIMD$dDD$XD$DD$LD$\D$Tn贎E3HEHu,裎0E3D8]t HEAC@L JHH8A;t(t#LcL JIAHMkXM ^ LL JA@8u)A;ttHcHƒHHkXI ^B8t,yE3D8]t HEA$E3HT$hHtD"ADT$@DT$HELUEH]AHHT$hAD$Hl$$OxHEHHHMHȃtH;\$ |@HcOHOx&Hf1HcGHGxHf0H HHL$0H3RH\$pHl$xH@A\_^H Ud3HH9 HHXHpHxL` UHHPE3IHHHtMtD8"u%HtfD!3H\$`Ht$hH|$pLd$xHP]HMI-WL]E9cu#HtfD8et HEHUHMD A~0A;|+IAHLǺ D$(H\$ #HMuHc H;r&D8gt D8e6HM&v*D8et HEAAHAQLljD$(HEH\$ HA# E3@SH@HL$ VHD$ DH@BY%|$8t HL$0H@[@SH@HL$ 3UHD$ DH@BY%|$8t HL$0H@[H\$Hl$Ht$WH Hڅxg; 's_HcH-HHHkXHDH<u;=au%tt u 7$HDH35u Ju H\$0Hl$8Ht$@H _H\$Hl$WH xq; siHcH-wHHHkXHDDtEH<t>=/au'tt u 3#HDH 3t t H\$0Hl$8H _H(urt Jt Mx1; Ďs)HcH HƒHHkXHDtH(t t sHH(HHXHpHxL` AVH HcLIL5RHkXK4|3 u4O v|3 uHL3[!#D3 utK HL$!H\$0Ht$8H|$@Ld$HH A^HcH ʍHƒHHkXHHLH% H\$Ht$H|$ATAUAVH@HDE3^ uuu3Hc|$$@LcJHH\$0JH H;C{ u< u{ u!HK> u DhDl$(C btEudHK Ct HKHHEu?CH3LK+H.袋.HLIIH?LDDd$ HXHHjD;XJHD$0HtsHcL4IЃ% I H H;s@H0@ ` HXHD$0|$ HcHHHkXID[DD|$ AsAH\$`Ht$hH|$pH@A^A]A\H\$L$VWATH Hcup ;=is}HHHL%ZHkXILtWIDt+;Hu 3ۅtprp Yp oH\$PH A\_^HHXHhHpHx ATH0IcIDE~HIHHcD$hH|$`~ HHt tD$(DLƋAH|$ +ظHHDH\$@Hl$HHt$PH|$XH0A\H\$T$UVWATAUAVAWH03LHuionL!M=IJLHL;f9hH5xoDAH;5rouo3HHuZHH9uHcHHHuH MHEHtH+H1 HHH/Hu3H/|$xH5nHHntIHtDKH oyy6tpenH$H0A_A^A]A\_^]Et3Hu#H膼HonHtH(H5pnHu aHZnHtH(H5KnHHtHM+HILl$pMcHtE=MHI׮3ɅuHfB94hfB9 hHHHuH5mH+HE3L9mHcHLLEtfL9ltHLHHHDHL9luHcHH;H tmAHt{rH5[mH+HsLdM.\EyߍG;tLcHL;^H蔼HHHcL$LlM.HlD9l$xtuI.H JHHtUIMHH[]uQHD$pHHGfD*HEIEou#l*HYKEt ILKM.E3E333Ll$ jI%KM.H\$Ht$WH@HHL$ AA|KHD$(DA|utHD$ H@BY#3t|$8t HL$0H\$PHt$XH@_̋AE33rH\$Ht$WH HHHu HBMjHu^J\HwCH yHHDL3L)HHuo9ytPHpt+HvHpj 3H\$0Ht$8H _jHMjjH{4jHH\$Ht$WH 3HHHt3HGHI;sEj 3=IHtHHHHHtH;sH+H 3L1HH\$0Ht$8H _HHXHhHpHx ATAUAWH H33DGiLHtPDG3ҋSHt=HH+HAWHEHHu1ji _iH\$@Hl$HHt$PH|$XH A_A]A\úDDI;HEMNjCt HH+H~%i8u h HAԋ LH3+Uy]E3HՋnHTQHHHHHu%h hHvHE3IՋH3H\$LcHՂMAIMkXJ BD8F\ADA@tXtHt(t uHBLJBd8BL80BLJBd8BL8BdBLJ Bd8EuA%@H\$H(Huvgg w3H(H\$fDL$ UVWHH`IHHHuMtHt!3Ht IvgfdHU@HMFL]A{E8f;vJHtHt L3Hf*f}t HMH$H`_^]Ht0Hu)uf_"f@8}eHMUHt}HEe(AKHE(HD$8Hd$0LE8A3҉|$(Ht$ t}(3HtzHtHt L3He"Be}HEH8Hd$ -H8fL$H8H |eHu IH jeHu%Hd$ LL$HHT$@A9tD$@H8H\$Hl$VWATH DHH谑SHc‚ud K 8@t d"3t{HCHSC{C u/[H0H;t[H`H;u -uHC+HS+kHBHC$C~DŋW SRuntime Error! Program: HH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSunHH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSun  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ((((( H h(((( H H  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~  GetProcessWindowStationGetUserObjectInformationWGetLastActivePopupGetActiveWindowMessageBoxWUSER32.DLL(null)(null)EEE50P( 8PX700WP `h````xpxxxxEEE00P('8PW700PP (`h`hhhxppwppCONOUT$user32.dllMessageBoxTimeoutAMessageBoxTimeoutWFatal Error in LauncherFatal Error in LauncherrbFailed to open executableUnable to find an appended archive.Unable to read from file#!PATHEXT;Job information querying failedJob information setting failedstdin duplication failedstdout duplication failedstderr duplication failedUnable to create process using '%ls': %lsFailed to get exit code of process.exe/usr/bin/envExpected to find a command ending in '.exe' in shebang line: %lsExpected to find whitespace after '/usr/bin/env': %lsUnable to find executable in environment: %lsExpected terminating double-quote for executable in shebang line: %ls<launcher_dir>\Terminating quote without starting quote for executable in shebang line: %lsFailed to find shebangExpected to find terminator in shebang lineExpected to decode shebang line using UTF-8Expected to find '#' at start of shebang lineExpected to find '!' following '#' in shebang lineExpected to find executable in shebang lineExpected to find arguments (even if empty) in shebang lineExpected to be able to allocate command line memory"%ls" %ls "%ls" %lsRSDSS0BI9 ~EC:\Users\Vinay\Projects\simple_launcher\dist\w64.pdbd 4 R p8Bej~2042 p d4rp8!!"  t d T 4 r- 5td 4 3 rPc0  4 rp  b 42 p`P  t d 4R8++.42 p8./H d T 4 Rpbd42p822H  t d 4R83X4bf4{4b  4 2p42 p855H  4 p86T7}T7   d T 4 rp dT4 Rpd 4R p8?A. d4 p Pctd42td428;FyF B8FFF d4 R p8HI  4 2p8fJpJJJ42p8 L9LKLL t d 428MPN- B8OOPO- dQTP4OJpc@/ td4Pcp2P  4 2p8VVr4r p`Pc8  t d 4R8Z[r208S_i_4  P td4Pd T42p  p ` 0 P d 4 2p8op tT44 2 p `8tu0 4 p`Pc t d 4 R8.GdT 4 pT 4 R p t d T 4R4 2 p `8+d T 4Rp t d T 42d 4 R p  4 2p t dT42 d T 42pd 4R p8$ $4$p`PRP  4 rp8Ԝ  p`P0cH- Etd4C PcHd4 p- 5td43r Pc0d4 p2 0  20dT42p0 4dZ p`Pc4 2 p `8I}6 %4q%f p`Pc 4 2 p `8!T4r p `c0 td 4 Pr0dT42pT42 p  td428U td 4 r8 4pU4 2 p `8' 4R p ` Pd 4 r p t d T 4244p ` P  bT 42 p `d 4R pd42 p  4 Rp`P2 p0c02  p0c0 d T 42p+t4430 Pcp  td4rP7 &t&d&4&PcBH#`!#!!!!!!!!"."J"\"r"""""""##(#:#''''#######$$6$T$h$|$$$$$$% %8%H%V%d%n%~%%%%%%%%%&&"&.&@&N&`&z&&&&&&''"'0'<'L'^'n'''l#V#x#ExitProcessGetCommandLineW+SearchPathW~SetInformationJobObjecthFreeLibraryCreateProcessWGetCurrentProcessWaitForSingleObjectmGenerateConsoleCtrlEventAssignProcessToJobObjectdFormatMessageWGetExitCodeProcessGetModuleFileNameWQueryInformationJobObjectiMultiByteToWideCharCreateJobObjectAkGetStdHandleGetLastErrorLGetProcAddress>LoadLibraryA;SetConsoleCtrlHandlerDuplicateHandleRCloseHandleKERNEL32.dllPathRemoveFileSpecWEStrStrIW:PathCombineWSHLWAPI.dllGetModuleHandleWDecodePointerHeapFreeHeapAllocpGetStringTypeWGetCommandLineAjGetStartupInfoWTerminateProcessUnhandledExceptionFilterSetUnhandledExceptionFilterIsDebuggerPresent&RtlVirtualUnwindRtlLookupFunctionEntryRtlCaptureContext%RtlUnwindExEnterCriticalSection;LeaveCriticalSectionInitializeCriticalSectionAndSpinCountEncodePointerDeleteCriticalSectionALoadLibraryWZFlsGetValue[FlsSetValueYFlsFreeSetLastErrorGetCurrentThreadIdXFlsAlloc4WriteFileHeapSetInformationGetVersionHeapCreatexGetCPInfonGetACP>GetOEMCP IsValidCodePage/LCMapStringWReadFile|SetHandleCountGetFileTypetSetFilePointergFreeEnvironmentStringsWGetEnvironmentStringsWGetModuleFileNameA WideCharToMultiByteQueryPerformanceCounterGetTickCountGetCurrentProcessIdGetSystemTimeAsFileTimeSleepCreateFileWHeapSizeGetConsoleCPGetConsoleModeSetStdHandle]FlushFileBuffersdCompareStringWeSetEnvironmentVariableWHeapReAllocaSetEndOfFileQGetProcessHeap3WriteConsoleW2-+] f@`@@`@        ! 5A CPR S WY l m pr   )    P@P@P@P@P@P@P@P@P@P@ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ7@`y!@~ڣ @ڣ AϢ[@~QQ^ _j21~Cp@l@h@d@`@\@X@P@H@@@0@ @@@@@@@@@@@@@@@@@@@@@@@@@p@`@X@T@H@0@ @ @@@@@@@@@@@@x@`@X@P@H@@@8@0@(@ @@@@@@@@@8@@@@p@`@H@0@$@@@@@$=@$=@$=@$=@$=@B@@@ @0=@?@@@@ ..B@B@S@S@S@S@S@S@S@S@S@B@S@S@S@S@S@S@S@.x @h @KA,D-08pxHxp@DMPf1 4  s""""#X#U#X###%%%p%b&&k(l(((((+++0+++J,XL, -p -../`/604801111Z2d\222334455~5 5557<77p78d8:l:;;;p;W<X<<<??/A8ABBBpB'C(CFCCCpCCpCD0DTD`DxDDDDDDEEEdEFFF FGDG%GpXGIdIII Jp JJJHK HKlKlKLL!M$MgMhMrNtNNpNN NN N2O OP,0PRLRRpR*Sp,SS STTdTTDVpDVVWW\WZZ[[\p@]^^____a`(d`Ja4Labbbbcc5cp8cccdP deXefpfgh#ot$o?p@pfpphpppssZt\t;uM[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq_______CCBABADL*(%$""&GABJIIDDJC??AD_-(''%$GG#_DIJIIJIIIDIJDD_+)(''%GG _JMCEJ?ABAECA?BA_,+)('%%"!_IM@AJACDCIDI____.,++>________JMJJJJJJJJJF_..,+)('%$"! #GIMCEJJJI?J__...,+(('%$"! &_JM?AJJJJCJ__...,+)(''%$" _IMJJJJJJJJ_K=...,++(''%$! _JMCDJJJJAJ_K_______L*%$"!_I_?AMNJJEJ_ L'%$"_I_MMMMMMJJ_ _('%%_I_CEMIJJMEM _(''*_I_?BMDJEMDMF _)(-LI_MMMCMMMMM_________< ____I_CEM1;MACDMEJM__I_?A_D1@IJJMJMM_FF_I__6_@/EMMMNMM_FF_I_C80EJDMJCJFF?:AA20?_M_MIEM______MIC4BC/ N______MMMMJIDAI_9/ HJJMMJMMMJ??BAI_A7503 IJMMCBCBA44CCI___BAO;6___C_MJIDIDMI_CI___O; @__C_C?J?AJI_?A_DJJI@ O_CM?;I?JI_________H9MAIJJIJI_CD_____JJI73C;IJIJI_?AMDJJDIMJIE5:JIJI__________MMIA:IJJJJJJJJJJJJJJJJMJ???( 444MMMRRRYYY~eGuuu}}}x>iErCE~7?HVbx/!P7pLcyϏ1Qq/Pp",6@J[1qQq/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq!%///* !*/"(%%'%/) /!#''////+/+"*(/ / !%(/ ( (*/ (///) */   )*  /"///// /+/// # + !%//  +"*+'#+//+'!%*++$++!+! !!!<(0`  !!$& &"   WܱNj+<<:5pi$!!!4888&SNJFB=950,(%%%5ǎVRNIEѹ|Jq?o@ZUQMID@<73/+&"-Ɍ444"ք̴wq?]YUPLHC?;72.*%!"""4888&dya\XTPKGC>:61-)% OÑ%%%5ʎA{;ys`\WSOJFB>951,($(9|:z;xq?o@mAkBiCgCdDuZ;73.*Ǒ%%%5̎È>89}:{;yq?o@mAjBhCfD~dEuZ?:625Оa789}:{;yr>p?n@lAjBhCfD}dEB>:5^ό555"܄ѳ„7789}:{;xr?p@n@lAjBgCeDFA=9"""4;;;&ŌC89~9|:z;xr?p@mAkAiBgCIELɑQQQJnnn~~~Įq?o@mAkBiCHHH"""vvv9~:{;yq?o@mAkB:::'''___sssttt8Ϧuǣvyp?n@lA888T---6fffnddd%%%"""OOOSSSċDҧuʤv{;yr?p?xM<<r?̷999VVV###)))444ѳ͝b@~9|:z;}Cg˶Ӎ󑑑ZZZlll;;;!!!""")))___&&&2:::ppp{{{___WWWWWW:::!!!"""***www"""4888&,̑999ԖJJJ|||lll:::"""BBBXXX|||$$$6,uuuKKKCCC@@@...www* Ҍ666"KKKaaaLLLWWW@$"""4;;;&nnnfff!!!$$$999444]ttt|ȇɑ&&&5ЎvvvmmmVVV{{{OOOڥaaaCCCpppό555"ބ|||MMMfff"""4;;;&\\\Ǒ%%%5Ύݧܦ͌555"ۄۥ"""4:::&ڤÑ%%%5ˎܤׇ ww?ww??ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwwwwwwwwwwwwwww?ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwww?wwwwwwww( @ !!!0\\\JeeeQ666D555A0$ vH<602\7qڴvvvj&&&D1"gLF@;5?кVQKE?9(aV[UPJD>82-uuun{{{j`ZTOVo@lAb_YSMGB<60+%<aVmt>q?n@bb^XRLFA;5/)$Ywwwn}}}j~Cv=s>p?bba]WQKE@:4.(+{;xbba[VPJD?93-'aV~:{;xr?o@lAiBfD}dE|cE|cEiB<61?9}:z;w=t>q?n@kAiCfD}cE|cE}dFGA;=aVңi89|:yq?n@kBhCeD|cE|cELF@mzzznjʓP8~9{;yp?mAjBgCeD|cEPJ\¯mAjBgC~dEaV}:z;xq?n@lAiCJJJőPyq?n@~YVVV???wwwiiiΡkA|;y>>3@@@y~~~obbb000kkk@@@---U<<<&&&[[[6uuusssWWWIII$$$&&&qqqlllg|||s4bbbhhhƑUUU000QQQ}}}---{bbb(iiiLLLBBBaVggg+++NNN|||nj]]]tttkkkrrrwwwӦaVӦzzznjӦˉ ?????(  C﫫oIਨS=?_QF4aZмoEcaXMB70~Iq?c`VK@58z;u=qv>3Eyn@iB~dE}dFGHYYYuuuġ=xmAhC}dE}eGS444|||gC}cEMMM~>q?kAiGRRR¢Gu=xKʺ~AAAAAAAAAAAAAAAA ( h00 %   h PAPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDȬج(8HXhxȭح0 0ȧЧا 08@HPX`hpxȭЭح (08@HPX`hpxȮЮخ (08@HPX`hpxȯЯد@PXxؠ08@HPX`hآ (8@HPX`hpPK!z t64-arm.exenu[MZ@ !L!This program cannot be run in DOS mode. $z)))薜()薚(o)薛()()()()薞()))I()I`))))I()Rich)PEdb" (84@ `H\<T D JTJ8.text, `.rdata@@.data8%p R@.pdata ^@@.rsrcTVl@@.relocD@B0@AT_{011"@1@GI>c2 __S[cks{CsP@uXAw`ByhC{pDa(@@?{EsDkCcB[ASƨ_S[cks{CsP@uXAw`ByhC{pDa(@@?{EsDkCcB[ASƨ_ T!_ "Tb6 ` b6 ` b6"@9b9_BTBcT! BT? @aT @`T L$ L!@!`` Ld LB"Tb06 @" A$B&C!!@!``b dfcBbTb06 L` Lb(6 L`Lb 6 pL`pLb6 p `p b6 ` b6 ` b6"@9b9_!!_ T6!c ` ` 6!c ` ` b6"_8b8_BTBT!BT? @aT @T! @L!$ @L!!c` Lcd LBT!&C$Bc" A @!!fdb `BbT06!c @L` L(6!c @L`L 6!@c@ p@L`pL6! c p@ `p 6!c ` ` 6!c ` ` b6"_8b8_{S[cks!@SP@UXAW`BYhC[pD](@?@BsFkEcD[CSB{A_@xb 4@7 @`T,@_?Tt@Lqn"&"4@| ՠtLqn"&5@`N!Npn&BR@_!@ˢ$@x4!T$@x5ѠA_`7? #T @T,@_?Tc@ˠt@Lqn"&4!˥? CT#CtLqn"&4caT!@T! ˥ˠtLqn"&b4$@xB4!TA_c@ˢ$@x"4!TclT_@8 4 @@T,@_? Tp@L1n"&4@|pL1n"&5@a N!N0n&B R_֥Ѡ_!@ˢ@8B4!T ?@#T @T,@_?lTc@ˠp@L1n"&4!˥?@CT#DpL1n"&B4caT! @T!@˥ˠpL1n"&4@84!T_c@ˢ@84!TclT_C11@c1_1@1@c0TC_ {C{A_Q @s/3CT_t1@?@?T_ NNNN_Tf ib8 * $! )&&&&&&&&&&&&&&&&@q @! @! _@q @! @ _@q @! A9_@q @! _@q @! _@q @ _@q A9_@q _H@ qL@qL_R_TIE)@LTB@_H @TAB@qLIF     )@!LTB@B_+T@LBT__@lTChhb8c`(($TJ ) @ $Z_@(@Tc  `$Z_D@(D@Tc `$Z_@8(@8`$Z_@(@Tc  `$Z_D@(D@Tc `$Z_$@x($@xTc`$Z_@8(@8`$Z_@(@Tc  `$Z_D@(D@Tc `$Z_$@x($@xc`$Z__@(@Tc  `$Z_D@(D@c `$Z_@(@c  `$Z_@(@Tc  `$Z_@8(@8`$Z_@(@Tc  `$Z_$@x($@xc`$Z_@(@Tc  `$Z_$@x($@xTc`$Z_@8(@8`$Z__+TB(($!T_ !T(($aT_ aTBjTB_@mTB @(@TB lT TB chhb8c`J ) @ $Z_c  `$Z_ΐ|ؚtl\JH_S {@{ @SŨ_S {@- q{ @S¨_S[{@ q{@[ASŨ_S {@h{ @SŨ_S {@q{ @S¨_{ 5 @R1 uM@ R? {Ĩ_{5@R M@ R?{Ĩ_S[c{89* h(@ q"ѓ{cB[ASè_S[{ )!)C; q @BRRn @ R|@ @Q?q3*d @ !#@$@c @h%h~@ j3$Ҩ# R K?q @4*RG @!j#!yh&@cj@h%~@ j3/"D)R @( sB(*( @ !K#С^Ё2B`5iQ @?q!R @ !3#FhBҁ24s"T @ {è@[ASè_S[{RR6Р@2R?44R$AC&!@* @!S5 @ac @@2R?5ca `4R @!q2{è@[ASè_{qTQqT(B`(H@R!R y @I? R{_{U@?ր4qaT@T@"R!R? R{A__S{  7g  {S_S[c{R  R @R TS TTS TTdT@ T@ ?@@?@`?R 5 R 2 XTA@ ?ҿWTA@@?ҿVTA@`? (T=@?A@ ?ֈ HT=@?A@@?h HT=@?A@`?{cB[ASè_{S[C <S_q$(@T+@t}@ _ T(+ F vtbbT҈@hT`CDs"T5 \)@ R?Q qTE@?C[BSA{è_S[C"{CI@?(1V( @VDR!R?֠4#@ RAq@TRh@RVD!R 2 @i?}}}}}}1@?g@rT@ ?@@?@`?!g@G2g[Q@R$R?ր55@?1@*RCRR?CRL!@@VD?;@@y8(@!R?!U=@@?9@@R?Y@@?CM@#@?S[{YAB?s`@y4q@TR 5ZAB`"?s"8qb@y4R `4 RR! .@x4R* @5h@y4R* `5h.@xh5`@yR `4ys @yqTh@yqys `4>@yqTh@yq `@y4R `4ys h@y4R* `4h.@xh5{@[ASè_S[c{@?@yqATqJR RAS @y4R*w `4.@xh5()%@ R?ֈ@y |@q`T )  Rz)x*H(9!xj BT 8?5qT?)qT CTѿ!"e-@K9 RcR R?"*qUh~!Tci)xc3@y4R** `4h.@xh5h@y !#qAR* `4h.@xh5h@y !a$q4R* `4h.@xh5C A%# @&5 UA?֨>@yqTARy QA ?yh4(-x5y-h4H-x5yLh4(-x5y+h4H-x5H A*AKt"/''""c C@R`>C_{R{_C@`>C_{ RV $*i% RS4*Z*!54!i %SH4E#5R{A_R{R{_{y&%{_S { RS( 4RC9dS4BNq` Th5(RB!A 3#`4RBa ! #HRB5RC9*qh@SH4s@aA?AR`?eh@Sh4`@$"$@z$@h*ZS4U5#R R* *OS4C@9H5#*{¨ @S¨_R?R=*#*#{{_{`4,!9 @H_hK ȩ5`T!9H_hK ȩ5;R{_ R{*Hy9q)R)I99Sh5R&S5R R{_S{4z9*h5qTu4s5(A9%5(9%4R (A9))9 )*) * (R:9 R{S_֠R{IR (@y kT,=@*, RH@ kATH1@y-qT ),()@y a) @y,) _ @TI @A)TH @  A)TJ jR H%@h6R RRR{¨_{S45(!9ȿ;{A_{(y9S)SH45*%*B R{A_{)()GaT$ A9%q`{A_{Z{_S{4@sXAT c ?@) (? @ |@) ? @ |@) ?#@C@ @H  @?X(( {èS_ 2-+3-+R_ R_R_(A:( (:_{V@ @  {_(@q_(_(_`>_{A ?֠@yIR k!T<@ R (I@? kaTH1@y-qTH@9qTH@h4 RR{_'(! S{@)h@ kTh@q!Ti"@H(K q T?kTR{S_ֲ@$csm @S[{a< 5<!!BTt@bA?ր?#T{[AS¨_S[{< 5<!!BTt@bA?ր?#T{[AS¨_(Eq_@y-<S54|= A  `N `N+>N7)>N S%Ț*`TIh 86<`N0:n>N1 `N(>N  H!Q qS%ɚ( @T  J(>N )(}@Ӊ H AIh5F N |=  `NsnR `N1 `NN>N/>N7 SI>NJ%Ț(>N  ( `T  ki _ k+T-T(}@ $(!Q qSJ%ɚHI?TT K}@ Ap<`NsnNQ:n(>NHR `NH>Nh H>N )(}@i H+Aj@y_ k`_S[ck#{f@@ ˨@h6 y@52A9HJ@?qZ@ R jT@kBTaжR4@_C(T @_C("T@4@q T*@"C( c`7qmT@) kThA` o_ 4sAaA?!R`?@"R @ C(@@"@@!C(h?} @@kTRB@@˟ kT *R4 *@_C(#T @_C(T@r`T R4R4R4R+@B(T @B("T@@ kT @ @ kTk kT * kT @@4B(@z!T *@J @ R"C)S@ * @ k *T R{è#@kCcB[ASŨ_csm{Sh5RSh5 R{_{Sh5 R{_S{C9@ kT@qT @  K qT@ @4@)@@ 6 @4@4@ @aA?`?{èS_ csm  {{_{ {_;@T_{`{_R#S[{@1aT8 ?*@ ? T@  ?`5 @ ȳ ?4(hz@  ?J * ?{[AS¨_{a( ?1T;  ?֠4(hz RR{A_{`@1T ?h R{A_{=(a RR ?4 HiO R IiR{_S[{jO4=sQ`R ?jO Qj35 R{@[ASè_S{ 3%RA{¨S_U{@T%R*N*S{q%R"Lh@*H6"R*%gh@;rTh@(9~@j@), F @yk ҩ!h@"9Oi@;?rT_q!Tyk!*@96yk!*96a@gh@; SH50%Rh@;6 _qATA{S_S[ck#{*~@);F @h{z +! (Ix9q6h@h5L }@h@*i@h9U 7V>ԩ֚>BR*p%aT`@*h@;Sh4 S?q*HH#R*X%aT!lTh@;S4h@;!Sh5@o"h{z @)! *@9 6 S?q*HHV> ֚(֚  {¨#@kCcB[ASŨ_{S[ck  $s/<h@*h5Ii"@ R*)*I@)3F@hzuWA"!@ %hzu"I@? AT@@ R# ?4R*$`@B( T#,A(# _ BTH95qT_ "TH9)qTJS8J)kJT#H@kDcC[BSA{Ũ_H *S_q( T *Aӟ %@x)qkaT` 郈 8J)q_ aT_ֲT(S[c{ K(s @tTuWRRR=* RR\8x"828B8R8*I *9?qcT!TR({cB[ASè_S[{@t T?ֵ"aT6({[AS¨_S[c{* @qcT#(R} R{¨cB[ASè_RRR(ҿ 87E k+TzsH z3RRg(*E s  |@(*F)@yj ! i!(S[c{*7(EkbTh~@)6F@zu "*@_TqT34qT qaT`@   ?zuR"4l#(R_#{cB[ASè_ |@(*F)@yj ! iA(S[c{R'R8qTs6!3*HE IufS*~@ F +yj(Rh9R'*{¨cB[ASè_@T@9H6! ?ֈ@9(6A ?ֵ@"  ɚ ~@ F  @ Hyli! (R(9Hyli! -sS[{*S7(EkTh~@)5F@zt "I@96H@ TqT34qT qaT`@   ?֨zt R"*"(R"{@[ASè_{1T""(R 7(EkT |@(*F)@yj +! i@9i6`@""(RV{_S[ck{hOh5@R qiR(h}@&&GhRh`Ҳ&&Gh 7tR 9RR`(GF@j(ziI!+@h  HTy"sbQ5R{kCcB[ASĨ_ |@ ! _S[{,*')tRG`jh%*Gijh @?s"Q5G&{[AS¨_! A S {*T"R{¨ @S¨_h@y4@y5"RC* @"R*3+s @* @{!RR R`!@R{A_S{!Rh@;5 S4e)*)d`6`@`&)*{S_S{ 3!Rc{¨S_h@;1 Sh4)q*r*{ <SR?k3<S`T?qTEA yix  C'y"R#yK R*4#@y R{¨A__S[c{*B,@AaA?*`?{cB[ASè_ @ hG*)3-ʚS*R @ ШGjlR K ,Ț( ʨ-ʚ_S{ @ *@*{¨S_S{ @*@*{¨S_{S[cs!R?T5s @x9c9SW kCyS9OS#*V6Ts5 @T73bTWs69 @@Tj(8SB(%@9S4@HC yI*.cC[BSA{Ĩ_t @!T38{S[c RV@T5 @x9c9SW kC9yS9OS#*V6Ts5 @T73bTWs6y @@Tz(xSB$@9S4@HC yI*cC[BSA{Ĩ_t @!T3xS {TF RRB3hTBhT Rf+uRB$3R҇$*{ @S¨_S {T RRB3~hTBhT R<+uRBb$3R]$*{ @S¨__qT_ qDLz T_4q T(S QR? j RR__q@T_ qTH0QqiT(<S ~ QR? jT RR_ 0B `@,BA h $ R 8@q @zTQ8B5>*I *( qTh +$@ 9 $@) $ K P $@H$_ 0B ` ,BB( h $ R 8@q @zTQ8B5>*I *( =SqTh *K=S $@h(y$@ $ A P$@ $_ 0B `@,BA h $R O|@8@q @TQ8O>+Ϛi ( LqT ,$@ 9 $@) $ K P $@H$_ 0B ` ,BB(O|@ h $R 8@q @TQ8O>+Ϛi (=S L=SqT *L=S $@(y$@ $ A P$@ $_S[c{*q7RMT@ @;(1 S4@ @@*5/1T@  ?1Tsk+T{cB[ASè_S[c{*q7RmTR@ @;(1 S4@ @@>S.?# kT@  ?1Tsk+T{@cB[ASĨ_S[{*q7RmT*5 @1TskT{@[ASè_S[{*q7RmT>S9 @1TskT{@[ASè_{b9($@hA5 )@i(a"`H@h D@i *`@aB*i@(C72*R(jb9{A_{SCh@@.h@S@jAh@,@i @K@@*@#KCys9?CG*CB"c@9C4@HC yI*.*C@SA{è_{SCh@@x.h@S@jAh@,@i @K@@*@#KC9ys9?CG*CBX"c@9C4@HC yI*.*C[@SA{è_(@ }@9*@L94* *? kT8*h5 4h94RS Q? j`Th8h5i*9_qT*8_qT(_ k,h885_-@ 9@Sh8?qT@ 8Sihx7Sh8?qAT 9?q }@m @*9j98 *8*5_S[{ @ u@BR@C ( @` @qT@ @?T RRh@h5U4u{¨[AS¨_S[{ @p u@BR@C ( @`b @qT@ @?T RRh@h5U4u{¨[AS¨_S{`6B  SH4h@hrD ir? qTR.d j*@i 7l9 S?iqT}@ +}ӊmij Rh.@ *}Kitk.!q`TqT (I8( /Sh5R{S_~)h~)9R950qTa]*j@ @* K!kl_l66h2@ Kj6 2i2(R:q`Taj@ @* K!kh_ h:qh:@)i:ASh4h@ 9i9h@)5 ihrD ir? qT`*@S{h6Bhh@Rm}hrD ir? qTR.b j*@i 7l9 S?iqT}@ +}ӊhijR  h.@) *}Kitk.!q TqhTi (I8( RS4a9b` :~)h~)9R94[/qTa)j@ @* K!kl_l66h2@ Kj6 2i2(R:q`Taj@ @* K!kh_ qh:)i:kS4h@ 9i9h@i5 ih.@qGzThrD ir? qT`*@{S_֩S{h6Bhh@,RshrD ir? q TR.\ j*@i 7k@yRh =S?iqTh }ӉLii Rh.@ *}Litl.!q@TqTI (I8( 6S4:~)h~)9R94/qTau)j@ @* K!kl_l66h2@ Kj6 2i2(R:q`Taj@ @* K!kh_ qh:)i:QSH4h@ @yiyh@)5 ihrD ir? qT`*@{S_ֲS{h6Bhh@RWzhrD ir? qTR._ j*@iJ 7k@yRh =S?iqTh }ӉLii Rh.@ ) *}Litl.!q TqhT (I8( *RbjR9 *` :~)h~)9R94d/qTa)j@ @* K!kl_l66h2@ Kj6 2i2(R:q`Taj@ @* K!kh_ qh:)i:83S4h@ @yiyh@5 ih.@qGzThrD ir? qT`*@{S_֬9qTqTq`TqTqT0@ 2 0@ 2 0@ 20@ 20@ 2 0 R_@yqTqTq`TqTqT0@ 2 0@ 2 0@ 20@ 20@ 2 0 R_{R;Sh5Rh6B`9 @;(1 S4h6B @a6B+1Th*@ i*h* R{A_{(R`@yhR9h6B @;(1 S4h6B @a6Bz*R! kTh*@ i*h* R{A_{`9R91Th@ @*@K`xhR4h6B @;(1 S4h6B @a6B*1Th*@ i*h*h@ 8i9h5R4R R{A_{a9R9?1Th@ @*@KaxhR4b`h@ 8i9h5`RR R{A_{ 9?qT@ 7R ,S`?9qaT@h 7 R ,DRRT<@(5?qTT?%qT?1q@T?QqT?qT @(9qT( )R=IR;R<9 R6 @*9_qT(9qaTJR_q!T(9qTjR( < $HaQ S?qTiX(%Ț6)RR?qT?q T?qT?q!TRRR  @(9qT( RiR < R{_  { 9?qT@ 7R ,%S`?9qaT@h 7 R ,RRT<@(5?qTT?%qT?1q@T?QqT?qT @(9qT( )R=IR;R<9 R6 @*9_qT(9qaTJR_q!T(9qTjR( < $HaQ S?qTiX(%Ț6)RR?qT?q T?qT?q!TRRR  @(9qT( RiR < R{_  { @y?qT@ 7R ,Sa?9qaT@ 7 R ,dRRU<@(5?qTT?%qT?1q@T?QqT?qT @(@yqT(  )R>IR<R<: R7 @*@y_qT(@yqaTJR_q!T(@yqTjR( < %RH =S?qTHX%ɚ6)RR?qT?q T?qT?q!TRRR  @(@yqT(  RiR < R{_ { @y?qT@ 7R ,Sa?9qaT@ 7 R ,RRU<@(5?qTT?%qT?1q@T?QqT?qT @(@yqT(  )R>IR<R<: R7 @*@y_qT(@yqaTJR_q!T(@yqTjR( < %RH =S?qTHX%ɚ6)RR?qT?q T?qT?q!TRRR  @(@yqT(  RiR < R{_ S {h9 Q_qT(Y ( R$M!fh2@ 2i2ARR i2@(Sh4(2h2R"RRR RhRi")SH 4hA9 5l2@Cy  9S4Sh4Rl6hRS4RC9+m9RS aQ? jTSh4.RRS QR* N55CRhi)8aqTqRAT RGhi)8k i6@ *hR@r)K4KTc*R`h6B @;(1 S4h6B @h*@  i*dBc*C`,i2@( S4( S5c*R`Rh*@(7h2@ S4c*R` RR{¨ @S¨_S {h9 Q_qT (Y ( R$o!h2@ 2i2ARR-i2@(Sh4(2h2R"RRR RhRi")<S 4hA9H 5l2@Cy  9S4Sh4Rl6hRS4RC9+m9RS aQ? jTSh4.RRS QR* N55CRhi)8aqTqRAT RGhi)8k i6@ *hR@r)K4KTc*R`dBc*C`i2@( S4( S5c*R`rR=h*@(7h2@ S4c*R`e RR{¨ @S¨_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy{SFh@y Q_qTi(Y ( R9$!rh2@ 2i2ARRi2@(Sh4(2h2R"RRR RhRi")iS 4hA9 5k2@  yhS4hSh4Rk6hRhS4Ry*l@yRaQ jThSh4-R RQR  M55R(y*xaqTqRAT R (y*xJ i6@ *hR@r)K4KTc*R`h6B @;(1 S4h6B @h*@  i*dBc*`i2@( S4( S5c*R`gRh*@(7h2@ S4c*R`Z RR@SA{è_{S[hh@y Q_qhT (Y ( R[$!h2@ 2i2ARR i2@(Sh4(2h2R"RRR RhRi")S 4hA9( 5k2@  yhS4hSh4Rk6hRhS4Ry*l@yRaQ jThSh4-R RQR  M55R(y*xaqTqRAT R (y*xJ i6@ *hR@r)K5KTc*R`tdBc*xi2@( S4( S5c*RR h*@(7h2@ S4c*R RR[BSA{è_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxS {j@ @* K!ku_@b>@a9`@*t&@yS4(RhR9)}S H%h&I%(85H%)R9iR R{ @S¨_S {j@ @* K!ku_@b>@a@y`@t&@yS4(RhR9)}S H%h&I%(85H%)R9iR R{ @S¨_S{Ch2@4Rj:@ 2i2J6hA9R Q? jRR*j: *5h9qT RqaTt:*RHu}@`btS(5h2Bh@h.BA uQi:ib(B(h&j@ @* K!kp_a2Ba@h.BAӡ@abcb h.B#H"Ag"@ e9f:@#h2@ S4h:@5a@`&@hA9R Q? jTh2@ S5a@`&@j&@K9qTh2@Jj& 2i2K9h%Q S?qTX(%Țh79qTh2@kRk9 yi2K9 k4(85( hR RC{¨S_ !S{Ch2@4Rj:@ 2i2J6h@yR Q? jRR*j: *5h@yqT RqaTt:*RHu}@`bS(5h2Bh@h.BA uQi:ib(B(h&j@ @* K!kp_a2Ba@h.BAӡ@abcb h.B#H"Ag"@ e 9f:@C#h2@ S4h:@5a@`&@Ah@yR Q? jTh2@ S5a@`&@j&@K9qTh2@Jj& 2i2K9h%Q S?qTX(%Țh79qTh2@kRky yi2K9 k4(85( hR RC{¨S_ !{b>@a9`@j@S4 @* K!kc_xa2B@abh.BAd@`B 4(Rh9ib(B, @* K!kh89(RhRib(B R(h&{A_S {5RuR9j@ @* K!kb>@a@y`@t_xibS5(BC9Cc@G9 h@ 6u9(B(yib(B RuR(h&{¨ @S¨_S[c{j>@*XS_-q(TI(I8( t@6 Sh@4 !i)85}@7 !i5_83tj@@V S 4 @* K!khx}@% @* K!ku_xtj@@ S @* K!ku_tj@@ S 4 @* K!ku @* K!ku_҉@(S4)2j:@6(Rh:(yA}@`b@ yR9"**T*)@ S4hR@4h&@ 9?q Th&@ R i&*9hR@ iR RRR{cB[ASè_ֱS[c{j>@*XS_-q(Ti(I8( t@6 Sh@4 !i)85}@7 !i5_83tj@@V S 4 @* K!khx}@% @* K!ku_xtj@@ S @* K!ku_tj@@ S 4 @* K!ku @* K!ku_҉@(S4)2j:@9Rj6y:(yA}@`bU@ yyR9"**T#*@ S4hR@4h&@ @y?q Th&@ R i&*yhR@ iR RVRR{@cB[ASĨ_ְS{j@ @* K!kt_{"4j>@_-qTi(I8( j* h*@hRyyh99(Rh9 R%RR{S_S {@ @* K! G) s_9@15& S4($&3$(R~@R9 (%&3%~@ *R R{ @S¨_S {@ @* K! G) s_@y@15&S4($&3$(R~@R9*(%&3% RqTh94 S@ @*@KkxrhkTR R{ @S¨_{@;1 S5Bq |@ TjFyji@ ,!  95q TjFyji@ +!  h@96R9R R{_ @I@ THa@94H@ IH@a@9H@ I @H @ I @H@9 @ Rh@ i_ @I@ THa@94H@ IH@a@9H@ I @H @ I @H@y @ Rh@ i_{SChRA9(4hR@qTu&@R&@xd@# 5@4h6B @;(1 S4h6B @h*@  i*dBc#`2hR@kATh*h6BbR@a&@ @;(1 S4h6B @h*@  i*dBc` RCe@SA{è_{STChRA94hR@qMTu&@R&@xd@#5@b4dBc#`hR@kT h*bR@dBa&@c` RC3@SA{è_S[c{hRA95hR@q-Tu&@RRc@#yCh@ *q-Th6B#@y @;(1 S4h6B @a6Ba # kTh*@ i*w*hR@6kTw*h6BbR@a&@ @;(1 S4h6B @h*@  i*dBc` R{¨cB[ASè_S[{hRA95hR@qMTu&@Rc@#yCh@ *qmT#@yb`hR@6kT h*bR@dBa&@c`8 R{¨[AS¨_S[{*4@*@ T(a@94h@  H @~@1@H@ I@H @ I @Ha@95Thh@ i{@[ASè_S[{*4@*@ T(a@94h@  H @~@1Ӳ@H@ I@H @ I @Ha@95Thh@ i{@[ASè_S[ck{3@*38u@T@8 @;(1 S4@ @)@1T @` @qT@ @;(1 S4@ @@R1T@ !Th@h5U4u{kCcB[ASĨ_S[ck#{@*~@v@7?TR@ '@x @;(1 S4@ @I@9R! kT@`q@qT@ @;(1 S4@ @@R$# kT@ ?Th@h5V4v{#@kCcB[ASŨ_{DRBc+C#C {Ȩ_{&RBc+C#C{Ȩ_S[ck{7R9sTiT@1T@qT"@h81AT!T@qT 691THRRy{kCcB[ASĨ_S[ck{7R9sTiT@1T@qT"@h1xAT!T@qT 6y1TyHRvR'{kCcB[ASĨ_S { *SaR{¨ @S¨_֟ qT#*K*"*S{_q Th@; R jTh@;rTh@qT`@; |@*F)@yj +! i9)7h955"RҨ@h@ (ˋ )ӟ kThӟkT j"@  ?lTh@( THhi@ R(KhR{S_S {h@*;5 S5 R8jRI_)yI5;*Sh5qTR{h@hi@;( S4jRI_)uI5; h@;)R qTh@;!Sh5@Rh"`@;*F@TR{ @S¨_!|@O{$@T RdRbyJHiix(%xh4!сy HRR@RR{_@@@@y4*@y * 4 * *kT-@x *i5i4,@x5@yH4)@y *)4 @y * * kT-@x*h55,@xh5$x @@_{k RA`H@{_S{ @h@@ |@*F)@ yj)! *@96:*G (R@*{¨S_{1T- 5 (R7EkT |@*F)@yj )! *@9J6S)Ccs  (R{è_S {*IaTR@qaTH!C97 qATHB96 R9@R6T*2 ?5 ?**~@ F @(yk I! ?94* R{ @S¨_S[{`R^ R{R"S)4(yh4) ( A6A RR`5SvR`RZ*{[AS¨_RIS {3yh4(-x5(i@A(y h4H-x5H ˿"T`@xuxqT(`4i@h@  { @S¨_R#R{a R@;{_{S[cK RRlcTy@@@yJ4RH =S?eqhTHy.@x*5RUR Ri*5& HR# @G~@Ty HR@R= A? T<LT|Dӊs/sR4RhsB R @@*@ R.41* HRTRh_R kaT`B8*EcC[BSA{Ĩ_S{C?co@94 @HC yI{èS_C߈CbR%@x+$@xHQeqIhQLieqhK5l4BB_{Ah5 RKA{_S[{ R4=VsR9C@h@(&&@xqBT @ ylx6h@il8Sc@<S&@xqBT @ ylx6h@ il8 Sc@ <S K5t4sѓ@94 @HC yI{è@[ASè_S[ck#{- R{è#@kCcB[ASŨ_ֳ ؚTTR3 ؚTh@; R j`Ti"@ R  Rh@; R j Tw@4 77BT*_C7 Ta@~@ӂ  aRv h@B7j@ZC7 KHA7ih~@B)T{@ W4I5>   K_C7CTh@hf@* 4@7 |@Z @@ 1T@Z(@9i"@  TR4 HRzjRI_)2I5jRI_)2I5;@ ؚlS[{ uTRy R*{¨@[ASè_<,9S[{*-sj@K_  T(AkT? T @ T Ra(AaT[w@v@"q TI+A?)A? T@I v@ kT@T  kT  kTI  kT  k*!T(R4R%RR"hRtRHRTRRR kT kTI kT  k*TRR RRRRHRTRhaA?*R?vaA?*?wR{@[ASè_֑@__ @h@*)*-ʚ___S{ @h@*)3-ʚsRaA?`?{S_ @ RIi K,ɚ h_S[c{((v"R8qTqUR@  8h9s8*q! 4@  9h9s545q`T&qT8R9(4q`T%qT94v"(@ R )9+R R8JqqTqTJ749qaTq RJ}S*4JQsw9s@  *59 45qIzTK4`99s!! 4@  9h9s@  s9s@  V(@ ){@cB[ASĨ_{bTB> š?T)|  )T !& O {A_S[{*u 4QqTRRSB RB(3@sh9H5Bc,A"R R0cq!T@tQHYC [*4 @   @ H@ h@)iY  R*{è[AS¨_S[{a`@h@HN@4t@@RRRn |@vA @*RR` @4R2#Ҹ @`@Ұ {[AS¨_S{@hRP s /`RҒ  *{S_S{@hR s Z`Rs q *{S_S[{9 4q)h4H85H8H5 - 94i4H85H?qT! u`5"? h@8 @4 2 / {@[ASè_RyS[{@y Ҩ4qk h4(-x5( A* @y5` 3@y4= =Sh4(-x5( A7_qTA u`5" h@ @  {@[ASè_R'S {@h@HRRR|@u! b@*RRs@4R!"ҩ h@R { @S¨_S{@@`TSh@ @ {S_S{@@`TSh@y @u {S_{a`@@h@h`4`5`@{A_zS{a`"@Sh@J @F @Sh@> @: {S_S{@a`@@h@h~`4V`5`@{S_tS[{( *Cӿvд@bA?ր?sT{@[ASè_S[{`Tu@bA?֠?ր5TR{[AS¨_S{ @ `@9 {¨S_S {"E95)R ;Ո@ @5 @K(@ `TI3-˚aA?R`?A?qT@ @5 a !  @ @5(R"9 @)R 9{ @S¨_k_csm{*)b5A ?֠@yIR k!T<@ R (I@? kaTH1@y-qTH@9qTH@h4*3cC9SC#HRIR)sGy@4{ĨA_*{* qT1@ @*!SJ5 ?ֈ! * ?*a * ?S{( (a *CR ?4) @ ?aA?*`? @A ?{¨S__"RARR"RRR}RARz @@ RIk K T ,˚* ʊ_ցRRh{RFR J;R{_{@Qur!T0@qT!(;R{R,R{_|@?@q- F@yl !*@9+9OT? @q T(@@Qyr@T?AqTH2(9(Ryl%H9 H2(9HRH(9H2(9yl%_9o5Rk5RqR(R _{ ? ? R{_a__S[{ @ C9'"`Tɂ h@ T ["`s"@ {è[AS¨_)R ;_{SCcCRR){¨_{*ZCJR)RrI1 Ts4q`T qTR y2H  *{A_A;_{qTRy H_@ 5;*{_!_S{ @? *@` *{¨S_S{ @- y*@N *{¨S_S[c{@ @- @@* ʩ@V-˚* ʩ @N-˚* M-˚ TC @(  U#T!Tu!Ҽ @  *C 胊kT @@ RJ KR @*-ʚK  @ RI K@.ɚ  !I@ R+ @J K -ʚ@+ H@ R  @HK@-Ț+ H@ {cB[ASè_S[ck#{@ @k?L@i@* i@U-Κ* ʩ? T-ΚHT "џT@`T  ʙhcA3-Κ?`?@L@+@h@  h@M-Κ  K-Κ`XT    T=L@@ @,@H@ @*@L R{#@kCcB[ASŨ_A{ScCIRHR){è_`  @@ T@ R_{ScC'HRIR){Ĩ_ ( R_{A R{_{ R{_{@d!! R{A_{RS{_S{jDH_QH 5;(5`DBTBh R{S_{`D`D`@`@ R{A_{A) S{_{S4GH RA) S{_{  @aA?`?"{$@T RRb9JHi8(8h4!с9HR@RR{_{,!`R;!)AH6`>`R57 66R?kT R_RS[c{h@*wSR|4 QqTC6y@R@-49m @S ix69 lq2q `TqT,49l Ru4BqaTB S?%qhTQ ~ S?eqhT^Q S?eqQITh4HR9RkS aQ? jTqRlѵl49 kTx*l@lt9lRqU5> KB S?%qhTQ ~ S?eqhT^Q S?eqQIT1@TkT kT k KziTR" Rh@7* 9lh49kT=7@9y4 @HC yIi@ih@(R1**HS4'HRw7@964 @HC yIi@ih@(R4 @HC yIi@ih@(W6K@94 @HC yIi@ih@(*{è@cB[ASĨ_S[c{@*uSRo4 QqTCV@R3@y( @%@x*R;@52qhQR jT@%@xzrRTqTqbThQp R k Tq TqbThQgq TqbThQa%q# T%qbTh%Q['qc T'qbTh'QU)q T)qbTh)QO+q T+qbTh+QI-q# T-qbTh-QC1qcT1qbTh1Q=3qT3qbTh3Q75qT5qbTh5Q1B9q#Tj9qbThB9Q+B;qcTj;qbThB;Q% KqTqbThQp R k Tq TqbThQgq TqbThQa%q# T%qbTh%Q['qc T'qbTh'QU)q T)qbTh)QO+q T+qbTh+QI-q# T-qbTh-QC1qcT1qbTh1Q=3qT3qbTh3Q75qT5qbTh5Q1B9q#Tj9qbThB9Q+B;qcTj;qbThB;Q%{ƨ[AS¨_{SC9Cc#R) R)sGC@9@q@ {Ĩ_S{i@;( q!T?rTh.@ Kkq-Ta@*k TjRI_)2I5; h@; S4jRI_)yI5;R{S_{R`5h@;- S4`5R{A_ R{h@;5 S4h@;S4`@mjR (I_) I5;~{A_{RC@h  R{¨A_|P;_S[{G)ᏹa( ѶT@Sh@;5 S(5kRh_ 2i 5;7h*7 _h  _RR_jRI_)2I5;x{[AS¨_S {C @y A ,@x?qT5R?q`T?qT?q!T3`RR*3!RJR RRRR)RDRREҨ@y** 4MqTTq TqTqTq@T9qTIqa T5s2s2=rTs22'R4f5&R37j3305s2/Rq$QqTqTqTqTq TqTr`Ts2rTs2 5Jy5J2.RqraTs2s`6 Rs2)R?q  5 q@y.@xqT5@yH4R@ @{¨ @S¨_ֈ b 5(@y(-@xqTq!T4 @y.@xqTP5h2IAG5h2  >`5h2jixqT H-@xqT5c9S {*&#@9h5@0R*C5HO@ IjRI_) *I5;@~h{è @S¨_ha {CH@  @@{¨_S{ @@ @*E@I_)I5;`@9{¨S_S{ @h@@`J@^`J@DT T@H5J@{¨S_S{ @@ @@!@@@`@{¨S_S{ @@ @ E@_Q 5;5A@T`@{¨S_{cR#c#RR)'+R'R (/h A%@C @AK@(E@iRIyy@ y@pC{Ũ_{O{A_{RRRR) @hA%?T 7@8@4@-@1@1@.@5@+@%@(@)@%@=@"@A@@AScCssC:{Ĩ_S{J@DJ@T T@H5Js{S_S {h ?*B1 T}TB`4y ҬB҇5B~>h * ?{ @S¨_nS{B1TG@TB[4y wBRҜM5BI ҏ{S_?S {h ?*B1 TTB&`4y BBg5BZh * ?{ @S¨_{ 1aTRR R{_{`B1Th R{A_S {hT(h!E R ?`h!`44ER?R{ @S¨_{A #RC{¨_{A #RCҞ{¨_S { 95 yKC@*R( @ kaT' q (@s@9hy R@9H4 @HC yI-@9cw4@# @qTkKT @!RQ @5( @(T94 @@#R @!R? 5?HRR{è @S¨_ҡS {#y @TSR7sh{@TRR+@)R @ kT#@ycS`qmT@@#@yqT@TRHR@R@94@HC yI{Ĩ @S¨_tu9S(Rh*S#RCR 4@5S`Rh ?qT@TRPHRt@Rc<S{Di@?TI C?jaT`{A_{Di@?TI C?jaT `{A_S[ck#{CK@9qS*.(TxHR)@R@HtaT@*R* `49 R+  R*iSKA 9 9Rh9@sRIS6y_)LRT{9@@8(Rh9ws t5R@}@ @(9(9@ @IRҟqmT@ +@h%š =S+j=S_qiTH =SHQj9=s!DӔQ6b7@S4kRl9S Q? jaT{8Tq@T i9h8h8qT*RsB49RqHkSk Ai9@l Ht ?*?hRh9_9 T }H ɚ  9 aT_ T H ɚ  i9k D J TIH ɚ  i9kH i99R@94@HC yIC{è#@kCcB[ASŨ_S[{*  `@_C1CS*@[@*Cqqן  H `49 +@RC***{¨@[ASè_S[ck{*qhŸ %)wS*STlHR@R{èkCcB[ASĨ_C64@q*qmTH9 h4(85(  @@RqaT9q Th9@h9(}@ @*9j8@ 33 Hi"12% 5` w4Rh9@ 9?q T@ Qm6 Kz9qkT}( `h 9+}l}K R h 9)qkT}( `h9+}l}K  h9 Kh9 h9? qT9qTb@94 @HC yIRRҦ QgfffS[c{C*S[@Rw4HQkT@q**H_i388@qTRh9s@q,T5@ 9(R?q@TR4h4t h9h4(85(tmx9t(qT9h4(85(^@}@ @*99@6Kq VzԢt4h9h4(85(`4G~@R@94 @HC yIR{ècB[ASè_S[c{@*C?}C*S*@c@*C*q@3Q v`49@ Q?1$UzT kTh8587@$RC*\ 7@&RC***{¨@cB[ASĨ_{)S(*T9R{_4R98@TcшS R-ySNQo/ ,yk9 h4H85H 臟  + /yk`5RRһS_{@W< *@K%ךs=S5"q7*5@h @*%ךL=S!qiT RT(!ך * _@TqTK @*%ךKS)L` qT34@qTs4@HR{_AS¨_S[{C*RpRwT+qTQ qRHT&RG7@tT@aT R   aTRs(*K`2S*]SD 2[@{qlTQyrTqTq+@ * *  :qTqT+@ **  +@} *#@**q'@   ˁo`49+@R*_ +@ * *  C{¨[AS¨_{S[C@<S;1 S 51@T1T*h~@ Fhyl @ I!  (9 S?q T1@T1T*h~@ Fhyl @ I!  (96*#<5@RqT#8!1T@sk TR@ Q6*<S@y@* *CA@[BSA{Ĩ_(@ Q)I6(@9)@S**_֨@)D @? _{@R_`T R[TI`5R R{A_S{Sh4 RFTA'@R?Ta'HO Ij@;R_jTjRKPRI_) *I5;Ո@ҭ@ RhrhIRhii"h R@R{S_{S4h@;% S4jR PI_) I5;"~{A_{A5HR A{@_T{_S {sR*-R#U{@TC@@f**!R5RQ@94 @HC yI{è @S¨_AH5S {CgsR#{@TR@@c@**"Rc_5RQ@94 @HC yI{è @S¨_S[c{C*q**Ta~@{k***C{cB[ASè_{<SR#y kaTR%c#@yqTh& @ ykx6@@ik8S@ @%RK#RC R `5#@y'@y@94@HC yI{Ĩ_S{3gR{S_h@;5 S(4h@;1 S5h@;SjR4I_)2I5;I_)2I5;h@; R jaTh@hb"@a@:`qTq RR+jRI_) *I5;h@;rT1`T1T*~@) F @)yk H% ( @9IR  qTjRI_)2I5;h"@qaTh@;S4h@;!Sh5Rh"h@j@ QiH@@9hbT_S[{*4h@94` @39~N95h@hh@94` @'9@R` qqh9i 5h @yR!R*|@5H ?֊@%i@ iTh@94` @9R` qqh9i5d @ *!R*|@I(hR{[AS¨_S {*4h@94` @9~R@y5h@hh@94` @9 ҕR` qqh9i5h @9RR*n|@5H ?%F@'i@ iTh@94` @9jR` qqh9i@5d @ *R*F|@I(hR{@ @S¨_S[ck#{RRq@HSRRCC9G9K9@i*t5Ȏ@hWB(C( C탉 ҭj@H9 h4(85(  T" WB T˂@H9h4(85(I!@5@wk4"TR *C@T*{Ĩ#@kCcB[ASŨ_R>S[c{9h4(85(4 TR{@cB[ASĨ_!қD5> 5i@?T`@Ҁ҅`Үi@ (iC  TҬ @ҝRҘ* `" i i@5h@ !iRR{S[c# X 9Q S?qhTi&Ț7TT 9?qATTy(Q S?qTh&Țh6)R R?qKc9e@)R @ k!Tc@94@HC yI"RIc@954@HC yI"R4@HC yIRC@RqRH R ?T1*^&@)7C39%@)R @ k!T@94@HC yI"R @954@HC yI"R4@HC yIR3+@q9qT9h4qaT94*35A9h4H  ?֠5"@  +C T @ aARA9h4H  ?cB9h4C@* #@cC[BSA{Ũ_ 4S {*h@9H49~8@y5h@hh@9H495HR@R9+h @9RR*C |@)H ?@h@?Td @*R*-|@I(hR{ @S¨_{Sa H! T|@Ӣ RC ?5H ?R)SS##9[@)R @ k!Tc@94@HC yI"R?c@954@HC yI"R4@HC yIRC{#@ .SA{¨_S[{ @H@ @*E@Aa'@ " R_R" R2RV@ @*E@Le@%h% Th}TB@ @*@H_QH 5;(5@ @ @A@T@ @@*@hE@H@*@KE@i_)i5;@%{¨[AS¨_qTq`TqThA q h h h _{*C?  1T(R( I(! 1!T(R( I( ?*1T(R( @ @@94 @HC yI*{èA_S{b" RR AhaB) R ˟His8)Qh85fhe  Rhii8JQ(85{S_{ i`@(Rk THA C ? 4R(8qT R[@99[4*@9qTI(8 kiT(-@85e@R  R!Rҕg@ RaA R Rg@ RaA R@Rof,R R%@x6iB,Kig8(a@92(a9 6iB,Kif8(a@92(a9 RKi/8JQ5  R RhQeqTh}QjB(nSIa@9(2Ha9 hQeq(Th}QjB(Ia@9(2iHa9.SRh e9kQ5 @{¨_S[{*6SS*%@*E@ @ kaTREҟ@ERE@**1T`R*{Ĩ[AS¨_V5N@ E@H_QH 5;5@E@(A@T(R@E@I*C_jT'RR)ScCqV4@ @IS {CI?jTJ@hF@RF@@Th_Qh 5;5A`Tc@Fi_)i5;ՠR{ @S¨_ S{h9h5'(Ah )Ah&@cB!R](R(9 R{S_{B'{_{S[1Cv*4! R U}@Ө~ iv?k@ TJ_q#TRk@ TH Ȁ>S ?ր4(RkaTh:y pHA * ?֠4ub" RR&@t qT@9(4(@94+@9kHT Kj Jj8kQ2J*8Jk5(-@8(5)R)Ji8?q2J)8cT`@)R` Ri J59wb" RRA! ҎRB2 j@9j4h@9(4_kTMqBTJm8Jig8(*J-8h@9_kTj-@85Q5(Rt)* `l2R*kQJyhx%xk5 RC@[BSA{Ĩ_S {*C**@jS* e@9?jaT4@@ jx*  Rj5R R@94 @HC yI{è @S¨_*҃RRRkTRK%qTTR(%h7qaTRӚRkT(՛RkiTh֛RkTRk`T(RkAT!Ha RKqR釟kHTRK%qTTRH%7qӚRkT(՛RkITh֛Rk)TRkT(Rk`T!xR?q?qi4GHa S[{H ?U@y4 =h4(-x5( A*k h@y5h 7A*RRR|@**RR`4H  ?{@[ASè_S {H ?t#@y4 =h4(-x5( A*k h@y5h 5AzsҜH  ?{ @S¨_S[ck#{**RRH V`Tt@9@Tst4@ t@@ATdt4 /`Xt@T@H %N@t@ @5@ i8?q$@z`T@Cu@(zu0z5zu(@((@h.Җz54ˡ ?#T?T }t49h4(854ˀ !uR `5 *_q_85HR RR*{#@kCcB[ASŨ_R"S[ck{*eRR V`TT@@y(@TT@4G T@(@ATT4h hґ@(T@4 ^@҇T@A@5@ yyx?q$@z`T@C˕@Hzuix5zu(@((@hgXT z54ˡ ?T?TSD }TW4yh4(-x5(A AuR 5(H q?x  ? 5HR @  @RR *{¨kCcB[ASĨ_RUS[{{[AS¨_h@ H@) Ti@(9 h4H85U ˠ!Ұj3js b@j5i@R|S[{{[AS¨_h@ H@) ti@(y h4H-x5H AAuj3Ҟjs b@5i@ҔRA{ 1@*@K @7Cm@Rq@T R{¨_H J RRq(H _S{A%`@@@Ta`@@@T\`@@@TW`@@@TR`@@@TM`"@"@@TH`&@&@@TC`6@6@@T>`:@:@@T9`>@>@@T4`B@B@@T/`F@F@@T*`J@J@@T%{S_S{A%`@@@T`@@@T` @ @@T `.@.@@T`2@2@@T{S_S {(@ҟ @sT{ @S¨_{```BA``@`@`@``b`B`A`B `RA`VA`ZA`^A{A_bRII @y 4(@y_kT!) @y(@y K_{S[ck+****t5H@ @q)R(R!R**%*v5R;~@ A? T<LT|Dӕs/sR?RhsBR**!R*`4Ha ** ?*Rh_R kaT`BEHc@94J@HC yI*_K+@kDcC[BSA{ƨ_ @I_)I5; p@I_)I5; x@I_)I5; t@I_)I5; @I_)I5;Ո ! RH_ TL@_)5;H^L__)5;JkQk5@US[{i~@iA%?Thr@@h5`z@@5`~@r`v@@5`~@`r@`~@h@@5h@h@h@`@`@2!vtR_T@@5@^_@H5"Q5{@[ASè_֠H2 T pH_H 5;*_{sH2Th^A;Ո5{A_֠H2 T pH_QH 5;*_ @I_)QI5; p@I_)QI5; x@I_)QI5; t@I_)QI5; @I_)QI5;Ո ! RH_ TL@_)Q5;H^L__)Q5;JkQk5@_S{9CI?j`TJ@SRWDB Rv{S_S{@aTt@5 `T{S_S[{U ՚TR]ҵ~jnUTR{[AS¨_{H ?ֈ {_ֈ  R_S[{@TWv@bA??S4sBT`TTs"h_u@bA?R?sBh"TR R{@[ASè_S[{TVu_bA?R?sBT R{[AS¨_ֈ_S{SHaA?`?`4 RR{S_{R @+HE*S-˚R{A_S{ @z @+HE*T-˚`@{¨S_qTq T<q`TTqTXq`T(! (a((_{SCcChRiR){¨_ֈ(_S[c{*R3RC9"q,T`T qTqTq T$.q@T>qTVQqT*!a5{è@@cB[ASĨ_֩@H E*(@kT)A? aT uR&7!RC9s4`R@4(@ V-˚`T.qT"R%6@"qT@R"qTH E@  KiEH _T_JA(@s4`RaTR"qaTHaA?a@R?HaA?*?֟.qhT"R%6"qTs4`R`Rg{1T(R7EkT |@*F)@yj )! *@9@(RR{_S[c{Uh7RtR }H 6}~@|iw- 4`6Qk-T |"(ih7qT }|JH ihR{cB[ASè_S{ @h@@ |@*F)@ yj)! *@9 6H ?`4R H ?*(R@>*{¨S_{1T(R7EkT |@*F)@yj )! *@9J6S)Ccsw(R({è_{S[ck+ͯ*~@:F@H{y xC"3" (@/hC"I(! ?#C@RR @'T~@)F+R{9_ k8R T+yh R h-"*94qKT@q TH{y"*@9 8. K6Tch"c *,i8kQH85 Rq-Tch8I J_k)8kT H{yQ  &k_9M5cHRq)R8@:`TQi@98(kTq*RIRX@#C&Ts6*I{y & l@9qT& j9B 9hR 9h991j9HS x6@v TB1T"1 T#@ҥR*Rs* 4H/@ s* ? 43@@jK@T k T+qTR3yH s"Rc ? 4@4@@TF'@@RT H{y Ji8 )&j9}@_ T ! RmT H{y"+ Ji8j9}@_ TH{y " *9J{y* h@92h9H ? @CB94?@HC yI@*+@kDcC[BSA{ƨ_{S[/(ҵs/ |@ *F)@yj RtB")! 7@TccRc1bTi9s?)qT 9! 8 TK H C*c ?@4@)@ ?kCTTH ? @@/(s/`@[BSA{Ĩ_{S[N/(hs/ |@ *F)@yj RtB")! 6@%cRтc1bTi@ys ?)qT y! %x Tc  AH CzSc ?@4@)@ ?kCTcTH ? @@/(s/[BSA{è_{S[ck+O(s/ |@*F)@yj vB")!  9@"T(cR*cBTi@ys ?)qaTy %x T AҥR#cR R*4R4#A4ȢKC?@4@ kTiKT( ?@ @O(s/+@kDcC[BSA{ƨ_S[c{** 1T+3(R,7Ek"Th~@F8@ {w)#*@96*y{w)#*@97(R *****(R{¨@@cB[ASĨ_{S[ck+Y**43R~@;F@h{z "T9 S?qHTU7H@9(6BR*T*4h{z"*9*64H@ @h{z"*9*4h{z"( @ ?4T4qBz TyB5 RRT&@x*" k!T* *q!TR<S5qT)T( ? @C2**h{z"I964qT q!T** ****8@@ ( * ?5( ?3(@) @HI @@h5@4qTR(RERd)bh{z"*@906h9iq TBR5UKR+@kDcC[BSA{ƨ_bR@8+@8HQeqIhQLieqhK5l4BB_{A5Rǻ A{@_T{_S {RT{@TsRCe@ @@8 ij8@8ij8 K5i4s@94 @HC yI{è @S¨_S {SRR{¨ @S¨_ue4trAT****C*@44i*F)@ yj*! I@9(H9`@GT4u*S[ck{*~@*F9)@yj *)! *96uj!TC5@ jATs2i ?@q:RXRT(A@Qyr`T(@QyrT(AQyrT9 3*(`Rh  qT99 r T9 07@ R RR kT R kT R k! T @ 4 qTq Tq! T3R4bRC*q`Az1T@qT qTkaT9*BR*R*T/@7~S=R kT&RߟR k!TRA*`T9R*`TS49RqT qTߟRSRsR4RC4bK*1T k TR{¨kCcB[ASĨ_Rҝ@S[{*9r**R TqT q T 6 r`TRRR h?qT?yr`T?qT?qT? qTIRRiR?qT?q T?q Tdh@ R)Ri BqTqTqTqTqTP  R khRHR(RR Rh)86h92h9x7HjTC5@!@qTh9a2h9@6IJ(** j87(RhT06h@j@ 2ii@H2h*2j`6h@ 2ih6h@ 2i(6h@ 2 6h@ 2i{¨@[ASè_R @S{*i~@*F yj)@)!  R+@9jaTK86BRT)@ qT/@"R#yC*v#@yq ZzT*O1TR*@TR{¨S_S[ck#{****?@H%@cJ @1h%j T@1!TR(RG@+RF)Ks* C@[#*E*(A  ?kE) D)T7@ R( kT6(A 6y E*#* ?aT *Fyj)@*! I@9(+iH9(?֊@(  ?`5( ?*| *F)@yj*! I@9(H9)( ?5RqTc92 qTc92c9@ Ҹ2*Fc9yj)@)!  89KFykI@)! ?936@*4@R*gc@C9H%@J @C*h%j @*u4*}@ F @(yk C9K! i9KFykI@,! @9(ASJ*S R h J9 jTs6 *Fyj)@+! i@9(2h9 R kT6(  ?(A z D)E*# ?aT( ? *Fyj)@+! i@9(h9@  *Fyj)@)! R{Ȩ#@kCcB[ASŨ_***%R{*C[hqT@@ sx R@94 @HC yI{èA_{Cg T@R kR)Siy{¨A_S[ck#{@6yҚRh9h5"h9h5Bh 9q"C: T`@kTIT A@QR)J*yR U3.xy UA ҟy~HR{¨#@kCcB[ASŨ_uҖh9h5"h9h5Bh 9q @TAT{_ .a59?`raT9?PrT* R?<rTR(KqTJ R?( rATkTj R ( a2i 8!|Slh*9@__'HR{_S {**5h9qෟ& @5h9qTTiU4(9(8qT5h_8 RqTh9qTq RaT qTh9qTq R@TR{ @S¨_S[{RRDa_q9H ?)TSRR*3R@v9u9h4R8BQ_q T97@**SH4(969(8qT(9h9qT@  jH9 h4(85( aPR{[AS¨_S[C@H4'@4 QQ 5*@_qT@C[AS¨_5@J5> ( q藟 C[AS¨_ ҟ1T }@  xiK N>h ΚQ }@ 1Th` )q(RKRh C[AS¨_ kT K k *Th}@ H}@.xi xikTJQ_ kkQTBT 4Q .xjQ 5xj(R RZJK S?qTRK4&!.*"qT Q +xjh%*ҥQ% 7}@Ӧ kT|@ xiRQI xiQ  xj4@%֚! q(!ԚOT Q  xjh%  *@C> Ú@Ƚ }@өT` %@@?T~@ӯ}@j}@ _Ti ? J )T R'4}@ *xiH-* `  xl_ kH Kk%x,k#TA$IT R4Ҩ }@ H xl+xhk(A+  x,O`ӃT*}@QQe6@ *_kTH}@ x)@J_kCT 4kQi xij5 k5C[AS¨_C[AS¨_{S[ck+,*c @7R}qaT9c 9@RRRR( it)@`T+@6h?Th@aT(R   aTRhs(*Kh2qT qT q`TqTh!?53Rhhh1@5Rh@g t)R_)@9 @3(RLRJ)T dl`* )ZR x(Kyrq)RHR+KqcT3XRR, 4 R33YjYj kA TJ_ qATQQ }S'RK)(!ƚQ3hQ(Yh*RR%* ZHIK K S_qZ ?q T k藟  6 qHTQQkT K Q kT3NYhR? kT3YiR  %(!J*3jY,Qk`TK@O@R43?Y( kTO@KRKRQQ }S'RK)(!ƚQ3hQ(Yh*RR%* ZHIK K S_qZ ?q T k藟  6 qHTQQkT K Q kT3NYhR? kT3YiR  %(!J*3jY,Qk`TK@O@R43?Y( kTO@KRKq Ts%XRR[ c 4 Rs%3YjYj kTJ_ qATZ(RIKR K S_qZ ? q'V qTRKQ?1T(Q? kT3JYi R kT3hYhRHy3hY))Q?1`TK@O@KȆRKt~S~~Rh)R)!*IY4}~s_0hTˣ6q Z*RHIKR K S_qZ ?q'V qTRKQ?1T(Q? kT3JYi R kT3hYhRH}3hY))Q?1`TK@O@KR9RpBBHU!7~`YS4IR?q Q)=3 Rt @9u@9~ӈ Ui@yH~ @ uC?qTC5RqTw4 R RsYk} A)Y+kkI`!T4BqTsIY(BBR RqT *@"}~_0sTC9RHR;BB34q T 4 R RsYk} A)Y+kkI`!T?k'?ksc1?ksb1?k$1qRR4fXn5kT?Y.1R*Re4qTkTY- LXg+Xmk} A/=*A+  )X-7@ET/4q TkTY-HYm A/IY-/`E/5q TkT*}~_0sTҢ9RHRʳBB)R4 @I9K5@HS uS* Z  K4h!iQ Yi 4_qT4 R R sYk} A)Y+kkI`!T)4BqTsIY(B"4 R R3M҈Yk} A)Y+kkI`!T)!4K@qT3IY(K@KKH`Sw4IRq Q)=3 Rt @9u@9~ӈ Ii@yH~ @ iC?qTC5RKq`TV4 R R3Yk} A)Y+kkI`!Ti4K@qT3IY(K@KO@RKRqT *K3@"}~_03T79R ~HR/gI)S4q T 4 R R3Yk} A)Y+kkI`!T?k'?k3c1?k3b1?k$1qRR4fXn5kTY.2R*R4qTkTY- LXg+Xmk| A+, *A/  )X-7@ETO4q@ TkTY-iYm}@ A)jY-O`E5q TkTK~~_03Tǡ9RHRK@O@(RH4 @IK5S uS* X K K4h!iQ Yi4_qT4 R R 3Yk} A)Y+kkI`!TI4K@q"T3IY(K@KK@KK93c#<@(qT)RBi9s4 R RsNҨYk} A)Y+k kI`!T)4BqTsIY(B9sz5Qh9s@@7_k  #@ ?A*H}@)145TK@ N4 R R3 XYk} A)Y+kkI`!T)4K@qT3IY(K@KK93Ac#K@ R*Kq9h} k `ӊ}SHuS L k KjH}STqhJ-8Q1T9%)(T@99q@9h4c*,+@kDcC[BSA{ƨ_Rʚ;S {sR@'RرR{ @S¨_ֿST͠RRTSR*{ {_S {C9h@;r Th.@R Khhi"@q*QjMTa@**i@kC9(9"qIT |@*F)@yj +! h  h@9/6BRQTjRI_)2I5; R"RCq{¨ @S¨_S {#yQh@;r Th.@R Kh hi"@q* QjMTa@*b*i@k#@y(y"qIT |@*F)@yj +! h  h@9/6BR TjRI_)2I5; RBRC<q{¨ @S¨_{@; Sh4 R"@;rT$@ @T@;բT( #RC ?ր4(a c ?֠4#A?R{¨A_S{*h@;rT=(RjRI_)2I5;Gh@;1 SH4.HRjRI_)2I5h@;6jRSh4h@hI_)yI5;jRI_)2I5;jRI_)yI5;h@; R jTHSh5S5jRI_)2I5I_)2I5{S_S{*~h@;rT(RjRI_)2I5;RGh@;1 SH4HRjRI_)2I5h@;6KjRSh4h@hI_)yI5;jRI_)2I5;jRI_)yI5;h@; R jTSh5P>SS5jRI_)2I5I_)2I5>{S_S[c{C*q**T~@C*qTa~@=*44***kh} y* HRC{cB[ASè_{S[ck+C*Aq***Ta~@*1TqT~@*1kTw5@ @S45k@TqTq,T(A A#* ? 4qMTH @ qTH;@9J;H4K@9 4@9H@9?k*!Kz TH-@85`RqMTH @ qTH;@9J;H4K@9 4)@9H@9?k*!KzTH-@85 R|R*!R**X4 A? RT<LT|Dds/CtRBT **!R*@4R*!R**64~ A? T<LT|D8s/CsRRhsBҳ**!R*4@@****R3h_R kT`BR_R kaTB*@RR_C+@kDcC[BSA{ƨ_S[c{C****۱****c@94 @HC yI{è@cB[ASĨ_{jHO! It`ҝh@jRI_)2I5;R I_)2I5;hrhHRh"h@h{A_{S[ck+Rɮ+@kDcC[BSA{ƨ_vY?T(ci# 7 ֚*_!HTTTbA? ?qt”TTH9kщi8i*8I8kT@HA}bAt? ?qT_Tjh8I9H9i8LbA? ?qT_TLH9kщi8i*8I8kbA? ?qTTH9kщi8i*8I8kTBTbA? ?qT (TbA? ?qT;˿)ThcA? ?qTTTlH9kщi8i*8I8k7 @TIT(aA? ?4 ; ThcA? ?4 @ W@ T_Twk{#7T9Txk{#_bT,7kѵ"W{# +@x@#{AR c9"9RíR{_LTi8h84)щ i8h84)iJJJ9iT8 R9HR@R{JR }@?BT?i*8qKT)@9i4-R+C( iil8!H *)@8hi,8)5 @9i4+R( )Cj!(il8_jT @8)5-{_ֈS{ReSTC@ @h5` kkџ Th@9 e@9I7h @j @@94 @HC yI{èS_{S[ck+CC*Eq***Ta~@ kw5@ @Hs@*R)RRqA**e*x5R A? RT<LT|D՝s/CtRB **!R*> 4R***U 49P66 4kTD@***{*u59~ A? T<LT|Dӕs/CsR?RhsB***S4*R*5R*5h_R kaT`BFR_R kaTB>*_CCJ+@kDcC[BSA{ƨ_D@*h_R kT`B*S[c{C****2@****#@94@HC yIC{è@cB[ASĨ_{Sq{_S[{ SC9R;9@)R @ k!T@94 @HC yI"R@954 @HC yI"R4 @HC yIR 5ڮ@)R @ k!T#A94@HC yI"R#A954@HC yI"R4@HC yIRCb`5 3@K@ ?A93@*A93@Ru4B9h4K@*{˨[AS¨_{%R֫ h E (A R ?{_S[{<$dHT!vE R ?ր!(4 4ER?֠R{[AS¨_{#y4S!RC`4#@yR{¨_S[c{"R*K*BRF T TMT!RR*>@ R*"*1TRs *mT@1T@qTR@!*RR* @T* ? 5}R ( ?*ks@R**{cB[ASè_{țChA)j -?.?(G?g [H @y5@987OqQh qaTLR h qaTlRhqTRR)R K(! Q+  * L@9 SK@ S? qAzT kT 8qaT  * T? T)KKL y SI yRhKqiTADq"TR R(R) (yhkTOq__HRCc{_{*Ax   jTRR9`RR0`-R{A_{``R{A_{`@`@IC @5@h@ kT@Rh@ k@T R{¨A_{ C5 @C@h(25R R{¨A_f )L T@`T %RR#RH/&RaR;@TERRCR X X Tn`t \8pp \ \ \+qf }`r;g;{y*sz | \8 yOT \RX yBXu+qR }yK]Yg^`g^;"Tz \gR1:p.fRn2\ 2lȵm}\l ~\b(-Lgt+KiQ}@8b HAu rymH :uP\VQU\q\st\KT7 yBUymFW\t wfY*u_VX }yc]Rg^`K^_ V]4x?Q#Ib?ƺ??^?AG;BIb?WUUUUU?B.?_D; R J}S rTPq T`qTpq `R R@RRr R_qRqR**qKRI*q**} SK * j *K*`*_(D;*r R_qRqOR**qJ*}SK * j *@ *_rTq TqT q  D; }@(X+Sjq Iq q *q @Iq * qI)* H D_`? r(D; X S KqjqHK qiq *I)D_`(94Th85_{s`DTH (A RdRbRR ?`{A_hD T _S[{wD ** ?*5 ?qTD T ?H (A RdRbRR ? * ?**{@[ASè_|S H2rKh2rjH2rKh2rjH 2rK rTPq T`qTpqTk2k2k2rh2`_*RjRTSH2rKh2rjH2rKh2r`L86 2_(D;}@(D{, *D; R J*,**  N*k T mSH2rKh2rjH2rKh2rjH2 rKrTq TqT qTk 2k 2k 2h2rRj @*DՋ{_S {*6@6 Ҥsz6H6@Ҟsz 6P6Ҙsz6X6u 6ґsz 6`6Ҍszq{ @S¨_{S[c#'yX (@`****bpg*5 qT@iR;(3#C**)RS(44@mm@AcS`5*&@*"@5@p'@#@cC[BSA{Ũ_Mg_RS[c{  @** @? 6 @H@ 2I6 @H@ 2I6 @TH@ 2I6 @H@ 2I6 @H@ 2Ih@ @ HӨ @)*iJ*, J h@ @ I @)*iJ*, J h@ @ JӨ @ )*iJ*, J h@ @ K @)*iJ*, J h@ @ LӨ @)*h3 6 @H @ 2I 6 @H @ 2I 6 @H @ 2I 6 @H @ 2I 6 @H @ 2I h@  r`T_Pq`T_`qT_pq!T @H@ 2 *RJR @(@H3( @H@ uI @@ J*+-h J @H!@ 2I! @h!@V4 mi! @@P @ha@ 2ia @Ha@ mIa @@QQ)R( 3h! @@0 @Ha@ 2Ia @)Rha@( 3ha @@1)Z C"RR* ? @H @ 6h@ wiH @6h@ viH @6h@ uiH @6h@ tiH @6h@ siH@ r T?qT? qT? qTh@ j )h@(jhIh@ hi4PQ@Q)@{¨cB[ASè_ {qTQqTHR(R{_(D;}@ *D_D; R J!*-)|@|@  i D_(D; }@K+D_(D;}@_<@ R (I)@yL @y( a4 I@?@)TH@  ?@)Tk kJT_S{4`5R aˀ`R$@h* R{S_@yIR kaT<@ R (I@? kTH1@y R-q@TR_{h@ @+u(kj}@I*@!ڔ R{_!594  |j7p= S %Ț N2 NI>N*`TIH>N )I87(}@` Hw }@H S %Ț 1 )>N*TH }@Ӏ IilA< N0:n>N1 N(>N }S(>N +j}SA*AV4 N|=   N4n1 Nr N,>NO>N 7 S)>NJ%ȚH>N-  (!Q qSJ%ɚOL ҆RkL ki _ kcTl>Nk>NJ86ki  K H <4n Nq NR N+>N/>NM>NL>N) (!ʚ * KډR) K HQ(!Ț * `TI  K(}@ H_954  |j7p= S %Ț N2 NI>N*`TIH>N )I87(}@` Hr }@H S %Ț 1 )>N*TH }@Ӏ IdlA< N0:n>N1 N(>N }S(>N +j}SA*AQh5N  | 73 Np= SJ%Ț NR N3nH>N1 N)>N.>N  , `TH>N *l _ k+T-T(}@` , }@( SI%Ț0  >N0   10.1 (>N  _ TTH }@ 3 NkAp< N3nNQ:n(>NHR NH>Nh H>N )(}@i H+Aj9_!k`__ BT@8!k`TBт_t3 @3.1 (>N ?qT(}@ _ @1gJ _A cT6 N_TpE@ir = mAn6n0=+A76nJT6n6nNN1N2:nH>N(_T_A#TpN_A"T_!Tp@3.1 (>N ?qT(}@` 53;nh>N(:n>Nh N  N :n>N N  N>Nh >N )(}@ 1 N(>Nh (>N )(}@i A J!k!h@8!k`TJъh__{(@@k {_a{@ @? k{_a{ ȨC@94( @c)ȱc*H@ kaTc( @?qTc(ȩ!@ kTc( !@ kTc(i!@ kTKc()3@Dl ձS?S ߈{A_a csm !"{ @J {_a{R& {_a{@ @x ՠ @5 {_a{ @@, {_a{ @@ {_a{`R {_a{ @@ {_a{@@ {_a{@@ {_a{@ġ {_a{R {_a{@@ {_a{R {_a{R {_a{R {_a{C@94`R {_a{@H4@@4i*Fh)@ yj*! I@9(H9`@y {_a{@ @R r? k{_aH_Z_r_______ `"`2`H`Z`j`````````e~epedeTe\avaaaaaabb"b.b><<!==!=[]operator->*++---+&->*/%<<=>>=,()~^|&&||*=+=-=/=%=>>=<<=&=|=^=`vftable'`vbtable'`vcall'`typeof'`local static guard'`string'`vbase destructor'`vector deleting destructor'`default constructor closure'`scalar deleting destructor'`vector constructor iterator'`vector destructor iterator'`vector vbase constructor iterator'`virtual displacement map'`eh vector constructor iterator'`eh vector destructor iterator'`eh vector vbase constructor iterator'`copy constructor closure'`udt returning'`EH`RTTI`local vftable'`local vftable constructor closure' new[] delete[]`omni callsig'`placement delete closure'`placement delete[] closure'`managed vector constructor iterator'`managed vector destructor iterator'`eh vector copy constructor iterator'`eh vector vbase copy constructor iterator'`dynamic initializer for '`dynamic atexit destructor for '`vector copy constructor iterator'`vector vbase copy constructor iterator'`managed vector copy constructor iterator'`local static thread guard'operator "" operator co_awaitoperator<=> Type Descriptor' Base Class Descriptor at ( Base Class Array' Class Hierarchy Descriptor' Complete Object Locator'`anonymous namespace'(null)(null)   mscoree.dllCorExitProcess@@@@X@p8@p8@ @@P@P@@@@@@H@p8@x6@p8@@@p8@(@@p8@        ! 5A CPR S WY l m pr  )   Y* `@@@ @p@@ @`@@@ @`@@@`@@@@@8@api-ms-win-core-datetime-l1-1-1api-ms-win-core-fibers-l1-1-1api-ms-win-core-file-l1-2-2api-ms-win-core-localization-l1-2-1api-ms-win-core-localization-obsolete-l1-2-0api-ms-win-core-processthreads-l1-1-2api-ms-win-core-string-l1-1-0api-ms-win-core-synch-l1-2-0api-ms-win-core-sysinfo-l1-2-1api-ms-win-core-winrt-l1-1-0api-ms-win-core-xstate-l2-1-0api-ms-win-rtcore-ntuser-window-l1-1-0api-ms-win-security-systemfunctions-l1-1-0ext-ms-win-ntuser-dialogbox-l1-1-0ext-ms-win-ntuser-windowstation-l1-1-0advapi32kernel32ntdllapi-ms-win-appmodel-runtime-l1-1-2user32api-ms-ext-ms-AreFileApisANSICompareStringExFlsAllocFlsFreeFlsGetValueFlsSetValueInitializeCriticalSectionExLCMapStringExLocaleNameToLCIDAppPolicyGetProcessTerminationMethodccsUTF-8UTF-16LEUNICODE ((((( H   !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~ ((((( H ( 0@@@@D@D@H@H@L@L@P@H@`@L@p@H@@L@INFinfNANnanNAN(SNAN)nan(snan)NAN(IND)nan(ind)e+000`@d@h@l@p@t@x@|@@@@@@@@@@@@@@@@@@@@@@@@$@,@4@@@P@X@h@t@x@@@@@@@@@@@@@@ @8@P@`@x@@@@@@@@@@@@@@@@@ @0@@@P@h@x@@@@@@@@SunMonTueWedThuFriSatSundayMondayTuesdayWednesdayThursdayFridaySaturdayJanFebMarAprMayJunJulAugSepOctNovDecJanuaryFebruaryMarchAprilJuneJulyAugustSeptemberOctoberNovemberDecemberAMPMMM/dd/yydddd, MMMM dd, yyyyHH:mm:ssSunMonTueWedThuFriSatSundayMondayTuesdayWednesdayThursdayFridaySaturdayJanFebMarAprMayJunJulAugSepOctNovDecJanuaryFebruaryMarchAprilJuneJulyAugustSeptemberOctoberNovemberDecemberAMPMMM/dd/yydddd, MMMM dd, yyyyHH:mm:ssen-USja-JPzh-CNko-KRzh-TWuk@@@@@@@@ @ @ @ @ @ @(@0@8@@@H@P@X@`@h@p@x@@@@@@ @!@"\@#@$@%@&@'@)@*@+@,@-@/@6@7@8 @9(@>0@?8@@@@AH@CP@DX@F`@Gh@Ip@Jx@K@N@O@P@V@W@Z@e@dE@@@@P@@@@ @ @ 0@ @@ P@`@p@@ @@@@@@@@@@@@ @0@@@ P@!`@"p@#@$@%@&@'@)@*@+@,@-@/(@28@4H@5X@6h@7x@8@9@:@;@>@?@@@A@C@D @E0@F@@GP@I`@Jp@K@L@N@O@P@R@V@W@Z@e@k @l0@@@P@0@`@ p@ @ @@@@@@@,@; @>0@C@@kX@ h@ x@ @ @ @ @ @; @k @@@ @ 0@ @@ P@`@;p@@@@ @ @ @@;@@ @ (@ 8@H@;`@p@ @ @@;@ @ @ @; @$@ $@ $(@;$8@(H@ (X@ (h@,x@ ,@ ,@0@ 0@ 0@4@ 4@ 4@8@ 8@<(@ <8@@H@ @X@ Dh@ Hx@ L@ P@|@|@arbgcazh-CHScsdadeelenesfifrhehuisitjakonlnoplptroruhrsksqsvthtruridbesletlvltfavihyazeumkafkafohimskkkyswuzttpagutateknmrsamnglkoksyrdivar-SAbg-BGca-EScs-CZda-DKde-DEel-GRfi-FIfr-FRhe-ILhu-HUis-ISit-ITnl-NLnb-NOpl-PLpt-BRro-ROru-RUhr-HRsk-SKsq-ALsv-SEth-THtr-TRur-PKid-IDuk-UAbe-BYsl-SIet-EElv-LVlt-LTfa-IRvi-VNhy-AMaz-AZ-Latneu-ESmk-MKtn-ZAxh-ZAzu-ZAaf-ZAka-GEfo-FOhi-INmt-MTse-NOms-MYkk-KZky-KGsw-KEuz-UZ-Latntt-RUbn-INpa-INgu-INta-INte-INkn-INml-INmr-INsa-INmn-MNcy-GBgl-ESkok-INsyr-SYdiv-MVquz-BOns-ZAmi-NZar-IQde-CHen-GBes-MXfr-BEit-CHnl-BEnn-NOpt-PTsr-SP-Latnsv-FIaz-AZ-Cyrlse-SEms-BNuz-UZ-Cyrlquz-ECar-EGzh-HKde-ATen-AUes-ESfr-CAsr-SP-Cyrlse-FIquz-PEar-LYzh-SGde-LUen-CAes-GTfr-CHhr-BAsmj-NOar-DZzh-MOde-LIen-NZes-CRfr-LUbs-BA-Latnsmj-SEar-MAen-IEes-PAfr-MCsr-BA-Latnsma-NOar-TNen-ZAes-DOsr-BA-Cyrlsma-SEar-OMen-JMes-VEsms-FIar-YEen-CBes-COsmn-FIar-SYen-BZes-PEar-JOen-TTes-ARar-LBen-ZWes-ECar-KWen-PHes-CLar-AEes-UYar-BHes-PYar-QAes-BOes-SVes-HNes-NIes-PRzh-CHTsrdE@B@,,@q@,@ ,@0,@@,@P,@`,@p,@,@,@,@,@,@,@C,@,@-@@)-@(-@k@!@-@c@P-@D`-@}p-@@-@E@-@G-@@-@H@-@-@-@I-@.@@A.@@(.@J@8.@H.@X.@h.@x.@.@.@.@.@.@.@K.@.@@ /@/@(/@8/@H/@X/@h/@x/@/@/@/@/@/@/@/@/@0@0@(0@@#80@e@*H0@l@&X0@h@ h0@L @.x0@s@ 0@0@0@0@M0@0@@>0@h@70@@ 1@N(@/1@tx@(1@81@Z @ H1@O@(X1@j@h1@a(@x1@P0@1@1@Q8@1@R@-1@r8@11@x@:1@@@@?1@1@S@@22@y@%2@g@$(2@f82@@+H2@mX2@@=h2@@;x2@0@02@2@w2@u2@UH@2@2@T2@P@2@`@63@~X@3@V`@(3@W83@H3@X3@h3@h@x3@Xp@3@Y@<3@3@3@v3@@3@[@"3@d3@4@4@(4@84@H4@@X4@\@h4@4@4@4@@4@4@]H@34@z@@4@p@85@x@95@@(5@^85@n@H5@_X@5X5@|\@ h5@b@x5@`P@45@5@{@'5@i5@o5@5@5@6@6@(6@86@FH6@paf-zaar-aear-bhar-dzar-egar-iqar-joar-kwar-lbar-lyar-maar-omar-qaar-saar-syar-tnar-yeaz-az-cyrlaz-az-latnbe-bybg-bgbn-inbs-ba-latnca-escs-czcy-gbda-dkde-atde-chde-dede-lide-ludiv-mvel-gren-auen-bzen-caen-cben-gben-ieen-jmen-nzen-phen-tten-usen-zaen-zwes-ares-boes-cles-coes-cres-does-eces-eses-gtes-hnes-mxes-nies-paes-pees-pres-pyes-sves-uyes-veet-eeeu-esfa-irfi-fifo-fofr-befr-cafr-chfr-frfr-lufr-mcgl-esgu-inhe-ilhi-inhr-bahr-hrhu-huhy-amid-idis-isit-chit-itja-jpka-gekk-kzkn-inkok-inko-krky-kglt-ltlv-lvmi-nzmk-mkml-inmn-mnmr-inms-bnms-mymt-mtnb-nonl-benl-nlnn-nons-zapa-inpl-plpt-brpt-ptquz-boquz-ecquz-pero-roru-rusa-inse-fise-nose-sesk-sksl-sisma-nosma-sesmj-nosmj-sesmn-fisms-fisq-alsr-ba-cyrlsr-ba-latnsr-sp-cyrlsr-sp-latnsv-fisv-sesw-kesyr-syta-inte-inth-thtn-zatr-trtt-ruuk-uaur-pkuz-uz-cyrluz-uz-latnvi-vnxh-zazh-chszh-chtzh-cnzh-hkzh-mozh-sgzh-twzu-za Tc-^k@tFМ, a\)cd4҇f;lDِe,BbE"&'O@V$gmsmrd'c%{pk>_nj f29.EZ%qVJ.C|!@Ί Ą' |Ô%I@T̿aYܫ\ DgR)`*! VG6K]_܀ @َЀk#cd8L2WBJa"=UD~ $s%rс@b;zO]3AOmm!3VV%(w;I-G 8NhU]i<$qE}A'JnWb쪉"f37>,ެdNj5jVg@;*xh2kůid&_U JW {,Ji)Ǫv6 UړǚK%v t:H孎cY˗i&>r䴆["93uzKG-wn@  _l%Bɝ s|-Ciu+-,W@zbjUUYԾX1EL9MLy;-"m^8{yrvxyN\lo};obwQ4Y+XW߯_w[R/=OB R E]B.4o?nz(wKgg;ɭVl H[=J6RMq! EJjت|Lu<@rd 6x)Q9%0+L ;<(wXC=sF|bt!ۮ.P9B4Ҁy7P,=87MsgmQĢR:#שsDp:RRN/M׫ Ob{!@fu)/wdq=v/}fL3. iLs&`@< q!-7ڊ1BALlȸ|Rabڇ3ah𔽚j-6zƞ) ?IϦw#[/r5D¨N2Lɭ3v2!L.2>p6\BF8҇i>o@@w,=q/ cQrFZ**F΍$'#+GK ŎQ1VÎX/4Bycg6fvPbag ;s?.❲ac*&pa%¹u !,`j;҉s}`+i7$fnIoۍut^6n16B(Ȏy$dAՙ,C瀢.=k=yICyJ"pפldNnEtTWtøBncW[5laQۺNPqc+/ޝ"^̯p?m- }oi^,dH94X<H'W&|.ڋu;-Hm~$P  %-5 > H R ] i u -C Y p        %  d'@Bʚ;01#INF1#QNAN1#SNAN1#IND??Xt?0 ?A??m?'?~?R?+M?0??ZR???'??$?\g?A)??@L?a???Ȇ?9??3?G?#??@D?M??@2?j?@Bt?@?X?R%?@>r?r? ?T??@_?01?^y?? ?(N??`??a?@?? -*?k?@@??B.?y|6>gsh>ƈ[^>/T,X>0S:zb>|si\a>酲j%M>zz[>ܥY#4o>wHn>G2k>)l>YHȆ>0AvVL>3/c>v ka>zzk>RUWk>q9a>de>B!Ѳm>dNpm>6/EiU>[ >$'<>F(o>BĮ^>&qN]k>YWm>bj ;>L!\>G[%_f>PHIZ>w_FGm>{]>`hj>>duo>3>ҾC`>\_>h_=N>qCF>WN@l>^b @>L-n>4b>\ngd>Z=@pn>6ނBg>?xb>8rZ>Oc>m>Bĩ*Vc>LHT>z\P>[0>'>m>[a>"߹oI>bAe>USY>kX>,HR>log10CONOUT$Fatal error in launcher: %s Fatal error in launcher: %s rbFailed to open executableUnable to find an appended archive.Unable to read from file#!PATHEXT;Job creation failedJob information querying failedJob information setting failedmaking stdin inheritable failedmaking stdout inheritable failedmaking stderr inheritable failedUnable to create process using '%ls': %lscontrol handler setting failedFailed to get exit code of process.exe/usr/bin/envExpected to find a command ending in '.exe' in shebang line: %lsExpected to find whitespace after '/usr/bin/env': %lsUnable to find executable in environment: %lsExpected terminating double-quote for executable in shebang line: %ls<launcher_dir>\Terminating quote without starting quote for executable in shebang line: %lsFailed to find shebangExpected to find terminator in shebang lineExpected to decode shebang line using UTF-8Expected to find '#' at start of shebang lineExpected to find '!' following '#' in shebang lineExpected to find executable in shebang lineExpected to find arguments (even if empty) in shebang lineExpected to be able to allocate command line memory"%ls" %ls "%ls" %lsbZL8b \L\8b pLp88p@@~@RSDS?嚌kFNTsC:\Users\Vinay\Projects\simple_launcher\ARM64\Release\t64-arm.pdbGCTL.text.text$mn.text$x.idata$5.00cfg.CRT$XCA.CRT$XCAA.CRT$XCZ.CRT$XIA.CRT$XIAA.CRT$XIAC.CRT$XIC.CRT$XIZ.CRT$XPA .CRT$XPX0.CRT$XPXA8.CRT$XPZ@.CRT$XTAH.CRT$XTZPx.rdataL.rdata$zzzdbgO.rtc$IAA O.rtc$IZZ(O.rtc$TAA0O.rtc$TZZ@O .xdataH\(.idata$2p\.idata$3\.idata$4H_V.idata$6p .dataz(.bss .pdataP.rsrc$01PQ.rsrc$02`"Ђ*Ђ**Ȃ*Ȃ*p@p90ȄpBȂ&@tȂ&@@ -@(@hP\@Ђ$=233 4043 @4p=5686 @@@'@"@"!@@".P(@"=|@@d@B@9@@0@ JɆȂ,JɆȂ,@0@ JɆȂ,JɆȂ,@@9H)@8!@ ɊȆB ɊȆBb0ɈȄpP @"=8DdDl@VP$@Ȃ&=$MMMXN.P @Ȃ&=TKKKK/P @Ђ$=@RXR @ P @"=SSl+@@Ȃ&@;@"J0Єp;0ЄpPЄp<0ЄpbPRȄpcPSȄpp"=UU @p"=UU20ЄpPȄpP@Ђ$=l!p"=D>P4@Ȃ$=$ħ((0Ȅp *P@Ȃ&=l@@ɆȂ*J@?@Ȃ&R@G@Ȃ&5@0@CP>@Ђ$=lhp"=@HH!pȂ$=p"=Hp"=H = FpцȂ(= HNpцȂ(=@p=5pȂ$=x1p"=H;pȂ$=4p=\@@Ђ$;@6@Ђ$.@*@"p"=(HHp"=Hp"=PHp"=Hs@E@Ђ$/7*52@ @@@ɆȂ(=`$o0Ȅp@ @"h`Ђ$@@ɆȂ*d@@цȂ(PшȄpB0pJ`$0Ȅp2P-@Ђ$=5T6\@+@Ȃ$0pVpȂ$=|/0H@@ɆȂ*@@ɆȂ(9@@Ȃ$:@@Ȃ$o0 ɈȄpP@"=@OTO8p=dRRXP%@цȂ(=T\UxUVxp"=RRH-p"=XWWFpцȂ(=ab0 ɈȄp40 ɈȄpN0ȄpL0Ȅp_0 ɈȄp6P @Ђ$=Pgxg@@@Ȃ&@@ɆȂ(j@F@ɆȂ**@@Ђ$gP V ɈȄp@=Ȃ$0 ɈȄpP  ɈȄp8@@+P'pP ɈȄpr0pNP D шȄpp"=ػ @@ @@@BB c\a(_PaH_Z_r_______ `"`2`H`Z`j`````````e~epedeTe\avaaaaaabb"b.bM[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq_______CCBABADL*(%$""&GABJIIDDJC??AD_-(''%$GG#_DIJIIJIIIDIJDD_+)(''%GG _JMCEJ?ABAECA?BA_,+)('%%"!_IM@AJACDCIDI____.,++>________JMJJJJJJJJJF_..,+)('%$"! #GIMCEJJJI?J__...,+(('%$"! &_JM?AJJJJCJ__...,+)(''%$" _IMJJJJJJJJ_K=...,++(''%$! _JMCDJJJJAJ_K_______L*%$"!_I_?AMNJJEJ_ L'%$"_I_MMMMMMJJ_ _('%%_I_CEMIJJMEM _(''*_I_?BMDJEMDMF _)(-LI_MMMCMMMMM_________< ____I_CEM1;MACDMEJM__I_?A_D1@IJJMJMM_FF_I__6_@/EMMMNMM_FF_I_C80EJDMJCJFF?:AA20?_M_MIEM______MIC4BC/ N______MMMMJIDAI_9/ HJJMMJMMMJ??BAI_A7503 IJMMCBCBA44CCI___BAO;6___C_MJIDIDMI_CI___O; @__C_C?J?AJI_?A_DJJI@ O_CM?;I?JI_________H9MAIJJIJI_CD_____JJI73C;IJIJI_?AMDJJDIMJIE5:JIJI__________MMIA:IJJJJJJJJJJJJJJJJMJ???( 444MMMRRRYYY~eGuuu}}}x>iErCE~7?HVbx/!P7pLcyϏ1Qq/Pp",6@J[1qQq/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq!%///* !*/"(%%'%/) /!#''////+/+"*(/ / !%(/ ( (*/ (///) */   )*  /"///// /+/// # + !%//  +"*+'#+//+'!%*++$++!+! !!!<(0`  !!$& &"   WܱNj+<<:5pi$!!!4888&SNJFB=950,(%%%5ǎVRNIEѹ|Jq?o@ZUQMID@<73/+&"-Ɍ444"ք̴wq?]YUPLHC?;72.*%!"""4888&dya\XTPKGC>:61-)% OÑ%%%5ʎA{;ys`\WSOJFB>951,($(9|:z;xq?o@mAkBiCgCdDuZ;73.*Ǒ%%%5̎È>89}:{;yq?o@mAjBhCfD~dEuZ?:625Оa789}:{;yr>p?n@lAjBhCfD}dEB>:5^ό555"܄ѳ„7789}:{;xr?p@n@lAjBgCeDFA=9"""4;;;&ŌC89~9|:z;xr?p@mAkAiBgCIELɑQQQJnnn~~~Įq?o@mAkBiCHHH"""vvv9~:{;yq?o@mAkB:::'''___sssttt8Ϧuǣvyp?n@lA888T---6fffnddd%%%"""OOOSSSċDҧuʤv{;yr?p?xM<<r?̷999VVV###)))444ѳ͝b@~9|:z;}Cg˶Ӎ󑑑ZZZlll;;;!!!""")))___&&&2:::ppp{{{___WWWWWW:::!!!"""***www"""4888&,̑999ԖJJJ|||lll:::"""BBBXXX|||$$$6,uuuKKKCCC@@@...www* Ҍ666"KKKaaaLLLWWW@$"""4;;;&nnnfff!!!$$$999444]ttt|ȇɑ&&&5ЎvvvmmmVVV{{{OOOڥaaaCCCpppό555"ބ|||MMMfff"""4;;;&\\\Ǒ%%%5Ύݧܦ͌555"ۄۥ"""4:::&ڤÑ%%%5ˎܤׇ ww?ww??ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwwwwwwwwwwwwwww?ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwww?wwwwwwww( @ !!!0\\\JeeeQ666D555A0$ vH<602\7qڴvvvj&&&D1"gLF@;5?кVQKE?9(aV[UPJD>82-uuun{{{j`ZTOVo@lAb_YSMGB<60+%<aVmt>q?n@bb^XRLFA;5/)$Ywwwn}}}j~Cv=s>p?bba]WQKE@:4.(+{;xbba[VPJD?93-'aV~:{;xr?o@lAiBfD}dE|cE|cEiB<61?9}:z;w=t>q?n@kAiCfD}cE|cE}dFGA;=aVңi89|:yq?n@kBhCeD|cE|cELF@mzzznjʓP8~9{;yp?mAjBgCeD|cEPJ\¯mAjBgC~dEaV}:z;xq?n@lAiCJJJőPyq?n@~YVVV???wwwiiiΡkA|;y>>3@@@y~~~obbb000kkk@@@---U<<<&&&[[[6uuusssWWWIII$$$&&&qqqlllg|||s4bbbhhhƑUUU000QQQ}}}---{bbb(iiiLLLBBBaVggg+++NNN|||nj]]]tttkkkrrrwwwӦaVӦzzznjӦˉ ?????(  C﫫oIਨS=?_QF4aZмoEcaXMB70~Iq?c`VK@58z;u=qv>3Eyn@iB~dE}dFGHYYYuuuġ=xmAhC}dE}eGS444|||gC}cEMMM~>q?kAiGRRR¢Gu=xKʺ~AAAAAAAAAAAAAAAA ( h00 %   h4VS_VERSION_INFO?fStringFileInfoB080904b0JCompanyNameSimple Launcher User^FileDescriptionSimple Launcher Executable2 FileVersion1.1.0.140InternalNamew32.exej#LegalCopyrightCopyright (C) Simple Launcher User8OriginalFilenamew32.exe@ProductNameSimple Launcher6 ProductVersion1.1.0.14DVarFileInfo$Translation  Т (0PX`pУ 0@P`pФ 0@P`pХ 0@P`pЦ 0@P`pЧ 0@P`pШ 0@P`pЩ 0@P`dP`pxȪЪت(08@HȬЬج (08@HPXȫЫث (08ȬЬج (08@HPX`hpxȭЭح (08@HPX`hpxȮЮخ (08@HPXxȣأ(8HXhxȤؤ(8HXhxȥإ(8HXhxȦئ(8HXhxȧا(8HXhxȨب(8HXhxȩة(8HXhxȪت(8HXhxȫث(8HXhxȬج(8HXhxȭح(8HXhxȮخ(8HXhxȯد(8HXhxȠؠ(8HXhxЭ 0@P`pЮ 0@P`pЯ  0@P`pР 0@P`pС 0@P`pТ 0@P`pУ 0@P`pФ 0@P`pХ 0@P`pЦ 0@P`pЧ 0@P`pШ 0@P`pЩ 0@P`pЪ 0@P`pЫ@ت𪰫pH(HhPX`hpxȩЩةPK!y!st64.exenu[MZ@ !L!This program cannot be run in DOS mode. $:`v[%[%[%t%[%ƥ%[%Ƥ%[%Ɛ%[%#%[%[%[%Ơ%[%Ɣ%[%Ɠ%[%Rich[%PEd}'\"  6@u@.<P l0.text `.rdata78@@.data@@(@.pdata  <@@.rsrcPRH@@.relocJ@BumLISMCMK HHH3H3H$0LʺICDBHL$0HD$ 8LD$0HH`H  ̅umLISMCMK HHH33H3H$0LʺICDBHL$0HD$ `LD$0HH`H CH\$Ht$WH BHH3LLBILHtBHA;IDII+LD9Ht$8HH\$0H _H\$Ht$H|$ UATAUAVAWHH@LL' HpRHM8E3Le8` A̅H HM8ED$3 HM8oHM8LcAAHE3LM8E|$AIDIHHHtHMED$HUHcI+HHM8AHAHE3qLM8DIHHHxAHN HHHMHA֨HcHH+HM EHM8E3EH+LM8LII#AH HAEf; uMfHM8AHE3LM8LIIAH HH1N\+M;r fA9t M+M;sMHM8x!L\$@II[0Is@I{HIA_A^A]A\]H\$UVWH03HW.H|$` H-GRHt-AE3H3H|$(Hl$ 4}L HT$hHL$XHT$hHL$XuRHL$X$ALH3H|$(Hl$ u3LD$`H bHuHL$X H\$PHH#H0_^]H\$Ht$WH@HHH#D$0LHLH׉t$(d$ ؅u DHt$XH\$PH@_H(u Yt32H(H\$H|$UH$H H.H3HpH33(LEAHHD$P HHD$ t|$Pu3HM0LEA HiH3HL$pDBh^D$phHUHHuzsHUHoHpUNHUHJHk0H E+L\$XL\$HHD$pE3HD$@Hd$8Hd$0d$(E3H3D$ uEHd$0HMpAD3DL$(HL$ yLMpHL3D$hHT$XHˉ WDHL$`HL$XHL$XHT$P+HAL$PH\$Hl$Ht$WATAVH HHH-E3AHHtDKft+f"t%AuHHKHHuHt IHHA Hc AHLHwftALuAHLYHft AuHfD9&t Au HfD9#u AtfD#HH AHHLHf?"u)f;"AHLfD#HHHHAHet f"tf;"AHL} ft%AEtfD#A0t HfuH]H\$@Hl$HHHt$PH A^A\_HHXHpHxUATAUAVAWH8HHO*H3H"f98tOHH3DfHu L-h#LhA}tIAEfuHJA3bf9=It L5I L5IHHpfA4V9P#HHH0HHHH;s9 t9 t HH;rHHH@7HD$P+LAԹDD$(HD$ ΅HHcft|PH|$Pf9t$PtAnt Hf97uf?#HptA?t Hfuf?!HnBA t HfuHT$@HHt$@HfHLL|$@MHwH DIu|L=HH`<H`SfA9T$u*IL$ Z[H>HMHqf7HcH`HMDL3IIIɍPfIHLAIfIHHLIfIHHLIfHI\HHHH@ƋLl$8Lt$0L LHHL|$(Ld$ 9 HIH({ffH; &uHfuHH\$Ht$WATAUH0Hd$ EHHE3AHuz##3AHtAfD9*tHHD$PHu 6#fD9.u"##H HL$ #3LEHH]HHZHH\$XHt$`H0A]A\_@SH ILHHu"C"$AHIHHt3"H [ f;tHfuf;uH3HHPHHL@LH SVWH H3Hu."!K3HtHt$PH#LE3HT$HH#H׋#HEH _^[Ht7SH LH \:3u!HZK!H [@SH d$@LD$@.HHu9D$@t`!Ht V!L$@HH [@SH HAHuY<HCHHHHKH;.t*u<:HH)H9CtHC *u E1HCHCuCHH [HHXHhHpHx ATH@E3IHHAMHue HtHL$ IL\$ E9cu?H+>fAr fZwf fAr fZwf HHt@ft;f;t4HT$ <HT$ <HHHt ftf;t+D8d$8t HL$0H\$PHl$XHt$`H|$hH@A\H(3LL9F8uwMtzHueH(HtL+C fAr fZwf AfAr fZwf IIt ftf;t+ȋH(E3UH(H\$Ht$WH HHw|HHEH m7Hu B}@<H H7L3HHu,9=tHBt r g HBR 3H\$0Ht$8H _Hq@SH ]u;LHcȺ]EHMHu$PHˉ]EHxMHuv3HHH0HHt HKME3HEHILJIHIHkXLIt ItMuIH0Iu3H [H(;I=`6tFH LH(a@SH HH XH;r>HH;w2HH*H+HHHH?LJkH [HK0H [H%@SH Hڃ}JkH [HJ0H [H%HH;r5HMH;w)qH+H*HHHH?L[IH0H%\} r>IHJ0H%?Mt 8tHIuIHH#@UAUAVH@Hl$0H]0Hu8H}@LeHHH3HEE3MHHHuQo3MH;rfD3IEHtTALúDt$(Lt$ LLcu?r*ffAr fZwf fHfD93u3II;sfD3'"]~g3HBHHrXKL$Hw1HAH;w HHLH+H|$0Ht)HHtHIHu /IEALËHDd$(H|$ KtLHH ]*HO9u}HMH3gH]0Hu8H}@LeHHeA^A]]H\$WH@HHHL$ ILD$ HH|$8t HL$0H\$PH@_E3LMK H8IC(ICIcH8H\$ UVWATAUAVAWH LLHL$hHMMHHT$pMtMtMu'`3H\$xH A_A^A]A\_^]H$Ht3HIL;v)HtL3ILHHt3HIL;wIIG HtDO$ADL$`HXG At^LcwEtP I;DBEL;LHHL$hVD)wALt$hH+HHL$pDL$`LH+Lt$hEI;rhEt 3I;v AEA HDID+ DI;EGAH;woHIVELt$hI֋UtkH+vHLtXHL$pHt'ADO$HIHDL$`Lt$hHL$pHHt L3IOK"5O H+3HI(OIHHXHpHxL` AUH0IMHLMt`Mt[H\$`Hu"Ht L3J/HH\$ LMHINHHWH3H\$@Ht$HH|$PLd$XH0A]H8LL$ MLH@H8HHPHHL@LH SVWATH(H33Hur3HtLd$`!G@HfTt*t%HcHHL{CHkXIH $H $HLVCB8u%ttHcHHHkXI A8tSu*HME3HT$XHTH׋cHH(A\_^[fL$SH f;u3Ef;sH'H&LL$@HT$0DG3ɅtL$@#H [H(E3MLMu3HtHu5IHu-IfE9tEfD;tHDfEufD9t HfuH+IfE9tEfD;tHDfEufD9u HfD9ufDHH;I IDH(HHXHhHpHx ATAUAVH HHu"Z:R{Lc}c3ADBg^xҋSu +s;L+A+kt'tuiHP!hy guWH''HtKHtFHgHH Ht3gH;vH fJhyHK(Ht (Hc(cH\$0H _H\$HL$WH Hك3Hu ? &A@tajH5HH\$8H _H\$WH0MZf9t38HcH H8PEu f9Hu3ۃv 9É\$@u"= t-/, )l'u"=t/,(oc/y !,H4:nHmy +jy +`)t+L>#L?#H # #=D$ ud+w+|$@uY+o+H\$HH0_H(koH(vHL$HH +H|HD$XE3HT$`HL$XHD$PH|$PtAHD$8HD$HHD$0HD$@HD$(H<HD$ LL$PLD$XHT$`3"H$HH$HHHH_H$H`6 0H HD$hH HD$p6o3H _=zu n HHĈLI[IkIs ISWATAUAVAWH@MyM1AIy8M+MLHfIcqHIKMCH;7HH\ CL;CL;{;tHL$0IIЅ~t}csmu(H=v7tH m7ntHV7KAIIID$@SLcMHD$(ID$(ILIHD$ H;793MA 3E3M+Ǩ t;39v5HOAL;rL;v H;sHLul DIcqHH;7sUHHHߋCL;r9CL;s1EtD;+t1t;kt(;uHT$xFAD$HDCMAH;7rL\$@I[0Ik@IsHIA_A^A]A\_H\$Hl$Ht$ WATAUAVAWH05)E3IE~ EHLEEEfD9:u HfD9;tAat0rt#wt-3C AA  HAfȃSytjA+ tGt>t' tuEEЃ@@@E|@uvpEubEA cTtOtILt$PkE3҅EZ Etf77D$pA@A AT$HDt MI9A rIEtLt$PA@tMFEFA@tMcFEFLt$PA@t MyIADu A rEy AA;AOt$tIHH#ʉL$HυMt3IIcHLB09~ƈHԋt$@H|$D+HDE0t8HALjufD;uAAA;AAO|$DA;~']HccHEHpH؋D|$DDIH ILt$PAHcHE#HMHL$0MDωL$(HMLHD|$ AtEuH HUHйgfD;uuH S HUHп-@8;uAHHkt$@E3DAt+fD$`At fD$`x|$H |$H Dt$\Ll$xE+D+A uLL$@MAIXLt$P|$D|$D Aō|HЉ|$DADT$DfA*u,AIXLt$PD$\A؉D$\D$\ AōDHЉD$\AA;t>#t2+;t#-;t0;XuZATAIACAPHHD$ LHt$(LHD$8HH|$ H;rpaH9uH;r_HHDHH HH L;uL;tLH\$(HH\$0LHD$8HHD$ HH dHH qEt Eu& AAH\$pHt$xH@A_A^A]A\_E33fE3APX33DBK̺3D9@SH @E3APLY3I; tHr3HHIDH\$Hl$Ht$ WATAUHPHH3H$@3HHNkuNqku =\H-ALHA3ɅL-Af5IA|$u*L&ItE3E333Ht$ 8I6HHH;sEH HJfB DrfB/ B1 DrGDrCH%HXHJH H;rŋ fD9t$b4HD$hH&Lc LhM9L;H=XHbHthH HՉH;sAHP HJb/fB DrfB0 DrGDrCHHXHJH H;rɋGH;|7A~|I<$thI<$taAEtZAEuI $ҚtEHcH HŃHHkXH,I$HEAEHMEiE II;|EIH=H<;tH<;t L;AD$D;ظɃEDݘHHtMHtHHt;H,;uL;@ uL;HL;MD; L;@H;HXAHH 3L$I[ Ik(I{0IA^A]A\HHXHhHpHx ATH =3HAH`HHu(t$d=DD;AAGA;uHl$8Ht$@H|$HHH\$0H A\HHXHhHpHx ATH 3HHAE3HH)HHu*9#v"ݘDD; AAGA;uHl$8Ht$@H|$HHH\$0H A\HHXHhHpHx ATH 3HHAHH$eHHu/Ht*9v"WDD;AAGA;uHl$8Ht$@H|$HHH\$0H A\H\$Hl$Ht$WATAUH 3IHALLHIkeHHu/Ht*9v"ʗDD;AAGA;uHl$HHt$PHH\$@H A]A\_H\$Ht$WH03O__\$ ;}eHcHH<tPH AtKtlj|$$|1HH H0H H &LI$돹H\$@Ht$HH0_H\$Ht$WH A3H$<u?At69+y~-HSDNjl;uCyCK HKcHt$8H H\$0H _@SH HHu H [4gt C@tH=zl3H [H\$Ht$H|$ATAUAWH0D33N3A\$ ;LcHOJ<thJBt^ӷH/J At3Au6A;t#Ɖt$$EuAtA;AD|$(HJp;ADH\$PHt$XH|$`H0A_A]A\ù H\$Ht$H|$ATH L%T33Iu&HcƺH H2H H%t&H$|ɸH\$0Ht$8H|$@H A\HcHI$3H\$Hl$Ht$WH $HH+Ht{tHcHsH#HHuHHKHt ;u3HHuH\$0Hl$8Ht$@H _HcHZHH H%H\$Ht$H|$AUH HcپH=_uNtHHL-I|ty(HHun 3X fHI|u-uHo2 3 I\TH $&H\$0Ht$8H|$@H A]H\$WH HcH=PHH<uuH=H H\$0H _H%H\$Ht$H|$UATAUHHP3MLHHMDC(3IH]$HujvMtHtLMHLE@L;AHGHMEBHuHuЉEAՋHt3x!MxHEЈHU3 t9]B\&ÍCL\$PI[ Is(I{0IA]A\]HHXHhHpHx ATH0IIHHMMuHuH3HHI;vMdLFH iHD$hLHD$(HD$`HHD$ ul.8" ~H 6HtDl18AEAADm`tu ШtL`ШtA;AB؋LHu MH3DBlL LK nL\0@K nIA D0HL0 A:AK nAAIVE`DD0 EtbK nL09A:tQtM K nAHE`DD09Au.K nL0:A:tt K nHE`ADD0:K nLMDH 1H|$ HcU܅|H;qLDK nD05At A> uL0d0IcIMIHEL;A AE<A:t HIHEHL;sIE8 uI~LK nLMHUXH 1AIH|$ ;u uf9}taL)K nD0Ht}X tD#K nEXD1 ;I;u }X u +MHAHj}X LӅtLȅD#HL;m K nD0@uL0 AEHDE+}`EHuHI;rHB8pQt BpQu*u;uHcH]K nD0Ht;HÈL0 |K nHÈD19uK nHÈD1:HcH+MHAHcyiELmPA+DMƉD$(3ҹLl$ Du;Ë]HmJ n@E|0HҺ t fA9uL0d0IcIMIHE`L;eA AEf.fA;tfHI HE`HL;sIEf9u ILK nLMHUH 1AIH|$ u9}LK nD0Ht; f9Ut@fD#EK nD1 EK nD19K nT0:LI;u f9Uuf7MHHDBg Lf9Ut LfD#HL;m`"K nD0@uL0 AEfHDE+]LmPM;tI蚡AD܋YuG \Amu뵋a,338 HXA_A^A]A\_^[]H\$Ht$L$WATAUAVAWH ALHcu3ۉ 3ۅ;=LLIL=AMkXKBL tiAuwPWiKBD tDIՋ 3Kj H\$XHt$`H A_A^A]A\_H(HuOAH(H\$Ht$WH IIHMu3VHu} I.E3҅A tf77D$\pA@A T$LDuA s MI.IA tA@tMFEFA@tMcFEFA@t MyIADu A rEy AA;AOt$dIHH#ʉL$LυMt3IIcHLB09~ƈHԋt$@H|$D+HÉD$HEt ;0 HD$H0uAguCD$D9A;AO|$D~&]HchHEHtH؋D$DIH IAHcHE1{HMDHL$0L$xLƉL$(L$DHӉL$ HMAt39D$DuH zHUHAguuH _zHUHЀ;-uAHH.t$@E3҉D$HD9T$\ZA@t1AsD$P- AtD$P+|$LAtD$P |$LDd$XHt$pD+d$HD+A uLL$@LAԱ HELL$@HL$PLƋHD$ 'RAtAuLL$@LAԱ0U|$H39D$Ttg~cHDHHMAHzeE3҅u/Ut(HELD$pLL$@HHD$ QE3҅u(AD|$@"HELL$@LƋHHD$ {QE3ҋt$@x!AtLD$pLL$@AԱ t$@E3HEHtHE3LU|$DLD$hT$`AL wE EGD8Ut HMHH3苔H$ HA_A^A]A\_^]AIt8Aht)Alt AwuA A8lu IA AA yAA<6uAx4uIAX<3uAx2uIA?I|$DAD|$D Ač|HЉ|$DoADT$DbA*uAID$XIAD$X AčDHЉD$X)A tAA#t1A+t"A-tA0AAAAADT$xDT$\DT$XDT$LEAD|$DDT$T4@8uH\$Ht$WH HcA*]Hu RDE3Hwuu3t HHHHHHkXdH\$0Ht$8H _H\$L$VWATAUAVH ADHcu耵 X xs;=skHLIL5HkXKLtE\KDtDAԋ  ] ɴ VH\$XH A^A]A\_^@SH B@It HzuA$f;u H [̅~LH\$Hl$Ht$WH IILH?tH\$0Hl$8Ht$@H _H\$Hl$Ht$WATAUH A@@H\$`ID#ILt IxuAC#~9AMLHI?u;*u?LH̃;uD#H\$@Hl$HHt$PH A]A\_H\$UVWATAUAVAWH$ HHbH3H3HHL$xHUHMIMLL$PD$pDD$XD$HD$LD$lD$D͑ E3HEHu,舲E3D8]t HE\ LEMtE(AEELUT$@fE! H]NYD^!ILE AfA+f;wH ALAHcH IcHHeD ADL$hA AEJM E'P AŹd;5ACQEGSX{ZtOac"Dl$D-D9T$l]A@/Af|$\|$LIILt$PHt9HXHt0-A sDoԙDl$D+DD8EDT$DHH%E3L_A0uE 9t$HIDILt$PESHEHDiHD8HU$E3҅tHAHD;|A0uE AIAfD$`Dl$DLt$PEt4D$dHEDT$eLc LMHT$dHM"E3҅y Dl$lfEH]E}EfEgA@H]Ћ\AD|$He8g;~ǹi; no;ptasu;x;AHHAHDDl$DH fD9tHuH+HDAAD$pEi Ey|fQfDl$\AQfD$^kAEyQD LI>ILt$PQ!E3҅D$@EZ EtfD$lA@A A0T$LDt MI9A rIEtLt$PA@tMFEFA@tMcFEFLt$PA@t MyIADu A rEy A;ODt$pIHH#ʉL$LυMt 3IIcHLB09~AƈHLt$PH|$H+HDDt D8+HAD+ufD;u?A;AO|$HA;~']HcHEHhH؋D|$HDIH /ILt$PAHcHEmHMHL$0MDωL$(HMLHD|$ AtEuH TmHUHйgfD;uuH ž/mHUHп-@8;uAHHIXLt$P|$Ht$H Aō|HЉ|$HADT$HfA*u,AIXLt$PD$XA؉D$XD$X AōDHЉD$XAA;t>#t2+;t#-;t0;XuWAQAFA@A9A3DUDT$lDT$XDT$LEt$HDT$D|$HDL$hLEXE(fEEtAu=D8Ut HMHH3虄H$0HA_A^A]A\_^]I֧E3D8]t HEH\$Hl$Ht$WHP3IHHMu3Hu|HtIwHL$0I{L\$0AKuGH+fAr fZwf  fAr fZwf HHt ftf;t+GDLǺt$(H\$ Su'I@8l$HTHD$@C@8l$Ht HL$@H\$`Hl$hHt$pHP_H(E3LD9 uxHuߦlH(HtIwL+AfAr fZwf  fAr fZwf HIt ftf;t+H(H(DHHfuH+HHH\$Hl$WH0Hd$@H HHtud$(Hd$ DL33eHctxHϺHD$@HtaLD33ɉ|$(HD$ {et:HL$@3RxHHHu3H\$HHl$PH0_HL$@Ht HL$@ÃHHXHhHpHx ATH0HtE3AHuf=tHH\CfuGHc$HHHtHfD9#tSHf;=pt.HcHHHtxLHHuQHHcHCfD9#uHŷHL%L'3H\$@Hl$HHt$PH|$XH0A\E3E333Ld$ \H `蓂L%TH\$Hl$Ht$WH e3HHtLf9tHf9uHf9u+ǃHcHHHtLHHHH'eHH\$0Hl$8Ht$@H _H\$WH HcJHtYHu @u ;u@`tJHJH;tJH7cu c3ۋILHHAHH MkXBDt Z3H\$0H _H\$L$VWATH Hcكu xe;s]HHHL%HkXIL8t7:JID8t 肢 J艢 a H\$PH A\_^@SH AHt"AtHI^c3HHCCH [H(H8csmu+xu%@ = t=!t="t=@u'3H(H(H a3H(H\$Hl$Ht$WH H:E3HHHH99tHHH;rHH;s99tIHRLAMEIu LIA@4Iu&HHy0HHLLH|9uǃ9uǃ9u ǃz9u ǃf9u ǃR9u ǃ>9u ǃ*9u ǃ9ǺD‰AЉ LIIAH3H\$0Hl$8Ht$@H _H\$Hl$Ht$WH0==uֵH3Hu<=tHJH\uGHcHHeHtHq;tPH ;=pt.HcHDHHtsLHHz"uKHHcH؀;uHHD}H% H'V3H\$@Hl$HHt$PH0_Hd$ E3E333辝H |H%HHXHhHpHx ATAUAVH Ll$`MIAeLHAHtLI3;"u3@"HË9AEHtH3HËaOtAEHtHH@tu@ t@ uHt GH3;; t; uH;MtI<$IA3H;\t;"u6utHC8"uH 33҅Ht\HAEutOu< tG< tCt7NHttHÈHAEH tHAEAEHYHtHAEMtI$$AH\$@Hl$HHt$PH|$XH A^A]A\H\$Ht$ WH0=Bu۲H=\A3HN]H5H=Ht;uHHD$HLL$@E33HHD$ Hct$@HH;s\HcL$HHsQHH;rHHHHt8LHD$HLL$@HHHD$ gD\$@H=A3D۴H\$PHt$XH0_HHXHhHpHx ATH@]E3HHHfD9 tHfD9#uHfD9#uLd$8H+Ld$0HL3DK3Dd$(Ld$ \HctQHHHtALd$8Ld$0DKL33ɉl$(HD$ \u HcyIHg\H HY\3H\$PHl$XHt$`H|$hH@A\H\$WH H}H=}HHtHH;rH\$0H _H\$WH H|H=|HHtHH;rH\$0H _H\$WH H{Hd$0H2-+H;t HHdvHL$0[H\$0[DI3[DI3[HL$8DI3{[L\$8L3HL#H3-+L;LDLILH\$@H _̃% HMZf9t3HcHEA IcEHTE+;)DE;D}AHc DeXHAHHkXIƀd8Dd8HcHƒHHkXI Ƌƀd8D8@8}u @tHc HHHkXIƀL A#;AHMQEDEHMPH|$0D$(ALMD$ ALSHu5xQLcIAHMkXIBd 8rHcHʃHHkXI H -E3E333H|$ IH\$WH@d$03H|$pHu/軐3Htك|$xtAtDL$(DD$ DLHHL$0؉D$4|$0t,t!HcHHHHkXH€d8rjH\$PH@_H8ADL$`ELD$(HL$ DAIH8Mu3ftf;u HHIu +H(u  Bx.; Hs&HcHTHHHkXHD@ӏ `3H(H\$Hl$ VWATH@HH3HD$0B@HHH-L%ټt5Ht(HHHcHDAMkXMLAC8$< HVt5HIt(HHl$$OxHEHHHMHHȃtH;\$ |@HcOHOx&Hf1HcGHGxHf0H HAHL$0H3jH\$pHl$xH@A\_^H\$WH H H NHHHuH\$0H _H 3HH9 $HHXHpHxL` UHHPE3IHHHtMtD8"u%HtfD!3H\$`Ht$hH|$pLd$xHP]HMIkL]E9cu#HtfD8et HEHUHMD A~0A;|+IAHLǺ D$(H\$ 7LHMuHc H;r&D8gt D8e6HM&P*D8et HEAAHAQLljD$(HEH\$ HK E3@SH@HL$ jHD$ DH@BY%|$8t HL$0H@[@SH@HL$ 3PjHD$ DH@BY%|$8t HL$0H@[ffHHHtfHt_uI~IHMHLHI3I#tHPtQtGHt9t/Ht!tt uHDHDHDHDHDHDHDHD@UATAUAVAWHPHl$@H]@HuHH}PHH3HE]`3MEU~*DIA@88t HEuAA+;ÍX|DexEuHD`DMẢ|$(H|$ ILcu3I~^3HBIHrOKL-Hw*HAH;wIHzH+H|$@HtjHHt HHtDMƺADl$(H|$ ILDu!t$(H!t$ AELAtJHc"AEt7Mp ;HEhL$(ELAAHD$ ,J~g3HBHHrXHL6I;w5HAH;w HH~H+H\$@HiHHtH3HtnELAAΉt$(H\$ I3ɅtfHMH3(dH]@HuHH}PHeA_A^A]A\]H\$Ht$WHpHHL$PIAtf$D$HL$PD\$@D$8$D$0H$LHD$($DNj։D$ |$ht HL$`L\$pI[IsI_@UATAUAVAWH@Hl$0H]@HuHH}PH&H3HEuh3EMDuHp]pΉ|$(H|$ FLcu3~gHL;wXKL$Hw1HAH;w HH[H+H\$0HtgHHtHHHtM3HMEMƺDd$(H\$ EtLM`DHAAFHK9uFdHMH30bH]@HuHH}PHeA_A^A]A\]H\$Ht$WH`HHL$@AI|dD$$HL$@D\$0D$(H$DLNjHD$ E|$Xt HL$PH\$pHt$xH`_ffLH+Irat6t  IȈHtf IfHt  IHMIuQMItH HHIuIMuI@ HIuIffffffffffffI sBH LT H HALQHD LT IHALQuIqffffHr  D @HuH@L LT L LQLL LT LILQLL LT (H@LILQLL LT LILQuIIq $fffffffffffIIrat6t HɊ IȈtHf Ift H IMIuPMItHH IHuIMuIHɊ IȈuIffffffffffffI sBHD LT H HALQHD L IHALuIsfffffHw H D @uH@LL LT LILQLL LT LILQLL LT H@LILQLL L LILuIIq $HSH HHI:`HK1`HK(`HK `HK(`HK0 `H `HK@_HKH_HKP_HKX_HK`_HKh_HK8_HKp_HKx_H_H_H_H_Hx_Hl_H`_HT_HH_H<_H0_H$_H_H _H_H^H^H^H^H^H ^H(^H0^H8^H@^HH|^HPp^Hpd^HxX^HL^H@^H4^H(^Hh^H^H^H]H]H]H]H]H]H]H]H]H]H]Ht]Hh]H\]H P]H(D]H08]H8,]H@ ]HH]HP]HX\H`\Hh\Hp\Hx\H\H\H\H\H\H\Hx\Hl\H [HtfSH HH H; EtF\HKH; ;t4\HKH; 1t"\HKXH; gt\HK`H; ]t[H [HSH HHIH; t[HK H; t[HK(H; ؏t[HK0H; Ώt[HK8H; ďt[HK@H; t{[HKHH; ti[HKhH; tW[HKpH; tE[HKxH; t3[HH; t[HH; t [HH; tZH [@SH Ht HtMuD|#|H [LM+ACItHuHu^|"3ffH+LtB :uVHtWHuIJ ffwHJ H;uI~LHHI3ItHH3ffft't#HttHtt tu3HHffH+Ir"tf: u,HIuMIuMt: u HIuH3ÐIt7HH; u[HAH;D uLHAH;D u=HAH;D u.H IuIMItHH; uHIuIHHHH HHH;ffMtuH+LItB H:uWItNtJHuJ ffwHJ H;uHII~vHLI3It H3HHÄt't#HttHtt tuH3H( HHt>/H(H(H +:HlH(H eH fH gH hH UH%9H\$Ht$WATAUAVAWH03|$`3уtbtMtXtSt.tt5!yx@L%ݛH ֛L%ڛH ӛ|L%›H l脓HHurHHLc7T9YtHIHHH;rIHHH;s9Yt3LaM,$ L%DH =|$`8LIu3Mu AM蔙̅t3Ht t tL|$(,LL|$(HuDdžDt$`u9 YSщL$ QS;}*HcHHHd‰T$ (SmI$t3认;u AA;t t L; DH\$hHt$pH0A_A^A]A\_H )H )@SH JHH7HzHkHuCH#3H [H\$Ht$H|$ATAUAVH LH 3=7LH -7HI;HI+LoII9,HI;sUH;HBHH;rI3Hu3HV H;rIIɞHt(6H5HPHH&6H5HPHH5Hg5LHHt"HYPH5H?5HؗHϗHƗLǗH;tbL;t]H5H H5LHtj)I H!|$ LL$HEI*|$H3뤋jxHD$PH +HAD@t A}2ii =+|$DH H3EH$H0A_A^A]A\_^]H\$L$VWATAUAVH ALHcudi #~4AMLHbIŃ?u;*uLHձ?Hу;uD#H\$@Hl$HHt$PH A]A\_H\$UVWATAUAVAWH$0HHiH3H3HHL$pHT$hHMIMD$dDD$XD$DD$LD$\D$T%EdfE3HEHu,SfeE3D8]t HEAC@L ]%H?HtA;t(t#LcL 4%IAHMkXM n LL %A@8u)A;ttHcHƒHHkXI nB8t,e)eE3D8]t HEA$E3HT$hHtD"ADT$@DT$HELUEH]AHHT$hAD$=7\u'tt u 3HDH 3X Y H\$0Hl$8H _H(uX X Mx1; s)HcH HƒHHkXHDtHX xX XHH(HHXHpHxL` AVH HcLIL5HkXK4|3 u4O '|3 uHL3s#D3 tK HLH\$0Ht$8H|$@Ld$HH A^HcH HƒHHkXHHLH%H\$Ht$H|$ATAUAVH@HDE3^ 苄ua3H|$$@LcJHH\$0JH H;C{ u< { u!HKVu DhDl$(C փEudHKCt HKHHEu?CH3LK+H.袋.HLIIH?LDDd$ HXHHD;XJ0~HD$0HtsHcL|IЃY I H H;s@H0@ ` HXHD$0|$ HcHHHkXID[DD|$ 赂AH\$`Ht$hH|$pH@A^A]A\H\$fDL$ UVWHH`IHHHuMtHt!3Ht Iv@UTdHU@HM3L]A{E8f;vJHtHt L3H蟈T*T}t HMH$H`_^]Ht0Hu)T_";T@8}eHMUHt}HEe(AKHE(HD$8Hd$0LE8A3҉|$(Ht$ t}(3HtzHtHt L3H裇S"zS}HEH8Hd$ -H8HHXHhHpHx ATH0IcIDE~HIHHcD$hH|$`~ HHt tD$(DLƋAH|$ +ظHHDH\$@Hl$HHt$PH|$XH0A\H\$T$UVWATAUAVAWH03LHuRnRL!M=I<0LHL;f9hH5kDAH;5kuo3HHuZHH9uHc`zHHHuH sHEHtH+HHHH/Hu3H/|$xH5kHHjtIHtD语Hekyy蚫tpQH$H0A_A^A]A\_^]Et3Hu#H&yHjHtH(H5jHu yHzjHtH(H5kjHHtHM+HILl$pMcHtE=MHI;3ɅuHfB94hfB9 hHHHuH5jH+HE3L9mHcHL/EtfL9ltHLHHHDHL9luHcHH;H iAyHt{rH5{iH+HsLdM.\EyߍG;tLcHL;^H4yHHHcL$LlM.H iD9l$xtuI蒩H wHHtUIrMHH CuQHD$pHHGfD*HEIEuO*H-Et I-M.E3E333Ll$ VNI-M.H\$Ht$WH@HHL$ AA-HD$(DA|utHD$ H@BY#3t|$8t HL$0H\$PHt$XH@_̋AE33rHHXHhHpHx ATAUAWH H33DGLHtPDG3ҋwHt=HH+HHAWHESHHu1>N 3NH\$@Hl$HHt$PH|$XH A_A]A\úDDI;HEMNj#t HH+H~M8u M HAԋ LH3 Uy]E3HՋHTHl HHHHu%fM {MH HE3IՋ5H3H\$LcHyzMAIMkXJ BD8F\ADA@tXtHt(t uHBLJBd8BL80BLJBd8BL8BdBLJ Bd8EuA%@H\$H(HuJLK Zo3H(H\$Hl$VWATH DHH8SHc‚uK K 8@t K"3t{HCHSC{C u/_-H0H;tQ-H`H;u YuHC+HS+kHBHC$C~DŋW SJIHH(LH b3H(H% fL$H8H \Hu H \Hu%Hd$ LL$HHT$@A tD$@H8H\$Ht$WH0HHtL0HHH'HHt.HVLH3`3"@V@@@@p#@}'\M"S@T@ccsUTF-8UTF-16LEUNICODEHH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSunHH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSun  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~CorExitProcessmscoree.dllruntime error TLOSS error SING error DOMAIN error R6033 - Attempt to use MSIL code from this assembly during native code initialization This indicates a bug in your application. It is most likely the result of calling an MSIL-compiled (/clr) function from a native constructor or from DllMain. R6032 - not enough space for locale information R6031 - Attempt to initialize the CRT more than once. This indicates a bug in your application. R6030 - CRT not initialized R6028 - unable to initialize heap R6027 - not enough space for lowio initialization R6026 - not enough space for stdio initialization R6025 - pure virtual function call R6024 - not enough space for _onexit/atexit table R6019 - unable to open console device R6018 - unexpected heap error R6017 - unexpected multithread lock error R6016 - not enough space for thread data R6010 - abort() has been called R6009 - not enough space for environment R6008 - not enough space for arguments R6002 - floating point support not loaded `@@ @ P@@@@@ @p @ @ @@ @ @ @ @ p @!@x`@y@@z @@@Microsoft Visual C++ Runtime Library ...<program name unknown>Runtime Error! Program: (null)(null)EEE50P( 8PX700WP `h````xpxxxx ((((( H h(((( H H  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~  GetProcessWindowStationGetUserObjectInformationWGetLastActivePopupGetActiveWindowMessageBoxWUSER32.DLLEEE00P('8PW700PP (`h`hhhxppwppCONOUT$Fatal error in launcher: %s Fatal error in launcher: %s rbFailed to open executableUnable to find an appended archive.Unable to read from file#!PATHEXT;Job information querying failedJob information setting failedstdin duplication failedstdout duplication failedstderr duplication failedUnable to create process using '%ls': %lsFailed to get exit code of process.exe/usr/bin/envExpected to find a command ending in '.exe' in shebang line: %lsExpected to find whitespace after '/usr/bin/env': %lsUnable to find executable in environment: %lsExpected terminating double-quote for executable in shebang line: %ls<launcher_dir>\Terminating quote without starting quote for executable in shebang line: %lsFailed to find shebangExpected to find terminator in shebang lineExpected to decode shebang line using UTF-8Expected to find '#' at start of shebang lineExpected to find '!' following '#' in shebang lineExpected to find executable in shebang lineExpected to find arguments (even if empty) in shebang lineExpected to be able to allocate command line memory"%ls" %ls "%ls" %lsRSDSdD_bC:\Users\Vinay\Projects\simple_launcher\dist\t64.pdbd 4 R p(8442p`0(8  20- 5td 4 3 rPq0  4 rp  b 42 p`P  t d 4R(8))Bp`0(8x*6+4 t d T 4242 p(8e.o.N d T 4 Rpd42p(82$2NRP  t d 4R(8)33h33h  4 2p42 p(8/595N  4 Rp(8666   d T 4 rp dT4 Rpd 4R p(8"=B>. d4 p Pqbt42   200 4 p`Pq/ td4Pqp  4 2p(8rQQ4r p`Pq8  t d 4R(8UV20(8CZYZ  4 2p(8 [[)[P[42p(8\\\&]4  P2042 p d4rp(8`a-- dQTP4OJpq@ tT4 t dT42 d T 42pd 4R p(8njj t d 4 R(8*lnlQkltd42dT42p2Ptd42(8gnn td4Pd 4R pd T42p  p ` 0 P d 4 2p(8~~d42 pdT42p4 2 p `(8ߋdT 4 pT 4 R p t d T 4R4 2 p `(8#Gd T 4Rpd 4 R p t d T 4 r  4 2p B(8$ $4$p`P  4 rp(8ͯ!T4r p `q0 td 4 Pr0- Etd4C PqHd4 p- 5td43r Pq0d4 p2 0 B(8 d4 R p(8K t d 42(8i p`P0qH6 %4q%f p`Pq 4 2 p `(84 2 p `(80 4dZ p`Pq4 2 p `(8T42 p  td42(8 td 4 r(8l 4p ` P 4R p ` P t d T 424T 42 p `  bd 4 r p,q0, q0+t4430 Pqp   4 Rp`P td4rP d T 42p7 &t&d&4&PqB.03x1p31111112282T2f2|22222223"37777|33333333464J4^4x444444455 5*565H5V5d5n5~5555555566$646@6R6l6666666 77*787H7Z7n7~77T3>3`3ExitProcessGetCommandLineW+SearchPathW~SetInformationJobObjectCreateProcessWGetCurrentProcessWaitForSingleObjectmGenerateConsoleCtrlEventAssignProcessToJobObjectdFormatMessageWGetExitCodeProcessGetModuleFileNameWQueryInformationJobObjectiMultiByteToWideCharCreateJobObjectAkGetStdHandleGetLastError;SetConsoleCtrlHandlerDuplicateHandleRCloseHandleKERNEL32.dllPathRemoveFileSpecWEStrStrIW:PathCombineWSHLWAPI.dllHeapFreeHeapAllocEnterCriticalSection;LeaveCriticalSectionpGetStringTypeWGetCommandLineATerminateProcessUnhandledExceptionFilterSetUnhandledExceptionFilterIsDebuggerPresent&RtlVirtualUnwindRtlLookupFunctionEntryRtlCaptureContext%RtlUnwindExInitializeCriticalSectionAndSpinCountEncodePointerDecodePointerHeapSetInformationGetVersionHeapCreatexGetCPInfonGetACP>GetOEMCP IsValidCodePageZFlsGetValue[FlsSetValueYFlsFreeSetLastErrorGetCurrentThreadIdXFlsAllocLGetProcAddressGetModuleHandleW4WriteFile|SetHandleCountGetFileTypejGetStartupInfoWDeleteCriticalSectionSleep/LCMapStringWReadFiletSetFilePointergFreeEnvironmentStringsWGetEnvironmentStringsWGetModuleFileNameA WideCharToMultiByteQueryPerformanceCounterGetTickCountGetCurrentProcessIdGetSystemTimeAsFileTimeCreateFileWALoadLibraryWHeapReAllocGetConsoleCPGetConsoleMode]FlushFileBuffersSetStdHandledCompareStringWeSetEnvironmentVariableWaSetEndOfFileQGetProcessHeapHeapSize3WriteConsoleWp@p@2-+] f        ! 5A CPR S WY l m pr   )     abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZPE@`y!@~ڣ @ڣ AϢ[@~QQ^ _j21~CH@D@@@<@8@4@0@(@ @@@@@@@@@@@@@@@@@@@@@@@|@t@l@`@X@H@8@0@,@ @@@ @@@@@@@@@@x@`@P@8@0@(@ @@@@@@@@@@@@@@@@p@`@H@8@ @@@@@@@J@J@J@J@J@R@`@@p@J@PM@d@ @@`@b@(@(@(@(@(@(@(@(@(@(@..R@R@xc@xc@xc@xc@xc@xc@xc@xc@xc@R@|c@|c@|c@|c@|c@|c@|c@.Kr.t-O\)P<.},.-.>.@LX.Lp..##CL'dP#5t#8yL'| L' 6!4*8!!.!"\)"p#L'p##.##L'#-$L'$&|#&&#&'#'S)#T))#)*%*J+$L++t#+s,.t,*.($,..D$./(/0h$01%11|(1>2$@22\)23$4k4L'l44$4N5$P56 %66.6&8D%(8%:L%(:=h%=_>%h>?%??.?W@*X@v@%@@.@A.AFAL'`AA%AA%AA%AA%AB%BB%BM&MN.NN$NDO|(DO4Q(&4QQH&QR*RTl&TV&VW.0XY\)YZL'ZyZ&ZZ.Ze[&h[[$[\L'\C] 'D]]L']^@'^^L'^^L' _O_L'P__T'__$_o`$p`a`'8b^bL'bd'd/e.8ekeL'le>h'@hh'hCi'Dii'iTj'Tjj(kyk\)|kkL'kl((lDmh(Dmm|(mn(no$oo(o@q)@q^q%`qqL'qq.qAr(rr(r]t(ptZu)\uv\)v})}~,)~.\)l),6\)8)OL'Pl)>'@&ę)ęX.t9)<q)t|(${)|L'..|(*ߣ($֤$*ؤ̥4*̥$<$<L*X*ħlx*l>*@r%.*6$PŴ*д*_*p**z+|ں,+ܺZT+ph+l+t# l+ mL'0x+@+ ++.L~+L'+. ,L'WL'X.k\)l\)T(,T3L,4 x, RL'T',Q$T7,8L'9|(<,\.\-,40-4p- % )o-p--f-h.'-4t.t. - (-.(4$4N(Nh(h$(((( (-(-Q(Qy(((((K$Ki(i((((((p0eH`x (h(%xhhHZ( @...GGGWWWiiiuuu ̀ ww ww||wwwwwwwwfwwwww|fwwwwwwffwwwwwwffwwwwwfflwwffffffwfffffflwffffffwffffff|ffffffffR\Ilffl)ffح2L18Ϥ"A< ΣTπU  ؀ ???????( 444MMMSSSzzzp p{p{ffkof_fffk_fff[f}UUUfL4UUU_kJqO_~'[U_Uwwwww{~( @%%%+++000===AAAIIIMMMQQQVVVYYY]]]~dFgggjjjmmmrrruuu}}}u?z=~;gEkCoAr@:IbpƏKУk(,1?5<\CKQsU[cbð/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq_______CCBABADL*(%$""&GABJIIDDJC??AD_-(''%$GG#_DIJIIJIIIDIJDD_+)(''%GG _JMCEJ?ABAECA?BA_,+)('%%"!_IM@AJACDCIDI____.,++>________JMJJJJJJJJJF_..,+)('%$"! #GIMCEJJJI?J__...,+(('%$"! &_JM?AJJJJCJ__...,+)(''%$" _IMJJJJJJJJ_K=...,++(''%$! _JMCDJJJJAJ_K_______L*%$"!_I_?AMNJJEJ_ L'%$"_I_MMMMMMJJ_ _('%%_I_CEMIJJMEM _(''*_I_?BMDJEMDMF _)(-LI_MMMCMMMMM_________< ____I_CEM1;MACDMEJM__I_?A_D1@IJJMJMM_FF_I__6_@/EMMMNMM_FF_I_C80EJDMJCJFF?:AA20?_M_MIEM______MIC4BC/ N______MMMMJIDAI_9/ HJJMMJMMMJ??BAI_A7503 IJMMCBCBA44CCI___BAO;6___C_MJIDIDMI_CI___O; @__C_C?J?AJI_?A_DJJI@ O_CM?;I?JI_________H9MAIJJIJI_CD_____JJI73C;IJIJI_?AMDJJDIMJIE5:JIJI__________MMIA:IJJJJJJJJJJJJJJJJMJ???( 444MMMRRRYYY~eGuuu}}}x>iErCE~7?HVbx/!P7pLcyϏ1Qq/Pp",6@J[1qQq/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq!%///* !*/"(%%'%/) /!#''////+/+"*(/ / !%(/ ( (*/ (///) */   )*  /"///// /+/// # + !%//  +"*+'#+//+'!%*++$++!+! !!!<(0`  !!$& &"   WܱNj+<<:5pi$!!!4888&SNJFB=950,(%%%5ǎVRNIEѹ|Jq?o@ZUQMID@<73/+&"-Ɍ444"ք̴wq?]YUPLHC?;72.*%!"""4888&dya\XTPKGC>:61-)% OÑ%%%5ʎA{;ys`\WSOJFB>951,($(9|:z;xq?o@mAkBiCgCdDuZ;73.*Ǒ%%%5̎È>89}:{;yq?o@mAjBhCfD~dEuZ?:625Оa789}:{;yr>p?n@lAjBhCfD}dEB>:5^ό555"܄ѳ„7789}:{;xr?p@n@lAjBgCeDFA=9"""4;;;&ŌC89~9|:z;xr?p@mAkAiBgCIELɑQQQJnnn~~~Įq?o@mAkBiCHHH"""vvv9~:{;yq?o@mAkB:::'''___sssttt8Ϧuǣvyp?n@lA888T---6fffnddd%%%"""OOOSSSċDҧuʤv{;yr?p?xM<<r?̷999VVV###)))444ѳ͝b@~9|:z;}Cg˶Ӎ󑑑ZZZlll;;;!!!""")))___&&&2:::ppp{{{___WWWWWW:::!!!"""***www"""4888&,̑999ԖJJJ|||lll:::"""BBBXXX|||$$$6,uuuKKKCCC@@@...www* Ҍ666"KKKaaaLLLWWW@$"""4;;;&nnnfff!!!$$$999444]ttt|ȇɑ&&&5ЎvvvmmmVVV{{{OOOڥaaaCCCpppό555"ބ|||MMMfff"""4;;;&\\\Ǒ%%%5Ύݧܦ͌555"ۄۥ"""4:::&ڤÑ%%%5ˎܤׇ ww?ww??ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwwwwwwwwwwwwwww?ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwww?wwwwwwww( @ !!!0\\\JeeeQ666D555A0$ vH<602\7qڴvvvj&&&D1"gLF@;5?кVQKE?9(aV[UPJD>82-uuun{{{j`ZTOVo@lAb_YSMGB<60+%<aVmt>q?n@bb^XRLFA;5/)$Ywwwn}}}j~Cv=s>p?bba]WQKE@:4.(+{;xbba[VPJD?93-'aV~:{;xr?o@lAiBfD}dE|cE|cEiB<61?9}:z;w=t>q?n@kAiCfD}cE|cE}dFGA;=aVңi89|:yq?n@kBhCeD|cE|cELF@mzzznjʓP8~9{;yp?mAjBgCeD|cEPJ\¯mAjBgC~dEaV}:z;xq?n@lAiCJJJőPyq?n@~YVVV???wwwiiiΡkA|;y>>3@@@y~~~obbb000kkk@@@---U<<<&&&[[[6uuusssWWWIII$$$&&&qqqlllg|||s4bbbhhhƑUUU000QQQ}}}---{bbb(iiiLLLBBBaVggg+++NNN|||nj]]]tttkkkrrrwwwӦaVӦzzznjӦˉ ?????(  C﫫oIਨS=?_QF4aZмoEcaXMB70~Iq?c`VK@58z;u=qv>3Eyn@iB~dE}dFGHYYYuuuġ=xmAhC}dE}eGS444|||gC}cEMMM~>q?kAiGRRR¢Gu=xKʺ~AAAAAAAAAAAAAAAA ( h00 %   h PAPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADТآPX4Ƞؠ(8HXhxȡء@ȪЪت (08@HPX`hpxȫЫث (08@HPX`hpxȬЬج (08@Hح8xPLpxȢТآ (08HPX`hpxPK!zzt32.exenu[MZ@ !L!This program cannot be run in DOS mode. $vТ%Т%Т%[:%Т%M %Т%M<%Т%M%Т%1%Т%У%Т%M %Т%M8%Т%M?%Т%RichТ%PEL'\  2@7@0<`P P@X.text `.rdata,.@@.data6 @.rsrcP`R@@.relocj@BU"A3ʼnE}uEEPu hhPgPh< Aj@P j@M3m U"A3ʼnE}uEEPu hhPVPhx A@P j@M3 UMW3FP.APQ t.A ;uHE+D0ϋ_]U,VWh AE3h`;AP}}i 3;h AQjWuuE$UE;}}WuuuhjSS9 ;t+EjY}E~V\ EEYE;}}WuuauVjunu3;h AuPUE+EjEYu}Eh ,MMj)MuuuWjS3; AVPf A$f;u]TEy3jPuuWjS3;VP$Df Af;tH;sEuEY_^U Vj.u3uYYtVhh=AhVuV@ttFqWh AEPEP$uu;uIEP AWu Vhh=AhPuV@uEPWV^ ;u3Fu Y_^UV@&jjjVPuPH@u @@uF^]U}uhEAt jP@3@]U"A3ĉ$ESVW3WWD$8@؍D$PjpD$xPj S0@t |$pu3@3h AP$0YYjpD$tPj S @h8 APjD^VD$4WP2]t$(5<@jPD$d$X APYYjPD$h$t APYYjPD$l$ APzYYjh@D$\D@D$PD$,PWWWjWWt$4W@;u=@@WQ$RQPWh$@$Pt$h AWt$D$$ShEA @t$L@jt$@D$Pt$(@h APYYt$@UQSVW=H@( ASu׋t>FEft"tjPYYu Su׋uӅt ]]j h4 ASa3ɅShP AQ6{ftjPAYYt3@3Sh AP ftjPYYuf?tjPYYuf9ujPYYt3fW/Sh AjXh=APf;"u&3f>"Sh APq3f jhH ASk tf{"t3f>"Shh AP0 ft&jP>YYt3fjP)YYt fuE 0_^[U0"A3ʼnESVW@f8"tj j"YQP7YYu Dž A$pjPYYt fu牵W`;AVj,@f=`;A"t Džb;A3ɍf B.AP3h APY3Y;s t tA;r3h APYYWP+VSjh4@33;h AP3fuYYf9tjPYYtf9u3f>#h(APjYYj_jP|YYt f;u3f>!hXAP7YYjPLYYt f;u荅PVS3hAP39hAPj[SWhH A$uvh`;AhP} PL@f"u+j[G j"P 3Wh APx3f_PPPP@ǍPffu+Hffu+Hffu+ȋPffu+jt1VD3hAPWh(AVVS1 0S&; "Au)j hA@3}3];;uv3{3u ;;t3f9>;tE;u ɉ}f9;u jEPh"A PuVSEE EuaYËUVuu'j^0$huu  t3^]ËUEfU f;tfuf9t3]j h0A3u3;;uMK39} ;t߉uV8Y}V ؍EPWu V!EVS E EugYËU}t-uj5 2A`@uV@@PY^]ËUQeVEPu ug, u9Ett M^ËUEVF ucx8FHlHhN; h+At )AHpu'6F;((AtF )AHpu.FF@puHpF  @F^]U3SW9E]u} tVuM0ExuA+;Ar Zw Ar Zw MtDft?f;t8EPP-:EPP:Mt ftf;t+}^tMap_[ËU=P2AVuy39Euu3cM t+Ar Zw Ar Zw Mt ftf;t+juu u^]ËUS]woVW= 2Au>j<h9YYt3@Pj5 2Ad@u&j ^98At S>YuM0F0_^So>Y2 3[]ø A̡VAVj^u;}ƣVAjP@YYFAujV5VA@YYFAujX^3ҹ AFA  "A|j^3ҹ AWEAt;tu1 Bp A|_3^cC=|2At/A5FAYËUVu A;r"`"Aw+QDN Y Vh@^]ËUE}PtDE H Y]ËE Ph@]ËUE A;r=`"Aw` +PRCY]à Pl@]ËUME }` Q#CY]à Pl@]̋D$ StRT$3ۊ\$ t 2trt2urWߋ_t 2t@u[Ãr 3˿~3σtJ2t#2t2t 2t_B[ÍB_[ÍB_[ÍB_[ËUEt8uPbY]ËUQQ"A3ʼnESV3W;u}j^0!,uVEYY;Er3fՋE @;u)f9tAr Zw ff9u3SSjVWPDȃM;u*9Ms3fj"];~Cj3Xr7D =wD;tPY;t M؅u  놋E QSjVWpCtSuV Pj*YSYƍe_^[M3*ËUuMVMEPu n}YYtMapËUju u ]ËUEPjuuu u]ËUMS] VW}M]t}tu93_^[Ëut 39Ev!t SjQHM t39Ew}F }tFEEF tDFt=;r;}W6uu\L)~>}+߃)}};]r\}t3;v uu+ ;w;Ew[PuVKYPJ t{tdE+)E$VCYtR}t"MEFKME&E} tu juL *"N +3uN j hPAP3u9ut/9ut*9uu-} tu VuK p3UueYuuuuu uEEEuYËUuuu juZ]j hpA3ۉ]3};;u839] ;t܉}WY]G @uoWDJYttȃ EAx+AA$u)ttEAx+A@$tIM9]u#W#EPSu WKEWVE EuxYËUQf9Eu3øf9EsE -AAEPjEPjp@u!EEM #ËUQEu3Vu t Muuc3Wft.>u ftf;t fuf>t fuf9Mt-u+h(YY]jhA395FAu VVjVx@MZf9@tu6<@@PEu f9@u܃t@v39@M(uj]Y%ujLYUeu,yj*Yt@FAd.Acyjk*YNayj Z*Yj1(Y;tPG*Yd2Ah2AP5\2A5X2A# E9uuP)).E MPQ_YYËeE܉E}uP))EEsdU(/A /A/A/A5/A=/Af0Af 0Af/Af/Af%/Af-/A0AE/AE0AE 0AH/A0A.A.A .A"A"A@@/AjdYj@h@@=@/AujqdYh @P|@ËU;A3SVu EUUUf> tat0rt#wt)3a 3ۃM M3AWf;y@St  tRHtCt- t!9EE @@EE ljE}utE nTtZtEHt0 tuE G}u;eE1}u% UEut3 ؃f}j _f9>tjVh@j f9>tf>=uuf9>tjh@Vm u Ajh@VN u "jh@V/ uf> t3f9>tahuE SuPit3 E.AMH M x8xxH_^[jh0AX33}js/Y]3u;5VAFA9t[@ uHuAFwFPo.YFA4VYYFA@ t PVYYF둋}cj8*Y FA;tNhFA P@FAu4YFA Ph@FA<}_ ;tg ___OE Ë}j-YËUE2A]ËU("A3ʼnES]WtS<`YjLjPu:0 ffffffEMDž0IM M@j@P@uu tSG_YM_3[ËVjVj V@P|@^ËU52A@t]uuuu u3PPPPPËUE3;͐"AtA-rHwj X]Ë͔"A]DjY;#]Mu#AÃ:u#Aà ËUVMQY0^]h9@d5D$l$l$+SVW"A1E3PeuEEEEdËMd Y__^[]Q̋US] Vs35"AWEE{t N3 8 N F3 8E@fMUS[ EMt_I[LDEEtEx@GE؃u΀}t$t N3 8N V3 :yE_^[]EɋM9csmu)=FAt hFAetUjRFAM UE 9X th"AWӋE MH t N3 8N V3 :EH*9S Oh"AWASVWT$D$L$URPQQh;@d5"A3ĉD$d%D$0XL$,3p t;T$4t;v.4v\ H {uhCfCfd_^[ËL$At3D$H3Uhp pp> ]D$T$UL$)qqq( ]UVWS33333[_^]Ëje33333USVWjRhV<@Q辧_^[]Ul$RQt$ ]UVuV4PeYYt|" ;u3@;u`3@.AF uNSW<2A?u S#YuFjFXFF ?~>^^N 3_@[3^]ËU}t'Vu F tV %f f&fY^]ËU@ @txtPuQeYYf;u]]ËUx"A3ʼnEESVu 3W}u>9u*8t `p ;t3҉f; j[ AfXw(A3HAjZ; $I@3  tJt6t%+t    f*u,j X k ɍDЉ= 1 f*u&  k ɍDЉItWhtFltwf>lu 6uf~4ud3uf~2u@d7i.o%uxX QDž|d/St~At+tY+t+ Dž@Dž0 0u u u -AQPEdYYtFF9|X+++3F tBPƅPPbyf6t:Ht3t+Dž-APpaYpegitqnt(oDžtaU7`c t ffDž@Dž Wufgu]DžQ9~~7]VnYt Dž5@GPPSP5.AЋtuPS5$.AYYfguuPS5 .AYY;-uCSDž$si+Dž'Džlj0XfQfGM t@tGGG@t3҉@t|s؃ځu3} Dž9~ u! t-RPWSA`0؋9~N뽍+Ft_tƀ80tT0=u -ADž Kf8tu+@t+tj-tj+tj YfDž++ u$j OYtP<8YYt/u&j0OYt⃽uk~aPWPK]~$(Y.%k7YY|3t*j OYtރtYft/kt `pM_^3[Ð@@>@>@#?@p?@|?@?@@@jhj@3Ʌ 2AËUMtj3X;E sg 3]M VuF3wVj5 2Ad@u2=8AtV_YuҋEt 3 Mt ^]-t"t t Ht3øøøøËVWh3FWP'3ȋ~~~  ~$A F+ο@Ou@Nu_^ËU"A3ʼnESWPv@3@;rƅ t0;w+@P j R& Cujv vPWPjj_3SvWPWPWv S]DSvWPWPhv S]$3EtLtL @;rRDž3)ЍZ w LQ w L QA;rƋM_3[j hPA( )AGptltwhuj Y@j Yewhu;5((At6tV@u$AtV/Y((AGh5((AuV@E뎋uj YËUS3SMb$2Au$2A@8]tEMapE,(AD;FG;v}>uЋuE}urlj{CijC C4(AZf1f0JuL@;v~0C@IuCC Ss3ȋ {95$2ATM_^3[jhpAM}_huqE;CWh :Y؅Fwh#SuYYEuvh@uFh=$AtPY^hS=@Fp )Aj YeC42AC82AC <2A3E}fLCf E(2A@3E=} L &A@3E=}('A@5((A@u((A=$AtPNY((ASE0j Y%u $AtSYQeEÃ=FAujVYFA3ËUSV5@W}W֋tP֋tP֋tP֋tP֍_PE{$)At tPփ{t CtPփMu֋P_^[]ËUW}SV5@W֋tP֋tP֋tP֋tP֍_PE{$)At tPփ{t CtPփMu֋P^[_]ËUSVu3W;to=8.Ath;t^9uZ;t9uPw\YY;t9uPV[YY>3YY;tD9u@-P+P+P=()At9uPWYY~PE$)At;t 9uPY9_tG;t 9uPYMuVrY_^[]ËUW} t;Et4V0;t(W8jYtV>Yu*AtVsY^3_]j hA )AFpt"~ltpluj $Yj Ye5h+AlVYYYEEj Yuj@@V5p+A@u5D2A@V5p+A@^ál+AtP5L2A@Ѓ l+Ap+AtP@ p+AjhAhL@@uF\Af3G~~pƆCƆKCFh$Aj Yevh@E>j uY}E Fluh+AFlvlYEa3Guj ^Yj UYËVW@@5l+AЋuNhjl YYt:V5l+A5H2A@ЅtjVYY@N VY3W@_^ËVujY^jhAduF$tPYF,tPYF4tPYF7֋5FA֋5FA9]u9Et]܉]ЉE؋}ԋ]E|@}@sEtЃEE@}@sEtЃEE }u)2Aj Yu}tjYËUjju ]ËUjju ]jjj jjjz ËUu2Yh̋U3M; @t @r3]Ë@]ËU"A3ʼnESVuWV3Y;lj?^Yj.^Yu ="A6h@h2AW h2AVSf4A,@uh@SVc t 3PPPPPRV0@Y^_[ËU}uu]S]VuWuu9u u3t} u8(uuu;v*8CSVh@uG8"uY8PWVh@D>u}u8"u%yu"O_^[]ËUujuuu u]ËUE~ PuYYuuPuu u@]ËU39E vMf9t @;E r]QL$+ȃ YZiQL$+ȃ YDiUQVu V# E F Yu N /@t "S3ۨt^NF F F ^] u,J ;t >@;u u 9YuV:jYF WF>HN+IN;~WPu ,Z EM F yM ttEAx+A@ tjSSQh#ƒt%FM3GWEPu Y E9}t N E%_[^ËUVuuyF @t F F u V#iYFvvVdYPg FF uQV:Yt0V.Yt$WV!V FnjjjueD(T,AHtzI tr}tlM} CED tPL% tE}t?@M}ED% u%L& t}t@MED& jMQuP4@xMm;MdMD}t ; u ]EÉ]E;M<< t CAMEH;sA8 u M uEmEjEPjEP4@u @@uE}t?DHt} t ML%;]u} tjjjuc} t CE9EFD@uC+E}EK xC3@;]rK @,At,Au *zA;u@D1Ht%CT1| T%Cu T&C+ؙjRPucE+]Pu Sujh4@Eu4@@PYME;E tPYEEE3;EL0ƅt f; u ]EÉ]E;E tf EM;sHf9 u Ej MEjEPjEP4@u @@u[}tUDHt(f} tj XfMLML%D& *;]uf} tjjjuaf} t j XfE9Et@u ff+]]@@j^;u 0jmZe\3_[^jhA]u x;tEAr j ҋ #ScYeD0tuu S E ME EbË]SdYËUEuN]Ë@]ËUVuu3a}uzj^0H}t9u rVuu ? u ju( }t9u s0j"YjX^]̋T$ L$ti3D$ur=lEAtdWr1كt +шuʃtt uD$_ËD$A @tyt$Ix  QPYYu ËU"A3ʼnES] Vu3W}uBu+t `p7 F @u^VYx+Attȃ EAA$uttȃEA@$q3;g C39y B@Dž W @9} DžjugucDžW9~~=]V%Yt Dž5@GPPSP5.AЋtuPS5$.AYYguuPS5 .AYY;-uCSDž*snHHXDž'Dž2Qƅ0Dž t@tGGG@t3҉@t|sځu39} Dž9~ u!u t-RPWS*0؋9~N뽍E+Ftbt΀90tW0@?If90tu+(u -AI8t@u+@t5t ƅ-t ƅ+ tƅ Dž++ u% OtPGYYt.u%˰0O5tヽtu~qPjEPP[u69t.EPGYYu#PFYY|2t) O\t߃t蝞Ytrt `pM_^3[胜Ðu@s@t@|t@t@t@u@Iv@UVuVUYuL MWuju P@u@@3t PYu?*uj?1Y} Ѓ?uE^ËUx"A3ʼnES]Vu3Wu} 芜Ju+;޷t `p 3;tf; jY9x BfXw A3k 0 Aj^;O $ŋ@3 ƒ tHt4+t$+t   f*u+f T k ʍDЉ9 - f*u%  k ʍDЉƒItQht@ltwf?lu 6uf4um3uf2uOdFi=o4u+x"XRDžʹYƒd1StAt+tZ+t+ Dž@Dž0 0u u [u -AQP!YYtFF9|X++3F tBPƅPPyf6t:Ht3t+Dž-APYpegitnnt$otbV[<x t ffDž@Dž ދCSufguWDžK;~ȁ~7]VYt Dž5@CPPWP5.AЋtuPW5$.AYYfguuPW5 .AYY?-uGWDž$s{+Dž'Dž|j0XfQfWW t@tCC@Ct3҉@t|s؃ځu3} Dž9~ u! t-RPWS0؋9~N뽍+Ft^tƀ80tS0YV5.AW3uf=tGV9YtFfuSjGW'YYl2Aue5.A5Vf>=Yxt"jWYYtAVWPU uI4~f>u5.A融%.A#FA3Y[_^5l2Ax%l2A3PPPPP̋V@3;u3^f9tf9uf9uS+ƍXWS Yu V@_[^SVW! UVuWVuDYtPEAu u u@DtjJDjADYY;tV5DYPL@u @@3VCEAYD0t WܨY3_^]jhA]u褨 艨 x;tEAr} b ҋ=u Fd.=u Fd=u Fd=uFdvdjY~d`QY^`[_^]Ã=FAuѽV5.AW3u<=tGVYtujGWYY=d2Atˋ5.AS3VP>=YXt"jSYYt?VSPU uG>u5.A?%.A'FA3Y[_^5d2A%d2A3PPPPP蜤̋UQMS3VU 9Et ]EE>"u39E"FE<tBU PFIYt} t M E FU Mt2}u t utBe>< t< uFN>}t EE3C3FA>\t>"u&u}t F8"u 339EEtIt\BuU tU}u< tK< tGt=Pt#.HYt M E FM E  HYtFU FVtBU ME^[t ËU S3VW9FAuOh:AVS;A@FA5t2A;tE8uuUEPSS} E =?sJMsB;r6PY;t)UEPWV}E HX2A5\2A3_^[ËU SV@3;u3wf93tf90uf90uW=@VVV+V@PSVVE׉E;t8P7YE;t*VVuPuSVVׅu u2YuS@E S@3_^[ËVAAW;stЃ;r_^ËVAAW;stЃ;r_^ËU"AeeSWN@;t t У"AeVEP@u3u@3@3@3EP @E3E3;uO@u G 5"A։5"A^_[Ã%pEAËU4S3EV]܈]]E ]t ]E E]EPGYEuE@u9EtME+ùtCHt(Ht Ӡj^0wMEt EuE@UEjY+t7+t*+t+t@u9UEEE E]E#¹W;3t(;t$;t=tT=u-ETEKEB=t4=t$;t)j^0蕟_^[EEEEt T2A#MxE@tMMMt } t M tM;;u!t WL`E=@juuEPuuu ׉E;upM#;u+Et%ejuEuPuuu ׉E;u76EAD0 @@PޞY貞Efu@uD6EAD0 @@V蘞YuL@u_ 렃uM@ uMu6q8ЃEAYYMLЃEAD$ MeHMuEtpjS6s ;uޝ8tP6vejEP6= uf}uǙRP6A ;tjj6 ;tE(@@}uE#u M EE#;tD=t)=@t"=t)=@t"=t=@uEM#;u EEE3E@}E#=@=tq;yE;nvv+[E3HHGEjjWW64 tWWW64#ƒ;jEP6 ;vtj}uXEE;iWjWW6q4 JWWW6\4#;E%=u6nY讛j^0u_=uWj6* ;E>WW6 Ej[+PD=P6g% ;݃ EAD$2M0 EAD$M ʀ}u!Etȃ EAD M#;u~EtxuL@juEjPuE%Pu @;u4@@P觚ȃ EAD 65Y6 EAEUSSSSS茙jhAx3}3u;;u j^0诙Y39};t9}tE%@tʉ}uuu uEP\EEE;t93u9}t(9}t EAD 65YËUjuuuuu !]ËU}u3]ËU MMtft f;u +]̋UMMZf9t3]ËA<8PEu3ҹ f9H‹]̋UEH<ASVq3WDt} H ;r X;r B(;r3_^[]̋UjhAh9@dPSVW"A1E3PEdeEh@*tTE-@Ph@Pt:@$ЃEMd Y_^[]ËE3ҁ9‹ËeE3Md Y_^[]USVWUjjh8@uB]_^[]ËL$At2D$H3uyUhP(RP$R]D$T$SVWD$UPjh@@d5"A3PD$dD$(Xp t:|$,t;t$,v-4v L$ H |uhDID_뷋L$d _^[3d y@@uQ R 9QuSQ-A SQ-AL$ KCk UQPXY]Y[ËUEur 3]Åx;tEArW ދȃ EAD@]ËU"A3ʼnESVu F @W6VJYx+At.V9Yt"V-Vp3p(ppppooooooo@ ooooo uo$jo(_o,To0Io4>o83o<(o@oDoHo@LnPnTnXn\n`n^]ËUVutY;8.AtPnYF;<.AtPnYF;@.AtP{nYF0;h.AtPinYv4;5l.AtVWnY^]ËUVuF ;D.AtP1nYF;H.AtPnYF;L.AtP nYF;P.AtPmYF;T.AtPmYF ;X.AtPmYF$;\.AtPmYF8;p.AtPmYF<;t.AtPmYF@;x.AtPmYFD;|.AtP}mYFH;.AtPkmYvL;5.AtVYmY^]UV3PPPPPPPPU I t $uI t $s ^ËUUVWt} u+j^0ψ3Eu+ @tOuuj"Y3_^]̋T$L$u<:u. t&:au% t:Au t:au uҋ3Ðt:u ttf:u t:au tUWVu M};v;r=lEAtWV;^_uh0ur)$@Ǻr $@$@$@$@P@t@#ъFGFGr$@I#ъFGr$@#ъr$@I@@ܱ@Ա@̱@ı@@@DDDDDDDDDDDDDD$@@@$@8@E^_ÐE^_ÐFGE^_ÍIFGFGE^_Ðt1|9u$r $@$L@IǺr +$@$@@Բ@@F#шGr$@IF#шGFGr$@F#шGFGFGV$@IP@X@`@h@p@x@@@DDDDDDDDD D DDDD$@@@ij@س@E^_ÐFGE^_ÍIFGFGE^_ÐFGFGFGE^_UV3PPPPPPPPU I t $u t $sF ^jh(AU@xte3@ËeE-h@@@(;AËUE,;A0;A4;A8;A]ËUE L AV9Ptk u ;rk M^;s9Pt3]54;A@j hHA83}}؋] KtjY+t"+t+tY+uC }؅uT,;A,;AUw\]YpQÃt2t!Htt빾4;A4;A0;A0;A 8;A8;AEP@E3}9Euj9EtP華Y3Et tuO`MԉG`u>OdMGdu, @ AM܋ D A @ A9M}Mk W\DEƝEuwdSUY]}؃}tj YSUYt tuEԉG`uEЉGd3ËUE@;A]ËUED;A]ËUQSV5@W5FA5FA؉]֋;+GruS+؍GY;sH;s;rPuYYuC;r>PuYYt/P4@FAu=@׉VףFAE3_^[ËVjj UYYV@FAFAujX^Ã&3^j hhA萁訡euYEE E謁臡ËUuYH]ËU$"A3ʼnEESEE VWEe=H;AEu}h A @؅=@h ASׅ5@Ph ASH;APh ASL;APhh ASP;AP֣X;AthP ASP֣T;AT;AM5@;tG9 X;At?P5X;A֋؅t,t(ׅtMQj MQjPӅtEu M 3L;A;Et)Pօt"ЉEtP;A;EtPօtuЉE5H;Aօtuuuu3M_^3[aËUVuWt} unj^0_^]ËMu3f݋f:tOut+f ftOu3ufj"Y몋UUS]VWuu9U u3_^[]Åt} u~j^0~݅u3fЋMu3fԋƒu+fft'Ou"+ fftOtKuu3fy3uM jPfDJXdfR~j"YjUMx~ u.A]á.A .A]~}]ËU}u u 9dY]Vu u uaY3MW0uFVuj5 2A$@u^98At@VYtvVբY} 3_^]}@@P7}Yo}@@P}YʋUM S3;vj3X;Es:} 3AMVW9]t u&YVuYYt;s+VjS۵ _^[]ËU2"A3ʼnEE VuW34809}u3;u|8|>|SEAL8$$?tu'MuW| <|{D8 tjjjVVYD@l39H P4,@3;`;t 8?P(@4 3,9E#@?g $3 ǃx8tP4UM`8jEPKPYt:4+M3@;jDSPS C@jSDP/ n3PPjMQjDQP C@@=j,PVEP$4@ @089,j,PjEP$E 4@,08<t<u!33Ƀ @D<t<uRD#Yf;DI8t)j XPD#Yf;D80E9@8T4D83ɋD8?D49M3+4H;Ms&CA u 0 @F@FrՋH+j(PVHP$4@C(8;;+4;El%?49MH@+4jH^;MsCΉ u0j [f @@fƁ@rH+j(PVHP$4@i(8;a+4;EGK4,9Mu,@+4jH^;Ms;,,΃ uj [f@@fƁ@r3VVhU QH++PPVh@;j(P+P5P$4@t (; @@D;\,+48;E ?Q(Qu448@t(D8 @@D8ulDt-j^9Du]v ev0?DivY1$D@t48u3$v%v 8+0[M_3^WjhA8v]uu u x;tEAru u Juҋ'} ~0EM hE>u?*u˰?R} Ճ?uE^ËU"A3ʼnES] Vu3W}uWtsu+esst `pa F @u^VwYx+Attȃ EAA$uttȃEA@$q3;g C9 B@Dž GW @} DžjugucDžW9~~=]V~Yt Dž5@GPPSP5.AЋtuPS5$.AYYguuPS5 .AYY;-uCS*stHH[Dž'Dž5Qƅ0Dž t@tGGG@t3҉@t|s؃ځu3} Dž9~ u!u t-RPWSR0؋9~N뽍E+Ftct΀90tX0@@If8tu+(u -AI8t@u+@t5t ƅ-t ƅ+ tƅ Dž++ u% OtPYYt.u%˰0O菢tヽtu~qPjEPP u69t.EPsYYu#PEYY|2t) O趡t߃tKYt3dt t `pM_^3[IÍI@@@"@n@z@@@QL$+#ȋ%;r Y$-UQQE VuEEWVEY;uUg NjJuMQuP@E;u@@t PGgYϋEAD0 EU_^jhADg]܉]Euf f Ëx;tEArf f LfыYP:YY;tZuu"YPWS E3ɍGfM#QW\@uM\*W@Y9utu@EY0ENG49u?NjW5l2A0 5l2A+9uuY;}ߍG;=?zPj5l2A ;aU qM1l2AVVVVV[u?EY03+UuMM@E MUTu}tMA#E3t3@}tMapËUjjuj]ËUSVW3jSSu]]E#ƒUtYjSSu#ʃtAu }+;SjT@Pd@Eu8[ -[_^[huYYE| ;rPuu t6+xӅuϋuuuYYujT@P`@3Z8u Z u;q|;skSuu u#ƒDuYPX@HE#‰Uu)LZ TZ@@u#uSuuu#ƒ3US] VuEA ΊA$Wy@tPtBt&tu=I L1$⁀'I L1$₀a I L1$!_^[u]%@]ËUEu8YXjX]Ë \;A3]ËUQVu VPE F YuX N =@t X"tfNF F feSj[ ÉF u,r? ;t f?@;u u YuVbYF WF>HN++ˉN~WPu S EN F =M ttEAx+A@ tSjjQ#ƒt-F]fjEPu ]f] E9}t N %_[^jzYWƃуtefofoNfoV fo^0ffOfW f_0fof@fonPfov`fo~pfg@foPfw`fpJutItfofvJut$t vIuȃt FGIuX^_]ú++Q‹ȃt FGIut vHuY tjY.Atjh@jT j2y̋U}uYVU]uj5 2AP@]ËUQ=.Au.AujMQjMQP@@tfEËUS39]u3AVWu轪pjV9 ;tuVWL u SSSSSU3_^[]UWVSM tMu} AZ I& t' t#:r:w:r:w:u u3:t rً[^_3PPjPjh@h, A@.Aá.At tPL@̋D$L$ ȋL$ u D$S؋D$d$؋D$[%@ 2Hd$<N*>Zx*4@R^lz&.>J\v$4BRdxj@P@c@@h@@n @'\M.AH/AccsUTF-8UTF-16LEUNICODEHH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSunHH:mm:ssdddd, MMMM dd, yyyyMM/dd/yyPMAMDecemberNovemberOctoberSeptemberAugustJulyJuneAprilMarchFebruaryJanuaryDecNovOctSepAugJulJunMayAprMarFebJanSaturdayFridayThursdayWednesdayTuesdayMondaySundaySatFriThuWedTueMonSunKERNEL32.DLLFlsFreeFlsSetValueFlsGetValueFlsAlloc  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~CorExitProcessmscoree.dllruntime error TLOSS error SING error DOMAIN error R6033 - Attempt to use MSIL code from this assembly during native code initialization This indicates a bug in your application. It is most likely the result of calling an MSIL-compiled (/clr) function from a native constructor or from DllMain. R6032 - not enough space for locale information R6031 - Attempt to initialize the CRT more than once. This indicates a bug in your application. R6030 - CRT not initialized R6028 - unable to initialize heap R6027 - not enough space for lowio initialization R6026 - not enough space for stdio initialization R6025 - pure virtual function call R6024 - not enough space for _onexit/atexit table R6019 - unable to open console device R6018 - unexpected heap error R6017 - unexpected multithread lock error R6016 - not enough space for thread data R6010 - abort() has been called R6009 - not enough space for environment R6008 - not enough space for arguments R6002 - floating point support not loaded `@@ @ h@@@h@@@P@@p@ @@@ @!@x@y@zh@`@@@Microsoft Visual C++ Runtime Library ...<program name unknown>Runtime Error! Program: (null)(null)EEE50P( 8PX700WP `h````xpxxxx ((((( H h(((( H H  !"#$%&'()*+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\]^_`abcdefghijklmnopqrstuvwxyz{|}~  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`ABCDEFGHIJKLMNOPQRSTUVWXYZ{|}~  GetProcessWindowStationGetUserObjectInformationWGetLastActivePopupGetActiveWindowMessageBoxWUSER32.DLLEEE00P('8PW700PP (`h`hhhxppwppCONOUT$Fatal error in launcher: %s Fatal error in launcher: %s rbFailed to open executableUnable to find an appended archive.Unable to read from file#!PATHEXT;Job information querying failedJob information setting failedstdin duplication failedstdout duplication failedstderr duplication failedUnable to create process using '%ls': %lsFailed to get exit code of process.exe/usr/bin/envExpected to find a command ending in '.exe' in shebang line: %lsExpected to find whitespace after '/usr/bin/env': %lsUnable to find executable in environment: %lsExpected terminating double-quote for executable in shebang line: %ls<launcher_dir>\Terminating quote without starting quote for executable in shebang line: %lsFailed to find shebangExpected to find terminator in shebang lineExpected to decode shebang line using UTF-8Expected to find '#' at start of shebang lineExpected to find '!' following '#' in shebang lineExpected to find executable in shebang lineExpected to find arguments (even if empty) in shebang lineExpected to be able to allocate command line memory"%ls" %ls "%ls" %lsH"AARSDSRj-HTT6C:\Users\Vinay\Projects\simple_launcher\dist\t32.pdb9;@@@X&@'@*@-@,/@n0@1@1@6@L@fP@S@U@$U@V@V@x[@Cb@c@c@Pe@q@@@=@@@`@d@M@ʷ@@@@@@@l\H 2Hd$<N*>Zx*4@R^lz&.>J\v$4BRdxjExitProcessGetCommandLineWSearchPathWqSetInformationJobObjectCreateProcessWGetCurrentProcessWaitForSingleObjectgGenerateConsoleCtrlEventAssignProcessToJobObject^FormatMessageWGetExitCodeProcessGetModuleFileNameWQueryInformationJobObjectgMultiByteToWideCharCreateJobObjectAdGetStdHandleGetLastError-SetConsoleCtrlHandlerDuplicateHandleRCloseHandleKERNEL32.dllPathRemoveFileSpecWEStrStrIW:PathCombineWSHLWAPI.dllHeapFreeHeapAllocEnterCriticalSection9LeaveCriticalSectioniGetStringTypeWGetCommandLineAHeapSetInformationTerminateProcessUnhandledExceptionFilterSetUnhandledExceptionFilterIsDebuggerPresentInitializeCriticalSectionAndSpinCountEncodePointerDecodePointerRtlUnwindHeapCreaterGetCPInfoInterlockedIncrementInterlockedDecrementhGetACP7GetOEMCP IsValidCodePageTlsAllocTlsGetValueTlsSetValueTlsFreeGetModuleHandleWsSetLastErrorGetCurrentThreadIdEGetProcAddress%WriteFileoSetHandleCountGetFileTypecGetStartupInfoWDeleteCriticalSectionSleep-LCMapStringWReadFilefSetFilePointeraFreeEnvironmentStringsWGetEnvironmentStringsWGetModuleFileNameAWideCharToMultiByteQueryPerformanceCounterGetTickCountGetCurrentProcessIdyGetSystemTimeAsFileTimeCreateFileW?LoadLibraryWHeapReAllocGetConsoleCPGetConsoleModeWFlushFileBuffersSetStdHandleIsProcessorFeaturePresentdCompareStringWWSetEnvironmentVariableWSSetEndOfFileJGetProcessHeapHeapSize$WriteConsoleWFAFAN@D        ! 5A CPR S WY l m pr   )     abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$A`y!@~ڣ @ڣ AϢ[@~QQ^ _j21~CH@D@@@<@8@4@0@(@ @@ @@@@@@@@@@@@@@@@@@@@@@@@t@l@`@T@P@L@@@,@ @ @@@@@@@@@@@@@l@d@\@T@L@D@<@4@,@$@@@ @@@@@D@@@@@@p@\@T@L@8@@@$)A$)A$)A$)A$)A8.AA0AA()A*AA @A0AAA 3@3@3@3@3@3@3@3@3@3@..0.A ;A ;A ;A ;A ;A ;A ;A ;A ;A4.A$;A$;A$;A$;A$;A$;A$;A8.A.K(p0eH`x bd(fnh(t%ЙxhhHZ( @...GGGWWWiiiuuu ̀ ww ww||wwwwwwwwfwwwww|fwwwwwwffwwwwwwffwwwwwfflwwffffffwfffffflwffffffwffffff|ffffffffR\Ilffl)ffح2L18Ϥ"A< ΣTπU  ؀ ???????( 444MMMSSSzzzp p{p{ffkof_fffk_fff[f}UUUfL4UUU_kJqO_~'[U_Uwwwww{~( @%%%+++000===AAAIIIMMMQQQVVVYYY]]]~dFgggjjjmmmrrruuu}}}u?z=~;gEkCoAr@:IbpƏKУk(,1?5<\CKQsU[cbð/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq_______CCBABADL*(%$""&GABJIIDDJC??AD_-(''%$GG#_DIJIIJIIIDIJDD_+)(''%GG _JMCEJ?ABAECA?BA_,+)('%%"!_IM@AJACDCIDI____.,++>________JMJJJJJJJJJF_..,+)('%$"! #GIMCEJJJI?J__...,+(('%$"! &_JM?AJJJJCJ__...,+)(''%$" _IMJJJJJJJJ_K=...,++(''%$! _JMCDJJJJAJ_K_______L*%$"!_I_?AMNJJEJ_ L'%$"_I_MMMMMMJJ_ _('%%_I_CEMIJJMEM _(''*_I_?BMDJEMDMF _)(-LI_MMMCMMMMM_________< ____I_CEM1;MACDMEJM__I_?A_D1@IJJMJMM_FF_I__6_@/EMMMNMM_FF_I_C80EJDMJCJFF?:AA20?_M_MIEM______MIC4BC/ N______MMMMJIDAI_9/ HJJMMJMMMJ??BAI_A7503 IJMMCBCBA44CCI___BAO;6___C_MJIDIDMI_CI___O; @__C_C?J?AJI_?A_DJJI@ O_CM?;I?JI_________H9MAIJJIJI_CD_____JJI73C;IJIJI_?AMDJJDIMJIE5:JIJI__________MMIA:IJJJJJJJJJJJJJJJJMJ???( 444MMMRRRYYY~eGuuu}}}x>iErCE~7?HVbx/!P7pLcyϏ1Qq/Pp",6@J[1qQq/Pp  =1[Qyq/"P0p=LYgx1Qq&/@PZpt1Qq/&PAp[tϩ1Qq/P"p0>M[iy1Qqұ/Pp  >1\Qzq/Pp!+6@IZ1pQq/ P6pLbx1Qq,/KPip1Qq/-P?pRcv1Qqϑܱ/Pp!&,>X1qQq!%///* !*/"(%%'%/) /!#''////+/+"*(/ / !%(/ ( (*/ (///) */   )*  /"///// /+/// # + !%//  +"*+'#+//+'!%*++$++!+! !!!<(0`  !!$& &"   WܱNj+<<:5pi$!!!4888&SNJFB=950,(%%%5ǎVRNIEѹ|Jq?o@ZUQMID@<73/+&"-Ɍ444"ք̴wq?]YUPLHC?;72.*%!"""4888&dya\XTPKGC>:61-)% OÑ%%%5ʎA{;ys`\WSOJFB>951,($(9|:z;xq?o@mAkBiCgCdDuZ;73.*Ǒ%%%5̎È>89}:{;yq?o@mAjBhCfD~dEuZ?:625Оa789}:{;yr>p?n@lAjBhCfD}dEB>:5^ό555"܄ѳ„7789}:{;xr?p@n@lAjBgCeDFA=9"""4;;;&ŌC89~9|:z;xr?p@mAkAiBgCIELɑQQQJnnn~~~Įq?o@mAkBiCHHH"""vvv9~:{;yq?o@mAkB:::'''___sssttt8Ϧuǣvyp?n@lA888T---6fffnddd%%%"""OOOSSSċDҧuʤv{;yr?p?xM<<r?̷999VVV###)))444ѳ͝b@~9|:z;}Cg˶Ӎ󑑑ZZZlll;;;!!!""")))___&&&2:::ppp{{{___WWWWWW:::!!!"""***www"""4888&,̑999ԖJJJ|||lll:::"""BBBXXX|||$$$6,uuuKKKCCC@@@...www* Ҍ666"KKKaaaLLLWWW@$"""4;;;&nnnfff!!!$$$999444]ttt|ȇɑ&&&5ЎvvvmmmVVV{{{OOOڥaaaCCCpppό555"ބ|||MMMfff"""4;;;&\\\Ǒ%%%5Ύݧܦ͌555"ۄۥ"""4:::&ڤÑ%%%5ˎܤׇ ww?ww??ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwwwwwwwwwwwwwww?ww?ww?ww?ww?ww?ww?ww?ww?ww?ww?wwwwwwwwwwwwwwww?wwwwwwww( @ !!!0\\\JeeeQ666D555A0$ vH<602\7qڴvvvj&&&D1"gLF@;5?кVQKE?9(aV[UPJD>82-uuun{{{j`ZTOVo@lAb_YSMGB<60+%<aVmt>q?n@bb^XRLFA;5/)$Ywwwn}}}j~Cv=s>p?bba]WQKE@:4.(+{;xbba[VPJD?93-'aV~:{;xr?o@lAiBfD}dE|cE|cEiB<61?9}:z;w=t>q?n@kAiCfD}cE|cE}dFGA;=aVңi89|:yq?n@kBhCeD|cE|cELF@mzzznjʓP8~9{;yp?mAjBgCeD|cEPJ\¯mAjBgC~dEaV}:z;xq?n@lAiCJJJőPyq?n@~YVVV???wwwiiiΡkA|;y>>3@@@y~~~obbb000kkk@@@---U<<<&&&[[[6uuusssWWWIII$$$&&&qqqlllg|||s4bbbhhhƑUUU000QQQ}}}---{bbb(iiiLLLBBBaVggg+++NNN|||nj]]]tttkkkrrrwwwӦaVӦzzznjӦˉ ?????(  C﫫oIਨS=?_QF4aZмoEcaXMB70~Iq?c`VK@58z;u=qv>3Eyn@iB~dE}dFGHYYYuuuġ=xmAhC}dE}eGS444|||gC}cEMMM~>q?kAiGRRR¢Gu=xKʺ~AAAAAAAAAAAAAAAA ( h00 %   h PAPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPADDINGPADDINGXXPAD 0A0Z0t000001)1A12h2y22 33)3S3_3o3333334464M4p4u44444455)5F5W5n5t5~55555556*6Y6666 7077777778/8C8z8888&9l999999:::::d;<<<<@=H=]=h=>2?a?g?v?????? T000&020?0c0u000000 1171f1E256667&777A99U:a>000000000001I1N1X1111122%2+21272>2E2L2S2Z2a2h2p2x2222222222222223 334 5*5I5555526B6l6}66666677788O8V8c8i8888819N99|::::;5;A;L<<<}=f>u>>@t12:4444699!9%9)9-91959D9P9999;:x::;1>z>>?}????????PH 0%0.040=0B0Q0x00001a11122f333334 444%4.444=4I4O4W4]4i4o4|44444443595c5i5o5555=6`6j66666777"7)7/767<7D7K7P7X7a7m7r7w7}777777777777777778 883898Q8999&9H9999999: :%:/:E:P:j:u:}:::::: ;;.;5;`;<<'>>I>o>u>>>>?G?Q?|????`00F0i0o000000031<1H1111111222$22"3-3P33333 4 4.444W4^4w4444445e5566788::::h<=(===b>o>D?N??pH,0^001y23:3`333367999:;U>Y>]>a>e>i>m>q>>>>>?G?P10141X1a456#7O7q7Z9;;;;;;;; ===f>>>>? ??&?B?~???? 040f00i1o122 33T3_3i3z33E5V5^5d5i5o5555%6q6}6666667 77!7)757^7f7q799::8:J:]:o:::===&>F>P>g>>>\?ph0m00000,1112/282y22222B33<4B4H4X4c4567g788J9m9:=>>'>9>_>q>>>>>>>>??%?7?001 1111 1I1o11111111111222 2r2}22222222)3034383<3@3D3H3L333333C4z4444444444465;5u5z5555556 666666667;7D7S7v7{777788$84898J8R8X8b8h8r8x8888888889(9:::;;!;X;p;;^<=!=>:>>D0011132R22!3I333 4C4M45555R6j669:011111#1'1+111112G22#363G3l33333E4m44444555C5L55555 646f6n667788b9999::::::;;#;;%<:>q>>>?$00R222222333334Hd1h1l1p1t11111>>>>>>>>? ???$?,?4?>> >>>>> >$>8><>@>D>H>L>P>T>X>\>h>l>p>t>x>|>>>>PK!"gg version.pycnu[ abc @srdZddlZddlZddlmZddddd d d d gZejeZd e fd YZ de fdYZ de fdYZ ejdZdZeZde fdYZdZde fdYZejddfejddfejddfejddfejddfejd dfejd!d"fejd#d$fejd%d&fejd'd(ff Zejd)dfejd*dfejd+d"fejd!d"fejd,dffZejd-Zd.Zd/Zejd0ejZid1d26d1d36d4d56d1d66d7d86dd6dd"6Zd9Zde fd:YZde fd;YZ ejd<ejZ!d=Z"d>Z#d e fd?YZ$d e fd@YZ%dAe fdBYZ&ie&eeedC6e&ee dDdE6e&e#e%edF6Z'e'dCe'dGtt|dksVtdS(Ni(tstript_stringtparset_partst isinstancettupletAssertionErrortlen(tselftstparts((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__init__scCstddS(Nsplease implement in a subclass(tNotImplementedError(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR$scCs5t|t|kr1td||fndS(Nscannot compare %r and %r(ttypet TypeError(Rtother((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt_check_compatible'scCs|j||j|jkS(N(RR(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__eq__+s cCs|j| S(N(R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__ne__/scCs|j||j|jkS(N(RR(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__lt__2s cCs|j|p|j| S(N(R R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__gt__6scCs|j|p|j|S(N(R R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__le__9scCs|j|p|j|S(N(R!R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__ge__<scCs t|jS(N(thashR(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__hash__@scCsd|jj|jfS(Ns%s('%s')(t __class__R R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__repr__CscCs|jS(N(R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt__str__FscCstddS(NsPlease implement in subclasses.(R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt is_prereleaseIs(R R RRRRRR R!R"R#R%R'R(tpropertyR)(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR s            tMatchercBseZdZejdZejdZejdZidd6dd6dd6d d 6d d 6d d6dd6dd6Z dZ dZ e dZ dZdZdZdZdZdZRS(s^(\w[\s\w'.-]*)(\((.*)\))?s'^(<=|>=|<|>|!=|={2,3}|~=)?\s*([^\s,]+)$s ^\d+(\.\d+)*$cCs ||kS(N((tvtctp((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytWttcCs||kp||kS(N((R,R-R.((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR/YR0s<=cCs||kp||kS(N((R,R-R.((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR/ZR0s>=cCs ||kS(N((R,R-R.((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR/[R0s==cCs ||kS(N((R,R-R.((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR/\R0s===cCs||kp||kS(N((R,R-R.((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR/^R0s~=cCs ||kS(N((R,R-R.((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR/_R0s!=c Cs|jdkrtdn|j|_}|jj|}|s\td|n|jd}|dj|_|jj |_ g}|drg|dj dD]}|j^q}x|D]}|j j|}|s td||fn|j}|dp#d}|d }|j d r|dkr^td |n|d t}} |jj|s|j|qn|j|t}} |j||| fqWnt||_dS(NsPlease specify a version classs Not valid: %rR0iit,sInvalid %r in %rs~=is.*s==s!=s#'.*' not allowed for %r constraintsi(s==s!=(t version_classtNonet ValueErrorR Rtdist_retmatchtgroupstnametlowertkeytsplittcomp_retendswithtTruetnum_retFalsetappendRR( RRtmR9tclistR-t constraintstoptvntprefix((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRbs: ,     cCst|tr!|j|}nx|jD]\}}}|jj|}t|trmt||}n|sd||jjf}t |n||||s+t Sq+Wt S(s Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. s%r not implemented for %s( RRR4Rt _operatorstgettgetattrR&R RRBR@(Rtversiontoperatort constraintRItftmsg((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR8scCsJd}t|jdkrF|jdddkrF|jdd}n|S(Niis==s===(s==s===(R5RR(Rtresult((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt exact_versions,cCsGt|t|ks*|j|jkrCtd||fndS(Nscannot compare %s and %s(RR:R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs*cCs/|j||j|jko.|j|jkS(N(RR<R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs cCs|j| S(N(R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRscCst|jt|jS(N(R$R<R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR%scCsd|jj|jfS(Ns%s(%r)(R&R R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR'scCs|jS(N(R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR(sN(R R R5R4tretcompileR7R>RARJRR8R*RSRRRR%R'R((((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+Ns,         %      sk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c CsK|j}tj|}|s4td|n|j}td|djdD}x0t|dkr|ddkr|d }qfW|dsd}nt|d}|dd!}|d d !}|d d !}|d }|dkrd}n|dt|df}|dkr.d}n|dt|df}|dkr]d}n|dt|df}|dkrd}nfg} xQ|jdD]@} | j rdt| f} n d| f} | j | qWt| }|s| r|rd}qd}n|s&d}n|s5d}n||||||fS(NsNot a valid version: %scss|]}t|VqdS(N(tint(t.0R,((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys sit.iiiiii i i i tatzt_tfinal(NN((NN((NN(((RYi(RZ(R[(R\( R tPEP440_VERSION_RER8RR9RR=RRVR5tisdigitRC( RRDR9tnumstepochtpretposttdevtlocalRtpart((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _pep_440_keysT  #%                      cBsAeZdZdZedddddgZedZRS(sIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCsQt|}tj|}|j}td|djdD|_|S(Ncss|]}t|VqdS(N(RV(RWR,((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys siRX(t_normalized_keyR]R8R9RR=t_release_clause(RRRRRDR9((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs   &RYtbR-trcRccstfdjDS(Nc3s(|]}|r|djkVqdS(iN(t PREREL_TAGS(RWtt(R(s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys s(tanyR(R((Rs?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR)s(R R R RtsetRkR*R)(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs cCsUt|}t|}||kr(tS|j|s;tSt|}||dkS(NRX(tstrR@t startswithRBR(txtytn((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _match_prefix"s    cBseZeZidd6dd6dd6dd6dd 6d d 6d d 6dd6ZdZdZdZdZdZ dZ dZ dZ dZ RS(t_match_compatibles~=t _match_ltR1t _match_gtR2t _match_les<=t _match_ges>=t _match_eqs==t_match_arbitrarys===t _match_nes!=cCsx|r"d|ko|jd}n|jd o:|jd}|rn|jjddd}|j|}n||fS(Nt+iii(RRR=R4(RRMRORIt strip_localR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _adjust_local<scCsj|j|||\}}||kr+tS|j}djg|D]}t|^qA}t|| S(NRX(RRBRhtjoinRoRt(RRMRORItrelease_clausetitpfx((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRvJs   (cCsj|j|||\}}||kr+tS|j}djg|D]}t|^qA}t|| S(NRX(RRBRhRRoRt(RRMRORIRRR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRwRs   (cCs%|j|||\}}||kS(N(R(RRMRORI((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRxZscCs%|j|||\}}||kS(N(R(RRMRORI((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRy^scCsC|j|||\}}|s0||k}nt||}|S(N(RRt(RRMRORIRR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRzbs cCst|t|kS(N(Ro(RRMRORI((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR{jscCsD|j|||\}}|s0||k}nt|| }|S(N(RRt(RRMRORIRR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR|ms cCs|j|||\}}||kr+tS||kr;tS|j}t|dkrc|d }ndjg|D]}t|^qp}t||S(NiiRX(RR@RBRhRRRoRt(RRMRORIRRR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRuus    ((R R RR4RJRRvRwRxRyRzR{R|Ru(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR-s&         s[.+-]$R0s^[.](\d)s0.\1s^[.-]s ^\((.*)\)$s\1s^v(ersion)?\s*(\d+)s\2s^r(ev)?\s*(\d+)s[.]{2,}RXs\b(alfa|apha)\btalphas\b(pre-alpha|prealpha)\bs pre.alphas \(beta\)$tbetas ^[:~._+-]+s [,*")([\]]s[~:+_ -]s\.$s (\d+(\.\d+)*)c Cs|jj}x&tD]\}}|j||}qW|sJd}ntj|}|snd}|}n|jdjd}g|D]}t|^q}x#t |dkr|j dqWt |dkr||j }nDdj g|dD]}t |^q||j }|d }dj g|D]}t |^qB}|j}|rx)tD]\}}|j||}qvWn|s|}n&d|krdnd}|||}t|sd}n|S( s Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. s0.0.0iRXiRct-R}N(R R;t _REPLACEMENTStsubt_NUMERIC_PREFIXR8R9R=RVRRCtendRRot_SUFFIX_REPLACEMENTSt is_semverR5( RRRtpattreplRDRItsuffixRtsep((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt_suggest_semantic_versions:  : (    cCs yt||SWntk r%nX|j}xSd2d3d4d5d6d7d8d9d:d;d<d=d>d?d@fD]\}}|j||}qfWtjdd|}tjdd|}tjdd|}tjdd|}tjdd|}|jdr |d }ntjd!d|}tjd"d#|}tjd$d%|}tjd&d|}tjd'd(|}tjd)d(|}tjd*d |}tjd+d,|}tjd-d%|}tjd.d/|}tjd0d1|}yt|Wntk rdA}nX|S(BsSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. s-alphaRYs-betaRiRRRjR-s-finalR0s-pres-releases.releases-stableR}RXR[t s.finalR\spre$tpre0sdev$tdev0s([abc]|rc)[\-\.](\d+)$s\1\2s[\-\.](dev)[\-\.]?r?(\d+)$s.\1\2s[.~]?([abc])\.?s\1R,is\b0+(\d+)(?!\d)s (\d+[abc])$s\g<1>0s\.?(dev-r|dev\.r)\.?(\d+)$s.dev\2s-(a|b|c)(\d+)$s[\.\-](dev|devel)$s.dev0s(?![\.\-])dev$s(final|stable)$s\.?(r|-|-r)\.?(\d+)$s.post\2s\.?(dev|git|bzr)\.?(\d+)$s\.?(pre|preview|-c)(\d+)$sc\g<2>sp(\d+)$s.post\1(s-alphaRY(s-betaRi(RRY(RRi(RjR-(s-finalR0(s-preR-(s-releaseR0(s.releaseR0(s-stableR0(R}RX(R[RX(RR0(s.finalR0(R\R0N(RgRR;treplaceRTRRpR5(RtrstorigR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt_suggest_normalized_versionsH           s([a-z]+|\d+|[\.-])R-Ratpreviewsfinal-RRjt@RccCsd}g}x||D]}|jdr|dkrgx'|rc|ddkrc|jq@Wnx'|r|ddkr|jqjWn|j|qWt|S(NcSsg}xtj|jD]j}tj||}|rd|d koUdknrl|jd}n d|}|j|qqW|jd|S(Nt0it9it*s*final(t _VERSION_PARTR=R;t_VERSION_REPLACERKtzfillRC(RRRR.((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt get_partsIs   Rs*finalis*final-t00000000(RptpopRCR(RRRRR.((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _legacy_keyHs  cBs eZdZedZRS(cCs t|S(N(R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRcscCsRt}xE|jD]:}t|tr|jdr|dkrt}PqqW|S(NRs*final(RBRRRRpR@(RRRRq((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR)fs (R R RR*R)(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRbs cBs?eZeZeejZded s~   1k =$ W  . r       #    PK!rjz/z/ manifest.pycnu[ abc@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ ej eZejdejZejd ejejBZejd Zdefd YZdS( su Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. iNi(tDistlibException(tfsdecode(t convert_pathtManifests\\w* s#.*?(?= )| (?=$)icBseZdZd dZdZdZdZedZ dZ dZ dZ e d ed Ze d ed Ze d ed Zd ZRS(s~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. cCsYtjjtjj|p!tj|_|jtj|_d|_ t |_ dS(sd Initialise an instance. :param base: The base directory to explore under. N( tostpathtabspathtnormpathtgetcwdtbasetseptprefixtNonetallfilestsettfiles(tselfR ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyt__init__*s- cCsddlm}m}m}g|_}|j}|g}|j}|j}x|r|}tj |} x| D]{} tj j || } tj| } | j } || r|jt | qu|| ru||  ru|| ququWqPWdS(smFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. i(tS_ISREGtS_ISDIRtS_ISLNKN(tstatRRRR R tpoptappendRtlistdirRtjointst_modeR(RRRRR troottstackRtpushtnamestnametfullnameRtmode((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pytfindall9s"          cCsM|j|js-tjj|j|}n|jjtjj|dS(sz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N( t startswithR RRRR RtaddR(Rtitem((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR$TscCs"x|D]}|j|qWdS(s Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N(R$(RtitemsR%((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pytadd_many^s csfdtj}|rgt}x'|D]}|tjj|q7W||O}ngtd|DD]}tjj|^q~S(s8 Return sorted files in directory order csj|j|tjd||jkrftjj|\}}|dksVt||ndS(Nsadd_dir added %stt/(R(R)(R$tloggertdebugR RRtsplittAssertionError(tdirstdtparentt_(tadd_dirR(s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR2ls  css!|]}tjj|VqdS(N(RRR,(t.0R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pys {s(RRRRtdirnametsortedR(RtwantdirstresultR.tft path_tuple((R2Rs@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR5gs   cCst|_g|_dS(sClear all collected files.N(RRR (R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pytclear}s cCs|j|\}}}}|dkrcx|D].}|j|dts.tjd|q.q.Wn|dkrx|D]}|j|dt}qvWn{|dkrxl|D].}|j|dtstjd|qqWn3|dkrx$|D]}|j|dt}qWn|dkr`x|D]1}|j|d |s(tjd ||q(q(Wn|d krx|D]}|j|d |}qsWn~|d kr|jdd |stjd |qnG|dkr|jdd |stjd|qntd|dS(sv Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands tincludetanchorsno files found matching %rtexcludesglobal-includes3no files found matching %r anywhere in distributionsglobal-excludesrecursive-includeR s-no files found matching %r under directory %rsrecursive-excludetgrafts no directories found matching %rtprunes4no previously-included directories found matching %rsinvalid action %rN( t_parse_directivet_include_patterntTrueR*twarningt_exclude_patterntFalseR R(Rt directivetactiontpatternstthedirt dirpatterntpatterntfound((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pytprocess_directivesD                    c Cs{|j}t|dkrA|ddkrA|jddn|d}d}}}|dkrt|d krtd |ng|dD]}t|^q}n|dkrt|d krtd|nt|d}g|d D]}t|^q}nT|dkr[t|d krHtd|nt|d}ntd|||||fS(s Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns iiR;R=sglobal-includesglobal-excludesrecursive-includesrecursive-excludeR>R?is$%r expects ...is*%r expects ...s!%r expects a single sunknown action %r(R;R=sglobal-includesglobal-excludesrecursive-includesrecursive-excludeR>R?N(R;R=sglobal-includesglobal-exclude(srecursive-includesrecursive-exclude(R>R?(R,tlentinsertR RR(RRFtwordsRGRHRIt dir_patterntword((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR@s:    & & cCszt}|j||||}|jdkr:|jnx9|jD].}|j|rD|jj|t}qDqDW|S(sSelect 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. N( REt_translate_patternR R R"tsearchRR$RB(RRKR<R tis_regexRLt pattern_reR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyRAs  cCsdt}|j||||}x?t|jD].}|j|r.|jj|t}q.q.W|S(stRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions (RERStlistRRTtremoveRB(RRKR<R RURLRVR8((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyRD)s  c CsH|r)t|tr"tj|S|Sntd krY|jdjd\}}}n|r|j|}td kr|j|r|j|st qnd}tj t j j |jd} |d k rtdkr|jd} |j|t|  } nV|j|} | j|r<| j|sBt | t|t| t|!} t j} t jdkrd} ntdkrd| | j | d|f}q;|t|t|t|!}d || | | ||f}nC|r;tdkrd| |}q;d || |t|f}ntj|S(sTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). iiR1R(s\s\\t^s.*s%s%s%s%s.*%s%ss%s%s%s(ii(iiN(ii(ii(ii(t isinstancetstrtretcompilet_PYTHON_VERSIONt _glob_to_ret partitionR#tendswithR-tescapeRRRR R RNR ( RRKR<R RUtstartR1tendRVR t empty_patternt prefix_reR ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyRS=sB   $ *!  $#   #  cCsStj|}tj}tjdkr0d}nd|}tjd||}|S(sTranslate 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). s\s\\\\s\1[^%s]s((? s       PK!~== __init__.pyonu[ abc@sddlZdZdefdYZyddlmZWn*ek rhdejfdYZnXejeZ e j edS(iNs0.2.4tDistlibExceptioncBseZRS((t__name__t __module__(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyR s(t NullHandlerRcBs#eZdZdZdZRS(cCsdS(N((tselftrecord((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pythandletcCsdS(N((RR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pytemitRcCs d|_dS(N(tNonetlock(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyt createLockR(RRRRR (((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyRs  ( tloggingt __version__t ExceptionRRt ImportErrortHandlert getLoggerRtloggert addHandler(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyts  PK!* compat.pyonu[ abc@@sddlmZddlZddlZddlZyddlZWnek r]dZnXejddkr ddl m Z e fZ e Z ddlmZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZm Z m!Z!m"Z"m#Z#m$Z$d Zddl%Z%dd l%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.erdd l%m/Z/nddl0Z0ddl1Z1ddl2Z3dd l4m4Z4ddl5Z5e6Z6ddl7m8Z9ddl7m:Z;da<dZ=nddl>m Z e?fZ e?Z ddl>m@ZddlZddlZddlZddlAmZmZmZm=Z=mZm Z mZmZm$Z$ddlBm'Z'mZm&Z&m!Z!m"Z"m*Z*m+Z+m,Z,m-Z-m.Z.erdd lBm/Z/nddlCm)Z)m(Z(m#Z#ddlDjEZ0ddlBjFZ%ddlGjEZ1ddl3Z3dd lHm4Z4ddlIjJZ5eKZ6ddl7m;Z;e9Z9yddlmLZLmMZMWn<ek rdeNfdYZMddZOdZLnXyddlmPZQWn'ek r"deRfdYZQnXyddlmSZSWn*ek rcejTejUBddZSnXdd lVmWZXeYeXd!reXZWn<dd"lVmZZ[d#e[fd$YZZd%eXfd&YZWydd'l\m]Z]Wnek rd(Z]nXyddl^Z^Wn!ek r,dd)lm^Z^nXy e_Z_Wn*e`k rcdd*lambZbd+Z_nXyejcZcejdZdWnJeek rejfZgegd,krd-Zhnd.Zhd/Zcd0ZdnXydd1limjZjWnTek r1dd2lkmlZlmmZmddlZejnd3Zod4Zpd5ZjnXydd6lqmrZrWn!ek ridd6lsmrZrnXejd7 dTkre4jtZtndd9lqmtZtydd:lamuZuWnkek rdd;lamvZvydd<lwmxZyWnek rd=d>ZynXd?evfd@YZunXyddAlzm{Z{Wnek rQddBZ{nXyddClam|Z|Wnek ryddDl}m~ZWn!ek rddDlm~ZnXy ddElmZmZmZWnek rnXdFefdGYZ|nXyddHlmZmZWnek rejndIejZdJZdKefdLYZddMZdNefdOYZdPefdQYZdReRfdSYZnXdS(Ui(tabsolute_importNi(tStringIO(tFileTypei(tshutil(turlparset urlunparseturljointurlsplitt urlunsplit(t urlretrievetquotetunquotet url2pathnamet pathname2urltContentTooShortErrort splittypecC@s+t|tr!|jd}nt|S(Nsutf-8(t isinstancetunicodetencodet_quote(ts((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR s( tRequestturlopentURLErrort HTTPErrortHTTPBasicAuthHandlertHTTPPasswordMgrt HTTPHandlertHTTPRedirectHandlert build_opener(t HTTPSHandler(t HTMLParser(tifilter(t ifilterfalsecC@sYtdkr*ddl}|jdantj|}|rO|jddSd|fS(sJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.iNs ^(.*)@(.*)$ii(t _userprogtNonetretcompiletmatchtgroup(thostR$R&((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt splituser4s  (t TextIOWrapper( RRRR)R R RRR( RR RR R RRRRR(RRR(t filterfalse(tmatch_hostnametCertificateErrorR-cB@seZRS((t__name__t __module__(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR-^sc C@sSg}|stS|jd}|d|d}}|jd}||krhtdt|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 startswithR$tescapetreplaceR%tjoint IGNORECASER&( tdnthostnamet max_wildcardstpatstpartstleftmostt remaindert wildcardstfragtpat((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt_dnsname_matchbs(  " &cC@s[|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. stempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDtsubjectAltNametDNSNtsubjectt commonNameis&hostname %r doesn't match either of %ss, shostname %r doesn't match %ris=no appropriate commonName or subjectAltName fields were found((( t ValueErrortgetRGR7tlenR-R;tmapR5(tcertR>tdnsnamestsantkeytvaluetsub((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR,s.  %(tSimpleNamespacet ContainercB@seZdZdZRS(sR A generic container for when multiple values need to be returned cK@s|jj|dS(N(t__dict__tupdate(tselftkwargs((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__init__s(R.R/t__doc__R\(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRWs(twhichc @sd}tjjr2||r.SdS|dkrYtjjdtj}n|scdS|jtj}t j dkrtj |kr|j dtj ntjjddjtj}t fd|Drg}qg|D]}|^q}n g}t}xu|D]m}tjj|} | |kr+|j| x9|D].} tjj|| } || |rc| SqcWq+q+WdS( sKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cS@s5tjj|o4tj||o4tjj| S(N(tostpathtexiststaccesstisdir(tfntmode((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt _access_checks$tPATHtwin32itPATHEXTtc3@s*|] }jj|jVqdS(N(R6tendswith(t.0text(tcmd(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pys sN(R_R`tdirnameR#tenvironRMtdefpathR3tpathseptsystplatformtcurdirtinserttanytsettnormcasetaddR;( RnReR`RftpathexttfilesRmtseentdirtnormdirtthefiletname((Rns>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR^s8  !        (tZipFilet __enter__(t ZipExtFileRcB@s#eZdZdZdZRS(cC@s|jj|jdS(N(RXRY(RZtbase((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\scC@s|S(N((RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRscG@s|jdS(N(tclose(RZtexc_info((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__exit__s(R.R/R\RR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs  RcB@s#eZdZdZdZRS(cC@s|S(N((RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR"scG@s|jdS(N(R(RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR%scO@stj|||}t|S(N(t BaseZipFiletopenR(RZtargsR[R((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR)s(R.R/RRR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR!s  (tpython_implementationcC@s@dtjkrdStjdkr&dStjjdr<dSdS(s6Return a string identifying the Python implementation.tPyPytjavatJythont IronPythontCPython(RstversionR_RR8(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR0s(t sysconfig(tCallablecC@s t|tS(N(RR(tobj((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytcallableDstmbcststricttsurrogateescapecC@sOt|tr|St|tr2|jttStdt|jdS(Nsexpect bytes or str, not %s( Rtbytest text_typeRt _fsencodingt _fserrorst TypeErrorttypeR.(tfilename((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytfsencodeRs cC@sOt|tr|St|tr2|jttStdt|jdS(Nsexpect bytes or str, not %s( RRRtdecodeRRRRR.(R((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytfsdecode[s (tdetect_encoding(tBOM_UTF8tlookupscoding[:=]\s*([-\w.]+)cC@s^|d jjdd}|dks7|jdr;dS|d ksV|jd rZdS|S(s(Imitates get_normal_name in tokenizer.c.i t_t-sutf-8sutf-8-slatin-1s iso-8859-1s iso-latin-1slatin-1-s iso-8859-1-s iso-latin-1-(slatin-1s iso-8859-1s iso-latin-1(slatin-1-s iso-8859-1-s iso-latin-1-(R6R:R8(torig_enctenc((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt_get_normal_namels c@s yjjWntk r)dnXtd}d}fd}fd}|}|jtrt|d}d}n|s|gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS(s? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. sutf-8c@s$y SWntk rdSXdS(NRj(t StopIteration((treadline(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt read_or_stops  c@s7y|jd}WnDtk rYd}dk rJdj|}nt|nXtj|}|ssdSt|d}yt|}WnHt k rdkrd|}ndj|}t|nXr3|j dkr&dkrd}ndj}t|n|d 7}n|S( Nsutf-8s'invalid or missing encoding declarations {} for {!r}isunknown encoding: sunknown encoding for {!r}: {}sencoding problem: utf-8s encoding problem for {!r}: utf-8s-sig( RtUnicodeDecodeErrorR#tformatt SyntaxErrort cookie_retfindallRRt LookupErrorR(tlinet line_stringtmsgtmatchestencodingtcodec(t bom_foundR(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt find_cookies6          is utf-8-sigN(t__self__RtAttributeErrorR#R2R8RtTrue(RRtdefaultRRtfirsttsecond((RRRs>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRws4  &         (R9ii(tunescape(tChainMap(tMutableMapping(trecursive_reprs...c@sfd}|S(sm Decorator to make a repr function return fillvalue for a recursive call c@smtfd}td|_td|_td|_tdi|_|S(Nc@sWt|tf}|kr%Sj|z|}Wdj|X|S(N(tidt get_identRztdiscard(RZRStresult(t fillvaluet repr_runningt user_function(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytwrappers  R/R]R.t__annotations__(RxtgetattrR/R]R.R(RR(R(RRs>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytdecorating_functions  ((RR((Rs>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt_recursive_reprsRcB@seZdZdZdZdZddZdZdZ dZ dZ e d Z ed Zd ZeZd Zed ZdZdZdZdZdZRS(s A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cG@st|pig|_dS(sInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N(tlisttmaps(RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\ scC@st|dS(N(tKeyError(RZRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __missing__scC@sAx1|jD]&}y ||SWq tk r/q Xq W|j|S(N(RRR(RZRStmapping((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __getitem__s   cC@s||kr||S|S(N((RZRSR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRMscC@sttj|jS(N(RNRxtunionR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__len__"scC@sttj|jS(N(titerRxRR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__iter__%sc@stfd|jDS(Nc3@s|]}|kVqdS(N((Rltm(RS(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pys )s(RwR(RZRS((RSs>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __contains__(scC@s t|jS(N(RwR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__bool__+scC@s%dj|djtt|jS(Ns{0.__class__.__name__}({1})s, (RR;ROR5R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__repr__.scG@s|tj||S(s?Create a ChainMap with a single dict created from the iterable.(tdicttfromkeys(tclstiterableR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR3scC@s$|j|jdj|jdS(sHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]ii(t __class__Rtcopy(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR8scC@s|ji|jS(s;New ChainMap with a new dict followed by all previous maps.(RR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt new_child>scC@s|j|jdS(sNew ChainMap from maps[1:].i(RR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytparentsBscC@s||jd|/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __setitem__GscC@s?y|jd|=Wn&tk r:tdj|nXdS(Nis(Key not found in the first mapping: {!r}(RRR(RZRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __delitem__Js cC@s9y|jdjSWntk r4tdnXdS(sPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.is#No keys found in the first mapping.N(RtpopitemR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRPs cG@sHy|jdj||SWn&tk rCtdj|nXdS(sWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].is(Key not found in the first mapping: {!r}N(RtpopRR(RZRSR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRWs cC@s|jdjdS(s'Clear maps[0], leaving maps[1:] intact.iN(Rtclear(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR^sN(R.R/R]R\RRR#RMRRRRRRt classmethodRRt__copy__RtpropertyRRRRRR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs(               (tcache_from_sourcecC@s2|dkrt}n|r$d}nd}||S(Ntcto(R#t __debug__(R`tdebug_overridetsuffix((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRes    (t OrderedDict(R(tKeysViewt ValuesViewt ItemsViewRcB@seZdZdZejdZejdZdZdZdZ e dZ dZ d Z d Zd Zd Zd ZdZeZeZedZddZddZdZdZeddZdZdZdZ dZ!dZ"RS(s)Dictionary that remembers insertion ordercO@st|dkr+tdt|ny |jWn7tk rog|_}||dg|(i|_nX|j||dS(sInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. is$expected at most 1 arguments, got %dN(RNRt_OrderedDict__rootRR#t_OrderedDict__mapt_OrderedDict__update(RZRtkwdstroot((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\s    cC@s\||krH|j}|d}|||g|d<|d<|j| od[i]=yiiN(RR(RZRSRTt dict_setitemRtlast((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs    )cC@s@||||jj|\}}}||d<||d del od[y]iiN(RR(RZRSt dict_delitemt link_prevt link_next((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs  cc@s=|j}|d}x#||k r8|dV|d}qWdS(sod.__iter__() <==> iter(od)iiN(R(RZRtcurr((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs    cc@s=|j}|d}x#||k r8|dV|d}qWdS(s#od.__reversed__() <==> reversed(od)iiN(R(RZRR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __reversed__s    cC@smyHx|jjD] }|2qW|j}||dg|(|jjWntk r[nXtj|dS(s.od.clear() -> None. Remove all items from od.N(Rt itervaluesRR#RRR(RZtnodeR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs  cC@s|stdn|j}|rO|d}|d}||d<||d (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. sdictionary is emptyiii(RRRRR(RZRRtlinkRRRSRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs            cC@s t|S(sod.keys() -> list of keys in od(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytkeysscC@sg|D]}||^qS(s#od.values() -> list of values in od((RZRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytvaluesscC@s!g|D]}|||f^qS(s.od.items() -> list of (key, value) pairs in od((RZRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytitemsscC@s t|S(s0od.iterkeys() -> an iterator over the keys in od(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytiterkeysscc@sx|D]}||VqWdS(s2od.itervalues -> an iterator over the values in odN((RZtk((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs cc@s$x|D]}|||fVqWdS(s=od.iteritems -> an iterator over the (key, value) items in odN((RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt iteritemss cO@s&t|dkr.tdt|fn|sCtdn|d}d}t|dkrr|d}nt|trxw|D]}|||| None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v is8update() takes at most 2 positional arguments (%d given)s,update() takes at least 1 argument (0 given)iiR N((RNRRRthasattrR R (RRRZtotherRSRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRYs&    cC@sC||kr!||}||=|S||jkr?t|n|S(sod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. (t_OrderedDict__markerR(RZRSRR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR!s  cC@s"||kr||S|||<|S(sDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od((RZRSR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt setdefault.s  cC@s|si}nt|tf}||kr4dSd|| repr(od)s...is%s()s%s(%r)N(Rt _get_identRR.R (RZt _repr_runningtcall_key((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR5s   cC@sg|D]}|||g^q}t|j}x'ttD]}|j|dqEW|rx|j|f|fS|j|ffS(s%Return state information for picklingN(tvarsRRRR#R(RZRR t inst_dict((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __reduce__Cs#cC@s |j|S(s!od.copy() -> a shallow copy of od(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRMscC@s(|}x|D]}||| New ordered dictionary with keys from S and values equal to v (which defaults to None). ((RRRTtdRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRQs  cC@sMt|tr=t|t|ko<|j|jkStj||S(sod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. (RRRNR Rt__eq__(RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\s.cC@s ||k S(N((RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__ne__escC@s t|S(s@od.viewkeys() -> a set-like object providing a view on od's keys(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytviewkeysjscC@s t|S(s<od.viewvalues() -> an object providing a view on od's values(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt viewvaluesnscC@s t|S(sBod.viewitems() -> a set-like object providing a view on od's items(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt viewitemsrsN(#R.R/R]R\RRRRRRRRR R R R RRRYRtobjectRRR#RRRRRRRRRRR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs:                   (tBaseConfiguratort valid_idents^[a-z_][a-z0-9_]*$cC@s,tj|}|s(td|ntS(Ns!Not a valid Python identifier: %r(t IDENTIFIERR&RLR(RR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR"|stConvertingDictcB@s#eZdZdZddZRS(s A converting dictionary wrapper.cC@sqtj||}|jj|}||k rm|||/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs    cC@sttj|||}|jj|}||k rp|||/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRMs    N(R.R/R]RR#RM(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR$s cC@sjtj|||}|jj|}||k rft|tttfkrf||_||_ qfn|S(N( RRR%R&RR$R'R(R)RS(RZRSRRTR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs   R'cB@s#eZdZdZddZRS(sA converting list wrapper.cC@sqtj||}|jj|}||k rm|||/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs    icC@s^tj||}|jj|}||k rZt|tttfkrZ||_qZn|S(N( RRR%R&RR$R'R(R)(RZtidxRTR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs  (R.R/R]RR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR's R(cB@seZdZdZRS(sA converting tuple wrapper.cC@sgtj||}|jj|}||k rct|tttfkrc||_||_ qcn|S(N( ttupleRR%R&RR$R'R(R)RS(RZRSRTR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs   (R.R/R]R(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR(sR!cB@seZdZejdZejdZejdZejdZejdZ idd6dd 6Z e e Z d Zd Zd Zd ZdZdZdZRS(sQ The configurator base class which defines some useful defaults. s%^(?P[a-z]+)://(?P.*)$s ^\s*(\w+)\s*s^\.\s*(\w+)\s*s^\[\s*(\w+)\s*\]\s*s^\d+$t ext_convertRmt cfg_converttcfgcC@st||_||j_dS(N(R$tconfigR%(RZR/((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\sc C@s|jd}|jd}yy|j|}x_|D]W}|d|7}yt||}Wq7tk r|j|t||}q7Xq7W|SWnVtk rtjd\}}td||f}|||_ |_ |nXdS(sl Resolve strings to objects using standard import and attribute syntax. R0iisCannot resolve %r: %sN( R3RtimporterRRt ImportErrorRsRRLt __cause__t __traceback__( RZRRtusedtfoundREtettbtv((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytresolves"    cC@s |j|S(s*Default converter for the ext:// protocol.(R9(RZRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR,scC@sO|}|jj|}|dkr7td|n||j}|j|jd}x|rJ|jj|}|r||jd}n|jj|}|r|jd}|j j|s||}qyt |}||}Wqt k r||}qXn|r1||j}qatd||fqaW|S(s*Default converter for the cfg:// protocol.sUnable to convert %risUnable to convert %r at %rN( t WORD_PATTERNR&R#RLtendR/tgroupst DOT_PATTERNt INDEX_PATTERNt DIGIT_PATTERNtintR(RZRTtrestRRR*tn((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR-s2     cC@s/t|t r7t|tr7t|}||_nt|t rnt|trnt|}||_nt|t rt|trt|}||_nt|tr+|j j |}|r+|j }|d}|j j |d}|r(|d}t||}||}q(q+n|S(s Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. tprefixRN(RR$RR%R'RR(R+t string_typestCONVERT_PATTERNR&t groupdicttvalue_convertersRMR#R(RZRTRRRCt converterR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR&)s*         c C@s|jd}t|s-|j|}n|jdd}tg|D]"}t|rI|||f^qI}||}|rx-|jD]\}}t|||qWn|S(s1Configure an object with a user-supplied factory.s()R0N(RRR9R#RR"R tsetattr( RZR/RtpropsRR[RRRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytconfigure_customEs 5 cC@s"t|trt|}n|S(s0Utility function which converts lists to tuples.(RRR+(RZRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytas_tupleSs(R.R/R]R$R%RER:R=R>R?RGt staticmethodt __import__R0R\R9R,R-R&RKRL(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR!s"      "  (ii(t __future__RR_R$RstsslR1R#t version_infoRt basestringRDRRttypesRt file_typet __builtin__tbuiltinst ConfigParsert configparsert _backportRRRRRRturllibR R RR R R RRturllib2RRRRRRRRRRthttplibt xmlrpclibtQueuetqueueRthtmlentitydefst raw_inputt itertoolsR tfilterR!R+R"R)tiotstrR*t urllib.parseturllib.requestt urllib.errort http.clienttclienttrequestt xmlrpc.clientt html.parsert html.entitiestentitiestinputR,R-RLRGRVRWR R^tF_OKtX_OKtzipfileRRRRtBaseZipExtFileRtRRRt NameErrort collectionsRRRRtgetfilesystemencodingRRttokenizeRtcodecsRRR%RRthtmlR9tcgiRRRtreprlibRRtimpRRtthreadRRt dummy_threadt_abcollRRRRtlogging.configR!R"tIR#R$RRR'R+R((((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyts$        (4  @         @F   2 +  A                   [   b          PK!. metadata.pyonu[ abc@sdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZejeZd e fd YZd e fdYZde fdYZde fdYZdddgZdZ dZ!ej"dZ#ej"dZ$ddddddd d!d"d#d$f Z%ddddd%ddd d!d"d#d$d&d'd(d)d*fZ&d(d)d*d&d'fZ'ddddd%ddd d!d"d#d+d,d$d&d'd-d.d/d0d1d2fZ(d/d0d1d-d2d+d,d.fZ)ddddd%ddd d!d"d#d+d,d$d&d'd-d.d/d0d1d2d3d4d5d6d7fZ*d3d7d4d5d6fZ+e,Z-e-j.e%e-j.e&e-j.e(e-j.e*ej"d8Z/d9Z0d:Z1idd;6dd<6dd=6dd>6d%d?6dd@6ddA6d dB6d!dC6d"dD6d#dE6d+dF6d,dG6d$dH6d&dI6d'dJ6d-dK6d/dL6d0dM6d5dN6d1dO6d2dP6d*dQ6d)dR6d(dS6d.dT6d3dU6d4dV6d6dW6d7dX6Z2d0d-d/fZ3d1fZ4dfZ5dd&d(d*d)d-d/d0d2d.d%d5d7d6fZ6d.fZ7d fZ8d"d+ddfZ9e:Z;ej"dYZ<e=dZZ>d[e:fd\YZ?d]Z@d^ZAd_e:fd`YZBdS(auImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). i(tunicode_literalsN(tmessage_from_filei(tDistlibExceptiont __version__(tStringIOt string_typest text_type(t interpret(textract_by_keyt get_extras(t get_schemetPEP440_VERSION_REtMetadataMissingErrorcBseZdZRS(uA required metadata is missing(t__name__t __module__t__doc__(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR stMetadataConflictErrorcBseZdZRS(u>Attempt to read or write metadata fields that are conflictual.(R RR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR st MetadataUnrecognizedVersionErrorcBseZdZRS(u Unknown metadata version number.(R RR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR$stMetadataInvalidErrorcBseZdZRS(uA metadata value is invalid(R RR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR(suMetadatauPKG_INFO_ENCODINGuPKG_INFO_PREFERRED_VERSIONuutf-8u1.1u \|u uMetadata-VersionuNameuVersionuPlatformuSummaryu DescriptionuKeywordsu Home-pageuAuthoru Author-emailuLicenseuSupported-Platformu Classifieru Download-URLu ObsoletesuProvidesuRequiresu MaintaineruMaintainer-emailuObsoletes-Distu Project-URLu Provides-Distu Requires-DistuRequires-PythonuRequires-ExternaluPrivate-Versionu Obsoleted-ByuSetup-Requires-Distu ExtensionuProvides-Extrau"extra\s*==\s*("([^"]+)"|'([^']+)')cCsP|dkrtS|dkr tS|dkr0tS|dkr@tSt|dS(Nu1.0u1.1u1.2u2.0(t _241_FIELDSt _314_FIELDSt _345_FIELDSt _426_FIELDSR(tversion((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt_version2fieldlistgs    c Csd}g}xB|jD]4\}}|gdd fkrCqn|j|qWddddg}x|D]}|tkrd|kr|jdn|tkrd|kr|jdn|tkrd|kr|jdn|tkrmd|krm|jdqmqmWt|dkr1|dSt|dkrRt d nd|koj||t }d|ko||t }d|ko||t }t |t |t |dkrt d n| r| r| rt|krtSn|r dS|rdSdS( u5Detect the best version depending on the fields used.cSs%x|D]}||krtSqWtS(N(tTruetFalse(tkeystmarkerstmarker((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt _has_markerus  uUNKNOWNu1.0u1.1u1.2u2.0iiuUnknown metadata setu(You used incompatible 1.1/1.2/2.0 fieldsN(titemstNonetappendRtremoveRRRtlenRt _314_MARKERSt _345_MARKERSt _426_MARKERStinttPKG_INFO_PREFERRED_VERSION( tfieldsRRtkeytvaluetpossible_versionstis_1_1tis_1_2tis_2_0((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt _best_versionssB  & umetadata_versionunameuversionuplatformusupported_platformusummaryu descriptionukeywordsu home_pageuauthoru author_emailu maintainerumaintainer_emailulicenseu classifieru download_urluobsoletes_distu provides_distu requires_distusetup_requires_disturequires_pythonurequires_externalurequiresuprovidesu obsoletesu project_urluprivate_versionu obsoleted_byu extensionuprovides_extrau[^A-Za-z0-9.]+cCsG|r9tjd|}tjd|jdd}nd||fS(uhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.u-u u.u%s-%s(t _FILESAFEtsubtreplace(tnameRt for_filename((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt_get_name_and_versions!tLegacyMetadatacBs4eZdZdddddZdZdZdZdZdZ dZ d Z d Z d Z d Zed ZdZdZdZdZedZedZddZdZedZedZedZdZdZdZdZ dZ!dZ"RS( uaThe legacy metadata of a release. Supports versions 1.0, 1.1 and 1.2 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name udefaultcCs|||gjddkr-tdni|_g|_d|_||_|dk rm|j|nB|dk r|j|n&|dk r|j ||j ndS(Niu'path, fileobj and mapping are exclusive( tcountR t TypeErrort_fieldstrequires_filest _dependenciestschemetreadt read_filetupdatetset_metadata_version(tselftpathtfileobjtmappingR=((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt__init__s        cCst|j|jdJscCst|}|d|jdtj|ddd}z|j||Wd|jXdS(u&Write the metadata fields to filepath.uwRbuutf-8N(RcRdt write_fileRe(RBRft skip_unknownRg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRGhscCs<|jx+t|dD]}|j|}|rT|dgdgfkrTqn|tkr|j||dj|qn|tkr|dkr|jd kr|jdd}q|jdd }n|g}n|t krg|D]}dj|^q}nx!|D]}|j|||qWqWd S( u0Write the PKG-INFO format data to a file object.uMetadata-VersionuUNKNOWNu,u Descriptionu1.0u1.1u u u |N(u1.0u1.1( RARRIRVRHtjoinRURXR3Ri(RBt fileobjectRqRnRoR+((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRpps$      % c sfd}|sn^t|drRxL|jD]}||||q4Wn$x!|D]\}}|||qYW|rx*|jD]\}}|||qWndS(uSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs2|tkr.|r.jj||ndS(N(RTRKRM(R*R+(RB(s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt_setsukeysN(thasattrRR(RBtothertkwargsRttktv((RBs@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR@s cCs|j|}|tks'|dkrt|ttf rt|trwg|jdD]}|j^q\}qg}nF|tkrt|ttf rt|tr|g}qg}nt j t j r|d}t |j}|tkrR|d k rRx|D];}|j|jddst jd|||qqWq|tkr|d k r|j|st jd|||qq|tkr|d k r|j|st jd|||qqn|tkr|dkr|j|}qn||j|d?d@f }i}x;|D]3\}}| sf||jkrD|||||D]3\}}| sk||jkrI||||(t __class__R R4R(RB((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt__repr__msN(#R RRR RFRARHRJRLRPRQRMRWR[R]RR_R`RaR>R?RGRpR@RKRRIRRRRRRoRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR7s>                     ,  , ;    u pydist.jsonu metadata.jsontMetadatacBseZdZejdZejdejZeZ ejdZ dZ de Z id>d6d?d6d@d 6Zd Zd ZiedAfd 6edBfd6e dCfd6e dDfd 6ZdEZdFdFdFddZedGZdFefZdFefZi defd6defd6ed6ed6ed6defd6ed6ed6ed6ed 6d!efd"6dHd$6dId 6Z[[d&ZdFd'Zd(Zed)Z ed*Z!e!j"d+Z!dFdFd,Z#ed-Z$ed.Z%e%j"d/Z%d0Z&d1Z'd2Z(d3Z)id4d6d5d6d6d6d7d 6d8d96d!d"6Z*d:Z+dFdFe,e-d;Z.d<Z/d=Z0RS(Ju The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. u ^\d+(\.\d+)*$u!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$u .{1,2047}u2.0u distlib (%s)unameuversionulegacyusummaryuqname version license summary description author author_email keywords platform home_page classifiers download_urluwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environmentsumetadata_versionu_legacyu_datauschemeudefaultcCs|||gjddkr-tdnd|_d|_||_|dk ry|j||||_Wqtk rtd|d||_|j qXnd}|rt |d}|j }WdQXn|r|j }n|dkri|j d6|j d6|_nt|ts?|jd}ny)tj||_|j|j|Wn9tk rtd t|d||_|j nXdS( Niu'path, fileobj and mapping are exclusiveRER=urbumetadata_versionu generatoruutf-8RD(R8R R9t_legacyt_dataR=t_validate_mappingRR7tvalidateRdR>tMETADATA_VERSIONt GENERATORRzRtdecodetjsontloadst ValueErrorR(RBRCRDRER=Rtf((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRFs>          ulicenseukeywordsu Requires-Distu run_requiresuSetup-Requires-Distubuild_requiresu dev_requiresu test_requiresu meta_requiresuProvides-Extrauextrasumodulesu namespacesuexportsucommandsu Classifieru classifiersu Download-URLu source_urluMetadata-Versionc Cstj|d}tj|d}||kr||\}}|jr|dkrs|dkrgdn|}q|jj|}q|dkrdn|}|d kr|jj||}qt}|}|jjd} | r|dkr| jd |}q|dkrH| jd } | r| j||}qq| jd } | sr|jjd } n| r| j||}qn||kr|}qnQ||krtj||}n0|jr|jj|}n|jj|}|S( Nu common_keysu mapped_keysucommandsuexportsumodulesu namespacesu classifiersu extensionsupython.commandsupython.detailsupython.exports(ucommandsuexportsumodulesu namespacesu classifiers(tobjectt__getattribute__RR RIR( RBR*tcommontmappedtlktmakertresultR+tsentineltd((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRsF           cCso||jkrk|j|\}}|p.|j|krk|j|}|shtd||fqhqkndS(Nu.'%s' is an invalid value for the '%s' property(tSYNTAX_VALIDATORSR=tmatchR(RBR*R+R=tpatternt exclusionstm((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt_validate_valuescCs|j||tj|d}tj|d}||kr||\}}|jr~|dkrntn||j|               cCst|j|jtS(N(R6R4RR(RB((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pytname_and_version@scCsd|jr|jd}n|jjdg}d|j|jf}||kr`|j|n|S(Nu Provides-Distuprovidesu%s (%s)(RRRR4RR!(RBRts((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pytprovidesDs  cCs*|jr||jd}||kr3|dkrZd }n|}||||d|kr>|}Pq>q>W|dkri|d6}|jd|n*t|dt|B}t||d(R4RRR RX(RBR4R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR(s (((ulegacy((ulegacy(ulegacy(ulegacy(u_legacyu_datauschemeN(unameuversionulicenseukeywordsusummary(u Download-URLN(uMetadata-VersionN(1R RRtretcompiletMETADATA_VERSION_MATCHERtIt NAME_MATCHERR tVERSION_MATCHERtSUMMARY_MATCHERRRRRRRRt __slots__R RFRKt common_keysR{t none_listtdictt none_dictt mapped_keysRRRtpropertyRRtsetterRRRRRRRRRRRRGRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRvs       ,         + ' *     % (CRt __future__RRctemailRRRRtRRtcompatRRRRRtutilRR RR R t getLoggerR R}R RRRt__all__tPKG_INFO_ENCODINGR(RRZRYRRR$RR%RR&RKRRR@tEXTRA_RERR0RTRRRRURiRVRRRR1RR6R7tMETADATA_FILENAMEtWHEEL_METADATA_FILENAMER(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt s                                         8            PK!"\N\N index.pycnu[ abc@sddlZddlZddlZddlZddlZddlZyddlmZWn!ek rddl mZnXddl m Z ddl m Z mZmZmZmZmZddlmZmZmZejeZdZdZd efd YZdS( iN(tThreadi(tDistlibException(tHTTPBasicAuthHandlertRequesttHTTPPasswordMgrturlparset build_openert string_types(tcached_propertytzip_dirt ServerProxyshttps://pypi.python.org/pypitpypit PackageIndexcBseZdZdZddZdZdZdZdZ dZ dZ dd Z dd Z dd Zddd d ddZdZddZddZdddZdZdZddZRS(sc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$c Cs|p t|_|jt|j\}}}}}}|sX|sX|sX|d krntd|jnd |_d |_d |_d |_ d |_ t t j dj}x`d D]X} y>tj| dgd|d |} | d kr| |_PnWqtk rqXqWWd QXd S(s Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. thttpthttpssinvalid repository: %stwtgpgtgpg2s --versiontstdouttstderriN(R R(RR(t DEFAULT_INDEXturltread_configurationRRtNonetpassword_handlert ssl_verifierRtgpg_homet rpc_proxytopentostdevnullt subprocesst check_calltOSError( tselfRtschemetnetloctpathtparamstquerytfragtsinktstrc((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyt__init__$s( !          cCs3ddlm}ddlm}|}||S(ss Get the distutils command for interacting with PyPI configurations. :return: the command. i(t Distribution(t PyPIRCCommand(tdistutils.coreR-tdistutils.configR.(R"R-R.td((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyt_get_pypirc_commandBs cCsy|j}|j|_|j}|jd|_|jd|_|jdd|_|jd|j|_dS(s Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. tusernametpasswordtrealmR t repositoryN(R2RR6t _read_pypirctgetR3R4R5(R"tctcfg((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyRLs   cCs0|j|j}|j|j|jdS(s Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. N(tcheck_credentialsR2t _store_pypircR3R4(R"R9((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytsave_configuration[s  cCs|jdks|jdkr-tdnt}t|j\}}}}}}|j|j||j|jt ||_ dS(sp Check that ``username`` and ``password`` have been set, and raise an exception if not. s!username and password must be setN( R3RR4RRRRt add_passwordR5RR(R"tpmt_R$((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyR;gs  !cCs|j|j|j}d|d<|j|jg}|j|}d|d<|j|jg}|j|S(sq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. tverifys:actiontsubmit(R;tvalidatettodicttencode_requesttitemst send_request(R"tmetadataR1trequesttresponse((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytregisterss     cCsjxYtr[|j}|sPn|jdj}|j|tjd||fqW|jdS(sr Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. sutf-8s%s: %sN(tTruetreadlinetdecodetrstriptappendtloggertdebugtclose(R"tnametstreamtoutbufR*((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyt_readers   cCs|jdddg}|dkr-|j}n|rI|jd|gn|dk rn|jdddgntj}tjj|tjj |d}|jd d d |d ||gt j d dj|||fS(s Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. s --status-fdt2s--no-ttys --homedirs--batchs--passphrase-fdt0s.ascs --detach-signs--armors --local-users--outputs invoking: %st N( RRRtextendttempfiletmkdtempRR%tjointbasenameRQRR(R"tfilenametsignert sign_passwordtkeystoretcmdttdtsf((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytget_sign_commands    %c Cs itjd6tjd6}|dk r6tj|d        c Cs|jtjj|s/td|ntjj|d}tjj|sitd|n|j|j|j }}t |j }d d|fd|fg}d||fg}|j ||} |j | S( s2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. snot a directory: %rs index.htmls not found: %rs:actiont doc_uploadRTtversionR(s:actionR(R;RR%tisdirRR^RRCRTRR tgetvalueRERG( R"RHtdoc_dirtfnRTRtzip_datatfieldsRRI((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytupload_documentation)s  cCs||jdddg}|dkr-|j}n|rI|jd|gn|jd||gtjddj||S( s| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. s --status-fdRXs--no-ttys --homedirs--verifys invoking: %sRZN(RRRR[RQRRR^(R"tsignature_filenamet data_filenameRcRd((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytget_verify_commandEs  cCsn|jstdn|j|||}|j|\}}}|dkrdtd|n|dkS(s6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. s0verification unavailable because gpg unavailableiis(verify command failed with error code %s(ii(RRRRv(R"RRRcRdR+RR((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytverify_signature]s     cCs |d kr"d }tjdnMt|ttfrF|\}}nd}tt|}tjd|t|d}|j t |}z|j } d} d} d} d} d| krt | d } n|r|| | | nxyt rp|j| }|sPn| t|7} |j||rJ|j|n| d 7} |r|| | | qqWWd |jXWd QX| dkr| | krtd | | fn|r|j}||krtd ||||fntjd|nd S(s This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. sNo digest specifiedRsDigest specified: %stwbi iiscontent-lengthsContent-LengthiNs1retrieval incomplete: got only %d out of %d bytess.%s digest mismatch for %s: expected %s, got %ssDigest verified: %s(RRQRRt isinstancetlistttupletgetattrRRRGRtinfotintRLRtlenRnRRSRR(R"Rtdestfiletdigestt reporthooktdigesterthashertdfptsfptheaderst blocksizetsizeRtblocknumtblocktactual((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyt download_filevsV        cCsWg}|jr"|j|jn|jr>|j|jnt|}|j|S(s Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). (RRPRRR(R"treqthandlerstopener((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyRGs   cCs<g}|j}xy|D]q\}}t|ttfsC|g}nxA|D]9}|jd|d|jdd|jdfqJWqWxG|D]?\}} } |jd|d|| fjdd| fqW|jd|ddfdj|} d|} i| d6tt| d 6} t |j | | S( s& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--s)Content-Disposition: form-data; name="%s"sutf-8ts8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=s Content-typesContent-length( tboundaryRRRR[RwR^tstrRRR(R"RRtpartsRtktvaluestvtkeyR`tvaluetbodytctR((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyREs4      cCsbt|tri|d6}n|jdkrIt|jdd|_n|jj||p^dS(NRTttimeoutg@tand(RRRRR Rtsearch(R"ttermstoperator((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyRs N(t__name__t __module__t__doc__RRR,R2RR=R;RKRWRgRvRyRRRRRRGRER(((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyR s*      # 8   M  +(RtloggingRRRR\t threadingRt ImportErrortdummy_threadingRRtcompatRRRRRRtutilRR R t getLoggerRRQRt DEFAULT_REALMtobjectR (((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyts       .PK!bޑ66 resources.pycnu[ abc@s ddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZejeZdadefdYZdefd YZd efd YZd efd YZdefdYZdefdYZieed6ee j6Z yQyddl!Z"Wne#k rddl$Z"nXee e"j%R R((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytfinds  cCst|jdS(Nurb(RR (RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR'scCs)t|jd}|jSWdQXdS(Nurb(RR tread(RRR ((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR+scCstjj|jS(N(RR tgetsize(RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR,scsDfd}tgtj|jD]}||r%|^q%S(Ncs|dko|jj S(Nu __pycache__(tendswithtskipped_extensions(R (R(sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytalloweds (tsetRtlistdirR (RRRIR ((RsA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR2scCs|j|jS(N(RCR (RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR0sccs|j|}|dk r|g}x|r|jd}|V|jr'|j}xe|jD]W}|sr|}ndj||g}|j|}|jr|j|q]|Vq]Wq'q'WndS(Niu/(RDRtpopR0R%R3R tappend(RR>RttodotrnameR%tnew_nametchild((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytiterators        (u.pycu.pyou.class(u.pycu.pyo(R"R#R.tsystplatformt startswithRHR R9RARBRRDR'R+R,R2R0t staticmethodRR RRCRR(((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR4ws"          tZipResourceFindercBs_eZdZdZdZdZdZdZdZdZ dZ d Z RS( u6 Resource finder for resources in .zip files. cCstt|j||jj}dt||_t|jdrY|jj|_nt j ||_t |j|_ dS(Niu_files( R RWR R7tarchivetlent prefix_lenthasattrt_filest zipimportt_zip_directory_cachetsortedtindex(RR5RX((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR s cCs|S(N((RR ((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR9scCs||j}||jkr%t}nr|rN|dtjkrN|tj}ntj|j|}y|j|j|}Wntk rt }nX|st j d||j j nt j d||j j |S(Niu_find failed: %r %ru_find worked: %r %r(RZR\RRR?tbisectR`RUt IndexErrorR/tloggertdebugR7R(RR Rti((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRBs    cCs-|jj}|jdt|}||fS(Ni(R7RXR RY(RRRR ((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRs cCs|jj|jS(N(R7tget_dataR (RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR+scCstj|j|S(N(tiotBytesIOR+(RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR'scCs|j|j}|j|dS(Ni(R RZR\(RRR ((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR,scCs|j|j}|r9|dtjkr9|tj7}nt|}t}tj|j|}xn|t|jkr|j|j|sPn|j||}|j |j tjdd|d7}qfW|S(Niii( R RZRR?RYRJRaR`RUtaddR<(RRR tplenRRets((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR2s   cCs||j}|r6|dtjkr6|tj7}ntj|j|}y|j|j|}Wntk r~t}nX|S(Ni(RZRR?RaR`RURbR/(RR ReR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRCs   ( R"R#R.R R9RBRR+R'R,R2RC(((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRWs       cCs|tt|sJ         ",!ZM       PK!bG markers.pycnu[ abc@sdZddlZddlZddlZddlZddlmZmZddlm Z dgZ de fdYZ dd ZdS( sEParser for the environment markers micro-language defined in PEP 345.iNi(tpython_implementationt string_types(tin_venvt interprett EvaluatorcBs^eZdZi dd6dd6dd6dd6d d 6d d 6d d6dd6dd6Zi ejd6dejd d6ejjdddd6e j d6e e d6ej d6ejd6ejd6ed 6Zd,d!Zd"Zd#Zd,d$Zd%Zd&Zd'Zd(Zd)Zd*Zd+ZRS(-s5 A limited evaluator for Python expressions. cCs ||kS(N((txty((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyttteqcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtgtcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtgtecCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtincCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtltcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtltecCs| S(N((R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyR RtnotcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyR!RtnoteqcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyR"Rtnotint sys_platforms%s.%sitpython_versiont iitpython_full_versiontos_nametplatform_in_venvtplatform_releasetplatform_versiontplatform_machinetplatform_python_implementationcCs|p i|_d|_dS(su Initialise an instance. :param context: If specified, names are looked up in this mapping. N(tcontexttNonetsource(tselfR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt__init__3scCsHd}d|j|||!}||t|jkrD|d7}n|S(sH Get the part of the source which is causing a problem. i s%rs...(Rtlen(Rtoffsett fragment_lents((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt get_fragment<s  cCst|d|dS(s@ Get a handler for the specified AST node type. sdo_%sN(tgetattrR(Rt node_type((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt get_handlerFscCst|tr||_idd6}|r8||dRtallowed_valuesR/(RR4tvalidtkeytresult((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt do_attributejs  cCs|j|jd}|jjtjk}|jjtjk}|sR|sRt|r^|sk|r| rxD|jdD]2}|j|}|r|s|ry| ryPqyqyWn|S(Nii(R8tvaluestopR0R-tOrtAndR:(RR4RDtis_ortis_andtn((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt do_boolopxs c sfd}j}j|}t}xtjjD]\}}||||jjj}|j krt d|nj|}j |||}|sPn|}|}qFW|S(Ncsbt}t|tjr3t|tjr3t}n|s^jj}td|ndS(NsInvalid comparison: %s(tTrueR,R-tStrR@R%R3R/(tlhsnodetrhsnodeRBR$(R4R(s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt sanity_checks $ sunsupported operation: %r( tleftR8RNtziptopst comparatorsR0R1R2t operatorsR/( RR4RRRPtlhsRDRGRQtrhs((R4Rs?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt do_compares  "  cCs|j|jS(N(R8tbody(RR4((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt do_expressionscCs|t}|j|jkr1t}|j|j}n+|j|jkr\t}|j|j}n|sxtd|jn|S(Nsinvalid expression: %s(R@R<RRNRAR/(RR4RBRD((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pytdo_namescCs|jS(N(R$(RR4((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pytdo_strsN(R1t __module__t__doc__RWtsystplatformt version_infotversiontsplittostnametstrRtreleasetmachineRRARR R%R(R8R>RERMRZR\R]R^(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRs@                      cCst|j|jS(s Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping (RR8tstrip(tmarkertexecution_context((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRs (R`R-RfRaRbtcompatRRtutilRt__all__tobjectRRR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyts     PK!V compat.pycnu[ abc@@sddlmZddlZddlZddlZyddlZWnek r]dZnXejddkr ddl m Z e fZ e Z ddlmZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZm Z m!Z!m"Z"m#Z#m$Z$d Zddl%Z%dd l%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.erdd l%m/Z/nddl0Z0ddl1Z1ddl2Z3dd l4m4Z4ddl5Z5e6Z6ddl7m8Z9ddl7m:Z;da<dZ=nddl>m Z e?fZ e?Z ddl>m@ZddlZddlZddlZddlAmZmZmZm=Z=mZm Z mZmZm$Z$ddlBm'Z'mZm&Z&m!Z!m"Z"m*Z*m+Z+m,Z,m-Z-m.Z.erdd lBm/Z/nddlCm)Z)m(Z(m#Z#ddlDjEZ0ddlBjFZ%ddlGjEZ1ddl3Z3dd lHm4Z4ddlIjJZ5eKZ6ddl7m;Z;e9Z9yddlmLZLmMZMWn<ek rdeNfdYZMddZOdZLnXyddlmPZQWn'ek r"deRfdYZQnXyddlmSZSWn*ek rcejTejUBddZSnXdd lVmWZXeYeXd!reXZWn<dd"lVmZZ[d#e[fd$YZZd%eXfd&YZWydd'l\m]Z]Wnek rd(Z]nXyddl^Z^Wn!ek r,dd)lm^Z^nXy e_Z_Wn*e`k rcdd*lambZbd+Z_nXyejcZcejdZdWnJeek rejfZgegd,krd-Zhnd.Zhd/Zcd0ZdnXydd1limjZjWnTek r1dd2lkmlZlmmZmddlZejnd3Zod4Zpd5ZjnXydd6lqmrZrWn!ek ridd6lsmrZrnXejd7 dTkre4jtZtndd9lqmtZtydd:lamuZuWnkek rdd;lamvZvydd<lwmxZyWnek rd=d>ZynXd?evfd@YZunXyddAlzm{Z{Wnek rQddBZ{nXyddClam|Z|Wnek ryddDl}m~ZWn!ek rddDlm~ZnXy ddElmZmZmZWnek rnXdFefdGYZ|nXyddHlmZmZWnek rejndIejZdJZdKefdLYZddMZdNefdOYZdPefdQYZdReRfdSYZnXdS(Ui(tabsolute_importNi(tStringIO(tFileTypei(tshutil(turlparset urlunparseturljointurlsplitt urlunsplit(t urlretrievetquotetunquotet url2pathnamet pathname2urltContentTooShortErrort splittypecC@s+t|tr!|jd}nt|S(Nsutf-8(t isinstancetunicodetencodet_quote(ts((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR s( tRequestturlopentURLErrort HTTPErrortHTTPBasicAuthHandlertHTTPPasswordMgrt HTTPHandlertHTTPRedirectHandlert build_opener(t HTTPSHandler(t HTMLParser(tifilter(t ifilterfalsecC@sYtdkr*ddl}|jdantj|}|rO|jddSd|fS(sJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.iNs ^(.*)@(.*)$ii(t _userprogtNonetretcompiletmatchtgroup(thostR$R&((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt splituser4s  (t TextIOWrapper( RRRR)R R RRR( RR RR R RRRRR(RRR(t filterfalse(tmatch_hostnametCertificateErrorR-cB@seZRS((t__name__t __module__(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR-^sc C@sSg}|stS|jd}|d|d}}|jd}||krhtdt|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 startswithR$tescapetreplaceR%tjoint IGNORECASER&( tdnthostnamet max_wildcardstpatstpartstleftmostt remaindert wildcardstfragtpat((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt_dnsname_matchbs(  " &cC@s[|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. stempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDtsubjectAltNametDNSNtsubjectt commonNameis&hostname %r doesn't match either of %ss, shostname %r doesn't match %ris=no appropriate commonName or subjectAltName fields were found((( t ValueErrortgetRGR7tlenR-R;tmapR5(tcertR>tdnsnamestsantkeytvaluetsub((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR,s.  %(tSimpleNamespacet ContainercB@seZdZdZRS(sR A generic container for when multiple values need to be returned cK@s|jj|dS(N(t__dict__tupdate(tselftkwargs((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__init__s(R.R/t__doc__R\(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRWs(twhichc @sd}tjjr2||r.SdS|dkrYtjjdtj}n|scdS|jtj}t j dkrtj |kr|j dtj ntjjddjtj}t fd|Drg}qg|D]}|^q}n g}t}xu|D]m}tjj|} | |kr+|j| x9|D].} tjj|| } || |rc| SqcWq+q+WdS( sKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cS@s5tjj|o4tj||o4tjj| S(N(tostpathtexiststaccesstisdir(tfntmode((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt _access_checks$tPATHtwin32itPATHEXTtc3@s*|] }jj|jVqdS(N(R6tendswith(t.0text(tcmd(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pys sN(R_R`tdirnameR#tenvironRMtdefpathR3tpathseptsystplatformtcurdirtinserttanytsettnormcasetaddR;( RnReR`RftpathexttfilesRmtseentdirtnormdirtthefiletname((Rns>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR^s8  !        (tZipFilet __enter__(t ZipExtFileRcB@s#eZdZdZdZRS(cC@s|jj|jdS(N(RXRY(RZtbase((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\scC@s|S(N((RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRscG@s|jdS(N(tclose(RZtexc_info((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__exit__s(R.R/R\RR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs  RcB@s#eZdZdZdZRS(cC@s|S(N((RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR"scG@s|jdS(N(R(RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR%scO@stj|||}t|S(N(t BaseZipFiletopenR(RZtargsR[R((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR)s(R.R/RRR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR!s  (tpython_implementationcC@s@dtjkrdStjdkr&dStjjdr<dSdS(s6Return a string identifying the Python implementation.tPyPytjavatJythont IronPythontCPython(RstversionR_RR8(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR0s(t sysconfig(tCallablecC@s t|tS(N(RR(tobj((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytcallableDstmbcststricttsurrogateescapecC@sOt|tr|St|tr2|jttStdt|jdS(Nsexpect bytes or str, not %s( Rtbytest text_typeRt _fsencodingt _fserrorst TypeErrorttypeR.(tfilename((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytfsencodeRs cC@sOt|tr|St|tr2|jttStdt|jdS(Nsexpect bytes or str, not %s( RRRtdecodeRRRRR.(R((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytfsdecode[s (tdetect_encoding(tBOM_UTF8tlookupscoding[:=]\s*([-\w.]+)cC@s^|d jjdd}|dks7|jdr;dS|d ksV|jd rZdS|S(s(Imitates get_normal_name in tokenizer.c.i t_t-sutf-8sutf-8-slatin-1s iso-8859-1s iso-latin-1slatin-1-s iso-8859-1-s iso-latin-1-(slatin-1s iso-8859-1s iso-latin-1(slatin-1-s iso-8859-1-s iso-latin-1-(R6R:R8(torig_enctenc((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt_get_normal_namels c@s yjjWntk r)dnXtd}d}fd}fd}|}|jtrt|d}d}n|s|gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS(s? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. sutf-8c@s$y SWntk rdSXdS(NRj(t StopIteration((treadline(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt read_or_stops  c@s7y|jd}WnDtk rYd}dk rJdj|}nt|nXtj|}|ssdSt|d}yt|}WnHt k rdkrd|}ndj|}t|nXr3|j dkr&dkrd}ndj}t|n|d 7}n|S( Nsutf-8s'invalid or missing encoding declarations {} for {!r}isunknown encoding: sunknown encoding for {!r}: {}sencoding problem: utf-8s encoding problem for {!r}: utf-8s-sig( RtUnicodeDecodeErrorR#tformatt SyntaxErrort cookie_retfindallRRt LookupErrorR(tlinet line_stringtmsgtmatchestencodingtcodec(t bom_foundR(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt find_cookies6          is utf-8-sigN(t__self__RtAttributeErrorR#R2R8RtTrue(RRtdefaultRRtfirsttsecond((RRRs>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRws4  &         (R9ii(tunescape(tChainMap(tMutableMapping(trecursive_reprs...c@sfd}|S(sm Decorator to make a repr function return fillvalue for a recursive call c@smtfd}td|_td|_td|_tdi|_|S(Nc@sWt|tf}|kr%Sj|z|}Wdj|X|S(N(tidt get_identRztdiscard(RZRStresult(t fillvaluet repr_runningt user_function(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytwrappers  R/R]R.t__annotations__(RxtgetattrR/R]R.R(RR(R(RRs>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytdecorating_functions  ((RR((Rs>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt_recursive_reprsRcB@seZdZdZdZdZddZdZdZ dZ dZ e d Z ed Zd ZeZd Zed ZdZdZdZdZdZRS(s A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cG@st|pig|_dS(sInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N(tlisttmaps(RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\ scC@st|dS(N(tKeyError(RZRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __missing__scC@sAx1|jD]&}y ||SWq tk r/q Xq W|j|S(N(RRR(RZRStmapping((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __getitem__s   cC@s||kr||S|S(N((RZRSR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRMscC@sttj|jS(N(RNRxtunionR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__len__"scC@sttj|jS(N(titerRxRR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__iter__%sc@stfd|jDS(Nc3@s|]}|kVqdS(N((Rltm(RS(s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pys )s(RwR(RZRS((RSs>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __contains__(scC@s t|jS(N(RwR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__bool__+scC@s%dj|djtt|jS(Ns{0.__class__.__name__}({1})s, (RR;ROR5R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__repr__.scG@s|tj||S(s?Create a ChainMap with a single dict created from the iterable.(tdicttfromkeys(tclstiterableR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR3scC@s$|j|jdj|jdS(sHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]ii(t __class__Rtcopy(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR8scC@s|ji|jS(s;New ChainMap with a new dict followed by all previous maps.(RR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt new_child>scC@s|j|jdS(sNew ChainMap from maps[1:].i(RR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytparentsBscC@s||jd|/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __setitem__GscC@s?y|jd|=Wn&tk r:tdj|nXdS(Nis(Key not found in the first mapping: {!r}(RRR(RZRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __delitem__Js cC@s9y|jdjSWntk r4tdnXdS(sPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.is#No keys found in the first mapping.N(RtpopitemR(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRPs cG@sHy|jdj||SWn&tk rCtdj|nXdS(sWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].is(Key not found in the first mapping: {!r}N(RtpopRR(RZRSR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRWs cC@s|jdjdS(s'Clear maps[0], leaving maps[1:] intact.iN(Rtclear(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR^sN(R.R/R]R\RRR#RMRRRRRRt classmethodRRt__copy__RtpropertyRRRRRR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs(               (tcache_from_sourcecC@sG|jdst|dkr*t}n|r9d}nd}||S(Ns.pytcto(RktAssertionErrorR#t __debug__(R`tdebug_overridetsuffix((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRes   (t OrderedDict(R(tKeysViewt ValuesViewt ItemsViewRcB@seZdZdZejdZejdZdZdZdZ e dZ dZ d Z d Zd Zd Zd ZdZeZeZedZddZddZdZdZeddZdZdZdZ dZ!dZ"RS(s)Dictionary that remembers insertion ordercO@st|dkr+tdt|ny |jWn7tk rog|_}||dg|(i|_nX|j||dS(sInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. is$expected at most 1 arguments, got %dN(RNRt_OrderedDict__rootRR#t_OrderedDict__mapt_OrderedDict__update(RZRtkwdstroot((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\s    cC@s\||krH|j}|d}|||g|d<|d<|j| od[i]=yiiN(RR(RZRSRTt dict_setitemRtlast((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs    )cC@s@||||jj|\}}}||d<||d del od[y]iiN(RR(RZRSt dict_delitemt link_prevt link_next((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs  cc@s=|j}|d}x#||k r8|dV|d}qWdS(sod.__iter__() <==> iter(od)iiN(R(RZRtcurr((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs    cc@s=|j}|d}x#||k r8|dV|d}qWdS(s#od.__reversed__() <==> reversed(od)iiN(R(RZRR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __reversed__s    cC@smyHx|jjD] }|2qW|j}||dg|(|jjWntk r[nXtj|dS(s.od.clear() -> None. Remove all items from od.N(Rt itervaluesRR#RRR(RZtnodeR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs  cC@s|stdn|j}|rO|d}|d}||d<||d (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. sdictionary is emptyiii(RRRRR(RZRRtlinkRRRSRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs            cC@s t|S(sod.keys() -> list of keys in od(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytkeysscC@sg|D]}||^qS(s#od.values() -> list of values in od((RZRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytvaluesscC@s!g|D]}|||f^qS(s.od.items() -> list of (key, value) pairs in od((RZRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytitemsscC@s t|S(s0od.iterkeys() -> an iterator over the keys in od(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytiterkeysscc@sx|D]}||VqWdS(s2od.itervalues -> an iterator over the values in odN((RZtk((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs cc@s$x|D]}|||fVqWdS(s=od.iteritems -> an iterator over the (key, value) items in odN((RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt iteritemss cO@s&t|dkr.tdt|fn|sCtdn|d}d}t|dkrr|d}nt|trxw|D]}|||| None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v is8update() takes at most 2 positional arguments (%d given)s,update() takes at least 1 argument (0 given)iiR N((RNRRRthasattrR R (RRRZtotherRSRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRYs&    cC@sC||kr!||}||=|S||jkr?t|n|S(sod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. (t_OrderedDict__markerR(RZRSRR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR!s  cC@s"||kr||S|||<|S(sDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od((RZRSR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt setdefault.s  cC@s|si}nt|tf}||kr4dSd|| repr(od)s...is%s()s%s(%r)N(Rt _get_identRR.R (RZt _repr_runningtcall_key((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR5s   cC@sg|D]}|||g^q}t|j}x'ttD]}|j|dqEW|rx|j|f|fS|j|ffS(s%Return state information for picklingN(tvarsRRRR#R(RZRR t inst_dict((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt __reduce__Cs#cC@s |j|S(s!od.copy() -> a shallow copy of od(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRMscC@s(|}x|D]}||| New ordered dictionary with keys from S and values equal to v (which defaults to None). ((RRRTtdRS((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRQs  cC@sMt|tr=t|t|ko<|j|jkStj||S(sod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. (RRRNR Rt__eq__(RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\s.cC@s ||k S(N((RZR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt__ne__escC@s t|S(s@od.viewkeys() -> a set-like object providing a view on od's keys(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytviewkeysjscC@s t|S(s<od.viewvalues() -> an object providing a view on od's values(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt viewvaluesnscC@s t|S(sBod.viewitems() -> a set-like object providing a view on od's items(R(RZ((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyt viewitemsrsN(#R.R/R]R\RRRRRRRRR R R RRRRYRtobjectRRR#RRRRRRRRRRR (((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs:                   (tBaseConfiguratort valid_idents^[a-z_][a-z0-9_]*$cC@s,tj|}|s(td|ntS(Ns!Not a valid Python identifier: %r(t IDENTIFIERR&RLR(RR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR#|stConvertingDictcB@s#eZdZdZddZRS(s A converting dictionary wrapper.cC@sqtj||}|jj|}||k rm|||/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs    cC@sttj|||}|jj|}||k rp|||/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRMs    N(R.R/R]RR#RM(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR%s cC@sjtj|||}|jj|}||k rft|tttfkrf||_||_ qfn|S(N( RRR&R'RR%R(R)R*RS(RZRSRRTR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs   R(cB@s#eZdZdZddZRS(sA converting list wrapper.cC@sqtj||}|jj|}||k rm|||/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs    icC@s^tj||}|jj|}||k rZt|tttfkrZ||_qZn|S(N( RRR&R'RR%R(R)R*(RZtidxRTR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs  (R.R/R]RR(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR(s R)cB@seZdZdZRS(sA converting tuple wrapper.cC@sgtj||}|jj|}||k rct|tttfkrc||_||_ qcn|S(N( ttupleRR&R'RR%R(R)R*RS(RZRSRTR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyRs   (R.R/R]R(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR)sR"cB@seZdZejdZejdZejdZejdZejdZ idd6dd 6Z e e Z d Zd Zd Zd ZdZdZdZRS(sQ The configurator base class which defines some useful defaults. s%^(?P[a-z]+)://(?P.*)$s ^\s*(\w+)\s*s^\.\s*(\w+)\s*s^\[\s*(\w+)\s*\]\s*s^\d+$t ext_convertRmt cfg_converttcfgcC@st||_||j_dS(N(R%tconfigR&(RZR0((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR\sc C@s|jd}|jd}yy|j|}x_|D]W}|d|7}yt||}Wq7tk r|j|t||}q7Xq7W|SWnVtk rtjd\}}td||f}|||_ |_ |nXdS(sl Resolve strings to objects using standard import and attribute syntax. R0iisCannot resolve %r: %sN( R3RtimporterRRt ImportErrorRsRRLt __cause__t __traceback__( RZRRtusedtfoundREtettbtv((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytresolves"    cC@s |j|S(s*Default converter for the ext:// protocol.(R:(RZRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR-scC@sO|}|jj|}|dkr7td|n||j}|j|jd}x|rJ|jj|}|r||jd}n|jj|}|r|jd}|j j|s||}qyt |}||}Wqt k r||}qXn|r1||j}qatd||fqaW|S(s*Default converter for the cfg:// protocol.sUnable to convert %risUnable to convert %r at %rN( t WORD_PATTERNR&R#RLtendR0tgroupst DOT_PATTERNt INDEX_PATTERNt DIGIT_PATTERNtintR(RZRTtrestRRR+tn((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR.s2     cC@s/t|t r7t|tr7t|}||_nt|t rnt|trnt|}||_nt|t rt|trt|}||_nt|tr+|j j |}|r+|j }|d}|j j |d}|r(|d}t||}||}q(q+n|S(s Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. tprefixRN(RR%RR&R(RR)R,t string_typestCONVERT_PATTERNR&t groupdicttvalue_convertersRMR#R(RZRTRRRDt converterR((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR')s*         c C@s|jd}t|s-|j|}n|jdd}tg|D]"}t|rI|||f^qI}||}|rx-|jD]\}}t|||qWn|S(s1Configure an object with a user-supplied factory.s()R0N(RRR:R#RR#R tsetattr( RZR0RtpropsRR[RRRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytconfigure_customEs 5 cC@s"t|trt|}n|S(s0Utility function which converts lists to tuples.(RRR,(RZRT((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pytas_tupleSs(R.R/R]R$R%RFR;R>R?R@RHt staticmethodt __import__R1R\R:R-R.R'RLRM(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyR"s"      "  (ii(t __future__RR_R$RstsslR2R#t version_infoRt basestringRERRttypesRt file_typet __builtin__tbuiltinst ConfigParsert configparsert _backportRRRRRRturllibR R RR R R RRturllib2RRRRRRRRRRthttplibt xmlrpclibtQueuetqueueRthtmlentitydefst raw_inputt itertoolsR tfilterR!R+R"R)tiotstrR*t urllib.parseturllib.requestt urllib.errort http.clienttclienttrequestt xmlrpc.clientt html.parsert html.entitiestentitiestinputR,R-RLRGRVRWR!R^tF_OKtX_OKtzipfileRRRRtBaseZipExtFileRtRRRt NameErrort collectionsRRRRtgetfilesystemencodingRRttokenizeRtcodecsRRR%RRthtmlR9tcgiRRRtreprlibRRtimpRRtthreadRRt dummy_threadt_abcollRRRRtlogging.configR"R#tIR$R%RRR(R,R)(((s>/usr/lib/python2.7/site-packages/pip/_vendor/distlib/compat.pyts$        (4  @         @F   2 +  A                   [   b          PK!:Yn database.pycnu[ abc@s0dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZdd lmZmZmZmZmZmZmZd d d d dgZ ej!e"Z#dZ$dZ%deddde$dfZ&dZ'de(fdYZ)de(fdYZ*de(fdYZ+de+fdYZ,de,fd YZ-d!e,fd"YZ.e-Z/e.Z0d#e(fd$YZ1d%d&Z2d'Z3d(Z4d)Z5dS(*uPEP 376 implementation.i(tunicode_literalsNi(tDistlibExceptiont resources(tStringIO(t get_schemetUnsupportedVersionError(tMetadatatMETADATA_FILENAMEtWHEEL_METADATA_FILENAME(tparse_requirementtcached_propertytparse_name_and_versiont read_exportst write_exportst CSVReadert CSVWriteru DistributionuBaseInstalledDistributionuInstalledDistributionuEggInfoDistributionuDistributionPathupydist-exports.jsonupydist-commands.jsonu INSTALLERuRECORDu REQUESTEDu RESOURCESuSHAREDu .dist-infot_CachecBs)eZdZdZdZdZRS(uL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_t|_dS(uZ Initialise an instance. There is normally one for each DistributionPath. N(tnametpathtFalset generated(tself((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__init__0s  cCs'|jj|jjt|_dS(uC Clear the cache, setting it to its initial state. N(RtclearRRR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR8s  cCsH|j|jkrD||j|j<|jj|jgj|ndS(u` Add a distribution to the cache. :param dist: The distribution to add. N(RRt setdefaulttkeytappend(Rtdist((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytadd@s(t__name__t __module__t__doc__RRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR,s  tDistributionPathcBseZdZd edZdZdZeeeZ dZ dZ dZ e dZdZd Zd d Zd Zd d ZRS(uU Represents a set of distributions installed on a path (typically sys.path). cCsg|dkrtj}n||_t|_||_t|_t|_t|_ t d|_ dS(u Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. udefaultN( tNonetsysRtTruet _include_distt _include_eggRt_cachet _cache_eggt_cache_enabledRt_scheme(RRt include_egg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRNs        cCs|jS(N(R((R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_get_cache_enabledbscCs ||_dS(N(R((Rtvalue((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_set_cache_enabledescCs|jj|jjdS(u, Clears the internal cache. N(R&RR'(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt clear_cachejs c cst}x|jD]}tj|}|dkr:qn|jd}| s|j r`qnt|j}x^|D]V}|j|}| sv|j|krqvn|jr}|j t r}t t g}x<|D]1}t j||} |j| } | rPqqWqvtj| j} td| dd} WdQXtjd|j|j|jt|jd| d|Vqv|jrv|j d rvtjd|j|j|jt|j|VqvqvWqWdS( uD Yield .dist-info and/or .egg(-info) distributions. utfileobjtschemeulegacyNuFound %stmetadatatenvu .egg-infou.egg(u .egg-infou.egg(tsetRRtfinder_for_pathR!tfindt is_containertsortedR$tendswitht DISTINFO_EXTRRt posixpathtjoint contextlibtclosingt as_streamRtloggertdebugRtnew_dist_classR%told_dist_class( RtseenRtfindertrtrsettentrytpossible_filenamestmetadata_filenamet metadata_pathtpydisttstreamR1((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_yield_distributionsrs@       cCs|jj }|jo |jj }|s/|rxF|jD]8}t|trd|jj|q<|jj|q<W|rt|j_n|rt|j_qndS(uk Scan the path for distributions and populate the cache with those that are found. N( R&RR%R'RMt isinstancetInstalledDistributionRR#(Rtgen_disttgen_eggR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_generate_caches  cCs)|jdd}dj||gtS(uo The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: stringu-u_(treplaceR;R9(tclsRtversion((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytdistinfo_dirnamesccs|js(xv|jD] }|VqWnZ|jx|jjjD] }|VqEW|jrx"|jjjD] }|VqpWndS(u5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N(R(RMRRR&RtvaluesR%R'(RR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytget_distributionss     cCsd}|j}|jsNx|jD]}|j|kr(|}Pq(q(Wne|j||jjkr|jj|d}n2|jr||j jkr|j j|d}n|S(u= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` iN( R!tlowerR(RMRRRR&RR%R'(RRtresultR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytget_distributions     c csd}|dk r_y |jjd||f}Wq_tk r[td||fq_Xnx|jD]z}|j}xh|D]`}t|\}}|dkr||kr|VPqq||kr|j|r|VPqqWqlWdS(u Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string u%s (%s)uinvalid name or version: %r, %rN( R!R)tmatchert ValueErrorRRXtprovidesR tmatch( RRRUR\Rtprovidedtptp_nametp_ver((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytprovides_distributions$       cCs;|j|}|dkr.td|n|j|S(u5 Return the path to a resource file. uno distribution named %r foundN(R[R!t LookupErrortget_resource_path(RRt relative_pathR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt get_file_paths ccsxy|jD]k}|j}||kr ||}|dk rY||kru||Vquqxx|jD] }|VqfWq q WdS(u Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N(RXtexportsR!RW(RtcategoryRRREtdtv((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytget_exported_entries"s     N(RRRR!RRR+R-tpropertyt cache_enabledR.RMRRt classmethodRVRXR[RdRhRm(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR Js    *    $ t DistributioncBseZdZeZeZdZedZeZ edZ edZ dZ edZ edZedZed Zed Zd Zd Zd ZdZRS(u A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. cCsp||_|j|_|jj|_|j|_d|_d|_d|_d|_ t |_ i|_ dS(u Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N( R1RRYRRUR!tlocatortdigesttextrastcontextR3t download_urlstdigests(RR1((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRGs        cCs |jjS(uH The source archive download URL for this distribution. (R1t source_url(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRxXscCsd|j|jfS(uX A utility property which displays the name and version in parentheses. u%s (%s)(RRU(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytname_and_versionascCsB|jj}d|j|jf}||kr>|j|n|S(u A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. u%s (%s)(R1R^RRUR(Rtplistts((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR^hs   cCsS|j}tjd|jt||}t|j|d|jd|jS(Nu%Getting requirements from metadata %rRtR2( R1R?R@ttodicttgetattrR3tget_requirementsRtRu(Rtreq_attrtmdtreqts((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_get_requirementsts  cCs |jdS(Nu run_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt run_requires{scCs |jdS(Nu meta_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt meta_requiresscCs |jdS(Nubuild_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytbuild_requiresscCs |jdS(Nu test_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt test_requiresscCs |jdS(Nu dev_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt dev_requiressc Cst|}t|jj}y|j|j}Wn@tk rvtjd||j d}|j|}nX|j }t }x]|j D]R}t |\}} ||krqny|j| }PWqtk rqXqW|S(u Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. u+could not read version %r - using name onlyi(R RR1R0R\t requirementRR?twarningtsplitRRR^R R_( RtreqRER0R\RRZRaRbRc((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytmatches_requirements*      cCs6|jrd|j}nd}d|j|j|fS(uC Return a textual representation of this instance, u [%s]uu(RxRRU(Rtsuffix((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__repr__s cCs[t|t|k r!t}n6|j|jkoT|j|jkoT|j|jk}|S(u< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. (ttypeRRRURx(RtotherRZ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__eq__s  cCs't|jt|jt|jS(uH Compute hash in a way which matches the equality test. (thashRRURx(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__hash__s(RRRRtbuild_time_dependencyt requestedRRnRxt download_urlRyR^RRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRq5s$   " tBaseInstalledDistributioncBs,eZdZdZddZddZRS(u] This is the base class for installed distributions (whether PEP 376 or legacy). cCs,tt|j|||_||_dS(u Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N(tsuperRRRt dist_path(RR1RR2((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs  cCs|dkr|j}n|dkr6tj}d}ntt|}d|j}||j}tj|jdj d}d||fS(u Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str uu%s=t=uasciiu%s%sN( R!thasherthashlibtmd5R}Rstbase64turlsafe_b64encodetrstriptdecode(RtdataRtprefixRs((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytget_hashs      !N(RRRR!RRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs ROcBseZdZdZdddZdZdZdZe dZ dZ dZ d Z d Zed Zd Ze d ZedZdZdZdZdZejZRS(u  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). usha256c Cstj||_}|dkr;ddl}|jn|rr|jrr||jjkrr|jj|j }n|dkr$|j t }|dkr|j t }n|dkr|j d}n|dkrt dt |fntj|j}td|dd}WdQXntt|j||||rb|jrb|jj|ny|j d}Wn'tk rddl}|jnX|dk |_dS(NiuMETADATAuno %s found in %sR/R0ulegacyu REQUESTED(RR4RDR!tpdbt set_traceR(R&RR1R5RRR]R<R=R>RRRORRtAttributeErrorR(RRR1R2RDRRERL((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs4  !       cCsd|j|j|jfS(Nu#(RRUR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR2scCsd|j|jfS(Nu%s %s(RRU(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__str__6sc Csg}|jd}tj|j}td|i}x_|D]W}gtt|dD] }d^qb}||\}} } |j|| | fqFWWdQXWdQX|S(u" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). uRECORDRLiN( tget_distinfo_resourceR<R=R>RtrangetlenR!R( RtresultsRERLt record_readertrowtitmissingRtchecksumtsize((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt _get_records9s (&cCs.i}|jt}|r*|j}n|S(u Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. (RtEXPORTS_FILENAMER (RRZRE((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRiPs cCsLi}|jt}|rHtj|j}t|}WdQXn|S(u Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. N(RRR<R=R>R (RRZRERL((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR ^s cCs8|jt}t|d}t||WdQXdS(u Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. uwN(tget_distinfo_fileRtopenR (RRitrftf((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR msc Cs|jd}tj|jF}td|.}x$|D]\}}||kr@|Sq@WWdQXWdQXtd|dS(uW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. u RESOURCESRLNu3no resource file with relative path %r is installed(RR<R=R>RtKeyError(RRgRERLtresources_readertrelativet destination((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRfxs  ccs x|jD] }|Vq WdS(u Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N(R(RRZ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytlist_installed_filessc Cstjj|d}tjj|j}|j|}tjj|d}|jd}tjd||rwdSt |}x|D]}tjj |s|j d rd} } nCdtjj |} t |d} |j| j} WdQX|j|s(|r@|j|r@tjj||}n|j|| | fqW|j|rtjj||}n|j|ddfWdQX|S( u Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. uuRECORDu creating %su.pycu.pyou%durbN(u.pycu.pyo(tosRR;tdirnamet startswithRR?tinfoR!RtisdirR8tgetsizeRRtreadtrelpathtwriterow( RtpathsRtdry_runtbasetbase_under_prefixt record_pathtwriterRt hash_valueRtfp((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytwrite_installed_filess. ! c Csg}tjj|j}|jd}xn|jD]`\}}}tjj|sptjj||}n||krq7ntjj|s|j|dt t fq7tjj |r7t tjj |}|r||kr|j|d||fq|rd|kr3|jddd}nd }t|dG} |j| j|} | |kr|j|d|| fnWd QXqq7q7W|S( u Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. uRECORDuexistsusizeu=iiurbuhashN(RRRRRtisabsR;texistsRR#RtisfiletstrRRR!RRR( Rt mismatchesRRRRRt actual_sizeRRt actual_hash((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytcheck_installed_filess.    ,cCsi}tjj|jd}tjj|rtj|ddd}|jj}WdQXx[|D]P}|jdd\}}|dkr|j |gj |qj|||su%s (%s)( RtstripRR?RR Rtt constraintsRRR;(RtreqsRRREtcons((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytparse_requires_dataos&       csRg}y4tj|dd}|j}WdQXWntk rMnX|S(uCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. uruutf-8N(RRRtIOError(treq_pathRR(R(s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytparse_requires_paths u.egguEGG-INFOuPKG-INFORR0ulegacyu requires.txtuEGG-INFO/PKG-INFOuutf8R/uEGG-INFO/requires.txtuutf-8u .egg-infou,path must end with .egg-info or .egg, got %r(R!R8RRRR;Rt zipimportt zipimporterRtget_dataRRRtadd_requirements( RRtrequiresRt meta_pathR1RtzipfR/R((Rs@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRls:     cCsd|j|j|jfS(Nu!(RRUR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRscCsd|j|jfS(Nu%s %s(RRU(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRscCsg}tjj|jd}tjj|rx`|jD]O\}}}||kr^q=ntjj|s=|j|dttfq=q=Wn|S(u Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. uinstalled-files.txtuexists(RRR;RRRR#R(RRRRt_((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs  #c Cs2d}d}tjj|jd}g}tjj|r.tj|ddd}x|D]}|j}tjjtjj|j|}tjj|stj d||j d rqdqntjj |sd|j |||||fqdqdWWd QX|j |d d fn|S( u Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) cSs@t|d}z|j}Wd|jXtj|jS(Nurb(RRtcloseRRt hexdigest(RRtcontent((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_md5s  cSstj|jS(N(Rtstattst_size(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_sizesuinstalled-files.txturRuutf-8uNon-existent file: %su.pycu.pyoN(u.pycu.pyo(RRR;RRRRtnormpathR?RR8RRR!(RRRRRZRRRa((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs"    $ /c cstjj|jd}t}tj|ddd}x|D]}|j}|dkrjt}q@n|s@tjjtjj|j|}|j |jr|r|Vq|Vqq@q@WWdQXdS(u  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths uinstalled-files.txturRuutf-8u./N( RRR;R#RRRRRR(RtabsoluteRtskipRRRa((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs    $cCst|to|j|jkS(N(RNRR(RR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRsN(RRRR#RRR!RRRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRNs  K    &  tDependencyGraphcBsheZdZdZdZd dZdZdZddZ e dZ d Z d Z RS( u Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dS(N(tadjacency_listt reverse_listR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR.s  cCsg|j| "%s" [label="%s"] u "%s" -> "%s" usubgraph disconnected { ulabel = "Disconnected" ubgcolor = red u"%s"u u} N(RRtitemsRRR!R(RRtskip_disconnectedt disconnectedRtadjsRR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytto_dotgs&    %    cCs=g}i}x(|jjD]\}}|||t|jD])\}}|sZ|j|||=qZqZW|sPnxO|jD]A\}}g|D]$\}}||kr||f^q||sL         4  7F 6  PK!zoo markers.pyonu[ abc@sdZddlZddlZddlZddlZddlmZmZddlm Z dgZ de fdYZ dd ZdS( sEParser for the environment markers micro-language defined in PEP 345.iNi(tpython_implementationt string_types(tin_venvt interprett EvaluatorcBs^eZdZi dd6dd6dd6dd6d d 6d d 6d d6dd6dd6Zi ejd6dejd d6ejjdddd6e j d6e e d6ej d6ejd6ejd6ed 6Zd,d!Zd"Zd#Zd,d$Zd%Zd&Zd'Zd(Zd)Zd*Zd+ZRS(-s5 A limited evaluator for Python expressions. cCs ||kS(N((txty((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyttteqcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtgtcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtgtecCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtincCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtltcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRRtltecCs| S(N((R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyR RtnotcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyR!RtnoteqcCs ||kS(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyR"Rtnotint sys_platforms%s.%sitpython_versiont iitpython_full_versiontos_nametplatform_in_venvtplatform_releasetplatform_versiontplatform_machinetplatform_python_implementationcCs|p i|_d|_dS(su Initialise an instance. :param context: If specified, names are looked up in this mapping. N(tcontexttNonetsource(tselfR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt__init__3scCsHd}d|j|||!}||t|jkrD|d7}n|S(sH Get the part of the source which is causing a problem. i s%rs...(Rtlen(Rtoffsett fragment_lents((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt get_fragment<s  cCst|d|dS(s@ Get a handler for the specified AST node type. sdo_%sN(tgetattrR(Rt node_type((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt get_handlerFscCst|tr||_idd6}|r8||dR%R3R/(tlhsnodetrhsnodeR@R$(R4R(s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt sanity_checks $ sunsupported operation: %r( tleftR8RLtziptopst comparatorsR0R1R2t operatorsR/( RR4RPRNtlhsRBREROtrhs((R4Rs?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt do_compares  "  cCs|j|jS(N(R8tbody(RR4((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyt do_expressionscCs|t}|j|jkr1t}|j|j}n+|j|jkr\t}|j|j}n|sxtd|jn|S(Nsinvalid expression: %s(R>R:RRLR?R/(RR4R@RB((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pytdo_namescCs|jS(N(R$(RR4((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pytdo_strsN(R1t __module__t__doc__RUtsystplatformt version_infotversiontsplittostnametstrRtreleasetmachineRR?RR R%R(R8R<RCRKRXRZR[R\(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRs@                      cCst|j|jS(s Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping (RR8tstrip(tmarkertexecution_context((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyRs (R^R-RdR_R`tcompatRRtutilRt__all__tobjectRRR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/markers.pyts     PK!bޑ66 resources.pyonu[ abc@s ddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZejeZdadefdYZdefd YZd efd YZd efd YZdefdYZdefdYZieed6ee j6Z yQyddl!Z"Wne#k rddl$Z"nXee e"j%R R((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytfinds  cCst|jdS(Nurb(RR (RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR'scCs)t|jd}|jSWdQXdS(Nurb(RR tread(RRR ((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR+scCstjj|jS(N(RR tgetsize(RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR,scsDfd}tgtj|jD]}||r%|^q%S(Ncs|dko|jj S(Nu __pycache__(tendswithtskipped_extensions(R (R(sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytalloweds (tsetRtlistdirR (RRRIR ((RsA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR2scCs|j|jS(N(RCR (RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR0sccs|j|}|dk r|g}x|r|jd}|V|jr'|j}xe|jD]W}|sr|}ndj||g}|j|}|jr|j|q]|Vq]Wq'q'WndS(Niu/(RDRtpopR0R%R3R tappend(RR>RttodotrnameR%tnew_nametchild((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pytiterators        (u.pycu.pyou.class(u.pycu.pyo(R"R#R.tsystplatformt startswithRHR R9RARBRRDR'R+R,R2R0t staticmethodRR RRCRR(((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR4ws"          tZipResourceFindercBs_eZdZdZdZdZdZdZdZdZ dZ d Z RS( u6 Resource finder for resources in .zip files. cCstt|j||jj}dt||_t|jdrY|jj|_nt j ||_t |j|_ dS(Niu_files( R RWR R7tarchivetlent prefix_lenthasattrt_filest zipimportt_zip_directory_cachetsortedtindex(RR5RX((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR s cCs|S(N((RR ((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR9scCs||j}||jkr%t}nr|rN|dtjkrN|tj}ntj|j|}y|j|j|}Wntk rt }nX|st j d||j j nt j d||j j |S(Niu_find failed: %r %ru_find worked: %r %r(RZR\RRR?tbisectR`RUt IndexErrorR/tloggertdebugR7R(RR Rti((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRBs    cCs-|jj}|jdt|}||fS(Ni(R7RXR RY(RRRR ((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRs cCs|jj|jS(N(R7tget_dataR (RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR+scCstj|j|S(N(tiotBytesIOR+(RR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR'scCs|j|j}|j|dS(Ni(R RZR\(RRR ((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR,scCs|j|j}|r9|dtjkr9|tj7}nt|}t}tj|j|}xn|t|jkr|j|j|sPn|j||}|j |j tjdd|d7}qfW|S(Niii( R RZRR?RYRJRaR`RUtaddR<(RRR tplenRRets((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyR2s   cCs||j}|r6|dtjkr6|tj7}ntj|j|}y|j|j|}Wntk r~t}nX|S(Ni(RZRR?RaR`RURbR/(RR ReR((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRCs   ( R"R#R.R R9RBRR+R'R,R2RC(((sA/usr/lib/python2.7/site-packages/pip/_vendor/distlib/resources.pyRWs       cCs|tt|sJ         ",!ZM       PK!t(_backport/__init__.pyonu[ abc@s dZdS(s Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N(t__doc__(((sJ/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/__init__.pyttPK!l>_backport/misc.pyonu[ abc@sdZddlZddlZdddgZyddlmZWnek r`edZnXy eZWn*e k rddl m Z d ZnXy ej Z Wne k rd Z nXdS( s/Backports for individual classes and functions.iNtcache_from_sourcetcallabletfsencode(RcCs|r dpd}||S(Ntcto((tpy_filetdebugtext((sF/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyRs(tCallablecCs t|tS(N(t isinstanceR(tobj((sF/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyRscCsRt|tr|St|tr5|jtjStdt|jdS(Nsexpect bytes or str, not %s( R tbyteststrtencodetsystgetfilesystemencodingt TypeErrorttypet__name__(tfilename((sF/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyR"s (t__doc__tosRt__all__timpRt ImportErrort __debug__Rt NameErrort collectionsRRtAttributeError(((sF/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyts         PK!"ND7D7_backport/tarfile.pycnu[ abc @s>ddlmZdZdZdZdZdZdZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZyddlZddlZWnek reZZnXeefZyeef7ZWnek rnXd d d d gZejd dkr3ddlZn ddlZejZdZdZ e dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1d Z2d!Z3d"Z4d#Z5d Z6d$Z7d%Z8e7Z9e'e(e)e*e-e.e/e+e,e0e1e2f Z:e'e(e/e2fZ;e0e1e2fZ<d&d'd(d)d*d+d,d-fZ=e>d&d'd,d-fZ?ie@d.6e@d/6e@d)6eAd*6eAd+6eAd(6ZBd0ZCd1ZDd2ZEd3ZFd4ZGd5ZHd6ZId7ZJdZKd8ZLd9ZMd:ZNd;ZOd<ZPd=ZQd>ZRd%ZSd$ZTe jUd?d@fkr)dAZVn ejWZVdBZXdCZYdDZZd=e9dEZ[dFZ\edGZ]eCdHfeDdIfeEdJfeFdKfeGdLfeHdMffeLdNffeMdOffeNeIBdPfeId feNd!ffeOdNffePdOffeQeJBdPfeJd feQd!ffeRdNffeSdOffeTeKBdQfeKdRfeTd!fff Z^dSZ_d e`fdTYZadUeafdVYZbdWeafdXYZcdYeafdZYZdd[eafd\YZed]eafd^YZfd_effd`YZgdaeffdbYZhdceffddYZideeffdfYZjdgeffdhYZkdielfdjYZmdkelfdlYZndmelfdnYZodoelfdpYZpdqelfdrYZqdselfdtYZrd elfduYZsd elfdvYZtdwelfdxYZudyZveZwetjZdS(zi(tprint_functions $Revision$s0.9.0s&Lars Gust\u00e4bel (lars@gustaebel.de)s5$Date: 2011-02-25 17:42:01 +0200 (Fri, 25 Feb 2011) $s?$Id: tarfile.py 88586 2011-02-25 15:42:01Z marc-andre.lemburg $s8Gustavo Niemeyer, Niels Gust\u00e4bel, Richard Townsend.NtTarFiletTarInfot is_tarfiletTarErroriisiisustar sustar00idit0t1t2t3t4t5t6t7tLtKtStxtgtXiitpathtlinkpathtsizetmtimetuidtgidtunametgnametatimetctimeiii`i@i iiiiii@i iiitnttcesutf-8cCs,|j||}|| |t|tS(s8Convert a string to a null-terminated bytes object. (tencodetlentNUL(tstlengthtencodingterrors((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytstnscCs8|jd}|dkr(|| }n|j||S(s8Convert a null-terminated bytes object to a string. si(tfindtdecode(R"R$R%tp((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytntss  cCs|dtdkr^y%tt|ddp1dd}Wqtk rZtdqXnId}x@tt|dD](}|dK}|t||d7}q{W|S( s/Convert a number field to a python number. iitasciitstrictRisinvalid headeri(tchrtintR*t ValueErrortInvalidHeaderErrortrangeR tord(R"tnti((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytntis%  cCsd|kod|dknrHd|d|fjdt}n|tksh|d|dkrwtdn|dkrtjdtjd |d}nt}x6t|dD]$}|j d|d @|dL}qW|j dd |S( s/Convert a python number to a number field. iiis%0*oR+isoverflow in number fieldR tlii( RR!t GNU_FORMATR/tstructtunpacktpackt bytearrayR1tinsert(R3tdigitstformatR"R4((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytitns $$  % cCsxdttjd|d tjd|dd!}dttjd|d tjd|dd!}||fS( sCalculate the checksum for a member's header by summing up all characters except for the chksum field which is treated as if it was filled with spaces. According to the GNU tar sources, some tars (Sun and NeXT) calculate chksum with signed char, which will be different if there are chars in the buffer with the high bit set. So we calculate two checksums, unsigned and signed. it148Bit356Biit148bt356b(tsumR8R9(tbuftunsigned_chksumt signed_chksum((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt calc_chksumss 77cCs|dkrdS|dkrSx0trN|jd}|s>Pn|j|qWdSd}t||\}}xQt|D]C}|j|}t||krtdn|j|q{W|dkr|j|}t||krtdn|j|ndS(sjCopy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. iNiisend of file reachedi@i@(tNonetTruetreadtwritetdivmodR1R tIOError(tsrctdstR#REtBUFSIZEtblockst remaindertb((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt copyfileobjs,    R6t-RTtdtcR)trtwR"tttTcCsig}xStD]K}xB|D]-\}}||@|kr|j|PqqW|jdq Wdj|S(scConvert a file's mode to a string of the form -rwxrwxrwx. Used by TarFile.list() RVt(tfilemode_tabletappendtjoin(tmodetpermttabletbittchar((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytfilemode8s  cBseZdZRS(sBase exception.(t__name__t __module__t__doc__(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRGst ExtractErrorcBseZdZRS(s%General exception for extract errors.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRjJst ReadErrorcBseZdZRS(s&Exception for unreadable tar archives.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRkMstCompressionErrorcBseZdZRS(s.Exception for unavailable compression methods.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRlPst StreamErrorcBseZdZRS(s=Exception for unsupported operations on stream-like TarFiles.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRmSst HeaderErrorcBseZdZRS(s!Base exception for header errors.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRnVstEmptyHeaderErrorcBseZdZRS(sException for empty headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRoYstTruncatedHeaderErrorcBseZdZRS(s Exception for truncated headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRp\stEOFHeaderErrorcBseZdZRS(s"Exception for end of file headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRq_sR0cBseZdZRS(sException for invalid headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR0bstSubsequentHeaderErrorcBseZdZRS(s3Exception for missing and invalid extended headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRrest _LowLevelFilecBs2eZdZdZdZdZdZRS(sLow-level file object. Supports reading and writing. It is used instead of a regular file object for streaming access. cCsgitjd6tjtjBtjBd6|}ttdrK|tjO}ntj||d|_dS(NRYRZtO_BINARYi( tostO_RDONLYtO_WRONLYtO_CREATtO_TRUNCthasattrRttopentfd(tselftnameRa((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__init__rs cCstj|jdS(N(RutcloseR|(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR{scCstj|j|S(N(RuRKR|(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRK~scCstj|j|dS(N(RuRLR|(R}R"((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRLs(RgRhRiRRRKRL(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRsls   t_StreamcBseZdZdZdZdZdZdZdZdZ dZ d d Z dd Z d Zd ZRS(sClass that serves as an adapter between TarFile and a stream-like object. The stream-like object only needs to have a read() or write() method and is accessed blockwise. Use of gzip or bzip2 compression is possible. A stream-like object could be for example: sys.stdin, sys.stdout, a socket, a tape device etc. _Stream is intended to be used only internally. cCst|_|dkr0t||}t|_n|dkrWt|}|j}n|p`d|_||_||_ ||_ ||_ d|_ d|_ t|_y|dkr%yddl}Wntk rtdnX||_|jd|_|dkr|jq%|jn|d kryddl}Wntk r`td nX|dkrd|_|j|_q|j|_nWn,|js|j jnt|_nXdS( s$Construct a _Stream object. t*R]itgziNszlib module is not availableRYtbz2sbz2 module is not available(RJt _extfileobjRIRstFalset _StreamProxyt getcomptypeR~RatcomptypetfileobjtbufsizeREtpostclosedtzlibt ImportErrorRltcrc32tcrct _init_read_gzt_init_write_gzRtdbuftBZ2Decompressortcmpt BZ2CompressorR(R}R~RaRRRRR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRsP                        cCs*t|dr&|j r&|jndS(NR(RzRR(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__del__scCs|jjd|jj|jj |jjd|_tjdtt j }|j d|d|j j dr|j d |_ n|j |j j dd td S( s6Initialize for writing with gzip compression. i isZ2RS(@sInformational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally. R~RaRRRRtchksumttypetlinknameRRtdevmajortdevminorRRt pax_headersRRt_sparse_structst _link_targetR]cCs||_d|_d|_d|_d|_d|_d|_t|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_i|_dS(sXConstruct a TarInfo object. name is the optional name of the member. iiR]N(R~RaRRRRRtREGTYPERRRRRRRRRIRR(R}R~((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs"                cCs|jS(N(R~(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt_getpathscCs ||_dS(N(R~(R}R~((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt_setpathscCs|jS(N(R(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt _getlinkpathscCs ||_dS(N(R(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt _setlinkpathscCs d|jj|jt|fS(Ns<%s %r at %#x>(t __class__RgR~tid(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__repr__scCsi |jd6|jd@d6|jd6|jd6|jd6|jd6|jd6|jd 6|jd 6|j d 6|j d 6|j d 6|j d6}|d t kr|djd r|dcd7R$R%R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyttobufs    cCst|dny||jd d Wn"tk r||||nXt|||kr>||||q>WxddddfD]\}}||krd||R$R%tpartsRER((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRYs&$#cCs@tt|t\}}|dkr<|t|t7}n|S(sdReturn the string payload filled with zero bytes up to the next 512 byte border. i(RMR RR!(tpayloadRRRS((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt_create_payloadus cCsm|j||t}i}d|d<||d|j|S|jtttfkrc|j |S|j |SdS(sYChoose the right processing method depending on the type and call it. N( RRRt _proc_gnulongRt _proc_sparseRRtSOLARIS_XHDTYPEt _proc_paxt _proc_builtin(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR%s   cCsx|jj|_|j}|js6|jtkrO||j|j7}n||_|j |j |j |j |S(sfProcess a builtin type or an unknown type which will be treated as a regular file. ( RRRtisregRtSUPPORTED_TYPESt_blockRRt_apply_pax_infoRR$R%(R}RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR+$s  cCs|jj|j|j}y|j|}Wntk rPtdnX|j|_|jt krt ||j |j |_ n-|jtkrt ||j |j |_n|S(sSProcess the blocks that hold a GNU longname or longlink member. s missing or bad subsequent header(RRKR.RR&RnRrRRRR*R$R%R~RR(R}RREtnext((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR'5s  c Cs|j\}}}|`x|r|jjt}d}xtdD]}}y6t|||d!}t||d|d!} Wntk rPnX|r| r|j|| fn|d7}qFWt|d}qW||_ |jj |_ |j |j |j |_||_ |S(s8Process a GNU sparse header plus extra headers. iii ii(RRRKRR1R5R/R_RRRRR.RR( R}RR R"R#RERR4RR!((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR(Ks(     cCs|jj|j|j}|jtkr9|j}n|jj}tj d|}|dk r|j dj d|ds  cCsx|jD]\}}|dkr8t|d|q |dkr]t|dt|q |dkrt|dt|q |tkr |tkryt||}Wqtk rd}qXn|dkr|jd}nt|||q q W|j|_dS( soReplace fields with supplemental information from a previous pax extended or global header. sGNU.sparse.nameRsGNU.sparse.sizeRsGNU.sparse.realsizeiRN( RtsetattrR.t PAX_FIELDStPAX_NUMBER_FIELDSR/RRR(R}RR$R%RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR/s"        cCs9y|j|dSWntk r4|j||SXdS(s1Decode a single field from a pax record. R,N(R(tUnicodeDecodeError(R}RR$tfallback_encodingtfallback_errors((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR:s cCs0t|t\}}|r(|d7}n|tS(s_Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024. i(RMR(R}RRRRS((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR. s cCs |jtkS(N(Rt REGULAR_TYPES(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR,scCs |jS(N(R,(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytisfilescCs |jtkS(N(RR(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRscCs |jtkS(N(RtSYMTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytissymscCs |jtkS(N(RtLNKTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytislnkscCs |jtkS(N(RtCHRTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytischr scCs |jtkS(N(RtBLKTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytisblk"scCs |jtkS(N(RtFIFOTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytisfifo$scCs |jdk S(N(RRI(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytissparse&scCs|jtttfkS(N(RRTRVRX(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytisdev(s(R~RaRRRRRRRRRRRRRRRRRR(3RgRhRit __slots__RRRtpropertyRRRRRRtDEFAULT_FORMATtENCODINGRRRRt classmethodR Rt staticmethodRRRRR$R&R%R+R'R(R*R=R<R>R/R:R.R,RORRQRSRURWRYRZR[(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs`         1  3?    f             c Bs-eZdZdZeZeZdZeZ e Z d1Z eZeZd1dd1d1d1d1d1d1dd1d1d1d Zed1dd1edZedd1dZedd1dd Zedd1dd Zid d 6d d6dd6ZdZdZdZdZd1d1d1dZedZ d1ed1d1dZ!d1dZ"dd1dZ#dedZ$dZ%edZ&dZ'd Z(d!Z)d"Z*d#Z+d$Z,d%Z-d&Z.d'Z/d(Z0d1ed)Z1d*Z2d1d+Z3d,Z4d-Z5d.Z6d/Z7d0Z8RS(2s=The TarFile Class provides an interface to tar archives. iiRYRc Cst|dks|dkr-tdn||_idd6dd6dd 6||_|s|jdkrtjj| rd |_d|_nt||j}t|_ nN|d krt |d r|j }nt |d r|j|_nt |_ |rtjj|nd |_ ||_|d k rC||_n|d k r[||_n|d k rs||_n|d k r||_n|d k r||_n| |_| d k r|jtkr| |_n i|_| d k r| |_n| d k r | |_nt|_g|_t|_|jj|_i|_y9|jdkrod |_ |j!|_ n|jdkrxt r|jj"|jy&|jj#|}|jj$|Wqt%k r|jj"|jPqt&k r } t't(| qXqWn|jd krzt |_|jrz|jj)|jj*}|jj+||jt|7_qznWn,|j s|jj,nt |_nXd S(sOpen an (uncompressed) tar archive `name'. `mode' is either 'r' to read from an existing archive, 'a' to append data to an existing file or 'w' to create a new file overwriting an existing one. `mode' defaults to 'r'. If `fileobj' is given, it is used for reading or writing data. If it can be determined, `mode' is overridden by `fileobj's mode. `fileobj' is not closed, when TarFile is closed. iRsmode must be 'r', 'a' or 'w'trbRYsr+btatwbRZR~RatawN(-R R/Rat_modeRuRtexistst bltn_openRRRIRzR~RJtabspathRR>Rt dereferencet ignore_zerosR$R%RRtdebugt errorlevelRtmemberst_loadedRRtinodest firstmemberR0RR&R_RqRnRkRR RRLR(R}R~RaRR>RRjRkR$R%RRlRmteRE((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRFs  ""     !                             c Ks4| r| rtdn|dkrx|jD]}t||j|}|dk rj|j}ny||d||SWq3ttfk r} |dk r3|j|q3q3q3Xq3WtdnUd|krV|jdd\} }| pd} |pd}||jkr3t||j|}ntd|||| ||Sd |kr|jd d\} }| pd} |pd}| d krtd nt || |||} y||| | |} Wn| j nXt | _ | S|d kr$|j ||||Std dS(s|Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for reading exclusively uncompressed 'r:gz' open for reading with gzip compression 'r:bz2' open for reading with bzip2 compression 'a' or 'a:' open for appending, creating the file if necessary 'w' or 'w:' open for writing without compression 'w:gz' open for writing with gzip compression 'w:bz2' open for writing with bzip2 compression 'r|*' open a stream of tar blocks with transparent compression 'r|' open an uncompressed stream of tar blocks for reading 'r|gz' open a gzip compressed stream of tar blocks 'r|bz2' open a bzip2 compressed stream of tar blocks 'w|' open an uncompressed stream for writing 'w|gz' open a gzip compressed stream for writing 'w|bz2' open a bzip2 compressed stream for writing snothing to openRYsr:*s%file could not be opened successfullyt:iRsunknown compression type %rt|trwsmode must be 'r' or 'w'Resundiscernible modeN(RYsr:*(R/t OPEN_METHRRIRRkRlRRERRRRttaropen( R R~RaRRtkwargsRtfunct saved_posRrRftstreamR[((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR{sN              cKs@t|dks|dkr-tdn|||||S(sCOpen uncompressed tar archive name for reading or writing. iRsmode must be 'r', 'a' or 'w'(R R/(R R~RaRRx((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRwsi c Ks6t|dks|dkr-tdnyddl}|jWn#ttfk ritdnX|dk }y8|j||d||}|j||||}Wnxt k r| r|dk r|j n|dkrnt dn*| r"|dk r"|j nnX||_ |S( skOpen gzip compressed tar archive name for reading or writing. Appending is not allowed. iRusmode must be 'r' or 'w'iNsgzip module is not availableRTsnot a gzip file( R R/tgziptGzipFileRtAttributeErrorRlRIRwRNRRkR( R R~RaRt compresslevelRxR|t extfileobjR[((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytgzopens.        cKst|dks|dkr-tdnyddl}Wntk r\tdnX|dk r{t||}n|j||d|}y|j||||}Wn-t t fk r|j t dnXt |_|S( slOpen bzip2 compressed tar archive name for reading or writing. Appending is not allowed. iRusmode must be 'r' or 'w'.iNsbz2 module is not availableRsnot a bzip2 file(R R/RRRlRIRtBZ2FileRwRNtEOFErrorRRkRR(R R~RaRRRxRR[((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytbz2open$s     RwRRRRRcCs|jr dS|jdkr|jjttd|jtd7_t|jt\}}|dkr|jjtt|qn|j s|jj nt |_dS(slClose the TarFile. In write-mode, two finishing zero blocks are appended to the archive. NReii( RRaRRLR!RRRMt RECORDSIZERRRJ(R}RRRS((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRHs   cCs2|j|}|dkr.td|n|S(sReturn a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version. sfilename %r not foundN(t _getmemberRItKeyError(R}R~R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt getmember\s cCs'|j|js |jn|jS(sReturn the members of the archive as a list of TarInfo objects. The list has the same order as the members in the archive. (t_checkRot_loadRn(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt getmembersgs   cCs g|jD]}|j^q S(sReturn the members of the archive as a list of their names. It has the same order as the list returned by getmembers(). (RR~(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytgetnamesqsc Cs\|jd|d k r%|j}n|d kr:|}ntjj|\}}|jtjd}|jd}|j }||_ |d krt tdr|j rtj |}qtj|}ntj|j}d}|j}tj|r|j|jf} |j rj|jdkrj| |jkrj||j| krjt} |j| }qt} | dr||j| slink toN(RtprintRfRaRRRRRURWRRRRt localtimeRR~RRQRRS(R}tverboseR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRAs&   !)  c Cs|jd|dkr"|}n|dk rtddl}|jdtd||rt|jdd|dSn|jdk rtjj ||jkr|jdd|dS|jd||j ||}|dkr|jdd |dS|dk r;||}|dkr;|jdd|dSn|j rst |d }|j |||jn|jr|j ||rxTtj|D]@}|jtjj||tjj||||d |qWqn |j |dS( s~Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `recursive' to False. `exclude' is a function that should return True for each filename to be excluded. `filter' is a function that expects a TarInfo object argument and returns the changed TarInfo object, if it returns None the TarInfo object will be excluded from the archive. ReiNsuse the filter argument insteadistarfile: Excluded %rstarfile: Skipped %ristarfile: Unsupported type %rRbtfilter(RRItwarningstwarntDeprecationWarningt_dbgR~RuRRiRR,RhtaddfileRRtlistdirtaddR`( R}R~Rt recursivetexcludeRRRtf((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRsD        *        *cCs|jdtj|}|j|j|j|j}|jj||jt |7_|dk rt ||j|j t |j t\}}|dkr|jjtt||d7}n|j|t7_n|jj|dS(s]Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. ReiiN(RRRR>R$R%RRLRR RIRURRMRR!RnR_(R}RRRERRRS((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR4s    t.cCs:g}|dkr|}nx_|D]W}|jr\|j|tj|}d|_n|j||d|j q"W|jdd|jx|D]}tj j ||j }y4|j |||j |||j||Wqtk r1}|jdkrq2|jdd|qXqWdS(sMExtract all members from the archive to the current working directory and set owner, modification time and permissions on directories afterwards. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by getmembers(). it set_attrstkeycSs|jS(N(R~(Rc((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytdR]is tarfile: %sN(RIRR_RRatextracttsorttreverseRuRR`R~tchowntutimetchmodRjRmR(R}RRnt directoriesRtdirpathRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt extractallNs*      !  R]cCs=|jdt|tr.|j|}n|}|jr^tjj||j|_ ny,|j |tjj||j d|Wnt k r}|j dkrq9|jdkr|jdd|jq9|jdd|j|jfn<tk r8}|j dkr!q9|jdd|nXdS(sxExtract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a TarInfo object. You can specify a different directory using `path'. File attributes (owner, mtime, mode) are set unless `set_attrs' is False. RYRiis tarfile: %sstarfile: %s %rN(RRRRRSRuRR`RRt_extract_memberR~tEnvironmentErrorRmtfilenameRIRtstrerrorRj(R}tmemberRRRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRts&  ! #cCs|jdt|tr.|j|}n|}|jrP|j||S|jtkro|j||S|js|j rt|j t rt dq|j |j|SndSdS(sExtract a member from the archive as a file object. `member' may be a filename or a TarInfo object. If `member' is a regular file, a file-like object is returned. If `member' is a link, a file-like object is constructed from the link's target. If `member' is none of the above, None is returned. The file-like object is read-only and provides the following methods: read(), readline(), readlines(), seek() and tell() RYs'cannot extract (sym)link as file objectN(RRRRR,t fileobjectRR-RSRQRRRmt extractfilet_find_link_targetRI(R}RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs  cCs|jd}|jdtj}tjj|}|r_tjj| r_tj|n|jsw|j r|j dd|j |j fn|j d|j |j r|j||n|jr|j||n|jr |j||n|js"|jr5|j||n]|jsM|j r`|j||n2|jtkr|j||n|j|||r|j|||j s|j|||j||qndS(s\Extract the TarInfo object tarinfo to a physical file called targetpath. Ris%s -> %sN(RRRuRRtdirnameRgtmakedirsRSRQRR~RR,tmakefileRtmakedirRYtmakefifoRURWtmakedevtmakelinkRR-t makeunknownRRR(R}Rt targetpathRt upperdirs((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs4#    cCsFytj|dWn+tk rA}|jtjkrBqBnXdS(s,Make a directory called targetpath. iN(RutmkdirRterrnotEEXIST(R}RRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs cCs|j}|j|jt|d}|jdk rqxJ|jD])\}}|j|t|||qAWnt|||j|j|j|j|j dS(s'Make a file called targetpath. RdN( RRRRhRRIRURttruncateR(R}RRtsourcettargetRR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs   cCs+|j|||jdd|jdS(sYMake a file from a TarInfo object with an unknown type at targetpath. is9tarfile: Unknown file type %r, extracted as regular file.N(RRR(R}RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s cCs/ttdrtj|n tddS(s'Make a fifo called targetpath. tmkfifosfifo not supported by systemN(RzRuRRj(R}RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR scCsttd s ttd r/tdn|j}|jrT|tjO}n |tjO}tj||tj |j |j dS(s<Make a character or block device called targetpath. tmknodRs'special devices not supported by systemN( RzRuRjRaRWRtS_IFBLKtS_IFCHRRRRR(R}RRRa((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s     cCsyj|jr%tj|j|nDtjj|jrPtj|j|n|j|j ||WnPt k r|jrtjj tjj |j |j}q|j}n>Xy|j|j ||Wntk rtdnXdS(sMake a (symbolic) link called targetpath. If it cannot be created (platform limitation), we try to make a copy of the referenced file instead of a link. s%unable to resolve link inside archiveN(RQRutsymlinkRRRgRtlinkRRtsymlink_exceptionR`RR~RRj(R}RRR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR' s"       cCstrttdrtjdkrytj|jd}Wntk r]|j}nXytj |j d}Wntk r|j }nXyZ|j rttdrtj |||n%tjdkrtj|||nWqtk r}tdqXndS(s6Set owner of targetpath according to tarinfo. tgeteuidiitlchowntos2emxscould not change ownerN(RRzRuRRtgetgrnamRRRtgetpwnamRRRQRtsystplatformRRRj(R}RRRtuRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRD s '    cCsOttdrKytj||jWqKtk rG}tdqKXndS(sASet file permissions of targetpath according to tarinfo. Rscould not change modeN(RzRuRRaRRj(R}RRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRZ s cCsYttdsdSy tj||j|jfWntk rT}tdnXdS(sBSet modification time of targetpath according to tarinfo. RNs"could not change modification time(RzRuRRRRj(R}RRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRc s  cCs|jd|jdk r2|j}d|_|S|jj|jd}xktry|jj|}WnGt k r}|j r|j dd|j|f|jt 7_qNqnt k r+}|j r|j dd|j|f|jt 7_qNq|jdkrtt|qntk rY|jdkrtdqn[tk r}|jdkrtt|qn%tk r}tt|nXPqNW|dk r|jj|n t|_|S(sReturn the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. trais0x%X: %sis empty fileN(RRqRIRRRRJRR&RqRkRRR0RkRRoRpRrRnR_Ro(R}tmRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR0n sF          cCs|j}|dk r.||j| }n|rItjj|}nxKt|D]=}|rztjj|j}n |j}||krV|SqVWdS(s}Find an archive member by name from bottom to top. If tarinfo is given, it is used as the starting point. N(RRItindexRuRtnormpathtreversedR~(R}R~Rt normalizeRnRt member_name((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s    cCs6x&tr(|j}|dkrPqqWt|_dS(sWRead through the entire archive file and look for readable members. N(RJR0RIRo(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s    cCsW|jr"td|jjn|dk rS|j|krStd|jndS(snCheck if TarFile is still open, and if the operation's mode corresponds to TarFile's mode. s %s is closedsbad operation for mode %rN(RRNRRgRIRa(R}Ra((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s cCs|jr5tjj|jd|j}d}n|j}|}|j|d|dt}|dkr~t d|n|S(sZFind the target member of a symlink or hardlink member in the archive. RRRslinkname %r not foundN( RQRuRRR~RRIRRJR(R}RRtlimitR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s     cCs$|jrt|jSt|SdS(s$Provide an iterator object. N(RotiterRntTarIter(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s  cCs)||jkr%t|dtjndS(s.Write debugging output to sys.stderr. tfileN(RlRRtstderr(R}tleveltmsg((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR scCs|j|S(N(R(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt __enter__ s cCs?|dkr|jn"|js2|jjnt|_dS(N(RIRRRRJR(R}RRt traceback((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__exit__ s    N(9RgRhRiRlRRjRkRmR^R>R_R$RIR%RRRRRR`RR{RwRRRvRRRRRRJRARRRRRRRRRRRRRRRR0RRRRRRRR(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR,sn  iK   b > &# & 0       1    RcBs/eZdZdZdZdZeZRS(sMIterator Class. for tarinfo in TarFile(...): suite... cCs||_d|_dS(s$Construct a TarIter object. iN(RR(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s cCs|S(s Return iterator object. ((R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR scCs}|jjs9|jj}|sjt|j_tqjn1y|jj|j}Wntk ritnX|jd7_|S(sReturn the next item using TarFile's next() method. When all members have been read, set TarFile as _loaded. i(RRoR0RJt StopIterationRnRt IndexError(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__next__ s     (RgRhRiRRRR0(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s    cCs7yt|}|jtSWntk r2tSXdS(sfReturn True if name points to a tar archive that we are able to handle, else return False. N(R{RRJRR(R~R[((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR# s    (xt __future__Rt __version__tversiont __author__t__date__t __cvsid__t __credits__RRuRRRR8RR3RRRRIR~tNotImplementedErrorRt WindowsErrort NameErrort__all__t version_infot __builtin__tbuiltinsR{t_openR!RRRRRRR RRRRRPRTRVRRXtCONTTYPERRRRRR)RR7RR^R-RNRRItsetR;RR.RJtS_IFLNKtS_IFREGRtS_IFDIRRtS_IFIFOtTSUIDtTSGIDtTSVTXtTUREADtTUWRITEtTUEXECtTGREADtTGWRITEtTGEXECtTOREADtTOWRITEtTOEXECR~R_tgetfilesystemencodingR&R*R5R?RHRUR^Rft ExceptionRRjRkRlRmRnRoRpRqR0RrtobjectRsRRRRRRRRRRh(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyts.                                                 ?K* PK!;VgVg_backport/shutil.pycnu[ abc@s"dZddlZddlZddlZddlmZddlZddlZddlZddl m Z yddl Z e Z Wnek reZ nXyddlmZWnek rdZnXyddlmZWnek rdZnXdd d d d d dddddddddddddddgZdefdYZdefdYZdefdYZd efd!YZd"efd#YZyeWnek rdZnXdWd&Zd'Z d(Z!d)Z"d*Z#d+Z$d,Z%d-Z&ede%ed.Z'edd/Z(d0Z)d1Z*d2Z+d3Z,d4Z-d5d6d6dddd7Z.eed8Z/d6d6dd9Z0ie.dXgd;fd<6e.dYgd>fd?6e.dZgd@fdA6e0gdBfdC6Z1e re.d[gd>fe1d?fe=d?dddVZ?dS(\sUtility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. iN(tabspathi(ttarfile(tgetpwnam(tgetgrnamt copyfileobjtcopyfiletcopymodetcopystattcopytcopy2tcopytreetmovetrmtreetErrortSpecialFileErrort ExecErrort make_archivetget_archive_formatstregister_archive_formattunregister_archive_formattget_unpack_formatstregister_unpack_formattunregister_unpack_formattunpack_archivetignore_patternscBseZRS((t__name__t __module__(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR ,scBseZdZRS(s|Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)(RRt__doc__(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR/scBseZdZRS(s+Raised when a command could not be executed(RRR(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR3st ReadErrorcBseZdZRS(s%Raised when an archive cannot be read(RRR(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR6st RegistryErrorcBseZdZRS(sVRaised when a registry operation with the archiving and unpacking registries fails(RRR(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR9siicCs1x*|j|}|sPn|j|qWdS(s=copy data from file-like object fsrc to file-like object fdstN(treadtwrite(tfsrctfdsttlengthtbuf((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRCs cCs{ttjdrAytjj||SWqAtk r=tSXntjjtjj|tjjtjj|kS(Ntsamefile(thasattrtostpathR$tOSErrortFalsetnormcaseR(tsrctdst((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt _samefileKs c Cst||r(td||fnx`||gD]R}ytj|}Wntk raq5Xtj|jr5td|q5q5Wt|d,}t|d}t ||WdQXWdQXdS(sCopy data from src to dsts`%s` and `%s` are the same files`%s` is a named pipetrbtwbN( R-R R&tstatR(tS_ISFIFOtst_modeRtopenR(R+R,tfntstR R!((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRWs cCsGttdrCtj|}tj|j}tj||ndS(sCopy mode bits from src to dsttchmodN(R%R&R0tS_IMODER2R6(R+R,R5tmode((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRkscCstj|}tj|j}ttdrOtj||j|jfnttdrqtj||nttdrt|drytj ||j Wqt k r}tt d s|j t j krqqXndS(sCCopy all stat info (mode bits, atime, mtime, flags) from src to dsttutimeR6tchflagstst_flagst EOPNOTSUPPN(R&R0R7R2R%R9tst_atimetst_mtimeR6R:R;R(terrnoR<(R+R,R5R8twhy((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRrscCsTtjj|r6tjj|tjj|}nt||t||dS(sVCopy data and mode bits ("cp src dst"). The destination may be a directory. N(R&R'tisdirtjointbasenameRR(R+R,((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRs$ cCsTtjj|r6tjj|tjj|}nt||t||dS(s]Copy data and all stat info ("cp -p src dst"). The destination may be a directory. N(R&R'RARBRCRR(R+R,((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR s$ csfd}|S(sFunction that can be used as copytree() ignore parameter. Patterns is a sequence of glob-style patterns that are used to exclude filescs:g}x'D]}|jtj||q Wt|S(N(textendtfnmatchtfiltertset(R'tnamest ignored_namestpattern(tpatterns(sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt_ignore_patternss ((RKRL((RKsH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRscCs tj|}|dk r-|||}n t}tj|g}xG|D]?} | |krhqPntjj|| } tjj|| } ytjj| rtj| } |rtj | | q6tjj |  r|rwPn|| | n8tjj | r)t | | |||n || | WqPt k r`} |j| jdqPtk r}|j| | t|fqPXqPWyt||WnMtk r}tdk rt|trq|j||t|fnX|r t |ndS(sRecursively copy a directory tree. The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. If the file pointed by the symlink doesn't exist, an exception will be added in the list of errors raised in an Error exception at the end of the copy process. You can set the optional ignore_dangling_symlinks flag to true if you want to silence this exception. Notice that this has no effect on platforms that don't support os.symlink. The optional ignore argument is a callable. If given, it is called with the `src` parameter, which is the directory being visited by copytree(), and `names` which is the list of `src` contents, as returned by os.listdir(): callable(src, names) -> ignored_names Since copytree() is called recursively, the callable will be called once for each directory that is copied. It returns a list of names relative to the `src` directory that should not be copied. The optional copy_function argument is a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. iN(R&tlistdirtNoneRGtmakedirsR'RBtislinktreadlinktsymlinktexistsRAR R RDtargstEnvironmentErrortappendtstrRR(t WindowsErrort isinstance(R+R,tsymlinkstignoret copy_functiontignore_dangling_symlinksRHRIterrorstnametsrcnametdstnametlinktoterrR@((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR sD$     $ cCs|rd}n|dkr*d}ny%tjj|rNtdnWn.tk r|tjj|tjdSXg}ytj|}Wn-tjk r|tj|tjnXx|D]}tjj ||}ytj |j }Wntjk rd}nXt j |r@t|||qytj|Wqtjk r|tj|tjqXqWytj|Wn-tjk r|tj|tjnXdS(sRecursively delete a directory tree. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, path, exc_info) where func is os.listdir, os.remove, or os.rmdir; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info(). If ignore_errors is false and onerror is None, an exception is raised. cWsdS(N((RT((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pytonerrorscWsdS(N((RT((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRdss%Cannot call rmtree on a symbolic linkNi(RNR&R'RPR(tsystexc_infoRMterrorRBtlstatR2R0tS_ISDIRR tremovetrmdir(R't ignore_errorsRdRHR_tfullnameR8((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR s>       !cCstjj|jtjjS(N(R&R'RCtrstriptsep(R'((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt _basename'scCs|}tjj|r~t||r;tj||dStjj|t|}tjj|r~td|q~nytj||Wnt k rtjj|rt ||rtd||fnt ||dt t |qt||tj|nXdS(sRecursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics. If the destination is on our current filesystem, then rename() is used. Otherwise, src is copied to the destination and then removed. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over. Ns$Destination path '%s' already existss.Cannot move a directory '%s' into itself '%s'.RZ(R&R'RAR-trenameRBRpRSR R(t _destinsrcR tTrueR R tunlink(R+R,treal_dst((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR ,s$   cCsut|}t|}|jtjjs@|tjj7}n|jtjjsh|tjj7}n|j|S(N(RtendswithR&R'Rot startswith(R+R,((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRrTs  cCs^tdks|dkrdSyt|}Wntk rEd}nX|dk rZ|dSdS(s"Returns a gid, given a group name.iN(RRNtKeyError(R_tresult((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt_get_gid]s   cCs^tdks|dkrdSyt|}Wntk rEd}nX|dk rZ|dSdS(s"Returns an uid, given a user name.iN(RRNRx(R_Ry((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt_get_uidis   tgzipics|idd6dd6}idd6} tr>d|d s                       Q1  ( =/    6     %   PK!"ND7D7_backport/tarfile.pyonu[ abc @s>ddlmZdZdZdZdZdZdZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZyddlZddlZWnek reZZnXeefZyeef7ZWnek rnXd d d d gZejd dkr3ddlZn ddlZejZdZdZ e dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1d Z2d!Z3d"Z4d#Z5d Z6d$Z7d%Z8e7Z9e'e(e)e*e-e.e/e+e,e0e1e2f Z:e'e(e/e2fZ;e0e1e2fZ<d&d'd(d)d*d+d,d-fZ=e>d&d'd,d-fZ?ie@d.6e@d/6e@d)6eAd*6eAd+6eAd(6ZBd0ZCd1ZDd2ZEd3ZFd4ZGd5ZHd6ZId7ZJdZKd8ZLd9ZMd:ZNd;ZOd<ZPd=ZQd>ZRd%ZSd$ZTe jUd?d@fkr)dAZVn ejWZVdBZXdCZYdDZZd=e9dEZ[dFZ\edGZ]eCdHfeDdIfeEdJfeFdKfeGdLfeHdMffeLdNffeMdOffeNeIBdPfeId feNd!ffeOdNffePdOffeQeJBdPfeJd feQd!ffeRdNffeSdOffeTeKBdQfeKdRfeTd!fff Z^dSZ_d e`fdTYZadUeafdVYZbdWeafdXYZcdYeafdZYZdd[eafd\YZed]eafd^YZfd_effd`YZgdaeffdbYZhdceffddYZideeffdfYZjdgeffdhYZkdielfdjYZmdkelfdlYZndmelfdnYZodoelfdpYZpdqelfdrYZqdselfdtYZrd elfduYZsd elfdvYZtdwelfdxYZudyZveZwetjZdS(zi(tprint_functions $Revision$s0.9.0s&Lars Gust\u00e4bel (lars@gustaebel.de)s5$Date: 2011-02-25 17:42:01 +0200 (Fri, 25 Feb 2011) $s?$Id: tarfile.py 88586 2011-02-25 15:42:01Z marc-andre.lemburg $s8Gustavo Niemeyer, Niels Gust\u00e4bel, Richard Townsend.NtTarFiletTarInfot is_tarfiletTarErroriisiisustar sustar00idit0t1t2t3t4t5t6t7tLtKtStxtgtXiitpathtlinkpathtsizetmtimetuidtgidtunametgnametatimetctimeiii`i@i iiiiii@i iiitnttcesutf-8cCs,|j||}|| |t|tS(s8Convert a string to a null-terminated bytes object. (tencodetlentNUL(tstlengthtencodingterrors((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytstnscCs8|jd}|dkr(|| }n|j||S(s8Convert a null-terminated bytes object to a string. si(tfindtdecode(R"R$R%tp((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytntss  cCs|dtdkr^y%tt|ddp1dd}Wqtk rZtdqXnId}x@tt|dD](}|dK}|t||d7}q{W|S( s/Convert a number field to a python number. iitasciitstrictRisinvalid headeri(tchrtintR*t ValueErrortInvalidHeaderErrortrangeR tord(R"tnti((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytntis%  cCsd|kod|dknrHd|d|fjdt}n|tksh|d|dkrwtdn|dkrtjdtjd |d}nt}x6t|dD]$}|j d|d @|dL}qW|j dd |S( s/Convert a python number to a number field. iiis%0*oR+isoverflow in number fieldR tlii( RR!t GNU_FORMATR/tstructtunpacktpackt bytearrayR1tinsert(R3tdigitstformatR"R4((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytitns $$  % cCsxdttjd|d tjd|dd!}dttjd|d tjd|dd!}||fS( sCalculate the checksum for a member's header by summing up all characters except for the chksum field which is treated as if it was filled with spaces. According to the GNU tar sources, some tars (Sun and NeXT) calculate chksum with signed char, which will be different if there are chars in the buffer with the high bit set. So we calculate two checksums, unsigned and signed. it148Bit356Biit148bt356b(tsumR8R9(tbuftunsigned_chksumt signed_chksum((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt calc_chksumss 77cCs|dkrdS|dkrSx0trN|jd}|s>Pn|j|qWdSd}t||\}}xQt|D]C}|j|}t||krtdn|j|q{W|dkr|j|}t||krtdn|j|ndS(sjCopy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. iNiisend of file reachedi@i@(tNonetTruetreadtwritetdivmodR1R tIOError(tsrctdstR#REtBUFSIZEtblockst remaindertb((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt copyfileobjs,    R6t-RTtdtcR)trtwR"tttTcCsig}xStD]K}xB|D]-\}}||@|kr|j|PqqW|jdq Wdj|S(scConvert a file's mode to a string of the form -rwxrwxrwx. Used by TarFile.list() RVt(tfilemode_tabletappendtjoin(tmodetpermttabletbittchar((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytfilemode8s  cBseZdZRS(sBase exception.(t__name__t __module__t__doc__(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRGst ExtractErrorcBseZdZRS(s%General exception for extract errors.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRjJst ReadErrorcBseZdZRS(s&Exception for unreadable tar archives.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRkMstCompressionErrorcBseZdZRS(s.Exception for unavailable compression methods.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRlPst StreamErrorcBseZdZRS(s=Exception for unsupported operations on stream-like TarFiles.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRmSst HeaderErrorcBseZdZRS(s!Base exception for header errors.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRnVstEmptyHeaderErrorcBseZdZRS(sException for empty headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRoYstTruncatedHeaderErrorcBseZdZRS(s Exception for truncated headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRp\stEOFHeaderErrorcBseZdZRS(s"Exception for end of file headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRq_sR0cBseZdZRS(sException for invalid headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR0bstSubsequentHeaderErrorcBseZdZRS(s3Exception for missing and invalid extended headers.(RgRhRi(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRrest _LowLevelFilecBs2eZdZdZdZdZdZRS(sLow-level file object. Supports reading and writing. It is used instead of a regular file object for streaming access. cCsgitjd6tjtjBtjBd6|}ttdrK|tjO}ntj||d|_dS(NRYRZtO_BINARYi( tostO_RDONLYtO_WRONLYtO_CREATtO_TRUNCthasattrRttopentfd(tselftnameRa((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__init__rs cCstj|jdS(N(RutcloseR|(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR{scCstj|j|S(N(RuRKR|(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRK~scCstj|j|dS(N(RuRLR|(R}R"((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRLs(RgRhRiRRRKRL(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRsls   t_StreamcBseZdZdZdZdZdZdZdZdZ dZ d d Z dd Z d Zd ZRS(sClass that serves as an adapter between TarFile and a stream-like object. The stream-like object only needs to have a read() or write() method and is accessed blockwise. Use of gzip or bzip2 compression is possible. A stream-like object could be for example: sys.stdin, sys.stdout, a socket, a tape device etc. _Stream is intended to be used only internally. cCst|_|dkr0t||}t|_n|dkrWt|}|j}n|p`d|_||_||_ ||_ ||_ d|_ d|_ t|_y|dkr%yddl}Wntk rtdnX||_|jd|_|dkr|jq%|jn|d kryddl}Wntk r`td nX|dkrd|_|j|_q|j|_nWn,|js|j jnt|_nXdS( s$Construct a _Stream object. t*R]itgziNszlib module is not availableRYtbz2sbz2 module is not available(RJt _extfileobjRIRstFalset _StreamProxyt getcomptypeR~RatcomptypetfileobjtbufsizeREtpostclosedtzlibt ImportErrorRltcrc32tcrct _init_read_gzt_init_write_gzRtdbuftBZ2Decompressortcmpt BZ2CompressorR(R}R~RaRRRRR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRsP                        cCs*t|dr&|j r&|jndS(NR(RzRR(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__del__scCs|jjd|jj|jj |jjd|_tjdtt j }|j d|d|j j dr|j d |_ n|j |j j dd td S( s6Initialize for writing with gzip compression. i isZ2RS(@sInformational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally. R~RaRRRRtchksumttypetlinknameRRtdevmajortdevminorRRt pax_headersRRt_sparse_structst _link_targetR]cCs||_d|_d|_d|_d|_d|_d|_t|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_i|_dS(sXConstruct a TarInfo object. name is the optional name of the member. iiR]N(R~RaRRRRRtREGTYPERRRRRRRRRIRR(R}R~((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs"                cCs|jS(N(R~(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt_getpathscCs ||_dS(N(R~(R}R~((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt_setpathscCs|jS(N(R(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt _getlinkpathscCs ||_dS(N(R(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt _setlinkpathscCs d|jj|jt|fS(Ns<%s %r at %#x>(t __class__RgR~tid(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__repr__scCsi |jd6|jd@d6|jd6|jd6|jd6|jd6|jd6|jd 6|jd 6|j d 6|j d 6|j d 6|j d6}|d t kr|djd r|dcd7R$R%R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyttobufs    cCst|dny||jd d Wn"tk r||||nXt|||kr>||||q>WxddddfD]\}}||krd||R$R%tpartsRER((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRYs&$#cCs@tt|t\}}|dkr<|t|t7}n|S(sdReturn the string payload filled with zero bytes up to the next 512 byte border. i(RMR RR!(tpayloadRRRS((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt_create_payloadus cCsm|j||t}i}d|d<||d|j|S|jtttfkrc|j |S|j |SdS(sYChoose the right processing method depending on the type and call it. N( RRRt _proc_gnulongRt _proc_sparseRRtSOLARIS_XHDTYPEt _proc_paxt _proc_builtin(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR%s   cCsx|jj|_|j}|js6|jtkrO||j|j7}n||_|j |j |j |j |S(sfProcess a builtin type or an unknown type which will be treated as a regular file. ( RRRtisregRtSUPPORTED_TYPESt_blockRRt_apply_pax_infoRR$R%(R}RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR+$s  cCs|jj|j|j}y|j|}Wntk rPtdnX|j|_|jt krt ||j |j |_ n-|jtkrt ||j |j |_n|S(sSProcess the blocks that hold a GNU longname or longlink member. s missing or bad subsequent header(RRKR.RR&RnRrRRRR*R$R%R~RR(R}RREtnext((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR'5s  c Cs|j\}}}|`x|r|jjt}d}xtdD]}}y6t|||d!}t||d|d!} Wntk rPnX|r| r|j|| fn|d7}qFWt|d}qW||_ |jj |_ |j |j |j |_||_ |S(s8Process a GNU sparse header plus extra headers. iii ii(RRRKRR1R5R/R_RRRRR.RR( R}RR R"R#RERR4RR!((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR(Ks(     cCs|jj|j|j}|jtkr9|j}n|jj}tj d|}|dk r|j dj d|ds  cCsx|jD]\}}|dkr8t|d|q |dkr]t|dt|q |dkrt|dt|q |tkr |tkryt||}Wqtk rd}qXn|dkr|jd}nt|||q q W|j|_dS( soReplace fields with supplemental information from a previous pax extended or global header. sGNU.sparse.nameRsGNU.sparse.sizeRsGNU.sparse.realsizeiRN( RtsetattrR.t PAX_FIELDStPAX_NUMBER_FIELDSR/RRR(R}RR$R%RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR/s"        cCs9y|j|dSWntk r4|j||SXdS(s1Decode a single field from a pax record. R,N(R(tUnicodeDecodeError(R}RR$tfallback_encodingtfallback_errors((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR:s cCs0t|t\}}|r(|d7}n|tS(s_Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024. i(RMR(R}RRRRS((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR. s cCs |jtkS(N(Rt REGULAR_TYPES(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR,scCs |jS(N(R,(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytisfilescCs |jtkS(N(RR(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRscCs |jtkS(N(RtSYMTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytissymscCs |jtkS(N(RtLNKTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytislnkscCs |jtkS(N(RtCHRTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytischr scCs |jtkS(N(RtBLKTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytisblk"scCs |jtkS(N(RtFIFOTYPE(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytisfifo$scCs |jdk S(N(RRI(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytissparse&scCs|jtttfkS(N(RRTRVRX(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytisdev(s(R~RaRRRRRRRRRRRRRRRRRR(3RgRhRit __slots__RRRtpropertyRRRRRRtDEFAULT_FORMATtENCODINGRRRRt classmethodR Rt staticmethodRRRRR$R&R%R+R'R(R*R=R<R>R/R:R.R,RORRQRSRURWRYRZR[(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs`         1  3?    f             c Bs-eZdZdZeZeZdZeZ e Z d1Z eZeZd1dd1d1d1d1d1d1dd1d1d1d Zed1dd1edZedd1dZedd1dd Zedd1dd Zid d 6d d6dd6ZdZdZdZdZd1d1d1dZedZ d1ed1d1dZ!d1dZ"dd1dZ#dedZ$dZ%edZ&dZ'd Z(d!Z)d"Z*d#Z+d$Z,d%Z-d&Z.d'Z/d(Z0d1ed)Z1d*Z2d1d+Z3d,Z4d-Z5d.Z6d/Z7d0Z8RS(2s=The TarFile Class provides an interface to tar archives. iiRYRc Cst|dks|dkr-tdn||_idd6dd6dd 6||_|s|jdkrtjj| rd |_d|_nt||j}t|_ nN|d krt |d r|j }nt |d r|j|_nt |_ |rtjj|nd |_ ||_|d k rC||_n|d k r[||_n|d k rs||_n|d k r||_n|d k r||_n| |_| d k r|jtkr| |_n i|_| d k r| |_n| d k r | |_nt|_g|_t|_|jj|_i|_y9|jdkrod |_ |j!|_ n|jdkrxt r|jj"|jy&|jj#|}|jj$|Wqt%k r|jj"|jPqt&k r } t't(| qXqWn|jd krzt |_|jrz|jj)|jj*}|jj+||jt|7_qznWn,|j s|jj,nt |_nXd S(sOpen an (uncompressed) tar archive `name'. `mode' is either 'r' to read from an existing archive, 'a' to append data to an existing file or 'w' to create a new file overwriting an existing one. `mode' defaults to 'r'. If `fileobj' is given, it is used for reading or writing data. If it can be determined, `mode' is overridden by `fileobj's mode. `fileobj' is not closed, when TarFile is closed. iRsmode must be 'r', 'a' or 'w'trbRYsr+btatwbRZR~RatawN(-R R/Rat_modeRuRtexistst bltn_openRRRIRzR~RJtabspathRR>Rt dereferencet ignore_zerosR$R%RRtdebugt errorlevelRtmemberst_loadedRRtinodest firstmemberR0RR&R_RqRnRkRR RRLR(R}R~RaRR>RRjRkR$R%RRlRmteRE((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRFs  ""     !                             c Ks4| r| rtdn|dkrx|jD]}t||j|}|dk rj|j}ny||d||SWq3ttfk r} |dk r3|j|q3q3q3Xq3WtdnUd|krV|jdd\} }| pd} |pd}||jkr3t||j|}ntd|||| ||Sd |kr|jd d\} }| pd} |pd}| d krtd nt || |||} y||| | |} Wn| j nXt | _ | S|d kr$|j ||||Std dS(s|Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for reading exclusively uncompressed 'r:gz' open for reading with gzip compression 'r:bz2' open for reading with bzip2 compression 'a' or 'a:' open for appending, creating the file if necessary 'w' or 'w:' open for writing without compression 'w:gz' open for writing with gzip compression 'w:bz2' open for writing with bzip2 compression 'r|*' open a stream of tar blocks with transparent compression 'r|' open an uncompressed stream of tar blocks for reading 'r|gz' open a gzip compressed stream of tar blocks 'r|bz2' open a bzip2 compressed stream of tar blocks 'w|' open an uncompressed stream for writing 'w|gz' open a gzip compressed stream for writing 'w|bz2' open a bzip2 compressed stream for writing snothing to openRYsr:*s%file could not be opened successfullyt:iRsunknown compression type %rt|trwsmode must be 'r' or 'w'Resundiscernible modeN(RYsr:*(R/t OPEN_METHRRIRRkRlRRERRRRttaropen( R R~RaRRtkwargsRtfunct saved_posRrRftstreamR[((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR{sN              cKs@t|dks|dkr-tdn|||||S(sCOpen uncompressed tar archive name for reading or writing. iRsmode must be 'r', 'a' or 'w'(R R/(R R~RaRRx((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRwsi c Ks6t|dks|dkr-tdnyddl}|jWn#ttfk ritdnX|dk }y8|j||d||}|j||||}Wnxt k r| r|dk r|j n|dkrnt dn*| r"|dk r"|j nnX||_ |S( skOpen gzip compressed tar archive name for reading or writing. Appending is not allowed. iRusmode must be 'r' or 'w'iNsgzip module is not availableRTsnot a gzip file( R R/tgziptGzipFileRtAttributeErrorRlRIRwRNRRkR( R R~RaRt compresslevelRxR|t extfileobjR[((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytgzopens.        cKst|dks|dkr-tdnyddl}Wntk r\tdnX|dk r{t||}n|j||d|}y|j||||}Wn-t t fk r|j t dnXt |_|S( slOpen bzip2 compressed tar archive name for reading or writing. Appending is not allowed. iRusmode must be 'r' or 'w'.iNsbz2 module is not availableRsnot a bzip2 file(R R/RRRlRIRtBZ2FileRwRNtEOFErrorRRkRR(R R~RaRRRxRR[((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytbz2open$s     RwRRRRRcCs|jr dS|jdkr|jjttd|jtd7_t|jt\}}|dkr|jjtt|qn|j s|jj nt |_dS(slClose the TarFile. In write-mode, two finishing zero blocks are appended to the archive. NReii( RRaRRLR!RRRMt RECORDSIZERRRJ(R}RRRS((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRHs   cCs2|j|}|dkr.td|n|S(sReturn a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version. sfilename %r not foundN(t _getmemberRItKeyError(R}R~R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt getmember\s cCs'|j|js |jn|jS(sReturn the members of the archive as a list of TarInfo objects. The list has the same order as the members in the archive. (t_checkRot_loadRn(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt getmembersgs   cCs g|jD]}|j^q S(sReturn the members of the archive as a list of their names. It has the same order as the list returned by getmembers(). (RR~(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytgetnamesqsc Cs\|jd|d k r%|j}n|d kr:|}ntjj|\}}|jtjd}|jd}|j }||_ |d krt tdr|j rtj |}qtj|}ntj|j}d}|j}tj|r|j|jf} |j rj|jdkrj| |jkrj||j| krjt} |j| }qt} | dr||j| slink toN(RtprintRfRaRRRRRURWRRRRt localtimeRR~RRQRRS(R}tverboseR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRAs&   !)  c Cs|jd|dkr"|}n|dk rtddl}|jdtd||rt|jdd|dSn|jdk rtjj ||jkr|jdd|dS|jd||j ||}|dkr|jdd |dS|dk r;||}|dkr;|jdd|dSn|j rst |d }|j |||jn|jr|j ||rxTtj|D]@}|jtjj||tjj||||d |qWqn |j |dS( s~Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `recursive' to False. `exclude' is a function that should return True for each filename to be excluded. `filter' is a function that expects a TarInfo object argument and returns the changed TarInfo object, if it returns None the TarInfo object will be excluded from the archive. ReiNsuse the filter argument insteadistarfile: Excluded %rstarfile: Skipped %ristarfile: Unsupported type %rRbtfilter(RRItwarningstwarntDeprecationWarningt_dbgR~RuRRiRR,RhtaddfileRRtlistdirtaddR`( R}R~Rt recursivetexcludeRRRtf((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRsD        *        *cCs|jdtj|}|j|j|j|j}|jj||jt |7_|dk rt ||j|j t |j t\}}|dkr|jjtt||d7}n|j|t7_n|jj|dS(s]Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. ReiiN(RRRR>R$R%RRLRR RIRURRMRR!RnR_(R}RRRERRRS((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR4s    t.cCs:g}|dkr|}nx_|D]W}|jr\|j|tj|}d|_n|j||d|j q"W|jdd|jx|D]}tj j ||j }y4|j |||j |||j||Wqtk r1}|jdkrq2|jdd|qXqWdS(sMExtract all members from the archive to the current working directory and set owner, modification time and permissions on directories afterwards. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by getmembers(). it set_attrstkeycSs|jS(N(R~(Rc((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pytdR]is tarfile: %sN(RIRR_RRatextracttsorttreverseRuRR`R~tchowntutimetchmodRjRmR(R}RRnt directoriesRtdirpathRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt extractallNs*      !  R]cCs=|jdt|tr.|j|}n|}|jr^tjj||j|_ ny,|j |tjj||j d|Wnt k r}|j dkrq9|jdkr|jdd|jq9|jdd|j|jfn<tk r8}|j dkr!q9|jdd|nXdS(sxExtract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a TarInfo object. You can specify a different directory using `path'. File attributes (owner, mtime, mode) are set unless `set_attrs' is False. RYRiis tarfile: %sstarfile: %s %rN(RRRRRSRuRR`RRt_extract_memberR~tEnvironmentErrorRmtfilenameRIRtstrerrorRj(R}tmemberRRRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRts&  ! #cCs|jdt|tr.|j|}n|}|jrP|j||S|jtkro|j||S|js|j rt|j t rt dq|j |j|SndSdS(sExtract a member from the archive as a file object. `member' may be a filename or a TarInfo object. If `member' is a regular file, a file-like object is returned. If `member' is a link, a file-like object is constructed from the link's target. If `member' is none of the above, None is returned. The file-like object is read-only and provides the following methods: read(), readline(), readlines(), seek() and tell() RYs'cannot extract (sym)link as file objectN(RRRRR,t fileobjectRR-RSRQRRRmt extractfilet_find_link_targetRI(R}RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs  cCs|jd}|jdtj}tjj|}|r_tjj| r_tj|n|jsw|j r|j dd|j |j fn|j d|j |j r|j||n|jr|j||n|jr |j||n|js"|jr5|j||n]|jsM|j r`|j||n2|jtkr|j||n|j|||r|j|||j s|j|||j||qndS(s\Extract the TarInfo object tarinfo to a physical file called targetpath. Ris%s -> %sN(RRRuRRtdirnameRgtmakedirsRSRQRR~RR,tmakefileRtmakedirRYtmakefifoRURWtmakedevtmakelinkRR-t makeunknownRRR(R}Rt targetpathRt upperdirs((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs4#    cCsFytj|dWn+tk rA}|jtjkrBqBnXdS(s,Make a directory called targetpath. iN(RutmkdirRterrnotEEXIST(R}RRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs cCs|j}|j|jt|d}|jdk rqxJ|jD])\}}|j|t|||qAWnt|||j|j|j|j|j dS(s'Make a file called targetpath. RdN( RRRRhRRIRURttruncateR(R}RRtsourcettargetRR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRs   cCs+|j|||jdd|jdS(sYMake a file from a TarInfo object with an unknown type at targetpath. is9tarfile: Unknown file type %r, extracted as regular file.N(RRR(R}RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s cCs/ttdrtj|n tddS(s'Make a fifo called targetpath. tmkfifosfifo not supported by systemN(RzRuRRj(R}RR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR scCsttd s ttd r/tdn|j}|jrT|tjO}n |tjO}tj||tj |j |j dS(s<Make a character or block device called targetpath. tmknodRs'special devices not supported by systemN( RzRuRjRaRWRtS_IFBLKtS_IFCHRRRRR(R}RRRa((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s     cCsyj|jr%tj|j|nDtjj|jrPtj|j|n|j|j ||WnPt k r|jrtjj tjj |j |j}q|j}n>Xy|j|j ||Wntk rtdnXdS(sMake a (symbolic) link called targetpath. If it cannot be created (platform limitation), we try to make a copy of the referenced file instead of a link. s%unable to resolve link inside archiveN(RQRutsymlinkRRRgRtlinkRRtsymlink_exceptionR`RR~RRj(R}RRR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR' s"       cCstrttdrtjdkrytj|jd}Wntk r]|j}nXytj |j d}Wntk r|j }nXyZ|j rttdrtj |||n%tjdkrtj|||nWqtk r}tdqXndS(s6Set owner of targetpath according to tarinfo. tgeteuidiitlchowntos2emxscould not change ownerN(RRzRuRRtgetgrnamRRRtgetpwnamRRRQRtsystplatformRRRj(R}RRRtuRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRD s '    cCsOttdrKytj||jWqKtk rG}tdqKXndS(sASet file permissions of targetpath according to tarinfo. Rscould not change modeN(RzRuRRaRRj(R}RRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRZ s cCsYttdsdSy tj||j|jfWntk rT}tdnXdS(sBSet modification time of targetpath according to tarinfo. RNs"could not change modification time(RzRuRRRRj(R}RRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyRc s  cCs|jd|jdk r2|j}d|_|S|jj|jd}xktry|jj|}WnGt k r}|j r|j dd|j|f|jt 7_qNqnt k r+}|j r|j dd|j|f|jt 7_qNq|jdkrtt|qntk rY|jdkrtdqn[tk r}|jdkrtt|qn%tk r}tt|nXPqNW|dk r|jj|n t|_|S(sReturn the next member of the archive as a TarInfo object, when TarFile is opened for reading. Return None if there is no more available. trais0x%X: %sis empty fileN(RRqRIRRRRJRR&RqRkRRR0RkRRoRpRrRnR_Ro(R}tmRRr((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR0n sF          cCs|j}|dk r.||j| }n|rItjj|}nxKt|D]=}|rztjj|j}n |j}||krV|SqVWdS(s}Find an archive member by name from bottom to top. If tarinfo is given, it is used as the starting point. N(RRItindexRuRtnormpathtreversedR~(R}R~Rt normalizeRnRt member_name((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s    cCs6x&tr(|j}|dkrPqqWt|_dS(sWRead through the entire archive file and look for readable members. N(RJR0RIRo(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s    cCsW|jr"td|jjn|dk rS|j|krStd|jndS(snCheck if TarFile is still open, and if the operation's mode corresponds to TarFile's mode. s %s is closedsbad operation for mode %rN(RRNRRgRIRa(R}Ra((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s cCs|jr5tjj|jd|j}d}n|j}|}|j|d|dt}|dkr~t d|n|S(sZFind the target member of a symlink or hardlink member in the archive. RRRslinkname %r not foundN( RQRuRRR~RRIRRJR(R}RRtlimitR((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s     cCs$|jrt|jSt|SdS(s$Provide an iterator object. N(RotiterRntTarIter(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s  cCs)||jkr%t|dtjndS(s.Write debugging output to sys.stderr. tfileN(RlRRtstderr(R}tleveltmsg((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR scCs|j|S(N(R(R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt __enter__ s cCs?|dkr|jn"|js2|jjnt|_dS(N(RIRRRRJR(R}RRt traceback((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__exit__ s    N(9RgRhRiRlRRjRkRmR^R>R_R$RIR%RRRRRR`RR{RwRRRvRRRRRRJRARRRRRRRRRRRRRRRR0RRRRRRRR(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR,sn  iK   b > &# & 0       1    RcBs/eZdZdZdZdZeZRS(sMIterator Class. for tarinfo in TarFile(...): suite... cCs||_d|_dS(s$Construct a TarIter object. iN(RR(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s cCs|S(s Return iterator object. ((R}((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR scCs}|jjs9|jj}|sjt|j_tqjn1y|jj|j}Wntk ritnX|jd7_|S(sReturn the next item using TarFile's next() method. When all members have been read, set TarFile as _loaded. i(RRoR0RJt StopIterationRnRt IndexError(R}R((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyt__next__ s     (RgRhRiRRRR0(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR s    cCs7yt|}|jtSWntk r2tSXdS(sfReturn True if name points to a tar archive that we are able to handle, else return False. N(R{RRJRR(R~R[((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyR# s    (xt __future__Rt __version__tversiont __author__t__date__t __cvsid__t __credits__RRuRRRR8RR3RRRRIR~tNotImplementedErrorRt WindowsErrort NameErrort__all__t version_infot __builtin__tbuiltinsR{t_openR!RRRRRRR RRRRRPRTRVRRXtCONTTYPERRRRRR)RR7RR^R-RNRRItsetR;RR.RJtS_IFLNKtS_IFREGRtS_IFDIRRtS_IFIFOtTSUIDtTSGIDtTSVTXtTUREADtTUWRITEtTUEXECtTGREADtTGWRITEtTGEXECtTOREADtTOWRITEtTOEXECR~R_tgetfilesystemencodingR&R*R5R?RHRUR^Rft ExceptionRRjRkRlRmRnRoRpRqR0RrtobjectRsRRRRRRRRRRh(((sI/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/tarfile.pyts.                                                 ?K* PK!਱BQBQ_backport/sysconfig.pycnu[ abc @s_dZddlZddlZddlZddlZddlmZmZyddlZWne k r{ddl ZnXdddddd d d d d dg Z dZ ej rejje ej Zne ejZejdkr(dedjkr(e ejjeeZnejdkrndedjkrne ejjeeeZnejdkrdedjkre ejjeeeZndZeZeadZejZejdZdZejj dZ!ejd Z"e!de!dZ#ejj$ej%Z&ejj$ej'Z(da*dZ+dZ,dZ-d Z.d!Z/d"Z0d#Z1dd$Z2d%Z3d&Z4d'Z5dd(Z6d)Z7d*Z8d+Z9e0de:d,Z;e0de:d-Z<d.Z=d/Z>d0Z?d1Z@d2ZAd3ZBeCd4kr[eBndS(5s-Access to Python's configuration information.iN(tpardirtrealpathtget_config_h_filenametget_config_vartget_config_varstget_makefile_filenametget_pathtget_path_namest get_pathst get_platformtget_python_versiontget_scheme_namestparse_config_hcCs'yt|SWntk r"|SXdS(N(RtOSError(tpath((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_safe_realpath"s tnttpcbuildis\pc\vis\pcbuild\amd64icCs=x6dD].}tjjtjjtd|rtSqWtS(Ns Setup.dists Setup.localtModules(s Setup.dists Setup.local(tosRtisfiletjoint _PROJECT_BASEtTruetFalse(tfn((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pytis_python_build:s $cCstsddlm}tjddd}||}|jd}|sYtd|j}tj |WdQXt rx7dD],}tj |d d tj |d d qWnt andS(Ni(tfindert.iis sysconfig.cfgssysconfig.cfg existst posix_prefixt posix_hometincludes{srcdir}/Includet platincludes{projectbase}/.(RR( t _cfg_readt resourcesRt__name__trsplittfindtAssertionErrort as_streamt_SCHEMEStreadfpt _PYTHON_BUILDtsetR(Rtbackport_packaget_findert_cfgfiletstscheme((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_ensure_cfg_readDs  s \{([^{]*?)\}cs-t|jdr(|jd}n t}|j}xb|D]Z}|dkr\qDnx?|D]7\}}|j||rqcn|j|||qcWqDW|jdxw|jD]i}t|j|fd}x<|j|D]+\}}|j||t j ||qWqWdS(Ntglobalscs0|jd}|kr#|S|jdS(Nii(tgroup(tmatchobjtname(t variables(sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _replaceros ( R1t has_sectiontitemsttupletsectionst has_optionR+tremove_sectiontdictt _VAR_REPLtsub(tconfigR2R;tsectiontoptiontvalueR7((R6sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_expand_globalsYs$     iiicsfd}tj||S(sIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. csJ|jd}|kr#|S|tjkr=tj|S|jdS(Nii(R3Rtenviron(R4R5(t local_vars(sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR7s   (R?R@(RRGR7((RGsK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _subst_varsscCsI|j}x6|jD](\}}||kr7qn|||dttjf}nd}tjjt d|dS(s Return the path of the Makefile.tMakefiletabiflagss config-%s%sRAtstdlib( R*RRRRthasattrRbt_PY_VERSION_SHORTRR(tconfig_dir_name((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyRMs cCst}yt||WnLtk rh}d|}t|drY|d|j}nt|nXt}y&t|}t||WdQXWnLtk r}d|}t|dr|d|j}nt|nXtr|d|dR(R9(R0RStexpand((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyRs cCst||||S(s[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. (R(R5R0RSR((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyRscGstd"krRiattdkrd4}qI|d?krd5}qIt d6|fqL|d.krtj!d@krId0}qIqL|dAkrLtj!dBkr@d3}qId/}qLqOnd:|||fS(CsReturn 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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. Rs bit (it)tamd64s win-amd64titaniumswin-ia64RORt/RmRt_t-itlinuxs%s-%stsunosit5tsolariss%d.%siiitirixtaixs%s-%s.%sitcygwins[\d.]+R^tMACOSX_DEPLOYMENT_TARGETs0/System/Library/CoreServices/SystemVersion.plists=ProductUserVisibleVersion\s*(.*?)NRitmacosxs10.4.s-archRotfats -arch\s+(\S+)ti386tppctx86_64tinteltfat3tppc64tfat64t universals%Don't know machine value for archs=%ri tPowerPCtPower_Macintoshs%s-%s-%s(RR(RR(RRR(RR(RRRRI(RRI("RR5RbRR%RcRtlowerRRR{R|RsRtRzR3RRaRRvRRtreadtcloseRPRRRytfindallR:RR+R}tmaxsize(RtitjtlooktosnamethosttreleaseRtmachinetrel_reRtcfgvarstmacvert macreleaseRtcflagstarchs((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR [s    (     + !               cCstS(N(R(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR scCsZxStt|jD]9\}\}}|dkrCd|GHnd||fGHqWdS(Nis%s: s %s = "%s"(t enumerateRR9(ttitletdatatindexRMRD((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _print_dicts+  cCsRdtGHdtGHdtGHdGHtdtdGHtdtdS( s*Display all information sysconfig detains.sPlatform: "%s"sPython version: "%s"s!Current installation scheme: "%s"tPathst VariablesN(((R R RWRRR(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_mains   t__main__(Dt__doc__RuRRsRbtos.pathRRt configparsert ImportErrort ConfigParsert__all__RRRRRRR5RRRR*RR!R1tRawConfigParserR(RtR?RERRRRRRRRRRRRPRt _USER_BASERHRNRURVRWRhRRRRR RR RRRRRRR R RRR#(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyts        %%!%!     #      v         PK!q@SQQ_backport/sysconfig.pyonu[ abc @s_dZddlZddlZddlZddlZddlmZmZyddlZWne k r{ddl ZnXdddddd d d d d dg Z dZ ej rejje ej Zne ejZejdkr(dedjkr(e ejjeeZnejdkrndedjkrne ejjeeeZnejdkrdedjkre ejjeeeZndZeZeadZejZejdZdZejj dZ!ejd Z"e!de!dZ#ejj$ej%Z&ejj$ej'Z(da*dZ+dZ,dZ-d Z.d!Z/d"Z0d#Z1dd$Z2d%Z3d&Z4d'Z5dd(Z6d)Z7d*Z8d+Z9e0de:d,Z;e0de:d-Z<d.Z=d/Z>d0Z?d1Z@d2ZAd3ZBeCd4kr[eBndS(5s-Access to Python's configuration information.iN(tpardirtrealpathtget_config_h_filenametget_config_vartget_config_varstget_makefile_filenametget_pathtget_path_namest get_pathst get_platformtget_python_versiontget_scheme_namestparse_config_hcCs'yt|SWntk r"|SXdS(N(RtOSError(tpath((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_safe_realpath"s tnttpcbuildis\pc\vis\pcbuild\amd64icCs=x6dD].}tjjtjjtd|rtSqWtS(Ns Setup.dists Setup.localtModules(s Setup.dists Setup.local(tosRtisfiletjoint _PROJECT_BASEtTruetFalse(tfn((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pytis_python_build:s $cCstsddlm}tjddd}||}|jd}|j}tj|WdQXt rx7d D],}tj |d d tj |d d qvWnt andS(Ni(tfindert.iis sysconfig.cfgt posix_prefixt posix_hometincludes{srcdir}/Includet platincludes{projectbase}/.(RR( t _cfg_readt resourcesRt__name__trsplittfindt as_streamt_SCHEMEStreadfpt _PYTHON_BUILDtsetR(Rtbackport_packaget_findert_cfgfiletstscheme((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_ensure_cfg_readDs  s \{([^{]*?)\}cs-t|jdr(|jd}n t}|j}xb|D]Z}|dkr\qDnx?|D]7\}}|j||rqcn|j|||qcWqDW|jdxw|jD]i}t|j|fd}x<|j|D]+\}}|j||t j ||qWqWdS(Ntglobalscs0|jd}|kr#|S|jdS(Nii(tgroup(tmatchobjtname(t variables(sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _replaceros ( R0t has_sectiontitemsttupletsectionst has_optionR*tremove_sectiontdictt _VAR_REPLtsub(tconfigR1R:tsectiontoptiontvalueR6((R5sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_expand_globalsYs$     iiicsfd}tj||S(sIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. csJ|jd}|kr#|S|tjkr=tj|S|jdS(Nii(R2Rtenviron(R3R4(t local_vars(sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR6s   (R>R?(RRFR6((RFsK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _subst_varsscCsI|j}x6|jD](\}}||kr7qn|||R?(RCRRR6((RRsK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt format_valuescCstjdkrdStjS(NRNR(RR4(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_get_default_schemescCstjjdd}d}tjdkr_tjjdpBd}|rO|S||dSntjdkrtd}|r|r|S|dd |d tjd Sqn|r|S|dd SdS( NtPYTHONUSERBASEcWstjjtjj|S(N(RRRPR(targs((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pytjoinusersRtAPPDATAt~tPythontdarwintPYTHONFRAMEWORKtLibrarys%d.%dis.local( RREtgetROR4tsystplatformRt version_info(tenv_baseRYtbaset framework((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _getuserbases"  cCstjd}tjd}tjd}|dkrBi}ni}i}tj|dddd}|j}WdQXx|D]} | jd s| jd krqn|j| } | r| j d d \} } | j} | j d d } d| kr| || dttjf}nd}tjjt d|dS(s Return the path of the Makefile.tMakefiletabiflagss config-%s%sR@tstdlib( R)RRRRthasattrRat_PY_VERSION_SHORTRR(tconfig_dir_name((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyRMs cCst}yt||WnLtk rh}d|}t|drY|d|j}nt|nXt}y&t|}t||WdQXWnLtk r}d|}t|dr|d|j}nt|nXtr|d|dkrd4}qI|d?krd5}qIt d6|fqL|d.krtj!d@krId0}qIqL|dAkrLtj!dBkr@d3}qId/}qLqOnd:|||fS(CsReturn 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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. Rs bit (it)tamd64s win-amd64titaniumswin-ia64RNRt/RlRt_t-itlinuxs%s-%stsunosit5tsolariss%d.%siiitirixtaixs%s-%s.%sitcygwins[\d.]+R]tMACOSX_DEPLOYMENT_TARGETs0/System/Library/CoreServices/SystemVersion.plists=ProductUserVisibleVersion\s*(.*?)NRitmacosxs10.4.s-archRntfats -arch\s+(\S+)ti386tppctx86_64tinteltfat3tppc64tfat64t universals%Don't know machine value for archs=%ri tPowerPCtPower_Macintoshs%s-%s-%s(RR(RR(RRR(RR(RRRRI(RRI("RR4RaRR%RbR~tlowerRRRzR{RrRsRyR2RR`RRuRRtreadtcloseRORRRxtfindallR9RR*R|tmaxsize(RtitjtlooktosnamethosttreleaseRtmachinetrel_reRtcfgvarstmacvert macreleaseRtcflagstarchs((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR [s    (     + !               cCstS(N(R(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyR scCsZxStt|jD]9\}\}}|dkrCd|GHnd||fGHqWdS(Nis%s: s %s = "%s"(t enumerateRR8(ttitletdatatindexRLRC((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt _print_dicts+  cCsRdtGHdtGHdtGHdGHtdtdGHtdtdS( s*Display all information sysconfig detains.sPlatform: "%s"sPython version: "%s"s!Current installation scheme: "%s"tPathst VariablesN(((R R RVRRR(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyt_mains   t__main__(Dt__doc__RtRRrRatos.pathRRt configparsert ImportErrort ConfigParsert__all__RRRRRRR4RRRR)RR!R0tRawConfigParserR'RsR>RDRRRRRRQRRRRRORt _USER_BASERGRMRTRURVRgRRRRR RR RRRRRRR R RRR#(((sK/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/sysconfig.pyts        %%!%!     #      v         PK!l>_backport/misc.pycnu[ abc@sdZddlZddlZdddgZyddlmZWnek r`edZnXy eZWn*e k rddl m Z d ZnXy ej Z Wne k rd Z nXdS( s/Backports for individual classes and functions.iNtcache_from_sourcetcallabletfsencode(RcCs|r dpd}||S(Ntcto((tpy_filetdebugtext((sF/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyRs(tCallablecCs t|tS(N(t isinstanceR(tobj((sF/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyRscCsRt|tr|St|tr5|jtjStdt|jdS(Nsexpect bytes or str, not %s( R tbyteststrtencodetsystgetfilesystemencodingt TypeErrorttypet__name__(tfilename((sF/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyR"s (t__doc__tosRt__all__timpRt ImportErrort __debug__Rt NameErrort collectionsRRtAttributeError(((sF/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/misc.pyts         PK!t(_backport/__init__.pycnu[ abc@s dZdS(s Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N(t__doc__(((sJ/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/__init__.pyttPK!;VgVg_backport/shutil.pyonu[ abc@s"dZddlZddlZddlZddlmZddlZddlZddlZddl m Z yddl Z e Z Wnek reZ nXyddlmZWnek rdZnXyddlmZWnek rdZnXdd d d d d dddddddddddddddgZdefdYZdefdYZdefdYZd efd!YZd"efd#YZyeWnek rdZnXdWd&Zd'Z d(Z!d)Z"d*Z#d+Z$d,Z%d-Z&ede%ed.Z'edd/Z(d0Z)d1Z*d2Z+d3Z,d4Z-d5d6d6dddd7Z.eed8Z/d6d6dd9Z0ie.dXgd;fd<6e.dYgd>fd?6e.dZgd@fdA6e0gdBfdC6Z1e re.d[gd>fe1d?fe=d?dddVZ?dS(\sUtility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. iN(tabspathi(ttarfile(tgetpwnam(tgetgrnamt copyfileobjtcopyfiletcopymodetcopystattcopytcopy2tcopytreetmovetrmtreetErrortSpecialFileErrort ExecErrort make_archivetget_archive_formatstregister_archive_formattunregister_archive_formattget_unpack_formatstregister_unpack_formattunregister_unpack_formattunpack_archivetignore_patternscBseZRS((t__name__t __module__(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR ,scBseZdZRS(s|Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)(RRt__doc__(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR/scBseZdZRS(s+Raised when a command could not be executed(RRR(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR3st ReadErrorcBseZdZRS(s%Raised when an archive cannot be read(RRR(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR6st RegistryErrorcBseZdZRS(sVRaised when a registry operation with the archiving and unpacking registries fails(RRR(((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR9siicCs1x*|j|}|sPn|j|qWdS(s=copy data from file-like object fsrc to file-like object fdstN(treadtwrite(tfsrctfdsttlengthtbuf((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRCs cCs{ttjdrAytjj||SWqAtk r=tSXntjjtjj|tjjtjj|kS(Ntsamefile(thasattrtostpathR$tOSErrortFalsetnormcaseR(tsrctdst((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt _samefileKs c Cst||r(td||fnx`||gD]R}ytj|}Wntk raq5Xtj|jr5td|q5q5Wt|d,}t|d}t ||WdQXWdQXdS(sCopy data from src to dsts`%s` and `%s` are the same files`%s` is a named pipetrbtwbN( R-R R&tstatR(tS_ISFIFOtst_modeRtopenR(R+R,tfntstR R!((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRWs cCsGttdrCtj|}tj|j}tj||ndS(sCopy mode bits from src to dsttchmodN(R%R&R0tS_IMODER2R6(R+R,R5tmode((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRkscCstj|}tj|j}ttdrOtj||j|jfnttdrqtj||nttdrt|drytj ||j Wqt k r}tt d s|j t j krqqXndS(sCCopy all stat info (mode bits, atime, mtime, flags) from src to dsttutimeR6tchflagstst_flagst EOPNOTSUPPN(R&R0R7R2R%R9tst_atimetst_mtimeR6R:R;R(terrnoR<(R+R,R5R8twhy((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRrscCsTtjj|r6tjj|tjj|}nt||t||dS(sVCopy data and mode bits ("cp src dst"). The destination may be a directory. N(R&R'tisdirtjointbasenameRR(R+R,((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRs$ cCsTtjj|r6tjj|tjj|}nt||t||dS(s]Copy data and all stat info ("cp -p src dst"). The destination may be a directory. N(R&R'RARBRCRR(R+R,((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR s$ csfd}|S(sFunction that can be used as copytree() ignore parameter. Patterns is a sequence of glob-style patterns that are used to exclude filescs:g}x'D]}|jtj||q Wt|S(N(textendtfnmatchtfiltertset(R'tnamest ignored_namestpattern(tpatterns(sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt_ignore_patternss ((RKRL((RKsH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRscCs tj|}|dk r-|||}n t}tj|g}xG|D]?} | |krhqPntjj|| } tjj|| } ytjj| rtj| } |rtj | | q6tjj |  r|rwPn|| | n8tjj | r)t | | |||n || | WqPt k r`} |j| jdqPtk r}|j| | t|fqPXqPWyt||WnMtk r}tdk rt|trq|j||t|fnX|r t |ndS(sRecursively copy a directory tree. The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. If the file pointed by the symlink doesn't exist, an exception will be added in the list of errors raised in an Error exception at the end of the copy process. You can set the optional ignore_dangling_symlinks flag to true if you want to silence this exception. Notice that this has no effect on platforms that don't support os.symlink. The optional ignore argument is a callable. If given, it is called with the `src` parameter, which is the directory being visited by copytree(), and `names` which is the list of `src` contents, as returned by os.listdir(): callable(src, names) -> ignored_names Since copytree() is called recursively, the callable will be called once for each directory that is copied. It returns a list of names relative to the `src` directory that should not be copied. The optional copy_function argument is a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. iN(R&tlistdirtNoneRGtmakedirsR'RBtislinktreadlinktsymlinktexistsRAR R RDtargstEnvironmentErrortappendtstrRR(t WindowsErrort isinstance(R+R,tsymlinkstignoret copy_functiontignore_dangling_symlinksRHRIterrorstnametsrcnametdstnametlinktoterrR@((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR sD$     $ cCs|rd}n|dkr*d}ny%tjj|rNtdnWn.tk r|tjj|tjdSXg}ytj|}Wn-tjk r|tj|tjnXx|D]}tjj ||}ytj |j }Wntjk rd}nXt j |r@t|||qytj|Wqtjk r|tj|tjqXqWytj|Wn-tjk r|tj|tjnXdS(sRecursively delete a directory tree. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, path, exc_info) where func is os.listdir, os.remove, or os.rmdir; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info(). If ignore_errors is false and onerror is None, an exception is raised. cWsdS(N((RT((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pytonerrorscWsdS(N((RT((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRdss%Cannot call rmtree on a symbolic linkNi(RNR&R'RPR(tsystexc_infoRMterrorRBtlstatR2R0tS_ISDIRR tremovetrmdir(R't ignore_errorsRdRHR_tfullnameR8((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR s>       !cCstjj|jtjjS(N(R&R'RCtrstriptsep(R'((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt _basename'scCs|}tjj|r~t||r;tj||dStjj|t|}tjj|r~td|q~nytj||Wnt k rtjj|rt ||rtd||fnt ||dt t |qt||tj|nXdS(sRecursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics. If the destination is on our current filesystem, then rename() is used. Otherwise, src is copied to the destination and then removed. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over. Ns$Destination path '%s' already existss.Cannot move a directory '%s' into itself '%s'.RZ(R&R'RAR-trenameRBRpRSR R(t _destinsrcR tTrueR R tunlink(R+R,treal_dst((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyR ,s$   cCsut|}t|}|jtjjs@|tjj7}n|jtjjsh|tjj7}n|j|S(N(RtendswithR&R'Rot startswith(R+R,((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyRrTs  cCs^tdks|dkrdSyt|}Wntk rEd}nX|dk rZ|dSdS(s"Returns a gid, given a group name.iN(RRNtKeyError(R_tresult((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt_get_gid]s   cCs^tdks|dkrdSyt|}Wntk rEd}nX|dk rZ|dSdS(s"Returns an uid, given a user name.iN(RRNRx(R_Ry((sH/usr/lib/python2.7/site-packages/pip/_vendor/distlib/_backport/shutil.pyt_get_uidis   tgzipics|idd6dd6}idd6} tr>d|d s                       Q1  ( =/    6     %   PK!:}yy wheel.pycnu[ abc@sddlmZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd l,m-Z-m.Z.e j/e0Z1e2a3e4ed rd Z5n9ej6j7d rdZ5nej6dkrdZ5ndZ5ej8dZ9e9 rdej:d Z9nde9Z;e5e9Z<ej"j=j>ddj>ddZ?ej8dZ@e@oze@j7dre@j>ddZ@ndZAeAZ@[AejBdejCejDBZEejBdejCejDBZFejBdZGejBdZHd ZId!ZJe jKd"kr$d#ZLn d$ZLd%eMfd&YZNeNZOd'eMfd(YZPd)ZQeQZR[Qe2d*ZSdS(+i(tunicode_literalsN(tmessage_from_filei(t __version__tDistlibException(t sysconfigtZipFiletfsdecodet text_typetfilter(tInstalledDistribution(tMetadatatMETADATA_FILENAME( t FileOperatort convert_patht CSVReadert CSVWritertCachetcached_propertytget_cache_baset read_exportsttempdir(tNormalizedVersiontUnsupportedVersionErrorupypy_version_infouppujavaujyucliuipucpupy_version_nodotu%s%siupyu-u_u.uSOABIucpython-cCs|dtg}tjdr+|jdntjdrJ|jdntjddkro|jdnd j|S( NucpuPy_DEBUGudu WITH_PYMALLOCumuPy_UNICODE_SIZEiuuu(t VER_SUFFIXRtget_config_vartappendtjoin(tparts((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt _derive_abi;s uz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ u7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonwu/cCs|S(N((to((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt]tcCs|jtjdS(Nu/(treplacetostsep(R((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR_RtMountercBs8eZdZdZdZddZdZRS(cCsi|_i|_dS(N(t impure_wheelstlibs(tself((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt__init__cs cCs!||j|<|jj|dS(N(R$R%tupdate(R&tpathnamet extensions((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytaddgs cCsI|jj|}x0|D](\}}||jkr|j|=qqWdS(N(R$tpopR%(R&R)R*tktv((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytremovekscCs"||jkr|}nd}|S(N(R%tNone(R&tfullnametpathtresult((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt find_moduleqs cCs|tjkrtj|}nx||jkrAtd|ntj||j|}||_|jdd}t|dkr|d|_ n|S(Nuunable to find extension for %su.ii( tsystmodulesR%t ImportErrortimpt load_dynamict __loader__trsplittlent __package__(R&R1R3R((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt load_modulexs N(t__name__t __module__R'R+R/R0R4R>(((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR#bs     tWheelcBseZdZdZdZdeedZedZ edZ edZ e dZ dZe d Zd Zdd Zd Zd ZdZdddZdZdZdZdZdZedZdZdZddZRS(u@ Class to build and install from Wheel files (PEP 427). iusha256cCs||_||_d|_tg|_dg|_dg|_tj|_ |dkr{d|_ d|_ |j |_nEtj|}|r|jd}|d|_ |djdd |_ |d |_|j |_ntjj|\}}tj|}|s!td |n|r?tjj||_ n||_|jd}|d|_ |d|_ |d |_|d jd |_|djd |_|djd |_dS(uB Initialise an instance using a (valid) filename. uunoneuanyudummyu0.1unmuvnu_u-ubnuInvalid name or filename: %rupyu.ubiuarN(tsignt should_verifytbuildvertPYVERtpyvertabitarchR!tgetcwdtdirnameR0tnametversiontfilenamet _filenametNAME_VERSION_REtmatcht groupdictR R2tsplitt FILENAME_RERtabspath(R&RMRBtverifytmtinfoRJ((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR'sB                cCs|jrd|j}nd}dj|j}dj|j}dj|j}|jjdd}d|j|||||fS(uJ Build and return a filename from the various components. u-uu.u_u%s-%s%s-%s-%s-%s.whl(RDRRFRGRHRLR RK(R&RDRFRGRHRL((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRMs cCs+tjj|j|j}tjj|S(N(R!R2RRJRMtisfile(R&R2((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytexistssccsNxG|jD]<}x3|jD](}x|jD]}|||fVq*WqWq WdS(N(RFRGRH(R&RFRGRH((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyttagssc Cs8tjj|j|j}d|j|jf}d|}tjd}t |d}|j |}|dj dd}t g|D]}t |^q} | d krd} nt} yItj|| } |j| "} || } td | }WdQXWn!tk r-td | nXWdQX|S( Nu%s-%su %s.dist-infouutf-8uru Wheel-Versionu.iuMETADATAtfileobju$Invalid wheel, because %s is missing(ii(R!R2RRJRMRKRLtcodecst getreaderRtget_wheel_metadataRRttupletintR t posixpathtopenR tKeyErrort ValueError(R&R)tname_vertinfo_dirtwrappertzftwheel_metadatatwvtit file_versiontfntmetadata_filenametbftwfR3((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytmetadatas( %    cCsud|j|jf}d|}tj|d}|j|(}tjd|}t|}WdQXt|S(Nu%s-%su %s.dist-infouWHEELuutf-8( RKRLRaRRbR\R]Rtdict(R&RhReRfRnRoRptmessage((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR^s cCsFtjj|j|j}t|d}|j|}WdQX|S(Nur(R!R2RRJRMRR^(R&R)RhR3((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRWsc Cstj|}|r|j}|| ||}}d|jkrQt}nt}tj|}|rd|jd}nd}||}||}ns|jd}|jd} |dks|| krd} n&|||d!d krd } nd} t| |}|S( Ntpythonwt iRs s iis ( t SHEBANG_RERPtendtlowertSHEBANG_PYTHONWtSHEBANG_PYTHONtSHEBANG_DETAIL_REtgroupstfind( R&tdataRVRwtshebangtdata_after_shebangtshebang_pythontargstcrtlftterm((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytprocess_shebangs,      cCs|dkr|j}nytt|}Wn!tk rNtd|nX||j}tj|j dj d}||fS(NuUnsupported hash algorithm: %rt=uascii( R0t hash_kindtgetattrthashlibtAttributeErrorRtdigesttbase64turlsafe_b64encodetrstriptdecode(R&R~RthasherR3((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytget_hashs   !cCs~t|}ttjj||}|j|ddf|jt|%}x|D]}|j|q]WWdQXdS(Nu( tlisttto_posixR!R2trelpathRtsortRtwriterow(R&trecordst record_pathtbasetptwritertrow((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt write_record's   cCsg}|\}}tt|j}xs|D]k\}} t| d} | j} WdQXd|j| } tjj| } |j || | fq+Wtjj |d} |j || |t tjj |d}|j || fdS(Nurbu%s=%suRECORD( RRRRbtreadRR!R2tgetsizeRRRR(R&RWtlibdirt archive_pathsRtdistinfoRfRtapRtfR~Rtsize((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt write_records0s c Cs\t|dtjA}x7|D]/\}}tjd|||j||qWWdQXdS(NuwuWrote %s to %s in wheel(Rtzipfilet ZIP_DEFLATEDtloggertdebugtwrite(R&R)RRhRR((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt build_zip@sc! s|dkri}nttfdd$d}|dkrgd}tg}tg}tg}n!d}tg}dg}dg}|jd ||_|jd ||_ |jd ||_ |} d |j |j f} d | } d| } g} xKd%D]C}|kr qn|}t jj|rx t j|D]\}}}x|D]}tt jj||}t jj||}tt jj| ||}| j||f|dkrb|jd rbt|d}|j}WdQX|j|}t|d}|j|WdQXqbqbWqLWqqW| }d}xt j|D]\}}}||krxUt|D]G\}}t|}|jdrt jj||}||=PqqW|stdnxl|D]d}t|jd&rqnt jj||}tt jj||}| j||fqWqkWt j|}xf|D]^}|d'kr|tt jj||}tt jj| |}| j||fq|q|Wd|p|jdtd |g}x4|j D])\}}}|jd!|||fq Wt jj|d}t|d"}|jd#j|WdQXtt jj| d}| j||f|j!|| f| | t jj|j"|j#} |j$| | | S((u Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. cs |kS(N((R(tpaths(s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRNRupurelibuplatlibiufalseutrueunoneuanyupyveruabiuarchu%s-%su%s.datau %s.dist-infoudatauheadersuscriptsu.exeurbNuwbu .dist-infou(.dist-info directory expected, not foundu.pycu.pyouRECORDu INSTALLERuSHAREDuWHEELuWheel-Version: %d.%duGenerator: distlib %suRoot-Is-Purelib: %su Tag: %s-%s-%suwu (upurelibuplatlib(udatauheadersuscripts(u.pycu.pyo(uRECORDu INSTALLERuSHAREDuWHEEL(%R0RRtIMPVERtABItARCHREtgetRFRGRHRKRLR!R2tisdirtwalkRRRRRtendswithRbRRRt enumeratetAssertionErrortlistdirt wheel_versionRRZRRJRMR(!R&RRZRtlibkeytis_puret default_pyvert default_abit default_archRRetdata_dirRfRtkeyR2troottdirstfilesRmRtrpRRR~RRktdnRiRFRGRHR)((Rs=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytbuildFs  "              %      cCKs |j}|jd}|jdt}tjj|j|j}d|j|j f}d|} d|} t j| t } t j| d} t j| d} t j d}t|d }|j| }||}t|}Wd QX|d jd d }tg|D]}t|^q}||jkrY|rY||j|n|ddkrv|d}n |d}i}|j| D}td|,}x"|D]}|d}||||jd.}6|6r|6jd/}6nWd QXWnt1k rt+j2d0nX|6r|6jd1i}>|6jd2i}?|>s|?r|jdd}@tjj?|@st@d3n|@|_xF|>jAD]8\}:}<d4|:|<f}A|j4|A}4|j5|4q(W|?ritd(6}BxL|?jAD];\}:}<d4|:|<f}A|j4|A|B}4|j5|4qWqqntjj|| }tB|}5tC|}|d=|d=||d5<|5jD||}|r9 |!j/|n|5jE|!|d6||5SWn+t1k r t+jFd7|jGnXWd tHjI|"XWd QXd S(9u Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. uwarnerulib_onlyu%s-%su%s.datau %s.dist-infouWHEELuRECORDuutf-8urNu Wheel-Versionu.iuRoot-Is-Purelibutrueupurelibuplatlibtstreamiuuscriptstdry_runu /RECORD.jwsiusize mismatch for %su=udigest mismatch for %sulib_only: skipping %su.exeu/urbudigest mismatch on write for %su.pyuByte-compilation failedtexc_infoulib_only: returning Noneu1.0uentry_points.txtuconsoleuguiu %s_scriptsuwrap_%su%s:%su %suAUnable to read legacy script metadata, so cannot generate scriptsu extensionsupython.commandsu8Unable to read JSON metadata, so cannot generate scriptsu wrap_consoleuwrap_guiuValid script path not specifiedu%s = %sulibuprefixuinstallation failed.(uconsoleugui(JRRtFalseR!R2RRJRMRKRLRaR R\R]RRbRRRR_R`RRR tTruetrecordR5tdont_write_bytecodettempfiletmkdtempt source_dirR0t target_dirtinfolistt isinstanceRRRtstrt file_sizeRRRt startswithRRR t copy_streamRt byte_compilet Exceptiontwarningtbasenametmaketset_executable_modetextendRWRtvaluestprefixtsuffixtflagstjsontloadRRdtitemsR Rrtwrite_shared_locationstwrite_installed_filest exceptiontrollbacktshutiltrmtree(CR&RtmakertkwargsRtwarnertlib_onlyR)ReRRft metadata_nametwheel_metadata_namet record_nameRgRhtbwfRpRsRjRkRlRRRotreaderRRtdata_pfxtinfo_pfxt script_pfxtfileoptbctoutfilestworkdirtzinfotarcnamet u_arcnametkindtvalueR~t_Rt is_scripttwhereRtoutfilet newdigesttpycRmtworknameRt filenamestdisttcommandsteptepdataRR-tdR.tstconsole_scriptst gui_scriptst script_dirtscripttoptions((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytinstallsD    %            #   "                            cCsGtdkrCtjjttdtjd }t |antS(Nu dylib-cachei( tcacheR0R!R2RRRR5RLR(R&R((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt_get_dylib_caches  c Cstjj|j|j}d|j|jf}d|}tj|d}tj d}g}t |dw}y\|j |G}||} t j | } |j} | j|} tjj| j| } tjj| stj| nx| jD]\}}tjj| t|}tjj|sHt}nQtj|j}tjj|}|j|}tj|j}||k}|r|j|| n|j||fqWWdQXWntk rnXWdQX|S(Nu%s-%su %s.dist-infou EXTENSIONSuutf-8ur( R!R2RRJRMRKRLRaR\R]RRbRRRt prefix_to_dirRRtmakedirsRR RYRtstattst_mtimetdatetimet fromtimestamptgetinfot date_timetextractRRc(R&R)ReRfRRgR3RhRoRpR*RRt cache_baseRKRtdestRt file_timeRWt wheel_time((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt_get_extensionss>     !  cCs t|S(uM Determine if a wheel is compatible with the running system. (t is_compatible(R&((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR%scCstS(uP Determine if a wheel is asserted as mountable by its metadata. (R(R&((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt is_mountablescCs tjjtjj|j|j}|jsLd|}t|n|jsqd|}t|n|t jkrt j d|ns|rt jj |nt jj d||j}|rtt jkrt jj tntj||ndS(Nu)Wheel %s not compatible with this Python.u$Wheel %s is marked as not mountable.u%s already in pathi(R!R2RTRRJRMR%RR&R5RRRtinsertR$t_hookt meta_pathR+(R&RR)tmsgR*((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytmounts"'     cCstjjtjj|j|j}|tjkrItjd|n]tjj ||t j krxt j |nt j st tj krtj j t qndS(Nu%s not in path( R!R2RTRRJRMR5RRR/R(R$R)(R&R)((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytunmounts' cCstjj|j|j}d|j|jf}d|}d|}tj|t}tj|d}tj|d}t j d}t |d } | j |} || } t | } WdQX| djd d } tg| D]}t|^q}i}| j |D}td |,}x"|D]}|d }|||Fsu0Cannot update non-compliant (PEP-440) version %rR2tlegacyuVersion updated from %r to %r(R0RR}RRR`RRRRR RLRR R( RLR2tupdatedR.RkRRtmdR0((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytupdate_version;s(   0 !     u%s-%su %s.dist-infouRECORDuruutf-8u..uinvalid entry in wheel: %rNRu.whlRu wheel-update-tdiruNot a directory: %r(R!R2RRJRMRKRLRaRRRRRRRRR R0RtmkstemptcloseRRRRRRtcopyfile(R&tmodifiertdest_dirRR.R3R)ReRfRRRhR-RRRR2toriginal_versionRtmodifiedtcurrent_versiontfdtnewpathRRRW((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR( sX           (iiN(R?R@t__doc__RRR0RR'tpropertyRMRYRZRRqR^RWRRRRRRRRR$R%R&R+R,RUR((((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRAs2)    h "    6cCstg}td}xGttjddddD](}|jdj|t|gq1Wg}xLtjD]>\}}}|j drp|j|j dddqpqpW|j t dkr|j dt n|jdg}tg}tjd kr=tjd t}|r=|j\} }}} t|}| g} | dkrg| jd n| dkr| jdn| dkr| jdn| dkr| jdn| dkr| jdnx`|dkr6x@| D]8} d| ||| f} | tkr|j| qqW|d8}qWq=nxH|D]@}x7|D]/} |jdjt|df|| fqQWqDWxwt|D]i\}}|jdjt|fddf|dkr|jdjt|dfddfqqWxwt|D]i\}}|jdjd|fddf|dkr|jdjd|dfddfqqWt|S(uG Return (pyver, abi, arch) tuples compatible with this Python. iiiuu.abiu.iunoneudarwinu(\w+)_(\d+)_(\d+)_(\w+)$ui386uppcufatux86_64ufat3uppc64ufat64uintelu universalu %s_%s_%s_%suanyupy(ui386uppc(ui386uppcux86_64(uppc64ux86_64(ui386ux86_64(ui386ux86_64uinteluppcuppc64(RtrangeR5t version_infoRRRR8t get_suffixesRRRRRR'RtplatformtreRPR|R`t IMP_PREFIXRtset(tversionstmajortminortabisRRR3tarchesRVRKRHtmatchesRPRRGRkRL((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytcompatible_tagss`  $&$               1% 0% 0cCst|tst|}nt}|dkr9t}nxN|D]F\}}}||jkr@||jkr@||jkr@t}Pq@q@W|S(N( RRARR0tCOMPATIBLE_TAGSRFRGRHR(twheelRZR3tverRGRH((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR%s  -(Tt __future__RRR\Rtdistutils.utilt distutilstemailRRR8RtloggingR!RaRERR5RRRRRtcompatRRRRRtdatabaseR RqR R tutilR R RRRRRRRRLRRt getLoggerR?RR0RthasattrRFRDRRRRBRERt get_platformR RRRtcompilet IGNORECASEtVERBOSERSRORvR{RzRyR"RtobjectR#R(RARNROR%(((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyts               (@     '   #  > PK!F22util.pyonu[ abc@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZyddlZWnek rdZnXddlZddlZddlZddlZddlZyddlZWnek r9ddlZnXddlZddlmZddlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e j1e2Z3dZ4e j5e4Z6dZ7d e7d Z8e7d Z9d Z:d e:de9de4d e:de9dZ;dZ<de;de<de;dZ=e8d e4e8dZ>de>dZ?de7de?de=dZ@e j5e@ZAde:de9d ZBe j5eBZCdZDd ZEd!ZFd"ZGddd#ZHd$ZId%ZJd&ZKejLd'ZMejLd(ZNejLd)d*ZOd+ePfd,YZQd-ZRd.ePfd/YZSd0ZTd1ePfd2YZUe j5d3e jVZWd4ZXdd5ZYd6ZZd7Z[d8Z\d9Z]d:Z^e j5d;e j_Z`e j5d<Zadd=Zbe j5d>Zcd?Zdd@ZedAZfdBZgdCZhdDZidEePfdFYZjdGePfdHYZkdIePfdJYZldZmdendRZodSZpdZqdZePfd[YZre j5d\Zse j5d]Zte j5d^Zud_Zd`ZverddalmwZxmyZymzZzdbe%j{fdcYZ{ddexfdeYZwdfewe(fdgYZ|nej}dh Z~e~dkr dje%jfdkYZer dle%jfdmYZq ndne&jfdoYZerFdpe&jfdqYZndre&jfdsYZdtZduePfdvYZdwefdxYZdyefdzYZd{e)fd|YZd}ePfd~YZdZdS(iN(tdeque(tiglobi(tDistlibException(t string_typest text_typetshutilt raw_inputtStringIOtcache_from_sourceturlopenturljointhttplibt xmlrpclibt splittypet HTTPHandlertBaseConfiguratort valid_identt Containert configparsertURLErrortZipFiletfsdecodetunquotes\s*,\s*s (\w|[.-])+s(\*|:(\*|\w+):|t)s\*?s([<>=!~]=)|[<>]t(s)?\s*(s)(s)\s*(s))*s(from\s+(?P.*))s \(\s*(?Pt|s)\s*\)|(?Ps\s*)s)*s \[\s*(?Ps)?\s*\]s(?Ps \s*)?(\s*s)?$s(?Ps )\s*(?Pc Cskd}d}tj|}|rg|j}|d}|dpK|d}|dsad}nd}|dj}|sd}d}|d} n{|ddkrd |}ntj|} g| D]}||^q}d |d jg|D]} d | ^qf} |d s$d} ntj |d } t d|d|d| d| d|d|}n|S(NcSs|j}|d|dfS(Ntoptvn(t groupdict(tmtd((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_constraintYs tdntc1tc2tdireftis<>!=s~=s%s (%s)s, s%s %stextnamet constraintstextrast requirementtsourceturl( tNonetREQUIREMENT_REtmatchRtstriptRELOP_IDENT_REtfinditertjointCOMMA_REtsplitR( tsRtresultRRR&tconsR+tconstrtrstiteratortconR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_requirementWs4       0  cCsd}i}x|D]\}}}tjj||}xt|D]}tjj||} xt| D]v} ||| } |dkr|j| dqo||| } |jtjjdjd} | d| || RAtrstrip(tresources_roottrulesREt destinationsRDtsuffixtdesttprefixtabs_basetabs_globtabs_patht resource_filetrel_pathtrel_dest((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_resources_dests|s  !cCs:ttdrt}ntjttdtjk}|S(Nt real_prefixt base_prefix(thasattrtsystTrueRMtgetattr(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytin_venvs cCs7tjjtj}t|ts3t|}n|S(N(R?R@tnormcaseRXt executablet isinstanceRR(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_executables cCs|}xwtrt|}|}| r7|r7|}n|r |dj}||kr]Pn|r|d|||f}q|q q W|S(Nis %c: %s %s(RYRtlower(tpromptt allowed_charst error_prompttdefaulttpR5tc((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytproceeds     cCsVt|tr|j}ni}x+|D]#}||kr+||||R$cCstjj|}||jkrtjj| r|jj|tjj|\}}|j|tj d||j stj |n|j r|j j|qndS(Ns Creating %s(R?R@RRRRR4RRRRtmkdirRR(RR@RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs"   cCst|| }tjd|||js|sD|j||rf|sSd}qf|t|}ntj|||t n|j ||S(NsByte-compiling %s to %s( RRRRRR,RBt py_compiletcompileRYR(RR@toptimizetforceRMtdpathtdiagpath((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt byte_compiles   cCstjj|rtjj|rtjj| rtjd||js`tj |n|j r ||j kr|j j |qq qtjj|rd}nd}tjd|||jstj |n|j r||j kr |j j |q qndS(NsRemoving directory tree at %stlinktfilesRemoving %s %s(R?R@RtisdirRRtdebugRRRRRRR(RR@R5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytensure_removeds"%     cCsjt}x]|setjj|r:tj|tj}Pntjj|}||kr\Pn|}q W|S(N(RR?R@RtaccesstW_OKR(RR@R6tparent((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt is_writables   cCs |j|jf}|j|S(sV Commit recorded changes, turn off recording, return changes. (RRR(RR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytcommits cCs|jsx9t|jD](}tjj|rtj|qqWt|jdt }x\|D]Q}tj |}|rtjj ||d}tj |ntj |qaWn|j dS(Ntreversei(RtlistRR?R@RRtsortedRRYtlistdirR2trmdirR(RRtdirsRtflisttsd((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytrollbacks  N(RRRRRRRRYRR,RRRRtset_executable_modeRRRRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRQs             cCs|tjkrtj|}n t|}|dkr@|}nG|jd}t||jd}x|D]}t||}qnW|S(Nt.i(RXtmodulest __import__R,R4RZRF(t module_namet dotted_pathtmodR6tpartsRe((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytresolves    t ExportEntrycBs;eZdZedZdZdZejZRS(cCs(||_||_||_||_dS(N(R&RMRKR(RR&RMRKR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs   cCst|j|jS(N(RRMRK(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRscCs d|j|j|j|jfS(Ns(R&RMRKR(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__repr__!scCsdt|tst}nH|j|jko]|j|jko]|j|jko]|j|jk}|S(N(R^RRR&RMRKR(RtotherR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__eq__%s ( RRRRRR R Rt__hash__(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs    s(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P\w+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c CsStj|}|sId}d|ks3d|krOtd|qOn|j}|d}|d}|jd}|dkr|d}}n4|dkrtd|n|jd\}}|d } | dkrd|ksd|kr td|ng} n(g| jd D]} | j^q"} t|||| }|S( Nt[t]sInvalid specification '%s'R&tcallablet:iiRt,( tENTRY_REtsearchR,RRtcountR4R/R( t specificationRR6RR&R@tcolonsRMRKRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRy7s2          (cCs|d krd}ntjdkrHdtjkrHtjjd}ntjjd}tjj|rtj|tj }|st j d|qnGytj |t }Wn-tk rt j d|dt t}nX|s tj}t j d |ntjj||S( s Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. s.distlibtntt LOCALAPPDATAs $localappdatat~s(Directory exists but is not writable: %ssUnable to create %stexc_infos#Default location unusable, using %sN(R,R?R&tenvironR@t expandvarst expanduserRRRRtwarningtmakedirsRYtOSErrorRRRR2(RKR6tusable((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_cache_baseVs&       cCs`tjjtjj|\}}|r?|jdd}n|jtjd}||dS(s Convert an absolute path to a directory name for use in a cache. The algorithm used is: #. On Windows, any ``':'`` in the drive is replaced with ``'---'``. #. Any occurrence of ``os.sep`` is replaced with ``'--'``. #. ``'.cache'`` is appended. Rs---s--s.cache(R?R@t splitdriveRR>RA(R@RRe((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytpath_to_cache_dirs $cCs|jds|dS|S(NR=(tendswith(R5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt ensure_slashscCskd}}d|kr^|jdd\}}d|krC|}q^|jdd\}}n|||fS(Nt@iR(R,R4(tnetloctusernametpasswordRM((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_credentialss    cCs tjd}tj||S(Ni(R?tumask(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_process_umasks cCsFt}d}x3t|D]%\}}t|tst}PqqW|S(N(RYR,t enumerateR^RR(tseqR6tiR5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytis_string_sequencess3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)s -py(\d\.?\d?)cCsd}d}t|jdd}tj|}|r[|jd}||j }n|rt|t|dkrtj tj |d|}|r|j }|| ||d|f}qn|dkrt j |}|r|jd|jd|f}qn|S(sw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None t t-is\biN( R,RR>tPYTHON_VERSIONRRtstartRBtreR.tescapetendtPROJECT_NAME_AND_VERSION(tfilenamet project_nameR6tpyverRtn((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytsplit_filenames"" ! 's-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCsRtj|}|s(td|n|j}|djj|dfS(s A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. s$Ill-formed name/version string: '%s'R&tver(tNAME_VERSION_RER.RRR/R`(ReRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_name_and_versions  cCs t}t|pg}t|p'g}d|krS|jd||O}nx|D]}|dkr||j|qZ|jdr|d}||krtjd|n||kr|j|qqZ||krtjd|n|j|qZW|S(Nt*R3isundeclared extra: %s(RRRt startswithRR(t requestedt availableR6trtunwanted((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt get_extrass&          cCsi}yqt|}|j}|jd}|jdsRtjd|n$tjd|}tj |}Wn&t k r}tj d||nX|S(Ns Content-Typesapplication/jsons(Unexpected response for JSON request: %ssutf-8s&Failed to get external data for %s: %s( R RtgetRCRRRsRtRvRwRzt exception(R+R6tresptheaderstcttreaderte((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt_get_external_datas  s'https://www.red-dove.com/pypi/projects/cCs9d|dj|f}tt|}t|}|S(Ns%s/%s/project.jsoni(tupperR t_external_data_base_urlRP(R&R+R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_project_datas cCs6d|dj||f}tt|}t|S(Ns%s/%s/package-%s.jsoni(RQR RRRP(R&tversionR+((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_package_datastCachecBs)eZdZdZdZdZRS(s A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsvtjj|s"tj|ntj|jd@dkrQtjd|ntjjtjj ||_ dS(su Initialise an instance. :param base: The base directory where the cache should be located. i?isDirectory '%s' is not privateN( R?R@RRRRRRRtnormpathRD(RRD((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR"s cCs t|S(sN Converts a resource prefix to a directory name in the cache. (R$(RRM((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt prefix_to_dir0scCsg}xtj|jD]}tjj|j|}yZtjj|s^tjj|rntj|n"tjj|rt j |nWqt k r|j |qXqW|S(s" Clear the cache. ( R?RRDR@R2RRRRRRRztappend(Rt not_removedtfn((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytclear6s$ (RRt__doc__RRXR\(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRVs  t EventMixincBs>eZdZdZedZdZdZdZRS(s1 A very simple publish/subscribe system. cCs i|_dS(N(t _subscribers(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRKscCs\|j}||kr+t|g|| %s;s %s;t}s (RkRYRmR2(RR6RtRvRsRn((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytdot s    ( RRRRoRRqRRRyRtpropertyRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRjs      3s.tar.gzs.tar.bz2s.tars.zips.tgzs.tbzs.whlc sfd}tjjtd}|dkr|jdrZd}q|jdrxd}d}q|jdrd }d }q|jd rd}d}qtd|nz|dkrt|d}|rZ|j}x|D]}||qWqZnBt j ||}|rZ|j }x|D]}||qCWn|dkrt j ddkrxA|jD]0} t| jts| jjd| _qqWn|jWd|r|jnXdS(Ncs|t|ts!|jd}ntjjtjj|}|j se|tjkrxt d|ndS(Nsutf-8spath outside destination: %r( R^RtdecodeR?R@RR2RCRAR(R@Re(tdest_dirtplen(s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt check_paths !#s.zips.whltzips.tar.gzs.tgzttgzsr:gzs.tar.bz2s.tbzttbzsr:bz2s.tarttarRFsUnknown format for %riisutf-8(s.zips.whl(s.tar.gzs.tgz(s.tar.bz2s.tbz(R?R@RRBR,R%RRtnamelistttarfileRtgetnamesRXRrt getmembersR^R&RRt extractallR~( tarchive_filenameRtformatRRtarchiveRtnamesR&ttarinfo((RRs</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt unarchivesH           c Cstj}t|}t|d}xutj|D]d\}}}xR|D]J}tjj||}||} tjj| |} |j|| qPWq:WWdQX|S(s*zip a directory tree into a BytesIO objectRN( tiotBytesIORBRR?twalkR@R2R( t directoryR6tdlentzftrootRRR&tfulltrelRL((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytzip_dirSs    R$tKtMtGtTtPtProgresscBseZdZdddZdZdZdZdZedZ ed Z d Z ed Z ed Z RS( tUNKNOWNiidcCs8||_|_||_d|_d|_t|_dS(Ni(RtcurtmaxR,tstartedtelapsedRtdone(Rtminvaltmaxval((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRjs    cCsD||_tj}|jdkr0||_n||j|_dS(N(RttimeRR,R(Rtcurvaltnow((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytupdaters    cCs|j|j|dS(N(RR(Rtincr((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt increment|scCs|j|j|S(N(RR(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR5scCs/|jdk r"|j|jnt|_dS(N(RR,RRYR(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytstopscCs|jdkr|jS|jS(N(RR,tunknown(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytmaximumscCsZ|jrd}nD|jdkr*d}n,d|j|j|j|j}d|}|S(Ns100 %s ?? %gY@s%3d %%(RRR,RR(RR6R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt percentages   " cCsU|dkr|jdks-|j|jkr6d}ntjdtj|}|S(Nis??:??:??s%H:%M:%S(RR,RRRtstrftimetgmtime(RtdurationR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytformat_durations- cCs|jrd}|j}nd}|jdkr9d}ne|jdksZ|j|jkrcd}n;t|j|j}||j|j:}|d|j}d||j|fS(NtDonesETA iiis%s: %s(RRRR,RRtfloatR(RRMtt((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytETAs   ! cCsh|jdkrd}n|j|j|j}x(tD] }|dkrLPn|d:}q6Wd||fS(Nigig@@s%d %sB/s(RRRtUNITS(RR6tunit((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytspeeds   (RRRRRRR5RRRRRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRgs    s \{([^}]*)\}s[^/\\,{]\*\*|\*\*[^/\\,}]s^[^{]*\}|\{[^}]*$cCsZtj|r(d}t||ntj|rPd}t||nt|S(sAExtended globbing function that supports ** and {opt1,opt2,opt3}.s7invalid glob %r: recursive glob "**" must be used alones2invalid glob %r: mismatching set marker '{' or '}'(t_CHECK_RECURSIVE_GLOBRRt_CHECK_MISMATCH_SETt_iglob(t path_globR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRsc csmtj|d}t|dkr~|\}}}x3|jdD]4}x+tdj|||fD] }|VqhWqCWnd|krxt|D] }|VqWn|jdd\}}|dkrd}n|dkrd}n|jd}|jd}x]tj|D]L\}}} tj j |}x(ttj j||D] } | VqVWqWdS( NiRR$s**RRBR=s\( t RICH_GLOBR4RBRR2t std_iglobRCR?RR@RW( Rtrich_path_globRMRRKtitemR@tradicaltdirRR[((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs(%      "(t HTTPSHandlertmatch_hostnametCertificateErrortHTTPSConnectioncBseZdZeZdZRS(c Cstj|j|jf|j}t|dtrI||_|jnt t ds|j rmt j }n t j }t j||j|jd|dt jd|j |_nt jt j}|jt jO_|jr|j|j|jni}|j rHt j |_|jd|j tt dtrH|j|d!           N(RRR,RRYRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRsRcBs&eZedZdZdZRS(cCs#tj|||_||_dS(N(tBaseHTTPSHandlerRRR(RRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR#s  cOs7t||}|jr3|j|_|j|_n|S(s This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. (RRR(RRgRhR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt _conn_maker(s   cCs_y|j|j|SWnAtk rZ}dt|jkrTtd|jq[nXdS(Nscertificate verify faileds*Unable to verify server certificate for %s(tdo_openRRtstrtreasonRR(RtreqRO((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt https_open8s(RRRYRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR"s  tHTTPSOnlyHandlercBseZdZRS(cCstd|dS(NsAUnexpected HTTP request on what should be a secure connection: %s(R(RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt http_openLs(RRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRKsiitHTTPcBseZdddZRS(R$cKs5|dkrd}n|j|j|||dS(Ni(R,t_setupt_connection_class(RRRRh((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRXs  N(RRR,R(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRWstHTTPScBseZdddZRS(R$cKs5|dkrd}n|j|j|||dS(Ni(R,RR (RRRRh((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR`s  N(RRR,R(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR _st TransportcBseZddZdZRS(icCs ||_tjj||dS(N(RR R R(RRt use_datetime((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRgs cCs|j|\}}}tdkr<t|d|j}nN|j sY||jdkr}||_|tj|f|_n|jd}|S(NiiRii(ii(t get_host_infot _ver_infoRRt _connectiont_extra_headersR tHTTPConnection(RRthtehtx509R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytmake_connectionks   (RRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR fs t SafeTransportcBseZddZdZRS(icCs ||_tjj||dS(N(RR RR(RRR ((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRxs cCs|j|\}}}|s'i}n|j|dR3(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR2s     tSubprocessMixincBs)eZeddZdZdZRS(cCs||_||_dS(N(tverbosetprogress(RRBRC((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs cCs|j}|j}x{tr|j}|s1Pn|dk rM|||q|sftjjdntjj|jdtjj qW|j dS(s Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Rsutf-8N( RCRBRYtreadlineR,RXtstderrRRtflushR~(RRpRRCRBR5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRN"s     cKstj|dtjdtj|}tjd|jd|jdf}|jtjd|jd|jdf}|j|j |j |j |j dk r|j ddn|j rtjjdn|S(NtstdoutRERRgsdone.tmainsdone. (t subprocesstPopentPIPEt threadingtThreadRNRGR5REtwaitR2RCR,RBRXR(RtcmdRhRett1tt2((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt run_command7s$ $     N(RRRR,RRNRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRAs cCstjdd|jS(s,Normalize a python package name a la PEP 503s[-_.]+R3(R6tsubR`(R&((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytnormalize_nameHs(s.tar.gzs.tar.bz2s.tars.zips.tgzs.tbzs.whl(R$RRRRR(ii(Rst collectionsRt contextlibR*tglobRRRRvtloggingR?RR6RRRt ImportErrorR,RIRXRRRRLtdummy_threadingRR$RtcompatRRRRRR R R R R RRRRRRRRRt getLoggerRRtCOMMARR3tIDENTt EXTRA_IDENTtVERSPECtRELOPtBARE_CONSTRAINTSt DIRECT_REFt CONSTRAINTSt EXTRA_LISTtEXTRASt REQUIREMENTR-t RELOP_IDENTR0R<RTR[R_RgRjRRtcontextmanagerRRRRRRRRRtVERBOSERRyR"R$R&R+R-R1tIR9R4R>R@RARHRPRRRSRURVR^RjtARCHIVE_EXTENSIONSRYRRRRRRRRRRRRRRRrRRR R RRR R!R)R.R2RART(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyts                      . %   /       )           ,H6 ] *)   :+PK!iff locators.pyonu[ abc@s&ddlZddlmZddlZddlZddlZddlZddlZyddlZWne k rddl ZnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.dd l/m0Z0m1Z1dd l2m3Z3m4Z4ej5e6Z7ej8d Z9ej8d ej:Z;ej8d Z<dZ=e>dZ?defdYZ@deAfdYZBdeBfdYZCdeBfdYZDdeAfdYZEdeBfdYZFdeBfdYZGdeBfdYZHd eBfd!YZId"eBfd#YZJeJeHeFd$d%d&d'd(ZKeKjLZLej8d)ZMd*eAfd+YZNdS(,iN(tBytesIOi(tDistlibException(turljointurlparset urlunparset url2pathnamet pathname2urltqueuetquotetunescapet string_typest build_openertHTTPRedirectHandlert text_typetRequestt HTTPErrortURLError(t DistributiontDistributionPatht make_dist(tMetadata( tcached_propertytparse_credentialst ensure_slashtsplit_filenametget_project_datatparse_requirementtparse_name_and_versiont ServerProxytnormalize_name(t get_schemetUnsupportedVersionError(tWheelt is_compatibles^(\w+)=([a-f0-9]+)s;\s*charset\s*=\s*(.*)\s*$stext/html|application/x(ht)?mlshttps://pypi.python.org/pypicCs1|dkrt}nt|dd}|jS(s Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. ttimeoutg@N(tNonet DEFAULT_INDEXRt list_packages(turltclient((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytget_all_distribution_names)s  tRedirectHandlercBs%eZdZdZeZZZRS(sE A class to work around a bug in some Python 3.2.x releases. c Csd}x(dD] }||kr ||}Pq q W|dkrAdSt|}|jdkrt|j|}t|dr|j||q||| Clear any errors which may have been logged. N(RR(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt clear_errorsscCs|jjdS(N(RDtclear(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt clear_cachescCs|jS(N(t_scheme(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _get_schemescCs ||_dS(N(RV(R3tvalue((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _set_schemescCstddS(s= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. s Please implement in the subclassN(tNotImplementedError(R3tname((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _get_projects cCstddS(sJ Return all the distribution names known to this locator. s Please implement in the subclassN(RZ(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytget_distribution_namesscCsj|jdkr!|j|}nE||jkr@|j|}n&|j|j|}||j|<|S(s For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N(RDR#R\RS(R3R[RP((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt get_projects  cCsyt|}tj|j}t}|jd}|rTtt||j}n|j dkd|j k|||fS(su Give an url a score which can be used to choose preferred URLs for a given project release. s.whlthttpsspypi.python.org( Rt posixpathtbasenametpathtTruetendswithR!R t wheel_tagsR.tnetloc(R3R&ttRat compatibletis_wheel((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt score_urls cCs{|}|rw|j|}|j|}||kr?|}n||kratjd||qwtjd||n|S(s{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. sNot replacing %r with %rsReplacing %r with %r(Rjtloggertdebug(R3turl1turl2RPts1ts2((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt prefer_urls    cCs t||S(sZ Attempt to split a filename in project name, version and Python version. (R(R3tfilenamet project_name((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRsc Csd}d}t|\}}}}} } | jjdrXtjd|| ntj| } | r| j\} } n d\} } |}|r|ddkr|d }n|j dryt |}t ||j r|dkrt }n||j|}|ri|jd6|jd6|jd 6t||||| d fd 6d jg|jD]}d jt|d^qdd6}qnWqtk r}tjd|qXn|j |jrtj|}}x|jD]}|j |r|t| }|j||}|s@tjd|nu|\}}}| se|||ri|d6|d6|d 6t||||| d fd 6}|r||d= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. sNot a valid requirement: %rsmatcher: %s (%s)iRRs%s did not match %rs%skipping pre-release version %s of %sserror matching %s with %riR:ssorted list: %siN(RR(R#RRRR.RFt requirementRkRlttypeR<R^R[Rt version_classR}t is_prereleaseRMRRtsortedR:textrasRKRt download_urlsR(R3Rt prereleasesRPtrR.RFtversionstslisttvclstkRxtdtsdR&((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytlocatePsT          $   (s.tar.gzs.tar.bz2s.tars.zips.tgzs.tbz(s.eggs.exes.whl(s.pdfN(s.whl(R<R=R>tsource_extensionstbinary_extensionstexcluded_extensionsR#ReRRIRRRSRURWRYtpropertyR.R\R]R^RjRqRRRRRLR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRBSs.             F  tPyPIRPCLocatorcBs)eZdZdZdZdZRS(s This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). cKs8tt|j|||_t|dd|_dS(s Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. R"g@N(tsuperRRItbase_urlRR'(R3R&tkwargs((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIs cCst|jjS(sJ Return all the distribution names known to this locator. (RR'R%(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]sc Csviid6id6}|jj|t}xF|D]>}|jj||}|jj||}td|j}|d|_|d|_|j d|_ |j dg|_ |j d|_ t |}|r0|d } | d |_|j| |_||_|||RIR]R\(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRs tPyPIJSONLocatorcBs)eZdZdZdZdZRS(sw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. cKs)tt|j|t||_dS(N(RRRIRR(R3R&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIscCstddS(sJ Return all the distribution names known to this locator. sNot available from this locatorN(RZ(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]scCsiid6id6}t|jdt|}yE|jj|}|jj}tj|}t d|j }|d}|d|_ |d|_ |j d|_|j d g|_|j d |_t|}||_|d} |||j RIR]R\(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRs  tPagecBszeZdZejdejejBejBZejdejejBZ dZ ejdejZ e dZ RS(s4 This class represents a scraped HTML page. s (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? s!]+)cCsM||_||_|_|jj|j}|rI|jd|_ndS(sk Initialise an instance with the Unicode page contents and the URL they came from. iN(RRR&t_basetsearchtgroup(R3RR&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIs  s[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsd}t}x|jj|jD]}|jd}|dpv|dpv|dpv|dpv|dpv|d}|d p|d p|d }t|j|}t|}|jj d |}|j ||fq(Wt |d ddt }|S(s Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs@t|\}}}}}}t||t||||fS(sTidy up an URL.(RRR(R&R.RfRbRRR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytclean%sR,trel1trel2trel3trel4trel5trel6RmRnturl3cSsdt|jdS(Ns%%%2xi(tordR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt3R,R:cSs|dS(Ni((Rg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR7R,treverse( Rt_hreftfinditerRt groupdictRRR t _clean_retsubRRRc(R3RRPR}RtrelR&((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytlinkss   (R<R=R>tretcompiletItStXRRRIRRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRs tSimpleScrapingLocatorcBseZdZiejd6dd6dd6ZdddZdZd Z d Z e j d e j Zd Zd ZdZdZdZe j dZdZRS(s A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. tdeflatecCstjdttjS(Ntfileobj(tgziptGzipFileRRR(tb((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRER,RcCs|S(N((R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRFR,tnonei cKstt|j|t||_||_i|_t|_t j |_ t|_ t |_||_tj|_tj|_dS(s Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. N(RRRIRRR"t _page_cacheRt_seenRRGt _to_fetcht _bad_hostsRLtskip_externalst num_workerst threadingtRLockt_lockt_gplock(R3R&R"RR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIIs       cCscg|_xSt|jD]B}tjd|j}|jt|j|jj |qWdS(s Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). ttargetN( t_threadstrangeRRtThreadt_fetcht setDaemonRctstartRM(R3tiRg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt_prepare_threadscs    cCsOx!|jD]}|jjdq Wx|jD]}|jq.Wg|_dS(su Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N(RRRR#R(R3Rg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _wait_threadsps c Csiid6id6}|j||_||_t|jdt|}|jj|jj|j z1t j d||j j ||j jWd|jX|`WdQX|S(NRRs%s/s Queueing %s(RRPRsRRRRRTRRRkRlRRRR(R3R[RPR&((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\}s        s<\b(linux-(i\d86|x86_64|arm\w+)|win(32|-amd64)|macosx-?\d+)\bcCs|jj|S(sD Does an URL refer to a platform-specific download? (tplatform_dependentR(R3R&((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt_is_platform_dependentscCsp|j|rd}n|j||j}tjd|||rl|j|j|j|WdQXn|S(s% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. sprocess_download: %s -> %sN( RR#RRsRkRlRRRP(R3R&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt_process_downloads   c Cst|\}}}}}}|j|j|j|jrGt}n|jrl|j|j rlt}n|j|jst}ny|d krt}nd|d krt}nO|j |rt}n7|j ddd} | j d krt}nt }t jd |||||S( s Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. thomepagetdownloadthttpR_tftpt:iit localhosts#should_queue: %s (%s) from %s -> %s(RR (R R_R (RRdRRRRLRR{RRtsplitRzRcRkRl( R3tlinktreferrerRR.RfRbt_RPthost((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _should_queues*           cCs xtr|jj}zy|r|j|}|dkrEwnx|jD]y\}}||jkrO|jj||j| r|j |||rt j d|||jj |qqOqOWnWn)t k r}|jj t|nXWd|jjX|sPqqWdS(s Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. sQueueing %s from %sN(RcRRKtget_pageR#RRRRRRkRlRRRHR RO(R3R&tpageRRRQ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRs(  !cCst|\}}}}}}|dkrZtjjt|rZtt|d}n||jkr|j|}tj d||nK|j ddd}d}||j krtj d||n t |did d 6}zy7tj d ||jj|d |j} tj d || j} | jdd} tj| r| j} | j} | jd}|r|j|}|| } nd}tj| }|r|jd}ny| j|} Wn tk r| jd} nXt| | }||j| ]*>([^<]+)tzlibt decompressRR#RIRRR\RRRRRRRRRR#R](((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR;s$           ;tDirectoryLocatorcBs2eZdZdZdZdZdZRS(s? This class locates distributions in a directory tree. cKso|jdt|_tt|j|tjj|}tjj |sbt d|n||_ dS(s Initialise an instance. :param path: The root of the directory tree to search. :param kwargs: Passed to the superclass constructor, except for: * recursive - if True (the default), subdirectories are recursed into. If False, only the top-level directory is searched, t recursivesNot a directory: %rN( RRcR'RR&RIRRbtabspathRRtbase_dir(R3RbR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRI5s cCs|j|jS(s Should a filename be considered as a candidate for a distribution archive? As well as the filename, the directory which contains it is provided, though not used by the current implementation. (RdR(R3Rrtparent((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytshould_includeFsc Csiid6id6}xtj|jD]\}}}x|D]}|j||r=tjj||}tddttjj|dddf}|j ||}|r|j ||qq=q=W|j s'Pq'q'W|S(NRRRR,( RtwalkR)R+RbRRRR(RRR'( R3R[RPtroottdirstfilestfnR&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\Ns"   c Cst}xtj|jD]\}}}x|D]}|j||r2tjj||}tddttjj |dddf}|j |d}|r|j |dqq2q2W|j sPqqW|S(sJ Return all the distribution names known to this locator. RR,R[N(RRR,R)R+RbRRRR(RR#RR'(R3RPR-R.R/R0R&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]^s "   (R<R=R>RIR+R\R](((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR&0s    t JSONLocatorcBs eZdZdZdZRS(s This locator uses special extended metadata (not available on PyPI) and is the basis of performant dependency resolution in distlib. Other locators require archive downloads before dependencies can be determined! As you might imagine, that can be slow. cCstddS(sJ Return all the distribution names known to this locator. sNot available from this locatorN(RZ(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]xscCsBiid6id6}t|}|r>x|jdgD]}|ddks9|ddkreq9nt|d|d d |jd d d |j}|j}|d |_d|kr|drd|df|_n|jdi|_|jdi|_|||j <|dj |j t j |d q9Wn|S(NRRR/tptypetsdistt pyversiontsourceR[RxRsPlaceholder for summaryR.R&RRt requirementstexports( RRKRR.RRRt dependenciesR7RxRRR(R3R[RPRRRR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\~s&        .(R<R=R>R]R\(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR1qs tDistPathLocatorcBs eZdZdZdZRS(s This locator finds installed distributions in a path. It can be useful for adding to an :class:`AggregatingLocator`. cKs#tt|j|||_dS(ss Initialise an instance. :param distpath: A :class:`DistributionPath` instance to search. N(RR9RItdistpath(R3R:R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIscCs|jj|}|dkr5iid6id6}nGi||j6it|jg|j6d6itdg|j6d6}|S(NRR(R:tget_distributionR#RxRR(R3R[RRP((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\s  (R<R=R>RIR\(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR9s tAggregatingLocatorcBsPeZdZdZdZdZeejj eZdZ dZ RS(sI This class allows you to chain and/or merge a list of locators. cOs8|jdt|_||_tt|j|dS(s Initialise an instance. :param locators: The list of locators to search. :param kwargs: Passed to the superclass constructor, except for: * merge - if False (the default), the first successful search from any of the locators is returned. If True, the results from all locators are merged (this can be slow). tmergeN(RRLR=tlocatorsRR<RI(R3R>R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIs  cCs5tt|jx|jD]}|jqWdS(N(RR<RUR>(R3R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRUscCs*||_x|jD]}||_qWdS(N(RVR>R.(R3RXR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRYs c Cs]i}xP|jD]E}|j|}|r|jr|jdi}|jdi}|j||jd}|r|rxF|jD]5\}} ||kr||c| OR^R=RKtupdateRRFR#RcRLR}( R3R[RPRRR/RtdfRRtddtfound((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\s8         cCsIt}x9|jD].}y||jO}Wqtk r@qXqW|S(sJ Return all the distribution names known to this locator. (RR>R]RZ(R3RPR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]s  ( R<R=R>RIRURYRRBR.tfgetR\R](((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR<s    ,shttps://pypi.python.org/simple/R"g@R.tlegacys1(?P[\w-]+)\s*\(\s*(==\s*)?(?P[^)]+)\)$tDependencyFindercBsVeZdZddZdZdZdZdZdZ de dZ RS( s0 Locate dependencies for distributions. cCs(|p t|_t|jj|_dS(sf Initialise an instance, using the specified locator to locate distributions. N(tdefault_locatorRRR.(R3R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIscCstjd||j}||j|<||j||jf= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. t cantreplace( treqtsRRQR}RxRt frozensetRLRORRLRc( R3RRtothertproblemstrlistt unmatchedRNRFRP((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyttry_to_replaceos"       # cCsi|_i|_i|_i|_t|p0g}d|krk|jd|tdddgO}nt|tr|}}tj d|nK|j j |d|}}|dkrt d|ntj d|t|_t}t|g}t|g}x|r|j}|j} | |jkrO|j|n/|j| } | |kr~|j|| |n|j|jB} |j} t} ||krxAdD]6}d |}||kr| t|d |O} qqWn| | B| B}x|D]}|j|}|s+tj d||j j |d|}|dkrv| rv|j j |dt}n|dkrtj d||jd|fq+|j|j}}||f|jkr|j|n|j||| kr+||kr+|j|tj d|jq+nxw|D]o}|j} | |jkrr|jj|tj|q2|j| } | |kr2|j|| |q2q2WqWqWt|jj}x<|D]4}||k|_|jrtj d|jqqWtj d|||fS(s Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. s:*:s:test:s:build:s:dev:spassed %s as requirementRsUnable to locate %rs located %sttesttbuildtdevs:%s:s %s_requiressNo providers found for %rsCannot satisfy %rt unsatisfiedsAdding %s to install_distss#%s is a build-time dependency only.sfind done for %sN(R\R]R^(RJRHRGRURRMt isinstanceRRkRlRRR#RRct requestedRR:RLR[t run_requirest meta_requirestbuild_requirestgetattrRSRRxtname_and_versionRtvaluestbuild_time_dependency(R3Rt meta_extrasRRRRXttodot install_distsR[RWtireqtstsreqtstereqtsR:RQt all_reqtsRt providersRRtnRRKRH((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytfinds                      !       "  "   N( R<R=R>R#RIRLRORQRSR[RLRr(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyREs      ((ORtioRRtloggingRR`RRt ImportErrortdummy_threadingR$R,RtcompatRRRRRRRR R R R R1R RRRtdatabaseRRRRRtutilRRRRRRRRRRxRRRR R!t getLoggerR<RkRR|RRRR$R#R(R)tobjectRBRRRRR&R1R9R<RFRtNAME_VERSION_RERE(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytsV        d@ :0E:A&[    PK!|j$$util.pycnu[ abc@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZyddlZWnek rdZnXddlZddlZddlZddlZddlZyddlZWnek r9ddlZnXddlZddlmZddlmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e j1e2Z3dZ4e j5e4Z6dZ7d e7d Z8e7d Z9d Z:d e:de9de4d e:de9dZ;dZ<de;de<de;dZ=e8d e4e8dZ>de>dZ?de7de?de=dZ@e j5e@ZAde:de9d ZBe j5eBZCdZDd ZEd!ZFd"ZGddd#ZHd$ZId%ZJd&ZKejLd'ZMejLd(ZNejLd)d*ZOd+ePfd,YZQd-ZRd.ePfd/YZSd0ZTd1ePfd2YZUe j5d3e jVZWd4ZXdd5ZYd6ZZd7Z[d8Z\d9Z]d:Z^e j5d;e j_Z`e j5d<Zadd=Zbe j5d>Zcd?Zdd@ZedAZfdBZgdCZhdDZidEePfdFYZjdGePfdHYZkdIePfdJYZldZmdendRZodSZpdZqdZePfd[YZre j5d\Zse j5d]Zte j5d^Zud_Zd`ZverddalmwZxmyZymzZzdbe%j{fdcYZ{ddexfdeYZwdfewe(fdgYZ|nej}dh Z~e~dkr dje%jfdkYZer dle%jfdmYZq ndne&jfdoYZerFdpe&jfdqYZndre&jfdsYZdtZduePfdvYZdwefdxYZdyefdzYZd{e)fd|YZd}ePfd~YZdZdS(iN(tdeque(tiglobi(tDistlibException(t string_typest text_typetshutilt raw_inputtStringIOtcache_from_sourceturlopenturljointhttplibt xmlrpclibt splittypet HTTPHandlertBaseConfiguratort valid_identt Containert configparsertURLErrortZipFiletfsdecodetunquotes\s*,\s*s (\w|[.-])+s(\*|:(\*|\w+):|t)s\*?s([<>=!~]=)|[<>]t(s)?\s*(s)(s)\s*(s))*s(from\s+(?P.*))s \(\s*(?Pt|s)\s*\)|(?Ps\s*)s)*s \[\s*(?Ps)?\s*\]s(?Ps \s*)?(\s*s)?$s(?Ps )\s*(?Pc Cskd}d}tj|}|rg|j}|d}|dpK|d}|dsad}nd}|dj}|sd}d}|d} n{|ddkrd |}ntj|} g| D]}||^q}d |d jg|D]} d | ^qf} |d s$d} ntj |d } t d|d|d| d| d|d|}n|S(NcSs|j}|d|dfS(Ntoptvn(t groupdict(tmtd((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_constraintYs tdntc1tc2tdireftis<>!=s~=s%s (%s)s, s%s %stextnamet constraintstextrast requirementtsourceturl( tNonetREQUIREMENT_REtmatchRtstriptRELOP_IDENT_REtfinditertjointCOMMA_REtsplitR( tsRtresultRRR&tconsR+tconstrtrstiteratortconR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_requirementWs4       0  cCsd}i}x|D]\}}}tjj||}xt|D]}tjj||} xt| D]v} ||| } |dkr|j| dqo||| } |jtjjdjd} | d| || RAtrstrip(tresources_roottrulesRGt destinationsRFtsuffixtdesttprefixtabs_basetabs_globtabs_patht resource_filetrel_pathtrel_dest((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_resources_dests|s  !cCs:ttdrt}ntjttdtjk}|S(Nt real_prefixt base_prefix(thasattrtsystTrueROtgetattr(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytin_venvs cCs7tjjtj}t|ts3t|}n|S(N(R?R@tnormcaseRZt executablet isinstanceRR(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_executables cCs|}xwtrt|}|}| r7|r7|}n|r |dj}||kr]Pn|r|d|||f}q|q q W|S(Nis %c: %s %s(R[Rtlower(tpromptt allowed_charst error_prompttdefaulttpR5tc((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytproceeds     cCsVt|tr|j}ni}x+|D]#}||kr+||||R$cCstjj|}||jkrtjj| r|jj|tjj|\}}|j|tj d||j stj |n|j r|j j|qndS(Ns Creating %s(R?R@RRRRR4RRRRtmkdirRR(RR@RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs"   cCst|| }tjd|||js|sD|j||r{|sSd}q{|j|sht|t|}nt j |||t n|j ||S(NsByte-compiling %s to %s( RRRRRR,RBRCRDt py_compiletcompileR[R(RR@toptimizetforceROtdpathtdiagpath((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt byte_compiles   cCstjj|rtjj|rtjj| rtjd||js`tj |n|j r ||j kr|j j |qq qtjj|rd}nd}tjd|||jstj |n|j r||j kr |j j |q qndS(NsRemoving directory tree at %stlinktfilesRemoving %s %s(R?R@RRRRtdebugRRRRRRR(RR@R5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytensure_removeds"%     cCsjt}x]|setjj|r:tj|tj}Pntjj|}||kr\Pn|}q W|S(N(RR?R@RtaccesstW_OKR(RR@R6tparent((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt is_writables   cCs/|jst|j|jf}|j|S(sV Commit recorded changes, turn off recording, return changes. (RRCRRR(RR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytcommits cCs|jsx9t|jD](}tjj|rtj|qqWt|jdt }xq|D]f}tj |}|r|dgkst tjj ||d}tj |ntj |qaWn|jdS(Ntreverset __pycache__i(RtlistRR?R@RRtsortedRR[tlistdirRCR2trmdirR(RRtdirsRtflisttsd((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytrollbacks  N(RRRRRRRR[RR,RRRRtset_executable_modeRRRRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRQs             cCs|tjkrtj|}n t|}|dkr@|}nG|jd}t||jd}x|D]}t||}qnW|S(Nt.i(RZtmodulest __import__R,R4R\RH(t module_namet dotted_pathtmodR6tpartsRg((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytresolves    t ExportEntrycBs;eZdZedZdZdZejZRS(cCs(||_||_||_||_dS(N(R&RORMR(RR&RORMR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs   cCst|j|jS(N(R RORM(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRscCs d|j|j|j|jfS(Ns(R&RORMR(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__repr__!scCsdt|tst}nH|j|jko]|j|jko]|j|jko]|j|jk}|S(N(R`R RR&RORMR(RtotherR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt__eq__%s ( RRRRRR RRt__hash__(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR s    s(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P\w+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c CsStj|}|sId}d|ks3d|krOtd|qOn|j}|d}|d}|jd}|dkr|d}}n4|dkrtd|n|jd\}}|d } | dkrd|ksd|kr td|ng} n(g| jd D]} | j^q"} t|||| }|S( Nt[t]sInvalid specification '%s'R&tcallablet:iiRt,( tENTRY_REtsearchR,RRtcountR4R/R ( t specificationRR6RR&R@tcolonsRORMRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR{7s2          (cCs|d krd}ntjdkrHdtjkrHtjjd}ntjjd}tjj|rtj|tj }|st j d|qnGytj |t }Wn-tk rt j d|dt t}nX|s tj}t j d |ntjj||S( s Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. s.distlibtntt LOCALAPPDATAs $localappdatat~s(Directory exists but is not writable: %ssUnable to create %stexc_infos#Default location unusable, using %sN(R,R?R&tenvironR@t expandvarst expanduserRRRRtwarningtmakedirsR[tOSErrorRRRR2(RMR6tusable((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_cache_baseVs&       cCs`tjjtjj|\}}|r?|jdd}n|jtjd}||dS(s Convert an absolute path to a directory name for use in a cache. The algorithm used is: #. On Windows, any ``':'`` in the drive is replaced with ``'---'``. #. Any occurrence of ``os.sep`` is replaced with ``'--'``. #. ``'.cache'`` is appended. Rs---s--s.cache(R?R@t splitdriveRR>RA(R@RRg((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytpath_to_cache_dirs $cCs|jds|dS|S(NR=(tendswith(R5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt ensure_slashscCskd}}d|kr^|jdd\}}d|krC|}q^|jdd\}}n|||fS(Nt@iR(R,R4(tnetloctusernametpasswordRO((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_credentialss    cCs tjd}tj||S(Ni(R?tumask(R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_process_umasks cCsXt}d}x3t|D]%\}}t|tst}PqqW|dk sTt|S(N(R[R,t enumerateR`RRRC(tseqR6tiR5((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytis_string_sequencess3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)s -py(\d\.?\d?)cCsd}d}t|jdd}tj|}|r[|jd}||j }n|rt|t|dkrtj tj |d|}|r|j }|| ||d|f}qn|dkrt j |}|r|jd|jd|f}qn|S(sw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None t t-is\biN( R,RR>tPYTHON_VERSIONRRtstartRDtreR.tescapetendtPROJECT_NAME_AND_VERSION(tfilenamet project_nameR6tpyverRtn((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytsplit_filenames"" ! 's-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCsRtj|}|s(td|n|j}|djj|dfS(s A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. s$Ill-formed name/version string: '%s'R&tver(tNAME_VERSION_RER.RRR/Rb(RgRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytparse_name_and_versions  cCs t}t|pg}t|p'g}d|krS|jd||O}nx|D]}|dkr||j|qZ|jdr|d}||krtjd|n||kr|j|qqZ||krtjd|n|j|qZW|S(Nt*R6isundeclared extra: %s(RRRRBRR!(t requestedt availableR6trtunwanted((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt get_extrass&          cCsi}yqt|}|j}|jd}|jdsRtjd|n$tjd|}tj |}Wn&t k r}tj d||nX|S(Ns Content-Typesapplication/jsons(Unexpected response for JSON request: %ssutf-8s&Failed to get external data for %s: %s( R RtgetRBRRRuRvRxRyR|t exception(R+R6tresptheaderstcttreaderte((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt_get_external_datas  s'https://www.red-dove.com/pypi/projects/cCs9d|dj|f}tt|}t|}|S(Ns%s/%s/project.jsoni(tupperR t_external_data_base_urlRR(R&R+R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_project_datas cCs6d|dj||f}tt|}t|S(Ns%s/%s/package-%s.jsoni(RSR RTRR(R&tversionR+((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytget_package_datastCachecBs)eZdZdZdZdZRS(s A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsvtjj|s"tj|ntj|jd@dkrQtjd|ntjjtjj ||_ dS(su Initialise an instance. :param base: The base directory where the cache should be located. i?isDirectory '%s' is not privateN( R?R@RR"RRRR!RtnormpathRF(RRF((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR"s cCs t|S(sN Converts a resource prefix to a directory name in the cache. (R'(RRO((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt prefix_to_dir0scCsg}xtj|jD]}tjj|j|}yZtjj|s^tjj|rntj|n"tjj|rt j |nWqt k r|j |qXqW|S(s" Clear the cache. ( R?RRFR@R2RRRRRRR|tappend(Rt not_removedtfn((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytclear6s$ (RRt__doc__RRZR^(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRXs  t EventMixincBs>eZdZdZedZdZdZdZRS(s1 A very simple publish/subscribe system. cCs i|_dS(N(t _subscribers(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRKscCs\|j}||kr+t|g|| %s;s %s;t}s (RmR[RoR2(RR6RvRxRuRp((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytdot s    ( RRRRqRRsRRR{RtpropertyRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRls      3s.tar.gzs.tar.bz2s.tars.zips.tgzs.tbzs.whlc sfd}tjjtd}|dkr|jdrZd}q|jdrxd}d}q|jdrd }d }q|jd rd}d}qtd|nz|dkrt|d}|rZ|j}x|D]}||qWqZnBt j ||}|rZ|j }x|D]}||qCWn|dkrt j ddkrxA|jD]0} t| jts| jjd| _qqWn|jWd|r|jnXdS(Ncs|t|ts!|jd}ntjjtjj|}|j se|tjkrxt d|ndS(Nsutf-8spath outside destination: %r( R`RtdecodeR?R@RR2RBRAR(R@Rg(tdest_dirtplen(s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt check_paths !#s.zips.whltzips.tar.gzs.tgzttgzsr:gzs.tar.bz2s.tbzttbzsr:bz2s.tarttarRHsUnknown format for %riisutf-8(s.zips.whl(s.tar.gzs.tgz(s.tar.bz2s.tbz(R?R@RRDR,R(RRtnamelistttarfileRtgetnamesRZRtt getmembersR`R&RRt extractallR( tarchive_filenameRtformatRRtarchiveRtnamesR&ttarinfo((RRs</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt unarchivesH           c Cstj}t|}t|d}xutj|D]d\}}}xR|D]J}tjj||}||} tjj| |} |j|| qPWq:WWdQX|S(s*zip a directory tree into a BytesIO objectRN( tiotBytesIORDRR?twalkR@R2R( t directoryR6tdlentzftrootRRR&tfulltrelRN((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytzip_dirSs    R$tKtMtGtTtPtProgresscBseZdZdddZdZdZdZdZedZ ed Z d Z ed Z ed Z RS( tUNKNOWNiidcCsV|dks||kst||_|_||_d|_d|_t|_dS(Ni( R,RCRtcurtmaxtstartedtelapsedRtdone(Rtminvaltmaxval((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRjs    cCs}|j|kst|jdks9||jks9t||_tj}|jdkri||_n||j|_dS(N(RRCRR,RttimeRR(Rtcurvaltnow((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytupdaters$   cCs*|dkst|j|j|dS(Ni(RCRR(Rtincr((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt increment|scCs|j|j|S(N(RR(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR8scCs/|jdk r"|j|jnt|_dS(N(RR,RR[R(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytstopscCs|jdkr|jS|jS(N(RR,tunknown(R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytmaximumscCsZ|jrd}nD|jdkr*d}n,d|j|j|j|j}d|}|S(Ns100 %s ?? %gY@s%3d %%(RRR,RR(RR6R((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt percentages   " cCsU|dkr|jdks-|j|jkr6d}ntjdtj|}|S(Nis??:??:??s%H:%M:%S(RR,RRRtstrftimetgmtime(RtdurationR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytformat_durations- cCs|jrd}|j}nd}|jdkr9d}ne|jdksZ|j|jkrcd}n;t|j|j}||j|j:}|d|j}d||j|fS(NtDonesETA iiis%s: %s(RRRR,RRtfloatR(RROtt((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytETAs   ! cCsh|jdkrd}n|j|j|j}x(tD] }|dkrLPn|d:}q6Wd||fS(Nigig@@s%d %sB/s(RRRtUNITS(RR6tunit((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytspeeds   (RRRRRRR8RRRRRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRgs    s \{([^}]*)\}s[^/\\,{]\*\*|\*\*[^/\\,}]s^[^{]*\}|\{[^}]*$cCsZtj|r(d}t||ntj|rPd}t||nt|S(sAExtended globbing function that supports ** and {opt1,opt2,opt3}.s7invalid glob %r: recursive glob "**" must be used alones2invalid glob %r: mismatching set marker '{' or '}'(t_CHECK_RECURSIVE_GLOBRRt_CHECK_MISMATCH_SETt_iglob(t path_globR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRsc cstj|d}t|dkrt|dksBt||\}}}x3|jdD]4}x+tdj|||fD] }|VqWqaWnd|krxt|D] }|VqWn|jdd\}}|dkrd}n|dkr d}n|jd}|jd }x]tj |D]L\}}} tj j |}x(ttj j||D] } | VqtWq7WdS( NiiRR$s**RRER=s\( t RICH_GLOBR4RDRCRR2t std_iglobRER?RR@RY( Rtrich_path_globRORRMtitemR@tradicaltdirRR]((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRs*%      "(t HTTPSHandlertmatch_hostnametCertificateErrortHTTPSConnectioncBseZdZeZdZRS(c Cstj|j|jf|j}t|dtrI||_|jnt t ds|j rmt j }n t j }t j||j|jd|dt jd|j |_nt jt j}|jt jO_|jr|j|j|jni}|j rHt j |_|jd|j tt dtrH|j|d!           N(RRR,RR[RR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRsRcBs&eZedZdZdZRS(cCs#tj|||_||_dS(N(tBaseHTTPSHandlerRRR(RRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR#s  cOs7t||}|jr3|j|_|j|_n|S(s This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. (RRR(RRiRjR6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt _conn_maker(s   cCs_y|j|j|SWnAtk rZ}dt|jkrTtd|jq[nXdS(Nscertificate verify faileds*Unable to verify server certificate for %s(tdo_openRRtstrtreasonRR(RtreqRQ((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt https_open8s(RRR[RRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR"s  tHTTPSOnlyHandlercBseZdZRS(cCstd|dS(NsAUnexpected HTTP request on what should be a secure connection: %s(R(RR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyt http_openLs(RRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRKsiitHTTPcBseZdddZRS(R$cKs5|dkrd}n|j|j|||dS(Ni(R,t_setupt_connection_class(RRRRj((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRXs  N(RRR,R(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR WstHTTPScBseZdddZRS(R$cKs5|dkrd}n|j|j|||dS(Ni(R,R R (RRRRj((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR`s  N(RRR,R(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR _st TransportcBseZddZdZRS(icCs ||_tjj||dS(N(RR R R(RRt use_datetime((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRgs cCs|j|\}}}tdkr<t|d|j}nN|j sY||jdkr}||_|tj|f|_n|jd}|S(NiiRii(ii(t get_host_infot _ver_infoR Rt _connectiont_extra_headersR tHTTPConnection(RRthtehtx509R6((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pytmake_connectionks   (RRRR(((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyR fs t SafeTransportcBseZddZdZRS(icCs ||_tjj||dS(N(RR RR(RRR((s</usr/lib/python2.7/site-packages/pip/_vendor/distlib/util.pyRxs cCs|j|\}}}|s'i}n|j|ds                      . %   /       )           ,H6 ] *)   :+PK!إ.. manifest.pyonu[ abc@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ ej eZejdejZejd ejejBZejd Zdefd YZdS( su Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. iNi(tDistlibException(tfsdecode(t convert_pathtManifests\\w* s#.*?(?= )| (?=$)icBseZdZd dZdZdZdZedZ dZ dZ dZ e d ed Ze d ed Ze d ed Zd ZRS(s~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. cCsYtjjtjj|p!tj|_|jtj|_d|_ t |_ dS(sd Initialise an instance. :param base: The base directory to explore under. N( tostpathtabspathtnormpathtgetcwdtbasetseptprefixtNonetallfilestsettfiles(tselfR ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyt__init__*s- cCsddlm}m}m}g|_}|j}|g}|j}|j}x|r|}tj |} x| D]{} tj j || } tj| } | j } || r|jt | qu|| ru||  ru|| ququWqPWdS(smFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. i(tS_ISREGtS_ISDIRtS_ISLNKN(tstatRRRR R tpoptappendRtlistdirRtjointst_modeR(RRRRR troottstackRtpushtnamestnametfullnameRtmode((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pytfindall9s"          cCsM|j|js-tjj|j|}n|jjtjj|dS(sz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N( t startswithR RRRR RtaddR(Rtitem((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR$TscCs"x|D]}|j|qWdS(s Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N(R$(RtitemsR%((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pytadd_many^s csfdtj}|rgt}x'|D]}|tjj|q7W||O}ngtd|DD]}tjj|^q~S(s8 Return sorted files in directory order csX|j|tjd||jkrTtjj|\}}||ndS(Nsadd_dir added %s(R$tloggertdebugR RRtsplit(tdirstdtparentt_(tadd_dirR(s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR/ls  css!|]}tjj|VqdS(N(RRR*(t.0R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pys {s(RRRRtdirnametsortedR(RtwantdirstresultR+tft path_tuple((R/Rs@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR2gs   cCst|_g|_dS(sClear all collected files.N(RRR (R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pytclear}s cCs|j|\}}}}|dkrcx|D].}|j|dts.tjd|q.q.Wn|dkrx|D]}|j|dt}qvWn{|dkrxl|D].}|j|dtstjd|qqWn3|dkrx$|D]}|j|dt}qWn|dkr`x|D]1}|j|d |s(tjd ||q(q(Wn|d krx|D]}|j|d |}qsWn~|d kr|jdd |stjd |qnG|dkr|jdd |stjd|qntd|dS(sv Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands tincludetanchorsno files found matching %rtexcludesglobal-includes3no files found matching %r anywhere in distributionsglobal-excludesrecursive-includeR s-no files found matching %r under directory %rsrecursive-excludetgrafts no directories found matching %rtprunes4no previously-included directories found matching %rsinvalid action %rN( t_parse_directivet_include_patterntTrueR(twarningt_exclude_patterntFalseR R(Rt directivetactiontpatternstthedirt dirpatterntpatterntfound((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pytprocess_directivesD                    c Cs{|j}t|dkrA|ddkrA|jddn|d}d}}}|dkrt|d krtd |ng|dD]}t|^q}n|dkrt|d krtd|nt|d}g|d D]}t|^q}nT|dkr[t|d krHtd|nt|d}ntd|||||fS(s Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns iiR8R:sglobal-includesglobal-excludesrecursive-includesrecursive-excludeR;R<is$%r expects ...is*%r expects ...s!%r expects a single sunknown action %r(R8R:sglobal-includesglobal-excludesrecursive-includesrecursive-excludeR;R<N(R8R:sglobal-includesglobal-exclude(srecursive-includesrecursive-exclude(R;R<(R*tlentinsertR RR(RRCtwordsRDRERFt dir_patterntword((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR=s:    & & cCszt}|j||||}|jdkr:|jnx9|jD].}|j|rD|jj|t}qDqDW|S(sSelect 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. N( RBt_translate_patternR R R"tsearchRR$R?(RRHR9R tis_regexRIt pattern_reR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR>s  cCsdt}|j||||}x?t|jD].}|j|r.|jj|t}q.q.W|S(stRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions (RBRPtlistRRQtremoveR?(RRHR9R RRRIRSR5((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyRA)s  c Cs|r)t|tr"tj|S|Sntd krY|jdjd\}}}n|r|j|}td krqnd}tjtj j |j d} |d k rtdkr|jd} |j|t |  } n2|j|} | t |t | t |!} tj} tjdkr>d} ntdkrnd| | j | d|f}q|t |t |t |!}d || | | ||f}nC|rtdkrd| |}qd || |t |f}ntj|S(sTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). iiR.ts\s\\t^s.*s%s%s%s%s.*%s%ss%s%s%s(ii(iiN(ii(ii(ii(t isinstancetstrtretcompilet_PYTHON_VERSIONt _glob_to_ret partitiontescapeRRRR R RKR ( RRHR9R RRtstartR.tendRSR t empty_patternt prefix_reR ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyRP=s@   $ !  #   #  cCsStj|}tj}tjdkr0d}nd|}tjd||}|S(sTranslate 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). s\s\\\\s\1[^%s]s((?RARPR](((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyR%s      O / (  6(RjRdtloggingRRZtsysRVRtcompatRtutilRt__all__t getLoggerRhR(R[tMt_COLLAPSE_PATTERNtSt_COMMENTED_LINEt version_infoR\tobjectR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/manifest.pyt s       PK!&Dff version.pyonu[ abc @srdZddlZddlZddlmZddddd d d d gZejeZd e fd YZ de fdYZ de fdYZ ejdZdZeZde fdYZdZde fdYZejddfejddfejddfejddfejddfejd dfejd!d"fejd#d$fejd%d&fejd'd(ff Zejd)dfejd*dfejd+d"fejd!d"fejd,dffZejd-Zd.Zd/Zejd0ejZid1d26d1d36d4d56d1d66d7d86dd6dd"6Zd9Zde fd:YZde fd;YZ ejd<ejZ!d=Z"d>Z#d e fd?YZ$d e fd@YZ%dAe fdBYZ&ie&eeedC6e&ee dDdE6e&e#e%edF6Z'e'dCe'dG=|<|>|!=|={2,3}|~=)?\s*([^\s,]+)$s ^\d+(\.\d+)*$cCs ||kS(N((tvtctp((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytWttcCs||kp||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+YR,s<=cCs||kp||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+ZR,s>=cCs ||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+[R,s==cCs ||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+\R,s===cCs||kp||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+^R,s~=cCs ||kS(N((R(R)R*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+_R,s!=c Cs|jdkrtdn|j|_}|jj|}|s\td|n|jd}|dj|_|jj |_ g}|drg|dj dD]}|j^q}x|D]}|j j|}|s td||fn|j}|dp#d}|d }|j d r|dkr^td |n|d t}} |jj|s|j|qn|j|t}} |j||| fqWnt||_dS(NsPlease specify a version classs Not valid: %rR,iit,sInvalid %r in %rs~=is.*s==s!=s#'.*' not allowed for %r constraintsi(s==s!=(t version_classtNonet ValueErrorR Rtdist_retmatchtgroupstnametlowertkeytsplittcomp_retendswithtTruetnum_retFalsetappendttupleR( RRtmR5tclistR)t constraintstoptvntprefix((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRbs: ,     cCst|tr!|j|}nx|jD]\}}}|jj|}t|trmt||}n|sd||jjf}t |n||||s+t Sq+Wt S(s Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. s%r not implemented for %s( t isinstanceRR0Rt _operatorstgettgetattrR"R RR>R<(Rtversiontoperatort constraintRFtftmsg((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR4scCsJd}t|jdkrF|jdddkrF|jdd}n|S(Niis==s===(s==s===(R1tlenR(Rtresult((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt exact_versions,cCsGt|t|ks*|j|jkrCtd||fndS(Nscannot compare %s and %s(RR6R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs*cCs/|j||j|jko.|j|jkS(N(RR8R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs cCs|j| S(N(R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRscCst|jt|jS(N(R R8R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR!scCsd|jj|jfS(Ns%s(%r)(R"R R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR#scCs|jS(N(R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR$sN(R R R1R0tretcompileR3R:R=RHRR4R&RRRRRR!R#R$(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR'Ns,         %      sk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c CsK|j}tj|}|s4td|n|j}td|djdD}x0t|dkr|ddkr|d }qfW|dsd}nt|d}|dd!}|d d !}|d d !}|d }|dkrd}n|dt|df}|dkr.d}n|dt|df}|dkr]d}n|dt|df}|dkrd}nfg} xQ|jdD]@} | j rdt| f} n d| f} | j | qWt| }|s| r|rd}qd}n|s&d}n|s5d}n||||||fS(NsNot a valid version: %scss|]}t|VqdS(N(tint(t.0R(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys sit.iiiiii i i i tatzt_tfinal(NN((NN((NN(((RXi(RY(RZ(R[( R tPEP440_VERSION_RER4RR5R@R9RPRUR1tisdigitR?( RRAR5tnumstepochtpretposttdevtlocalRtpart((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _pep_440_keysT  #%                      cBsAeZdZdZedddddgZedZRS(sIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCsQt|}tj|}|j}td|djdD|_|S(Ncss|]}t|VqdS(N(RU(RVR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys siRW(t_normalized_keyR\R4R5R@R9t_release_clause(RRRQRAR5((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs   &RXtbR)trcRbcstfdjDS(Nc3s(|]}|r|djkVqdS(iN(t PREREL_TAGS(RVtt(R(s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pys s(tanyR(R((Rs?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR%s(R R R RtsetRjR&R%(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs cCsUt|}t|}||kr(tS|j|s;tSt|}||dkS(NRW(tstrR<t startswithR>RP(txtytn((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _match_prefix"s    cBseZeZidd6dd6dd6dd6dd 6d d 6d d 6dd6ZdZdZdZdZdZ dZ dZ dZ dZ RS(t_match_compatibles~=t _match_ltR-t _match_gtR.t _match_les<=t _match_ges>=t _match_eqs==t_match_arbitrarys===t _match_nes!=cCsx|r"d|ko|jd}n|jd o:|jd}|rn|jjddd}|j|}n||fS(Nt+iii(RRR9R0(RRKRMRFt strip_localR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _adjust_local<scCsj|j|||\}}||kr+tS|j}djg|D]}t|^qA}t|| S(NRW(R~R>RgtjoinRnRs(RRKRMRFtrelease_clausetitpfx((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRuJs   (cCsj|j|||\}}||kr+tS|j}djg|D]}t|^qA}t|| S(NRW(R~R>RgRRnRs(RRKRMRFRRR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRvRs   (cCs%|j|||\}}||kS(N(R~(RRKRMRF((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRwZscCs%|j|||\}}||kS(N(R~(RRKRMRF((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRx^scCsC|j|||\}}|s0||k}nt||}|S(N(R~Rs(RRKRMRFRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRybs cCst|t|kS(N(Rn(RRKRMRF((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRzjscCsD|j|||\}}|s0||k}nt|| }|S(N(R~Rs(RRKRMRFRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR{ms cCs|j|||\}}||kr+tS||kr;tS|j}t|dkrc|d }ndjg|D]}t|^qp}t||S(NiiRW(R~R<R>RgRPRRnRs(RRKRMRFRRR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRtus    ((R R RR0RHR~RuRvRwRxRyRzR{Rt(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR-s&         s[.+-]$R,s^[.](\d)s0.\1s^[.-]s ^\((.*)\)$s\1s^v(ersion)?\s*(\d+)s\2s^r(ev)?\s*(\d+)s[.]{2,}RWs\b(alfa|apha)\btalphas\b(pre-alpha|prealpha)\bs pre.alphas \(beta\)$tbetas ^[:~._+-]+s [,*")([\]]s[~:+_ -]s\.$s (\d+(\.\d+)*)c Cs|jj}x&tD]\}}|j||}qW|sJd}ntj|}|snd}|}n|jdjd}g|D]}t|^q}x#t |dkr|j dqWt |dkr||j }nDdj g|dD]}t |^q||j }|d }dj g|D]}t |^qB}|j}|rx)tD]\}}|j||}qvWn|s|}n&d|krdnd}|||}t|sd}n|S( s Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. s0.0.0iRWiRbt-R|N(R R7t _REPLACEMENTStsubt_NUMERIC_PREFIXR4R5R9RURPR?tendRRnt_SUFFIX_REPLACEMENTSt is_semverR1( RRQtpattreplRARFtsuffixRtsep((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt_suggest_semantic_versions:  : (    cCs yt||SWntk r%nX|j}xSd2d3d4d5d6d7d8d9d:d;d<d=d>d?d@fD]\}}|j||}qfWtjdd|}tjdd|}tjdd|}tjdd|}tjdd|}|jdr |d }ntjd!d|}tjd"d#|}tjd$d%|}tjd&d|}tjd'd(|}tjd)d(|}tjd*d |}tjd+d,|}tjd-d%|}tjd.d/|}tjd0d1|}yt|Wntk rdA}nX|S(BsSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. s-alphaRXs-betaRhRRRiR)s-finalR,s-pres-releases.releases-stableR|RWRZt s.finalR[spre$tpre0sdev$tdev0s([abc]|rc)[\-\.](\d+)$s\1\2s[\-\.](dev)[\-\.]?r?(\d+)$s.\1\2s[.~]?([abc])\.?s\1R(is\b0+(\d+)(?!\d)s (\d+[abc])$s\g<1>0s\.?(dev-r|dev\.r)\.?(\d+)$s.dev\2s-(a|b|c)(\d+)$s[\.\-](dev|devel)$s.dev0s(?![\.\-])dev$s(final|stable)$s\.?(r|-|-r)\.?(\d+)$s.post\2s\.?(dev|git|bzr)\.?(\d+)$s\.?(pre|preview|-c)(\d+)$sc\g<2>sp(\d+)$s.post\1(s-alphaRX(s-betaRh(RRX(RRh(RiR)(s-finalR,(s-preR)(s-releaseR,(s.releaseR,(s-stableR,(R|RW(RZRW(RR,(s.finalR,(R[R,N(RfRR7treplaceRSRRoR1(RtrstorigR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt_suggest_normalized_versionsH           s([a-z]+|\d+|[\.-])R)R`tpreviewsfinal-RRit@RbcCsd}g}x||D]}|jdr|dkrgx'|rc|ddkrc|jq@Wnx'|r|ddkr|jqjWn|j|qWt|S(NcSsg}xtj|jD]j}tj||}|rd|d koUdknrl|jd}n d|}|j|qqW|jd|S(Nt0it9it*s*final(t _VERSION_PARTR9R7t_VERSION_REPLACERItzfillR?(RRQR*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt get_partsIs   Rs*finalis*final-t00000000(RotpopR?R@(RRRQR*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _legacy_keyHs  cBs eZdZedZRS(cCs t|S(N(R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRcscCsRt}xE|jD]:}t|tr|jdr|dkrt}PqqW|S(NRs*final(R>RRGRRoR<(RRQRp((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR%fs (R R RR&R%(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRbs cBs?eZeZeejZdedt numeric_reR4RntloggertwarningR<R5trsplitRs(RRKRMRFRAR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRtys    ( R R RR0tdictR'RHRSRTRRt(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRqs  sN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs tj|S(N(t _SEMVER_RER4(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRsc Csd}t|}|s*t|n|j}g|d D]}t|^qA\}}}||dd||dd}} |||f|| fS(NcSsi|dkr|f}nM|djd}tg|D]'}|jrV|jdn|^q5}|S(NiRWi(R1R9R@R]R(RtabsentRQRR*((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt make_tuples   :it|iR(RRR5RU( RRRAR5RtmajortminortpatchR`tbuild((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt _semantic_keys  ,'cBs eZdZedZRS(cCs t|S(N(R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRscCs|jdddkS(NiiR(R(R((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR%s(R R RR&R%(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs cBseZeZRS((R R RR0(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRst VersionSchemecBs8eZddZdZdZdZdZRS(cCs||_||_||_dS(N(R8tmatchert suggester(RR8RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs  cCs8y|jj|t}Wntk r3t}nX|S(N(RR0R<RR>(RRRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytis_valid_versions    cCs5y|j|t}Wntk r0t}nX|S(N(RR<RR>(RRRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytis_valid_matchers     cCs|jd|S(s: Used for processing some metadata fields sdummy_name (%s)(R(RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytis_valid_constraint_listscCs+|jdkrd}n|j|}|S(N(RR1(RRRQ((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pytsuggests N(R R R1RRRRR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs     t normalizedcCs|S(N((RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyR+R,tlegacytsemantictdefaultcCs'|tkrtd|nt|S(Nsunknown scheme name: %r(t_SCHEMESR2(R6((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyRs ()R tloggingRStcompatRt__all__t getLoggerR RR2RtobjectR R'RTR\ReRfRRsRRRRRRtIRR1RRRRRRRRRRRR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/version.pyt s~   1k =$ W  . r       #    PK!:Yn database.pyonu[ abc@s0dZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZdd lmZmZmZmZmZmZmZd d d d dgZ ej!e"Z#dZ$dZ%deddde$dfZ&dZ'de(fdYZ)de(fdYZ*de(fdYZ+de+fdYZ,de,fd YZ-d!e,fd"YZ.e-Z/e.Z0d#e(fd$YZ1d%d&Z2d'Z3d(Z4d)Z5dS(*uPEP 376 implementation.i(tunicode_literalsNi(tDistlibExceptiont resources(tStringIO(t get_schemetUnsupportedVersionError(tMetadatatMETADATA_FILENAMEtWHEEL_METADATA_FILENAME(tparse_requirementtcached_propertytparse_name_and_versiont read_exportst write_exportst CSVReadert CSVWriteru DistributionuBaseInstalledDistributionuInstalledDistributionuEggInfoDistributionuDistributionPathupydist-exports.jsonupydist-commands.jsonu INSTALLERuRECORDu REQUESTEDu RESOURCESuSHAREDu .dist-infot_CachecBs)eZdZdZdZdZRS(uL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_t|_dS(uZ Initialise an instance. There is normally one for each DistributionPath. N(tnametpathtFalset generated(tself((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__init__0s  cCs'|jj|jjt|_dS(uC Clear the cache, setting it to its initial state. N(RtclearRRR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR8s  cCsH|j|jkrD||j|j<|jj|jgj|ndS(u` Add a distribution to the cache. :param dist: The distribution to add. N(RRt setdefaulttkeytappend(Rtdist((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytadd@s(t__name__t __module__t__doc__RRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR,s  tDistributionPathcBseZdZd edZdZdZeeeZ dZ dZ dZ e dZdZd Zd d Zd Zd d ZRS(uU Represents a set of distributions installed on a path (typically sys.path). cCsg|dkrtj}n||_t|_||_t|_t|_t|_ t d|_ dS(u Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. udefaultN( tNonetsysRtTruet _include_distt _include_eggRt_cachet _cache_eggt_cache_enabledRt_scheme(RRt include_egg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRNs        cCs|jS(N(R((R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_get_cache_enabledbscCs ||_dS(N(R((Rtvalue((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_set_cache_enabledescCs|jj|jjdS(u, Clears the internal cache. N(R&RR'(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt clear_cachejs c cst}x|jD]}tj|}|dkr:qn|jd}| s|j r`qnt|j}x^|D]V}|j|}| sv|j|krqvn|jr}|j t r}t t g}x<|D]1}t j||} |j| } | rPqqWqvtj| j} td| dd} WdQXtjd|j|j|jt|jd| d|Vqv|jrv|j d rvtjd|j|j|jt|j|VqvqvWqWdS( uD Yield .dist-info and/or .egg(-info) distributions. utfileobjtschemeulegacyNuFound %stmetadatatenvu .egg-infou.egg(u .egg-infou.egg(tsetRRtfinder_for_pathR!tfindt is_containertsortedR$tendswitht DISTINFO_EXTRRt posixpathtjoint contextlibtclosingt as_streamRtloggertdebugRtnew_dist_classR%told_dist_class( RtseenRtfindertrtrsettentrytpossible_filenamestmetadata_filenamet metadata_pathtpydisttstreamR1((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_yield_distributionsrs@       cCs|jj }|jo |jj }|s/|rxF|jD]8}t|trd|jj|q<|jj|q<W|rt|j_n|rt|j_qndS(uk Scan the path for distributions and populate the cache with those that are found. N( R&RR%R'RMt isinstancetInstalledDistributionRR#(Rtgen_disttgen_eggR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_generate_caches  cCs)|jdd}dj||gtS(uo The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: stringu-u_(treplaceR;R9(tclsRtversion((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytdistinfo_dirnamesccs|js(xv|jD] }|VqWnZ|jx|jjjD] }|VqEW|jrx"|jjjD] }|VqpWndS(u5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N(R(RMRRR&RtvaluesR%R'(RR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytget_distributionss     cCsd}|j}|jsNx|jD]}|j|kr(|}Pq(q(Wne|j||jjkr|jj|d}n2|jr||j jkr|j j|d}n|S(u= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` iN( R!tlowerR(RMRRRR&RR%R'(RRtresultR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytget_distributions     c csd}|dk r_y |jjd||f}Wq_tk r[td||fq_Xnx|jD]z}|j}xh|D]`}t|\}}|dkr||kr|VPqq||kr|j|r|VPqqWqlWdS(u Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string u%s (%s)uinvalid name or version: %r, %rN( R!R)tmatchert ValueErrorRRXtprovidesR tmatch( RRRUR\Rtprovidedtptp_nametp_ver((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytprovides_distributions$       cCs;|j|}|dkr.td|n|j|S(u5 Return the path to a resource file. uno distribution named %r foundN(R[R!t LookupErrortget_resource_path(RRt relative_pathR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt get_file_paths ccsxy|jD]k}|j}||kr ||}|dk rY||kru||Vquqxx|jD] }|VqfWq q WdS(u Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N(RXtexportsR!RW(RtcategoryRRREtdtv((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytget_exported_entries"s     N(RRRR!RRR+R-tpropertyt cache_enabledR.RMRRt classmethodRVRXR[RdRhRm(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR Js    *    $ t DistributioncBseZdZeZeZdZedZeZ edZ edZ dZ edZ edZedZed Zed Zd Zd Zd ZdZRS(u A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. cCsp||_|j|_|jj|_|j|_d|_d|_d|_d|_ t |_ i|_ dS(u Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N( R1RRYRRUR!tlocatortdigesttextrastcontextR3t download_urlstdigests(RR1((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRGs        cCs |jjS(uH The source archive download URL for this distribution. (R1t source_url(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRxXscCsd|j|jfS(uX A utility property which displays the name and version in parentheses. u%s (%s)(RRU(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytname_and_versionascCsB|jj}d|j|jf}||kr>|j|n|S(u A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. u%s (%s)(R1R^RRUR(Rtplistts((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR^hs   cCsS|j}tjd|jt||}t|j|d|jd|jS(Nu%Getting requirements from metadata %rRtR2( R1R?R@ttodicttgetattrR3tget_requirementsRtRu(Rtreq_attrtmdtreqts((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_get_requirementsts  cCs |jdS(Nu run_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt run_requires{scCs |jdS(Nu meta_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt meta_requiresscCs |jdS(Nubuild_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytbuild_requiresscCs |jdS(Nu test_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt test_requiresscCs |jdS(Nu dev_requires(R(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt dev_requiressc Cst|}t|jj}y|j|j}Wn@tk rvtjd||j d}|j|}nX|j }t }x]|j D]R}t |\}} ||krqny|j| }PWqtk rqXqW|S(u Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. u+could not read version %r - using name onlyi(R RR1R0R\t requirementRR?twarningtsplitRRR^R R_( RtreqRER0R\RRZRaRbRc((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytmatches_requirements*      cCs6|jrd|j}nd}d|j|j|fS(uC Return a textual representation of this instance, u [%s]uu(RxRRU(Rtsuffix((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__repr__s cCs[t|t|k r!t}n6|j|jkoT|j|jkoT|j|jk}|S(u< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. (ttypeRRRURx(RtotherRZ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__eq__s  cCs't|jt|jt|jS(uH Compute hash in a way which matches the equality test. (thashRRURx(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__hash__s(RRRRtbuild_time_dependencyt requestedRRnRxt download_urlRyR^RRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRq5s$   " tBaseInstalledDistributioncBs,eZdZdZddZddZRS(u] This is the base class for installed distributions (whether PEP 376 or legacy). cCs,tt|j|||_||_dS(u Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N(tsuperRRRt dist_path(RR1RR2((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs  cCs|dkr|j}n|dkr6tj}d}ntt|}d|j}||j}tj|jdj d}d||fS(u Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str uu%s=t=uasciiu%s%sN( R!thasherthashlibtmd5R}Rstbase64turlsafe_b64encodetrstriptdecode(RtdataRtprefixRs((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytget_hashs      !N(RRRR!RRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs ROcBseZdZdZdddZdZdZdZe dZ dZ dZ d Z d Zed Zd Ze d ZedZdZdZdZdZejZRS(u  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). usha256c Cstj||_}|dkr;ddl}|jn|rr|jrr||jjkrr|jj|j }n|dkr$|j t }|dkr|j t }n|dkr|j d}n|dkrt dt |fntj|j}td|dd}WdQXntt|j||||rb|jrb|jj|ny|j d}Wn'tk rddl}|jnX|dk |_dS(NiuMETADATAuno %s found in %sR/R0ulegacyu REQUESTED(RR4RDR!tpdbt set_traceR(R&RR1R5RRR]R<R=R>RRRORRtAttributeErrorR(RRR1R2RDRRERL((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs4  !       cCsd|j|j|jfS(Nu#(RRUR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR2scCsd|j|jfS(Nu%s %s(RRU(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt__str__6sc Csg}|jd}tj|j}td|i}x_|D]W}gtt|dD] }d^qb}||\}} } |j|| | fqFWWdQXWdQX|S(u" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). uRECORDRLiN( tget_distinfo_resourceR<R=R>RtrangetlenR!R( RtresultsRERLt record_readertrowtitmissingRtchecksumtsize((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt _get_records9s (&cCs.i}|jt}|r*|j}n|S(u Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. (RtEXPORTS_FILENAMER (RRZRE((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRiPs cCsLi}|jt}|rHtj|j}t|}WdQXn|S(u Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. N(RRR<R=R>R (RRZRERL((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR ^s cCs8|jt}t|d}t||WdQXdS(u Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. uwN(tget_distinfo_fileRtopenR (RRitrftf((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR msc Cs|jd}tj|jF}td|.}x$|D]\}}||kr@|Sq@WWdQXWdQXtd|dS(uW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. u RESOURCESRLNu3no resource file with relative path %r is installed(RR<R=R>RtKeyError(RRgRERLtresources_readertrelativet destination((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRfxs  ccs x|jD] }|Vq WdS(u Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N(R(RRZ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytlist_installed_filessc Cstjj|d}tjj|j}|j|}tjj|d}|jd}tjd||rwdSt |}x|D]}tjj |s|j d rd} } nCdtjj |} t |d} |j| j} WdQX|j|s(|r@|j|r@tjj||}n|j|| | fqW|j|rtjj||}n|j|ddfWdQX|S( u Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. uuRECORDu creating %su.pycu.pyou%durbN(u.pycu.pyo(tosRR;tdirnamet startswithRR?tinfoR!RtisdirR8tgetsizeRRtreadtrelpathtwriterow( RtpathsRtdry_runtbasetbase_under_prefixt record_pathtwriterRt hash_valueRtfp((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytwrite_installed_filess. ! c Csg}tjj|j}|jd}xn|jD]`\}}}tjj|sptjj||}n||krq7ntjj|s|j|dt t fq7tjj |r7t tjj |}|r||kr|j|d||fq|rd|kr3|jddd}nd }t|dG} |j| j|} | |kr|j|d|| fnWd QXqq7q7W|S( u Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. uRECORDuexistsusizeu=iiurbuhashN(RRRRRtisabsR;texistsRR#RtisfiletstrRRR!RRR( Rt mismatchesRRRRRt actual_sizeRRt actual_hash((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytcheck_installed_filess.    ,cCsi}tjj|jd}tjj|rtj|ddd}|jj}WdQXx[|D]P}|jdd\}}|dkr|j |gj |qj|||su%s (%s)( RtstripRR?RR Rtt constraintsRRR;(RtreqsRRREtcons((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytparse_requires_dataos&       csRg}y4tj|dd}|j}WdQXWntk rMnX|S(uCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. uruutf-8N(RRRtIOError(treq_pathRR(R(s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytparse_requires_paths u.egguEGG-INFOuPKG-INFORR0ulegacyu requires.txtuEGG-INFO/PKG-INFOuutf8R/uEGG-INFO/requires.txtuutf-8u .egg-infou,path must end with .egg-info or .egg, got %r(R!R8RRRR;Rt zipimportt zipimporterRtget_dataRRRtadd_requirements( RRtrequiresRt meta_pathR1RtzipfR/R((Rs@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRls:     cCsd|j|j|jfS(Nu!(RRUR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRscCsd|j|jfS(Nu%s %s(RRU(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRscCsg}tjj|jd}tjj|rx`|jD]O\}}}||kr^q=ntjj|s=|j|dttfq=q=Wn|S(u Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. uinstalled-files.txtuexists(RRR;RRRR#R(RRRRt_((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs  #c Cs2d}d}tjj|jd}g}tjj|r.tj|ddd}x|D]}|j}tjjtjj|j|}tjj|stj d||j d rqdqntjj |sd|j |||||fqdqdWWd QX|j |d d fn|S( u Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) cSs@t|d}z|j}Wd|jXtj|jS(Nurb(RRtcloseRRt hexdigest(RRtcontent((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_md5s  cSstj|jS(N(Rtstattst_size(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyt_sizesuinstalled-files.txturRuutf-8uNon-existent file: %su.pycu.pyoN(u.pycu.pyo(RRR;RRRRtnormpathR?RR8RRR!(RRRRRZRRRa((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs"    $ /c cstjj|jd}t}tj|ddd}x|D]}|j}|dkrjt}q@n|s@tjjtjj|j|}|j |jr|r|Vq|Vqq@q@WWdQXdS(u  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths uinstalled-files.txturRuutf-8u./N( RRR;R#RRRRRR(RtabsoluteRtskipRRRa((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRs    $cCst|to|j|jkS(N(RNRR(RR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRsN(RRRR#RRR!RRRRRRRRRRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyRNs  K    &  tDependencyGraphcBsheZdZdZdZd dZdZdZddZ e dZ d Z d Z RS( u Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dS(N(tadjacency_listt reverse_listR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pyR.s  cCsg|j| "%s" [label="%s"] u "%s" -> "%s" usubgraph disconnected { ulabel = "Disconnected" ubgcolor = red u"%s"u u} N(RRtitemsRRR!R(RRtskip_disconnectedt disconnectedRtadjsRR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/database.pytto_dotgs&    %    cCs=g}i}x(|jjD]\}}|||t|jD])\}}|sZ|j|||=qZqZW|sPnxO|jD]A\}}g|D]$\}}||kr||f^q||sL         4  7F 6  PK!7JJ metadata.pycnu[ abc@sdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZejeZd e fd YZd e fdYZde fdYZde fdYZdddgZdZ dZ!ej"dZ#ej"dZ$ddddddd d!d"d#d$f Z%ddddd%ddd d!d"d#d$d&d'd(d)d*fZ&d(d)d*d&d'fZ'ddddd%ddd d!d"d#d+d,d$d&d'd-d.d/d0d1d2fZ(d/d0d1d-d2d+d,d.fZ)ddddd%ddd d!d"d#d+d,d$d&d'd-d.d/d0d1d2d3d4d5d6d7fZ*d3d7d4d5d6fZ+e,Z-e-j.e%e-j.e&e-j.e(e-j.e*ej"d8Z/d9Z0d:Z1idd;6dd<6dd=6dd>6d%d?6dd@6ddA6d dB6d!dC6d"dD6d#dE6d+dF6d,dG6d$dH6d&dI6d'dJ6d-dK6d/dL6d0dM6d5dN6d1dO6d2dP6d*dQ6d)dR6d(dS6d.dT6d3dU6d4dV6d6dW6d7dX6Z2d0d-d/fZ3d1fZ4dfZ5dd&d(d*d)d-d/d0d2d.d%d5d7d6fZ6d.fZ7d fZ8d"d+ddfZ9e:Z;ej"dYZ<e=dZZ>d[e:fd\YZ?d]Z@d^ZAd_e:fd`YZBdS(auImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). i(tunicode_literalsN(tmessage_from_filei(tDistlibExceptiont __version__(tStringIOt string_typest text_type(t interpret(textract_by_keyt get_extras(t get_schemetPEP440_VERSION_REtMetadataMissingErrorcBseZdZRS(uA required metadata is missing(t__name__t __module__t__doc__(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR stMetadataConflictErrorcBseZdZRS(u>Attempt to read or write metadata fields that are conflictual.(R RR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR st MetadataUnrecognizedVersionErrorcBseZdZRS(u Unknown metadata version number.(R RR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR$stMetadataInvalidErrorcBseZdZRS(uA metadata value is invalid(R RR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR(suMetadatauPKG_INFO_ENCODINGuPKG_INFO_PREFERRED_VERSIONuutf-8u1.1u \|u uMetadata-VersionuNameuVersionuPlatformuSummaryu DescriptionuKeywordsu Home-pageuAuthoru Author-emailuLicenseuSupported-Platformu Classifieru Download-URLu ObsoletesuProvidesuRequiresu MaintaineruMaintainer-emailuObsoletes-Distu Project-URLu Provides-Distu Requires-DistuRequires-PythonuRequires-ExternaluPrivate-Versionu Obsoleted-ByuSetup-Requires-Distu ExtensionuProvides-Extrau"extra\s*==\s*("([^"]+)"|'([^']+)')cCsP|dkrtS|dkr tS|dkr0tS|dkr@tSt|dS(Nu1.0u1.1u1.2u2.0(t _241_FIELDSt _314_FIELDSt _345_FIELDSt _426_FIELDSR(tversion((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt_version2fieldlistgs    c Csd}g}xB|jD]4\}}|gdd fkrCqn|j|qWddddg}x|D]}|tkrd|kr|jdn|tkrd|kr|jdn|tkrd|kr|jdn|tkrmd|krm|jdqmqmWt|dkr1|dSt|dkrRt d nd|koj||t }d|ko||t }d|ko||t }t |t |t |dkrt d n| r| r| rt|krtSn|r dS|rdSdS( u5Detect the best version depending on the fields used.cSs%x|D]}||krtSqWtS(N(tTruetFalse(tkeystmarkerstmarker((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt _has_markerus  uUNKNOWNu1.0u1.1u1.2u2.0iiuUnknown metadata setu(You used incompatible 1.1/1.2/2.0 fieldsN(titemstNonetappendRtremoveRRRtlenRt _314_MARKERSt _345_MARKERSt _426_MARKERStinttPKG_INFO_PREFERRED_VERSION( tfieldsRRtkeytvaluetpossible_versionstis_1_1tis_1_2tis_2_0((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt _best_versionssB  & umetadata_versionunameuversionuplatformusupported_platformusummaryu descriptionukeywordsu home_pageuauthoru author_emailu maintainerumaintainer_emailulicenseu classifieru download_urluobsoletes_distu provides_distu requires_distusetup_requires_disturequires_pythonurequires_externalurequiresuprovidesu obsoletesu project_urluprivate_versionu obsoleted_byu extensionuprovides_extrau[^A-Za-z0-9.]+cCsG|r9tjd|}tjd|jdd}nd||fS(uhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.u-u u.u%s-%s(t _FILESAFEtsubtreplace(tnameRt for_filename((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt_get_name_and_versions!tLegacyMetadatacBs4eZdZdddddZdZdZdZdZdZ dZ d Z d Z d Z d Zed ZdZdZdZdZedZedZddZdZedZedZedZdZdZdZdZ dZ!dZ"RS( uaThe legacy metadata of a release. Supports versions 1.0, 1.1 and 1.2 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name udefaultcCs|||gjddkr-tdni|_g|_d|_||_|dk rm|j|nB|dk r|j|n&|dk r|j ||j ndS(Niu'path, fileobj and mapping are exclusive( tcountR t TypeErrort_fieldstrequires_filest _dependenciestschemetreadt read_filetupdatetset_metadata_version(tselftpathtfileobjtmappingR=((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt__init__s        cCst|j|jdJscCst|}|d|jdtj|ddd}z|j||Wd|jXdS(u&Write the metadata fields to filepath.uwRbuutf-8N(RcRdt write_fileRe(RBRft skip_unknownRg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRGhscCs<|jx+t|dD]}|j|}|rT|dgdgfkrTqn|tkr|j||dj|qn|tkr|dkr|jd kr|jdd}q|jdd }n|g}n|t krg|D]}dj|^q}nx!|D]}|j|||qWqWd S( u0Write the PKG-INFO format data to a file object.uMetadata-VersionuUNKNOWNu,u Descriptionu1.0u1.1u u u |N(u1.0u1.1( RARRIRVRHtjoinRURXR3Ri(RBt fileobjectRqRnRoR+((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRpps$      % c sfd}|sn^t|drRxL|jD]}||||q4Wn$x!|D]\}}|||qYW|rx*|jD]\}}|||qWndS(uSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs2|tkr.|r.jj||ndS(N(RTRKRM(R*R+(RB(s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt_setsukeysN(thasattrRR(RBtothertkwargsRttktv((RBs@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR@s cCs|j|}|tks'|dkrt|ttf rt|trwg|jdD]}|j^q\}qg}nF|tkrt|ttf rt|tr|g}qg}nt j t j r|d}t |j}|tkrR|d k rRx|D];}|j|jddst jd|||qqWq|tkr|d k r|j|st jd|||qq|tkr|d k r|j|st jd|||qqn|tkr|dkr|j|}qn||j|d?d@f }i}x;|D]3\}}| sf||jkrD|||||D]3\}}| sk||jkrI||||(t __class__R R4R(RB((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt__repr__msN(#R RRR RFRARHRJRLRPRQRMRWR[R]RR_R`RaR>R?RGRpR@RKRRIRRRRRRoRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR7s>                     ,  , ;    u pydist.jsonu metadata.jsontMetadatacBseZdZejdZejdejZeZ ejdZ dZ de Z id>d6d?d6d@d 6Zd Zd ZiedAfd 6edBfd6e dCfd6e dDfd 6ZdEZdFdFdFddZedGZdFefZdFefZi defd6defd6ed6ed6ed6defd6ed6ed6ed6ed 6d!efd"6dHd$6dId 6Z[[d&ZdFd'Zd(Zed)Z ed*Z!e!j"d+Z!dFdFd,Z#ed-Z$ed.Z%e%j"d/Z%d0Z&d1Z'd2Z(d3Z)id4d6d5d6d6d6d7d 6d8d96d!d"6Z*d:Z+dFdFe,e-d;Z.d<Z/d=Z0RS(Ju The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. u ^\d+(\.\d+)*$u!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$u .{1,2047}u2.0u distlib (%s)unameuversionulegacyusummaryuqname version license summary description author author_email keywords platform home_page classifiers download_urluwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environmentsumetadata_versionu_legacyu_datauschemeudefaultcCs|||gjddkr-tdnd|_d|_||_|dk ry|j||||_Wqtk rtd|d||_|j qXnd}|rt |d}|j }WdQXn|r|j }n|dkri|j d6|j d6|_nt|ts?|jd}ny)tj||_|j|j|Wn9tk rtd t|d||_|j nXdS( Niu'path, fileobj and mapping are exclusiveRER=urbumetadata_versionu generatoruutf-8RD(R8R R9t_legacyt_dataR=t_validate_mappingRR7tvalidateRdR>tMETADATA_VERSIONt GENERATORRzRtdecodetjsontloadst ValueErrorR(RBRCRDRER=Rtf((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRFs>          ulicenseukeywordsu Requires-Distu run_requiresuSetup-Requires-Distubuild_requiresu dev_requiresu test_requiresu meta_requiresuProvides-Extrauextrasumodulesu namespacesuexportsucommandsu Classifieru classifiersu Download-URLu source_urluMetadata-Versionc Cstj|d}tj|d}||kr||\}}|jr|dkrs|dkrgdn|}q|jj|}q|dkrdn|}|d kr|jj||}qt}|}|jjd} | r|dkr| jd |}q|dkrH| jd } | r| j||}qq| jd } | sr|jjd } n| r| j||}qn||kr|}qnQ||krtj||}n0|jr|jj|}n|jj|}|S( Nu common_keysu mapped_keysucommandsuexportsumodulesu namespacesu classifiersu extensionsupython.commandsupython.detailsupython.exports(ucommandsuexportsumodulesu namespacesu classifiers(tobjectt__getattribute__RR RIR( RBR*tcommontmappedtlktmakertresultR+tsentineltd((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRsF           cCso||jkrk|j|\}}|p.|j|krk|j|}|shtd||fqhqkndS(Nu.'%s' is an invalid value for the '%s' property(tSYNTAX_VALIDATORSR=tmatchR(RBR*R+R=tpatternt exclusionstm((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt_validate_valuescCs|j||tj|d}tj|d}||kr||\}}|jr~|dkrntn||j|               cCst|j|jtS(N(R6R4RR(RB((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pytname_and_version@scCsd|jr|jd}n|jjdg}d|j|jf}||kr`|j|n|S(Nu Provides-Distuprovidesu%s (%s)(RRRR4RR!(RBRts((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pytprovidesDs  cCs*|jr||jd}||krL|dkrsd }n|}||||d|kr>|}Pq>q>W|dkri|d6}|jd|n*t|dt|B}t||d(R4RRR RX(RBR4R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyR(s (((ulegacy((ulegacy(ulegacy(ulegacy(u_legacyu_datauschemeN(unameuversionulicenseukeywordsusummary(u Download-URLN(uMetadata-VersionN(1R RRtretcompiletMETADATA_VERSION_MATCHERtIt NAME_MATCHERR tVERSION_MATCHERtSUMMARY_MATCHERRRRRRRRt __slots__R RFRKt common_keysR{t none_listtdictt none_dictt mapped_keysRRRtpropertyRRtsetterRRRRRRRRRRRRGRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyRvs       ,         + ' *     % (CRt __future__RRctemailRRRRtRRtcompatRRRRRtutilRR RR R t getLoggerR R}R RRRt__all__tPKG_INFO_ENCODINGR(RRZRYRRR$RR%RR&RKRRR@tEXTRA_RERR0RTRRRRURiRVRRRR1RR6R7tMETADATA_FILENAMEtWHEEL_METADATA_FILENAMER(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.pyt s                                         8            PK!^00 scripts.pycnu[ abc@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZejeZdjZejdZd Zd Zd efd YZdS( i(tBytesIONi(t sysconfigtdetect_encodingtZipFile(tfinder(t FileOperatortget_export_entryt convert_pathtget_executabletin_venvs s^#!.*pythonw?[0-9.]*([ ].*)?$s|# -*- coding: utf-8 -*- if __name__ == '__main__': import sys, re def _resolve(module, func): __import__(module) mod = sys.modules[module] parts = func.split('.') result = getattr(mod, parts.pop(0)) for p in parts: result = getattr(result, p) return result try: sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) func = _resolve('%(module)s', '%(func)s') rc = func() # None interpreted as 0 except Exception as e: # only supporting Python >= 2.6 sys.stderr.write('%%s\n' %% e) rc = 1 sys.exit(rc) cCsd|kr|jdre|jdd\}}d|kr|jd rd||f}qq|jdsd|}qn|S(Nt s /usr/bin/env it"s%s "%s"s"%s"(t startswithtsplit(t executabletenvt _executable((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt_enquote_executableBs t ScriptMakercBseZdZeZdZeeddZ dZ e j j drZdZdZndddZdZeZd Zd Zdd Zd Zed ZejdZejdksejdkrejdkrdZnddZddZ RS(s_ A class to copy or create scripts from source scripts or callable specifications. cCs||_||_||_t|_t|_tjdkpWtjdkoWtjdk|_ t d|_ |p{t ||_ tjdkptjdkotjdk|_dS(NtposixtjavatsX.Ytnt(RsX.Y(t source_dirt target_dirt add_launcherstFalsetforcetclobbertostnamet_nametset_modetsettvariantsRt_fileopt_is_nt(tselfRRRtdry_runtfileop((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt__init__[s     cCsa|jdtr]|jr]tjj|\}}|jdd}tjj||}n|S(Ntguitpythontpythonw(tgetRR$RtpathR treplacetjoin(R%Rtoptionstdntfn((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt_get_alternate_executableks RcCs[y,t|}|jddkSWdQXWn(ttfk rVtjd|tSXdS(sl Determine if the specified executable is a script (contains a #! line) is#!NsFailed to open %s(topentreadtOSErrortIOErrortloggertwarningR(R%Rtfp((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _is_shellss cCs^|j|r=ddl}|jjjddkrV|Sn|jjdrV|Sd|S(Nisos.nametLinuxs jython.exes/usr/bin/env %s(R;RtlangtSystemt getPropertytlowertendswith(R%RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt_fix_jython_executables RcCst}|jr!|j}t}ntjs9t}nqtrptjj tj ddtj d}n:tjj tj ddtj dtj df}|r|j ||}nt jjdr|j|}ntjj|}|rt|}n|jd}t jd krSd |krSd |krS|d 7}nd ||d}y|jdWn!tk rtd|nX|dkry|j|Wqtk rtd||fqXn|S(Ntscriptsspython%stEXEtBINDIRs python%s%stVERSIONRsutf-8tclis -X:Framess -X:FullFramess -X:Framess#!s s,The shebang (%r) is not decodable from utf-8s?The shebang (%r) is not decodable from the script encoding (%r)(tTrueRRRtis_python_buildRR RR-R/tget_pathtget_config_varR3tsystplatformR RBtnormcaseRtencodetdecodetUnicodeDecodeErrort ValueError(R%tencodingt post_interpR0tenquoteRtshebang((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _get_shebangsL             cCs |jtd|jd|jS(Ntmoduletfunc(tscript_templatetdicttprefixtsuffix(R%tentry((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt_get_script_textscCstjj|}|j|S(N(RR-tbasenametmanifest(R%texenametbase((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt get_manifestscCs|jo|j}tjjd}|s;|||}n||dkrY|jd}n|jd}t} t| d} | jd|WdQX| j } |||| }x|D]} tj j |j | } |rtj j | \}}|jdr|} nd| } y|jj| |Wqltk rtjdd | }tj j|r|tj|ntj| ||jj| |tjd ytj|Wqtk rqXqlXn|jr| jd | rd | |f} ntj j| r:|j r:tjd | qn|jj| ||jrl|jj| gn|j| qWdS(Nsutf-8tpytttws __main__.pys.pys%s.exes:Failed to write executable - trying to use .deleteme logics %s.deletemes0Able to replace executable using .deleteme logict.s%s.%ssSkipping existing file %s(RR$RtlinesepROt _get_launcherRRtwritestrtgetvalueR-R/RtsplitextR R#twrite_binary_filet ExceptionR8R9texiststremovetrenametdebugRARR tset_executable_modetappend(R%tnamesRVt script_bytest filenamestextt use_launcherRitlaunchertstreamtzftzip_dataRtoutnametntetdfname((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _write_scriptsT             c CsQd}|rL|jdg}|rLddj|}|jd}qLn|jd|d|}|j|jd}|j}t} d|jkr| j|nd|jkr| jd|t j d fnd |jkr | jd |t j d fn|r.|jd t r.d} nd} |j | |||| dS(NRtinterpreter_argss %sR sutf-8R0tXs%s%sisX.Ys%s-%siR)tpywRe( R,R/RORWR_RR!R"taddRLtversionRR( R%R^RxR0RTtargsRVtscriptRt scriptnamesRy((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _make_scripts(  !! cCs@t}tjj|jt|}tjj|jtjj|}|j r||j j || r|t j d|dSyt |d}Wn&tk r|jsnd}noX|j}|st jd|j|dStj|jdd}|r&t}|jdp d}n|s|r?|jn|j j|||jrq|j j|gn|j|nt jd||j|j js)t|j\} } |j d |j!| |} d |krd } nd } tjj|} |j"| g| |j#|| n|r<|jndS( Nsnot copying %s (up-to-date)trbs"%s: %s is an empty file (skipping)s s iRscopying and adjusting %s -> %siR+RRe($RRR-R/RRRR`RR#tnewerR8RsR4R7R&tNonetreadlineR9tget_command_namet FIRST_LINE_REtmatchR.RHtgrouptcloset copy_fileR RtRutinfoRtseekRWRR5(R%RRxtadjustRtft first_lineRRTRStlinesRVRyR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _copy_scriptsR$              %cCs |jjS(N(R#R&(R%((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyR&JscCs||j_dS(N(R#R&(R%tvalue((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyR&NsRcCsftjddkrd}nd}d||f}tjddd}t|j|j}|S( NtPit64t32s%s%s.exeRhii(tstructtcalcsizet__name__trsplitRtfindtbytes(R%tkindtbitsRtdistlib_packagetresult((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyRjVs cCsKg}t|}|dkr1|j||n|j||d||S(s Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. R0N(RRRR(R%t specificationR0RxR^((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pytmakeds   cCs4g}x'|D]}|j|j||q W|S(s Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, (textendR(R%tspecificationsR0RxR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt make_multiplews N(!Rt __module__t__doc__tSCRIPT_TEMPLATERZRRRHRR(R3RLRMR R;RBRWR_t_DEFAULT_MANIFESTRaRdRRRtpropertyR&tsetterRRRRjRR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyRRs,  8   2  4-  (tioRtloggingRtreRRLtcompatRRRt resourcesRtutilRRRRR t getLoggerRR8tstripRtcompileRRRtobjectR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyts     (  PK!㚳 locators.pycnu[ abc@s&ddlZddlmZddlZddlZddlZddlZddlZyddlZWne k rddl ZnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.dd l/m0Z0m1Z1dd l2m3Z3m4Z4ej5e6Z7ej8d Z9ej8d ej:Z;ej8d Z<dZ=e>dZ?defdYZ@deAfdYZBdeBfdYZCdeBfdYZDdeAfdYZEdeBfdYZFdeBfdYZGdeBfdYZHd eBfd!YZId"eBfd#YZJeJeHeFd$d%d&d'd(ZKeKjLZLej8d)ZMd*eAfd+YZNdS(,iN(tBytesIOi(tDistlibException(turljointurlparset urlunparset url2pathnamet pathname2urltqueuetquotetunescapet string_typest build_openertHTTPRedirectHandlert text_typetRequestt HTTPErrortURLError(t DistributiontDistributionPatht make_dist(tMetadata( tcached_propertytparse_credentialst ensure_slashtsplit_filenametget_project_datatparse_requirementtparse_name_and_versiont ServerProxytnormalize_name(t get_schemetUnsupportedVersionError(tWheelt is_compatibles^(\w+)=([a-f0-9]+)s;\s*charset\s*=\s*(.*)\s*$stext/html|application/x(ht)?mlshttps://pypi.python.org/pypicCs1|dkrt}nt|dd}|jS(s Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. ttimeoutg@N(tNonet DEFAULT_INDEXRt list_packages(turltclient((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytget_all_distribution_names)s  tRedirectHandlercBs%eZdZdZeZZZRS(sE A class to work around a bug in some Python 3.2.x releases. c Csd}x(dD] }||kr ||}Pq q W|dkrAdSt|}|jdkrt|j|}t|dr|j||q||| Clear any errors which may have been logged. N(RR(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt clear_errorsscCs|jjdS(N(RDtclear(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt clear_cachescCs|jS(N(t_scheme(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _get_schemescCs ||_dS(N(RV(R3tvalue((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _set_schemescCstddS(s= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. s Please implement in the subclassN(tNotImplementedError(R3tname((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _get_projects cCstddS(sJ Return all the distribution names known to this locator. s Please implement in the subclassN(RZ(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytget_distribution_namesscCsj|jdkr!|j|}nE||jkr@|j|}n&|j|j|}||j|<|S(s For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N(RDR#R\RS(R3R[RP((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt get_projects  cCsyt|}tj|j}t}|jd}|rTtt||j}n|j dkd|j k|||fS(su Give an url a score which can be used to choose preferred URLs for a given project release. s.whlthttpsspypi.python.org( Rt posixpathtbasenametpathtTruetendswithR!R t wheel_tagsR.tnetloc(R3R&ttRat compatibletis_wheel((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt score_urls cCs{|}|rw|j|}|j|}||kr?|}n||kratjd||qwtjd||n|S(s{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. sNot replacing %r with %rsReplacing %r with %r(Rjtloggertdebug(R3turl1turl2RPts1ts2((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt prefer_urls    cCs t||S(sZ Attempt to split a filename in project name, version and Python version. (R(R3tfilenamet project_name((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRsc Csd}d}t|\}}}}} } | jjdrXtjd|| ntj| } | r| j\} } n d\} } |}|r|ddkr|d }n|j dryt |}t ||j r|dkrt }n||j|}|ri|jd6|jd6|jd 6t||||| d fd 6d jg|jD]}d jt|d^qdd6}qnWqtk r}tjd|qXn|j |jrtj|}}x|jD]}|j |r|t| }|j||}|s@tjd|nu|\}}}| se|||ri|d6|d6|d 6t||||| d fd 6}|r||d= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. sNot a valid requirement: %rsmatcher: %s (%s)iRRs%s did not match %rs%skipping pre-release version %s of %sserror matching %s with %riR:ssorted list: %siN(RR(R#RRRR.RFt requirementRkRlttypeR<R^R[Rt version_classR}t is_prereleaseRMRRtsortedR:textrasRKRt download_urlsR(R3Rt prereleasesRPtrR.RFtversionstslisttvclstkRxtdtsdR&((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytlocatePsT          $   (s.tar.gzs.tar.bz2s.tars.zips.tgzs.tbz(s.eggs.exes.whl(s.pdfN(s.whl(R<R=R>tsource_extensionstbinary_extensionstexcluded_extensionsR#ReRRIRRRSRURWRYtpropertyR.R\R]R^RjRqRRRRRLR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRBSs.             F  tPyPIRPCLocatorcBs)eZdZdZdZdZRS(s This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). cKs8tt|j|||_t|dd|_dS(s Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. R"g@N(tsuperRRItbase_urlRR'(R3R&tkwargs((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIs cCst|jjS(sJ Return all the distribution names known to this locator. (RR'R%(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]sc Csviid6id6}|jj|t}xF|D]>}|jj||}|jj||}td|j}|d|_|d|_|j d|_ |j dg|_ |j d|_ t |}|r0|d } | d |_|j| |_||_|||RIR]R\(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRs tPyPIJSONLocatorcBs)eZdZdZdZdZRS(sw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. cKs)tt|j|t||_dS(N(RRRIRR(R3R&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIscCstddS(sJ Return all the distribution names known to this locator. sNot available from this locatorN(RZ(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]scCsiid6id6}t|jdt|}yE|jj|}|jj}tj|}t d|j }|d}|d|_ |d|_ |j d|_|j d g|_|j d |_t|}||_|d} |||j RIR]R\(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRs  tPagecBszeZdZejdejejBejBZejdejejBZ dZ ejdejZ e dZ RS(s4 This class represents a scraped HTML page. s (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? s!]+)cCsM||_||_|_|jj|j}|rI|jd|_ndS(sk Initialise an instance with the Unicode page contents and the URL they came from. iN(RRR&t_basetsearchtgroup(R3RR&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIs  s[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsd}t}x|jj|jD]}|jd}|dpv|dpv|dpv|dpv|dpv|d}|d p|d p|d }t|j|}t|}|jj d |}|j ||fq(Wt |d ddt }|S(s Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs@t|\}}}}}}t||t||||fS(sTidy up an URL.(RRR(R&R.RfRbRRR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytclean%sR,trel1trel2trel3trel4trel5trel6RmRnturl3cSsdt|jdS(Ns%%%2xi(tordR(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt3R,R:cSs|dS(Ni((Rg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR7R,treverse( Rt_hreftfinditerRt groupdictRRR t _clean_retsubRRRc(R3RRPR}RtrelR&((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytlinkss   (R<R=R>tretcompiletItStXRRRIRRR(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRs tSimpleScrapingLocatorcBseZdZiejd6dd6dd6ZdddZdZd Z d Z e j d e j Zd Zd ZdZdZdZe j dZdZRS(s A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. tdeflatecCstjdttjS(Ntfileobj(tgziptGzipFileRRR(tb((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRER,RcCs|S(N((R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRFR,tnonei cKstt|j|t||_||_i|_t|_t j |_ t|_ t |_||_tj|_tj|_dS(s Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. N(RRRIRRR"t _page_cacheRt_seenRRGt _to_fetcht _bad_hostsRLtskip_externalst num_workerst threadingtRLockt_lockt_gplock(R3R&R"RR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIIs       cCscg|_xSt|jD]B}tjd|j}|jt|j|jj |qWdS(s Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). ttargetN( t_threadstrangeRRtThreadt_fetcht setDaemonRctstartRM(R3tiRg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt_prepare_threadscs    cCsOx!|jD]}|jjdq Wx|jD]}|jq.Wg|_dS(su Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N(RRRR#R(R3Rg((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _wait_threadsps c Csiid6id6}|j||_||_t|jdt|}|jj|jj|j z1t j d||j j ||j jWd|jX|`WdQX|S(NRRs%s/s Queueing %s(RRPRsRRRRRTRRRkRlRRRR(R3R[RPR&((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\}s        s<\b(linux-(i\d86|x86_64|arm\w+)|win(32|-amd64)|macosx-?\d+)\bcCs|jj|S(sD Does an URL refer to a platform-specific download? (tplatform_dependentR(R3R&((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt_is_platform_dependentscCsp|j|rd}n|j||j}tjd|||rl|j|j|j|WdQXn|S(s% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. sprocess_download: %s -> %sN( RR#RRsRkRlRRRP(R3R&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt_process_downloads   c Cst|\}}}}}}|j|j|j|jrGt}n|jrl|j|j rlt}n|j|jst}ny|d krt}nd|d krt}nO|j |rt}n7|j ddd} | j d krt}nt }t jd |||||S( s Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. thomepagetdownloadthttpR_tftpt:iit localhosts#should_queue: %s (%s) from %s -> %s(RR (R R_R (RRdRRRRLRR{RRtsplitRzRcRkRl( R3tlinktreferrerRR.RfRbt_RPthost((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyt _should_queues*           cCs xtr|jj}zy|r|j|}|dkrEwnx|jD]y\}}||jkrO|jj||j| r|j |||rt j d|||jj |qqOqOWnWn)t k r}|jj t|nXWd|jjX|sPqqWdS(s Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. sQueueing %s from %sN(RcRRKtget_pageR#RRRRRRkRlRRRHR RO(R3R&tpageRRRQ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRs(  !cCst|\}}}}}}|dkrZtjjt|rZtt|d}n||jkr|j|}tj d||nK|j ddd}d}||j krtj d||n t |did d 6}zy7tj d ||jj|d |j} tj d || j} | jdd} tj| r| j} | j} | jd}|r|j|}|| } nd}tj| }|r|jd}ny| j|} Wn tk r| jd} nXt| | }||j| ]*>([^<]+)tzlibt decompressRR#RIRRR\RRRRRRRRRR#R](((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR;s$           ;tDirectoryLocatorcBs2eZdZdZdZdZdZRS(s? This class locates distributions in a directory tree. cKso|jdt|_tt|j|tjj|}tjj |sbt d|n||_ dS(s Initialise an instance. :param path: The root of the directory tree to search. :param kwargs: Passed to the superclass constructor, except for: * recursive - if True (the default), subdirectories are recursed into. If False, only the top-level directory is searched, t recursivesNot a directory: %rN( RRcR'RR&RIRRbtabspathRRtbase_dir(R3RbR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRI5s cCs|j|jS(s Should a filename be considered as a candidate for a distribution archive? As well as the filename, the directory which contains it is provided, though not used by the current implementation. (RdR(R3Rrtparent((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytshould_includeFsc Csiid6id6}xtj|jD]\}}}x|D]}|j||r=tjj||}tddttjj|dddf}|j ||}|r|j ||qq=q=W|j s'Pq'q'W|S(NRRRR,( RtwalkR)R+RbRRRR(RRR'( R3R[RPtroottdirstfilestfnR&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\Ns"   c Cst}xtj|jD]\}}}x|D]}|j||r2tjj||}tddttjj |dddf}|j |d}|r|j |dqq2q2W|j sPqqW|S(sJ Return all the distribution names known to this locator. RR,R[N(RRR,R)R+RbRRRR(RR#RR'(R3RPR-R.R/R0R&R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]^s "   (R<R=R>RIR+R\R](((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR&0s    t JSONLocatorcBs eZdZdZdZRS(s This locator uses special extended metadata (not available on PyPI) and is the basis of performant dependency resolution in distlib. Other locators require archive downloads before dependencies can be determined! As you might imagine, that can be slow. cCstddS(sJ Return all the distribution names known to this locator. sNot available from this locatorN(RZ(R3((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR]xscCsBiid6id6}t|}|r>x|jdgD]}|ddks9|ddkreq9nt|d|d d |jd d d |j}|j}|d |_d|kr|drd|df|_n|jdi|_|jdi|_|||j <|dj |j t j |d q9Wn|S(NRRR/tptypetsdistt pyversiontsourceR[RxRsPlaceholder for summaryR.R&RRt requirementstexports( RRKRR.RRRt dependenciesR7RxRRR(R3R[RPRRRR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\~s&        .(R<R=R>R]R\(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR1qs tDistPathLocatorcBs eZdZdZdZRS(s This locator finds installed distributions in a path. It can be useful for adding to an :class:`AggregatingLocator`. cKs8tt|j|t|ts+t||_dS(ss Initialise an instance. :param distpath: A :class:`DistributionPath` instance to search. N(RR9RIt isinstanceRtAssertionErrortdistpath(R3R<R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIscCs|jj|}|dkr5iid6id6}nGi||j6it|jg|j6d6itdg|j6d6}|S(NRR(R<tget_distributionR#RxRR(R3R[RRP((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR\s  (R<R=R>RIR\(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR9s tAggregatingLocatorcBsPeZdZdZdZdZeejj eZdZ dZ RS(sI This class allows you to chain and/or merge a list of locators. cOs8|jdt|_||_tt|j|dS(s Initialise an instance. :param locators: The list of locators to search. :param kwargs: Passed to the superclass constructor, except for: * merge - if False (the default), the first successful search from any of the locators is returned. If True, the results from all locators are merged (this can be slow). tmergeN(RRLR?tlocatorsRR>RI(R3R@R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIs  cCs5tt|jx|jD]}|jqWdS(N(RR>RUR@(R3R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRUscCs*||_x|jD]}||_qWdS(N(RVR@R.(R3RXR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRYs c Cs]i}xP|jD]E}|j|}|r|jr|jdi}|jdi}|j||jd}|r|rxF|jD]5\}} ||kr||c| ORIRURYRRBR.tfgetR\R](((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyR>s    ,shttps://pypi.python.org/simple/R"g@R.tlegacys1(?P[\w-]+)\s*\(\s*(==\s*)?(?P[^)]+)\)$tDependencyFindercBsVeZdZddZdZdZdZdZdZ de dZ RS( s0 Locate dependencies for distributions. cCs(|p t|_t|jj|_dS(sf Initialise an instance, using the specified locator to locate distributions. N(tdefault_locatorRRR.(R3R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRIscCstjd||j}||j|<||j||jf= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. t cantreplace( treqtsRRSR}RxRt frozensetRLRQRRNRc( R3RTtothertproblemstrlistt unmatchedRPRFRP((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyttry_to_replaceos"       # cCsi|_i|_i|_i|_t|p0g}d|krk|jd|tdddgO}nt|tr|}}tj d|nK|j j |d|}}|dkrt d|ntj d|t|_t}t|g}t|g}x|r|j}|j} | |jkrO|j|n/|j| } | |kr~|j|| |n|j|jB} |j} t} ||krxAdD]6}d |}||kr| t|d |O} qqWn| | B| B}x|D]}|j|}|s+tj d||j j |d|}|dkrv| rv|j j |dt}n|dkrtj d||jd|fq+|j|j}}||f|jkr|j|n|j||| kr+||kr+|j|tj d|jq+nxw|D]o}|j} | |jkrr|jj|tj|q2|j| } | |kr2|j|| |q2q2WqWqWt|jj}x<|D]4}||k|_|jrtj d|jqqWtj d|||fS(s Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. s:*:s:test:s:build:s:dev:spassed %s as requirementRsUnable to locate %rs located %sttesttbuildtdevs:%s:s %s_requiressNo providers found for %rsCannot satisfy %rt unsatisfiedsAdding %s to install_distss#%s is a build-time dependency only.sfind done for %sN(R^R_R`(RLRJRIRWRROR:RRkRlRRR#RRct requestedRR:RNR]t run_requirest meta_requirestbuild_requirestgetattrRURRxtname_and_versionRtvaluestbuild_time_dependency(R3Rt meta_extrasRRRRZttodot install_distsR[RYtireqtstsreqtstereqtsR:RQt all_reqtsRt providersRTtnRRMRJ((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytfinds                      !       "  "   N( R<R=R>R#RIRNRQRSRUR]RLRs(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pyRGs      ((ORtioRRtloggingRR`RRt ImportErrortdummy_threadingR$R,RtcompatRRRRRRRR R R R R1R RRRtdatabaseRRRRRtutilRRRRRRRRRRxRRRR R!t getLoggerR<RkRR|RRRR$R#R(R)tobjectRBRRRRR&R1R9R>RHRtNAME_VERSION_RERG(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/locators.pytsV        d@ :0E:A&[    PK!^00 scripts.pyonu[ abc@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZejeZdjZejdZd Zd Zd efd YZdS( i(tBytesIONi(t sysconfigtdetect_encodingtZipFile(tfinder(t FileOperatortget_export_entryt convert_pathtget_executabletin_venvs s^#!.*pythonw?[0-9.]*([ ].*)?$s|# -*- coding: utf-8 -*- if __name__ == '__main__': import sys, re def _resolve(module, func): __import__(module) mod = sys.modules[module] parts = func.split('.') result = getattr(mod, parts.pop(0)) for p in parts: result = getattr(result, p) return result try: sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) func = _resolve('%(module)s', '%(func)s') rc = func() # None interpreted as 0 except Exception as e: # only supporting Python >= 2.6 sys.stderr.write('%%s\n' %% e) rc = 1 sys.exit(rc) cCsd|kr|jdre|jdd\}}d|kr|jd rd||f}qq|jdsd|}qn|S(Nt s /usr/bin/env it"s%s "%s"s"%s"(t startswithtsplit(t executabletenvt _executable((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt_enquote_executableBs t ScriptMakercBseZdZeZdZeeddZ dZ e j j drZdZdZndddZdZeZd Zd Zdd Zd Zed ZejdZejdksejdkrejdkrdZnddZddZ RS(s_ A class to copy or create scripts from source scripts or callable specifications. cCs||_||_||_t|_t|_tjdkpWtjdkoWtjdk|_ t d|_ |p{t ||_ tjdkptjdkotjdk|_dS(NtposixtjavatsX.Ytnt(RsX.Y(t source_dirt target_dirt add_launcherstFalsetforcetclobbertostnamet_nametset_modetsettvariantsRt_fileopt_is_nt(tselfRRRtdry_runtfileop((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt__init__[s     cCsa|jdtr]|jr]tjj|\}}|jdd}tjj||}n|S(Ntguitpythontpythonw(tgetRR$RtpathR treplacetjoin(R%Rtoptionstdntfn((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt_get_alternate_executableks RcCs[y,t|}|jddkSWdQXWn(ttfk rVtjd|tSXdS(sl Determine if the specified executable is a script (contains a #! line) is#!NsFailed to open %s(topentreadtOSErrortIOErrortloggertwarningR(R%Rtfp((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _is_shellss cCs^|j|r=ddl}|jjjddkrV|Sn|jjdrV|Sd|S(Nisos.nametLinuxs jython.exes/usr/bin/env %s(R;RtlangtSystemt getPropertytlowertendswith(R%RR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt_fix_jython_executables RcCst}|jr!|j}t}ntjs9t}nqtrptjj tj ddtj d}n:tjj tj ddtj dtj df}|r|j ||}nt jjdr|j|}ntjj|}|rt|}n|jd}t jd krSd |krSd |krS|d 7}nd ||d}y|jdWn!tk rtd|nX|dkry|j|Wqtk rtd||fqXn|S(Ntscriptsspython%stEXEtBINDIRs python%s%stVERSIONRsutf-8tclis -X:Framess -X:FullFramess -X:Framess#!s s,The shebang (%r) is not decodable from utf-8s?The shebang (%r) is not decodable from the script encoding (%r)(tTrueRRRtis_python_buildRR RR-R/tget_pathtget_config_varR3tsystplatformR RBtnormcaseRtencodetdecodetUnicodeDecodeErrort ValueError(R%tencodingt post_interpR0tenquoteRtshebang((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _get_shebangsL             cCs |jtd|jd|jS(Ntmoduletfunc(tscript_templatetdicttprefixtsuffix(R%tentry((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt_get_script_textscCstjj|}|j|S(N(RR-tbasenametmanifest(R%texenametbase((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt get_manifestscCs|jo|j}tjjd}|s;|||}n||dkrY|jd}n|jd}t} t| d} | jd|WdQX| j } |||| }x|D]} tj j |j | } |rtj j | \}}|jdr|} nd| } y|jj| |Wqltk rtjdd | }tj j|r|tj|ntj| ||jj| |tjd ytj|Wqtk rqXqlXn|jr| jd | rd | |f} ntj j| r:|j r:tjd | qn|jj| ||jrl|jj| gn|j| qWdS(Nsutf-8tpytttws __main__.pys.pys%s.exes:Failed to write executable - trying to use .deleteme logics %s.deletemes0Able to replace executable using .deleteme logict.s%s.%ssSkipping existing file %s(RR$RtlinesepROt _get_launcherRRtwritestrtgetvalueR-R/RtsplitextR R#twrite_binary_filet ExceptionR8R9texiststremovetrenametdebugRARR tset_executable_modetappend(R%tnamesRVt script_bytest filenamestextt use_launcherRitlaunchertstreamtzftzip_dataRtoutnametntetdfname((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _write_scriptsT             c CsQd}|rL|jdg}|rLddj|}|jd}qLn|jd|d|}|j|jd}|j}t} d|jkr| j|nd|jkr| jd|t j d fnd |jkr | jd |t j d fn|r.|jd t r.d} nd} |j | |||| dS(NRtinterpreter_argss %sR sutf-8R0tXs%s%sisX.Ys%s-%siR)tpywRe( R,R/RORWR_RR!R"taddRLtversionRR( R%R^RxR0RTtargsRVtscriptRt scriptnamesRy((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _make_scripts(  !! cCs@t}tjj|jt|}tjj|jtjj|}|j r||j j || r|t j d|dSyt |d}Wn&tk r|jsnd}noX|j}|st jd|j|dStj|jdd}|r&t}|jdp d}n|s|r?|jn|j j|||jrq|j j|gn|j|nt jd||j|j js)t|j\} } |j d |j!| |} d |krd } nd } tjj|} |j"| g| |j#|| n|r<|jndS( Nsnot copying %s (up-to-date)trbs"%s: %s is an empty file (skipping)s s iRscopying and adjusting %s -> %siR+RRe($RRR-R/RRRR`RR#tnewerR8RsR4R7R&tNonetreadlineR9tget_command_namet FIRST_LINE_REtmatchR.RHtgrouptcloset copy_fileR RtRutinfoRtseekRWRR5(R%RRxtadjustRtft first_lineRRTRStlinesRVRyR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt _copy_scriptsR$              %cCs |jjS(N(R#R&(R%((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyR&JscCs||j_dS(N(R#R&(R%tvalue((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyR&NsRcCsftjddkrd}nd}d||f}tjddd}t|j|j}|S( NtPit64t32s%s%s.exeRhii(tstructtcalcsizet__name__trsplitRtfindtbytes(R%tkindtbitsRtdistlib_packagetresult((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyRjVs cCsKg}t|}|dkr1|j||n|j||d||S(s Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. R0N(RRRR(R%t specificationR0RxR^((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pytmakeds   cCs4g}x'|D]}|j|j||q W|S(s Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, (textendR(R%tspecificationsR0RxR((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyt make_multiplews N(!Rt __module__t__doc__tSCRIPT_TEMPLATERZRRRHRR(R3RLRMR R;RBRWR_t_DEFAULT_MANIFESTRaRdRRRtpropertyR&tsetterRRRRjRR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyRRs,  8   2  4-  (tioRtloggingRtreRRLtcompatRRRt resourcesRtutilRRRRR t getLoggerRR8tstripRtcompileRRRtobjectR(((s?/usr/lib/python2.7/site-packages/pip/_vendor/distlib/scripts.pyts     (  PK!"\N\N index.pyonu[ abc@sddlZddlZddlZddlZddlZddlZyddlmZWn!ek rddl mZnXddl m Z ddl m Z mZmZmZmZmZddlmZmZmZejeZdZdZd efd YZdS( iN(tThreadi(tDistlibException(tHTTPBasicAuthHandlertRequesttHTTPPasswordMgrturlparset build_openert string_types(tcached_propertytzip_dirt ServerProxyshttps://pypi.python.org/pypitpypit PackageIndexcBseZdZdZddZdZdZdZdZ dZ dZ dd Z dd Z dd Zddd d ddZdZddZddZdddZdZdZddZRS(sc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$c Cs|p t|_|jt|j\}}}}}}|sX|sX|sX|d krntd|jnd |_d |_d |_d |_ d |_ t t j dj}x`d D]X} y>tj| dgd|d |} | d kr| |_PnWqtk rqXqWWd QXd S(s Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. thttpthttpssinvalid repository: %stwtgpgtgpg2s --versiontstdouttstderriN(R R(RR(t DEFAULT_INDEXturltread_configurationRRtNonetpassword_handlert ssl_verifierRtgpg_homet rpc_proxytopentostdevnullt subprocesst check_calltOSError( tselfRtschemetnetloctpathtparamstquerytfragtsinktstrc((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyt__init__$s( !          cCs3ddlm}ddlm}|}||S(ss Get the distutils command for interacting with PyPI configurations. :return: the command. i(t Distribution(t PyPIRCCommand(tdistutils.coreR-tdistutils.configR.(R"R-R.td((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyt_get_pypirc_commandBs cCsy|j}|j|_|j}|jd|_|jd|_|jdd|_|jd|j|_dS(s Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. tusernametpasswordtrealmR t repositoryN(R2RR6t _read_pypirctgetR3R4R5(R"tctcfg((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyRLs   cCs0|j|j}|j|j|jdS(s Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. N(tcheck_credentialsR2t _store_pypircR3R4(R"R9((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytsave_configuration[s  cCs|jdks|jdkr-tdnt}t|j\}}}}}}|j|j||j|jt ||_ dS(sp Check that ``username`` and ``password`` have been set, and raise an exception if not. s!username and password must be setN( R3RR4RRRRt add_passwordR5RR(R"tpmt_R$((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyR;gs  !cCs|j|j|j}d|d<|j|jg}|j|}d|d<|j|jg}|j|S(sq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. tverifys:actiontsubmit(R;tvalidatettodicttencode_requesttitemst send_request(R"tmetadataR1trequesttresponse((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytregisterss     cCsjxYtr[|j}|sPn|jdj}|j|tjd||fqW|jdS(sr Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. sutf-8s%s: %sN(tTruetreadlinetdecodetrstriptappendtloggertdebugtclose(R"tnametstreamtoutbufR*((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyt_readers   cCs|jdddg}|dkr-|j}n|rI|jd|gn|dk rn|jdddgntj}tjj|tjj |d}|jd d d |d ||gt j d dj|||fS(s Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. s --status-fdt2s--no-ttys --homedirs--batchs--passphrase-fdt0s.ascs --detach-signs--armors --local-users--outputs invoking: %st N( RRRtextendttempfiletmkdtempRR%tjointbasenameRQRR(R"tfilenametsignert sign_passwordtkeystoretcmdttdtsf((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytget_sign_commands    %c Cs itjd6tjd6}|dk r6tj|d        c Cs|jtjj|s/td|ntjj|d}tjj|sitd|n|j|j|j }}t |j }d d|fd|fg}d||fg}|j ||} |j | S( s2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. snot a directory: %rs index.htmls not found: %rs:actiont doc_uploadRTtversionR(s:actionR(R;RR%tisdirRR^RRCRTRR tgetvalueRERG( R"RHtdoc_dirtfnRTRtzip_datatfieldsRRI((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytupload_documentation)s  cCs||jdddg}|dkr-|j}n|rI|jd|gn|jd||gtjddj||S( s| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. s --status-fdRXs--no-ttys --homedirs--verifys invoking: %sRZN(RRRR[RQRRR^(R"tsignature_filenamet data_filenameRcRd((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytget_verify_commandEs  cCsn|jstdn|j|||}|j|\}}}|dkrdtd|n|dkS(s6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. s0verification unavailable because gpg unavailableiis(verify command failed with error code %s(ii(RRRRv(R"RRRcRdR+RR((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pytverify_signature]s     cCs |d kr"d }tjdnMt|ttfrF|\}}nd}tt|}tjd|t|d}|j t |}z|j } d} d} d} d} d| krt | d } n|r|| | | nxyt rp|j| }|sPn| t|7} |j||rJ|j|n| d 7} |r|| | | qqWWd |jXWd QX| dkr| | krtd | | fn|r|j}||krtd ||||fntjd|nd S(s This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. sNo digest specifiedRsDigest specified: %stwbi iiscontent-lengthsContent-LengthiNs1retrieval incomplete: got only %d out of %d bytess.%s digest mismatch for %s: expected %s, got %ssDigest verified: %s(RRQRRt isinstancetlistttupletgetattrRRRGRtinfotintRLRtlenRnRRSRR(R"Rtdestfiletdigestt reporthooktdigesterthashertdfptsfptheaderst blocksizetsizeRtblocknumtblocktactual((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyt download_filevsV        cCsWg}|jr"|j|jn|jr>|j|jnt|}|j|S(s Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). (RRPRRR(R"treqthandlerstopener((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyRGs   cCs<g}|j}xy|D]q\}}t|ttfsC|g}nxA|D]9}|jd|d|jdd|jdfqJWqWxG|D]?\}} } |jd|d|| fjdd| fqW|jd|ddfdj|} d|} i| d6tt| d 6} t |j | | S( s& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--s)Content-Disposition: form-data; name="%s"sutf-8ts8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=s Content-typesContent-length( tboundaryRRRR[RwR^tstrRRR(R"RRtpartsRtktvaluestvtkeyR`tvaluetbodytctR((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyREs4      cCsbt|tri|d6}n|jdkrIt|jdd|_n|jj||p^dS(NRTttimeoutg@tand(RRRRR Rtsearch(R"ttermstoperator((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyRs N(t__name__t __module__t__doc__RRR,R2RR=R;RKRWRgRvRyRRRRRRGRER(((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyR s*      # 8   M  +(RtloggingRRRR\t threadingRt ImportErrortdummy_threadingRRtcompatRRRRRRtutilRR R t getLoggerRRQRt DEFAULT_REALMtobjectR (((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/index.pyts       .PK!46cycy wheel.pyonu[ abc@sddlmZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd l,m-Z-m.Z.e j/e0Z1e2a3e4ed rd Z5n9ej6j7d rdZ5nej6dkrdZ5ndZ5ej8dZ9e9 rdej:d Z9nde9Z;e5e9Z<ej"j=j>ddj>ddZ?ej8dZ@e@oze@j7dre@j>ddZ@ndZAeAZ@[AejBdejCejDBZEejBdejCejDBZFejBdZGejBdZHd ZId!ZJe jKd"kr$d#ZLn d$ZLd%eMfd&YZNeNZOd'eMfd(YZPd)ZQeQZR[Qe2d*ZSdS(+i(tunicode_literalsN(tmessage_from_filei(t __version__tDistlibException(t sysconfigtZipFiletfsdecodet text_typetfilter(tInstalledDistribution(tMetadatatMETADATA_FILENAME( t FileOperatort convert_patht CSVReadert CSVWritertCachetcached_propertytget_cache_baset read_exportsttempdir(tNormalizedVersiontUnsupportedVersionErrorupypy_version_infouppujavaujyucliuipucpupy_version_nodotu%s%siupyu-u_u.uSOABIucpython-cCs|dtg}tjdr+|jdntjdrJ|jdntjddkro|jdnd j|S( NucpuPy_DEBUGudu WITH_PYMALLOCumuPy_UNICODE_SIZEiuuu(t VER_SUFFIXRtget_config_vartappendtjoin(tparts((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt _derive_abi;s uz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ u7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonwu/cCs|S(N((to((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt]tcCs|jtjdS(Nu/(treplacetostsep(R((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR_RtMountercBs8eZdZdZdZddZdZRS(cCsi|_i|_dS(N(t impure_wheelstlibs(tself((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt__init__cs cCs!||j|<|jj|dS(N(R$R%tupdate(R&tpathnamet extensions((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytaddgs cCsI|jj|}x0|D](\}}||jkr|j|=qqWdS(N(R$tpopR%(R&R)R*tktv((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytremovekscCs"||jkr|}nd}|S(N(R%tNone(R&tfullnametpathtresult((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt find_moduleqs cCs|tjkrtj|}nx||jkrAtd|ntj||j|}||_|jdd}t|dkr|d|_ n|S(Nuunable to find extension for %su.ii( tsystmodulesR%t ImportErrortimpt load_dynamict __loader__trsplittlent __package__(R&R1R3R((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt load_modulexs N(t__name__t __module__R'R+R/R0R4R>(((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR#bs     tWheelcBseZdZdZdZdeedZedZ edZ edZ e dZ dZe d Zd Zdd Zd Zd ZdZdddZdZdZdZdZdZedZdZdZddZRS(u@ Class to build and install from Wheel files (PEP 427). iusha256cCs||_||_d|_tg|_dg|_dg|_tj|_ |dkr{d|_ d|_ |j |_nEtj|}|r|jd}|d|_ |djdd |_ |d |_|j |_ntjj|\}}tj|}|s!td |n|r?tjj||_ n||_|jd}|d|_ |d|_ |d |_|d jd |_|djd |_|djd |_dS(uB Initialise an instance using a (valid) filename. uunoneuanyudummyu0.1unmuvnu_u-ubnuInvalid name or filename: %rupyu.ubiuarN(tsignt should_verifytbuildvertPYVERtpyvertabitarchR!tgetcwdtdirnameR0tnametversiontfilenamet _filenametNAME_VERSION_REtmatcht groupdictR R2tsplitt FILENAME_RERtabspath(R&RMRBtverifytmtinfoRJ((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR'sB                cCs|jrd|j}nd}dj|j}dj|j}dj|j}|jjdd}d|j|||||fS(uJ Build and return a filename from the various components. u-uu.u_u%s-%s%s-%s-%s-%s.whl(RDRRFRGRHRLR RK(R&RDRFRGRHRL((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRMs cCs+tjj|j|j}tjj|S(N(R!R2RRJRMtisfile(R&R2((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytexistssccsNxG|jD]<}x3|jD](}x|jD]}|||fVq*WqWq WdS(N(RFRGRH(R&RFRGRH((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyttagssc Cs8tjj|j|j}d|j|jf}d|}tjd}t |d}|j |}|dj dd}t g|D]}t |^q} | d krd} nt} yItj|| } |j| "} || } td | }WdQXWn!tk r-td | nXWdQX|S( Nu%s-%su %s.dist-infouutf-8uru Wheel-Versionu.iuMETADATAtfileobju$Invalid wheel, because %s is missing(ii(R!R2RRJRMRKRLtcodecst getreaderRtget_wheel_metadataRRttupletintR t posixpathtopenR tKeyErrort ValueError(R&R)tname_vertinfo_dirtwrappertzftwheel_metadatatwvtit file_versiontfntmetadata_filenametbftwfR3((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytmetadatas( %    cCsud|j|jf}d|}tj|d}|j|(}tjd|}t|}WdQXt|S(Nu%s-%su %s.dist-infouWHEELuutf-8( RKRLRaRRbR\R]Rtdict(R&RhReRfRnRoRptmessage((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR^s cCsFtjj|j|j}t|d}|j|}WdQX|S(Nur(R!R2RRJRMRR^(R&R)RhR3((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRWsc Cstj|}|r|j}|| ||}}d|jkrQt}nt}tj|}|rd|jd}nd}||}||}ns|jd}|jd} |dks|| krd} n&|||d!d krd } nd} t| |}|S( Ntpythonwt iRs s iis ( t SHEBANG_RERPtendtlowertSHEBANG_PYTHONWtSHEBANG_PYTHONtSHEBANG_DETAIL_REtgroupstfind( R&tdataRVRwtshebangtdata_after_shebangtshebang_pythontargstcrtlftterm((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytprocess_shebangs,      cCs|dkr|j}nytt|}Wn!tk rNtd|nX||j}tj|j dj d}||fS(NuUnsupported hash algorithm: %rt=uascii( R0t hash_kindtgetattrthashlibtAttributeErrorRtdigesttbase64turlsafe_b64encodetrstriptdecode(R&R~RthasherR3((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytget_hashs   !cCs~t|}ttjj||}|j|ddf|jt|%}x|D]}|j|q]WWdQXdS(Nu( tlisttto_posixR!R2trelpathRtsortRtwriterow(R&trecordst record_pathtbasetptwritertrow((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt write_record's   cCsg}|\}}tt|j}xs|D]k\}} t| d} | j} WdQXd|j| } tjj| } |j || | fq+Wtjj |d} |j || |t tjj |d}|j || fdS(Nurbu%s=%suRECORD( RRRRbtreadRR!R2tgetsizeRRRR(R&RWtlibdirt archive_pathsRtdistinfoRfRtapRtfR~Rtsize((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt write_records0s c Cs\t|dtjA}x7|D]/\}}tjd|||j||qWWdQXdS(NuwuWrote %s to %s in wheel(Rtzipfilet ZIP_DEFLATEDtloggertdebugtwrite(R&R)RRhRR((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt build_zip@sc! s|dkri}nttfdd#d}|dkrgd}tg}tg}tg}n!d}tg}dg}dg}|jd ||_|jd ||_ |jd ||_ |} d |j |j f} d | } d| } g} xKd$D]C}|kr qn|}t jj|rx t j|D]\}}}x|D]}tt jj||}t jj||}tt jj| ||}| j||f|dkrb|jd rbt|d}|j}WdQX|j|}t|d}|j|WdQXqbqbWqLWqqW| }d}xt j|D]\}}}||krxXt|D]G\}}t|}|jdrt jj||}||=PqqWnxl|D]d}t|jd%r qnt jj||}tt jj||}| j||fqWqkWt j|}xf|D]^}|d&krjtt jj||}tt jj| |}| j||fqjqjWd|p|jdtd|g}x4|jD])\}}}|jd |||fqWt jj|d}t|d!}|jd"j|WdQXtt jj| d}| j||f|j || f| | t jj|j!|j"} |j#| | | S('u Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. cs |kS(N((R(tpaths(s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRNRupurelibuplatlibiufalseutrueunoneuanyupyveruabiuarchu%s-%su%s.datau %s.dist-infoudatauheadersuscriptsu.exeurbNuwbu .dist-infou.pycu.pyouRECORDu INSTALLERuSHAREDuWHEELuWheel-Version: %d.%duGenerator: distlib %suRoot-Is-Purelib: %su Tag: %s-%s-%suwu (upurelibuplatlib(udatauheadersuscripts(u.pycu.pyo(uRECORDu INSTALLERuSHAREDuWHEEL($R0RRtIMPVERtABItARCHREtgetRFRGRHRKRLR!R2tisdirtwalkRRRRRtendswithRbRRRt enumeratetlistdirt wheel_versionRRZRRJRMR(!R&RRZRtlibkeytis_puret default_pyvert default_abit default_archRRetdata_dirRfRtkeyR2troottdirstfilesRmRtrpRRR~RRktdnRiRFRGRHR)((Rs=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytbuildFs  "              %      cCKs |j}|jd}|jdt}tjj|j|j}d|j|j f}d|} d|} t j| t } t j| d} t j| d} t j d}t|d }|j| }||}t|}Wd QX|d jd d }tg|D]}t|^q}||jkrY|rY||j|n|ddkrv|d}n |d}i}|j| D}td|,}x"|D]}|d}||||jd.}6|6r|6jd/}6nWd QXWnt1k rt+j2d0nX|6r|6jd1i}>|6jd2i}?|>s|?r|jdd}@tjj?|@st@d3n|@|_xF|>jAD]8\}:}<d4|:|<f}A|j4|A}4|j5|4q(W|?ritd(6}BxL|?jAD];\}:}<d4|:|<f}A|j4|A|B}4|j5|4qWqqntjj|| }tB|}5tC|}|d=|d=||d5<|5jD||}|r9 |!j/|n|5jE|!|d6||5SWn+t1k r t+jFd7|jGnXWd tHjI|"XWd QXd S(9u Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. uwarnerulib_onlyu%s-%su%s.datau %s.dist-infouWHEELuRECORDuutf-8urNu Wheel-Versionu.iuRoot-Is-Purelibutrueupurelibuplatlibtstreamiuuscriptstdry_runu /RECORD.jwsiusize mismatch for %su=udigest mismatch for %sulib_only: skipping %su.exeu/urbudigest mismatch on write for %su.pyuByte-compilation failedtexc_infoulib_only: returning Noneu1.0uentry_points.txtuconsoleuguiu %s_scriptsuwrap_%su%s:%su %suAUnable to read legacy script metadata, so cannot generate scriptsu extensionsupython.commandsu8Unable to read JSON metadata, so cannot generate scriptsu wrap_consoleuwrap_guiuValid script path not specifiedu%s = %sulibuprefixuinstallation failed.(uconsoleugui(JRRtFalseR!R2RRJRMRKRLRaR R\R]RRbRRRR_R`RRR tTruetrecordR5tdont_write_bytecodettempfiletmkdtempt source_dirR0t target_dirtinfolistt isinstanceRRRtstrt file_sizeRRRt startswithRRR t copy_streamRt byte_compilet Exceptiontwarningtbasenametmaketset_executable_modetextendRWRtvaluestprefixtsuffixtflagstjsontloadRRdtitemsR Rrtwrite_shared_locationstwrite_installed_filest exceptiontrollbacktshutiltrmtree(CR&RtmakertkwargsRtwarnertlib_onlyR)ReRRft metadata_nametwheel_metadata_namet record_nameRgRhtbwfRpRsRjRkRlRRRotreaderRRtdata_pfxtinfo_pfxt script_pfxtfileoptbctoutfilestworkdirtzinfotarcnamet u_arcnametkindtvalueR~t_Rt is_scripttwhereRtoutfilet newdigesttpycRmtworknameRt filenamestdisttcommandsteptepdataRR-tdR.tstconsole_scriptst gui_scriptst script_dirtscripttoptions((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytinstallsD    %            #   "                            cCsGtdkrCtjjttdtjd }t |antS(Nu dylib-cachei( tcacheR0R!R2RRRR5RLR(R&R((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt_get_dylib_caches  c Cstjj|j|j}d|j|jf}d|}tj|d}tj d}g}t |dw}y\|j |G}||} t j | } |j} | j|} tjj| j| } tjj| stj| nx| jD]\}}tjj| t|}tjj|sHt}nQtj|j}tjj|}|j|}tj|j}||k}|r|j|| n|j||fqWWdQXWntk rnXWdQX|S(Nu%s-%su %s.dist-infou EXTENSIONSuutf-8ur( R!R2RRJRMRKRLRaR\R]RRbRRRt prefix_to_dirRRtmakedirsRR RYRtstattst_mtimetdatetimet fromtimestamptgetinfot date_timetextractRRc(R&R)ReRfRRgR3RhRoRpR*RRt cache_baseRKRtdestRt file_timeRWt wheel_time((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt_get_extensionss>     !  cCs t|S(uM Determine if a wheel is compatible with the running system. (t is_compatible(R&((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR$scCstS(uP Determine if a wheel is asserted as mountable by its metadata. (R(R&((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyt is_mountablescCs tjjtjj|j|j}|jsLd|}t|n|jsqd|}t|n|t jkrt j d|ns|rt jj |nt jj d||j}|rtt jkrt jj tntj||ndS(Nu)Wheel %s not compatible with this Python.u$Wheel %s is marked as not mountable.u%s already in pathi(R!R2RTRRJRMR$RR%R5RRRtinsertR#t_hookt meta_pathR+(R&RR)tmsgR*((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytmounts"'     cCstjjtjj|j|j}|tjkrItjd|n]tjj ||t j krxt j |nt j st tj krtj j t qndS(Nu%s not in path( R!R2RTRRJRMR5RRR/R'R$R((R&R)((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytunmounts' cCstjj|j|j}d|j|jf}d|}d|}tj|t}tj|d}tj|d}t j d}t |d } | j |} || } t | } WdQX| djd d } tg| D]}t|^q}i}| j |D}td |,}x"|D]}|d }|||Fsu0Cannot update non-compliant (PEP-440) version %rR2tlegacyuVersion updated from %r to %r(R0RR}RRR`RRRRR RLRR R( RLR2tupdatedR.RkR RtmdR/((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytupdate_version;s(   0 !     u%s-%su %s.dist-infouRECORDuruutf-8u..uinvalid entry in wheel: %rNRu.whlRu wheel-update-tdiruNot a directory: %r(R!R2RRJRMRKRLRaRRRRRRRRR R0RtmkstemptcloseRRRRRRtcopyfile(R&tmodifiertdest_dirRR-R2R)ReRfRRRhR,RRRR2toriginal_versionRtmodifiedtcurrent_versiontfdtnewpathRRRW((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR( sX           (iiN(R?R@t__doc__RRR0RR'tpropertyRMRYRZRRqR^RWRRRRRRRRR#R$R%R*R+RUR((((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyRAs2)    h "    6cCstg}td}xGttjddddD](}|jdj|t|gq1Wg}xLtjD]>\}}}|j drp|j|j dddqpqpW|j t dkr|j dt n|jdg}tg}tjd kr=tjd t}|r=|j\} }}} t|}| g} | dkrg| jd n| dkr| jdn| dkr| jdn| dkr| jdn| dkr| jdnx`|dkr6x@| D]8} d| ||| f} | tkr|j| qqW|d8}qWq=nxH|D]@}x7|D]/} |jdjt|df|| fqQWqDWxwt|D]i\}}|jdjt|fddf|dkr|jdjt|dfddfqqWxwt|D]i\}}|jdjd|fddf|dkr|jdjd|dfddfqqWt|S(uG Return (pyver, abi, arch) tuples compatible with this Python. iiiuu.abiu.iunoneudarwinu(\w+)_(\d+)_(\d+)_(\w+)$ui386uppcufatux86_64ufat3uppc64ufat64uintelu universalu %s_%s_%s_%suanyupy(ui386uppc(ui386uppcux86_64(uppc64ux86_64(ui386ux86_64(ui386ux86_64uinteluppcuppc64(RtrangeR5t version_infoRRRR8t get_suffixesRRRRRR&RtplatformtreRPR|R`t IMP_PREFIXRtset(tversionstmajortminortabisRRR3tarchesRVRKRHtmatchesRPR RGRkRL((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pytcompatible_tagss`  $&$               1% 0% 0cCst|tst|}nt}|dkr9t}nxN|D]F\}}}||jkr@||jkr@||jkr@t}Pq@q@W|S(N( RRARR0tCOMPATIBLE_TAGSRFRGRHR(twheelRZR3tverRGRH((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyR$s  -(Tt __future__RRR\Rtdistutils.utilt distutilstemailRRR8RtloggingR!RaRDRR5RRRRRtcompatRRRRRtdatabaseR RqR R tutilR R RRRRRRRRLRRt getLoggerR?RR0RthasattrRERCRRRRARERt get_platformR RRRtcompilet IGNORECASEtVERBOSERSRORvR{RzRyR"RtobjectR#R'RARMRNR$(((s=/usr/lib/python2.7/site-packages/pip/_vendor/distlib/wheel.pyts               (@     '   #  > PK!~== __init__.pycnu[ abc@sddlZdZdefdYZyddlmZWn*ek rhdejfdYZnXejeZ e j edS(iNs0.2.4tDistlibExceptioncBseZRS((t__name__t __module__(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyR s(t NullHandlerRcBs#eZdZdZdZRS(cCsdS(N((tselftrecord((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pythandletcCsdS(N((RR((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pytemitRcCs d|_dS(N(tNonetlock(R((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyt createLockR(RRRRR (((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyRs  ( tloggingt __version__t ExceptionRRt ImportErrortHandlert getLoggerRtloggert addHandler(((s@/usr/lib/python2.7/site-packages/pip/_vendor/distlib/__init__.pyts  PK!JE**"__pycache__/scripts.cpython-38.pycnu[U .e?@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZeeZdZedZd Zd d ZGd d d eZdS))BytesION) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executablein_venva s^#!.*pythonw?[0-9.]*([ ].*)?$z# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) cCsXd|krT|drB|dd\}}d|krT|dsTd||f}n|dsTd|}|S)N z /usr/bin/env r"z%s "%s"z"%s") startswithsplit) executableenvZ _executabler?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/scripts.py_enquote_executable3s  rc@seZdZdZeZdZd'ddZddZe j d rBd d Z d d Z ddZd(ddZddZeZddZddZd)ddZddZeddZejddZejd ksejd krejd krd!d"Zd*d#d$Zd+d%d&ZdS), ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFcCsz||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t d|_ |pRt ||_ tjdkprtjdkortjdk|_ dS)NFposixjava)X.Ynt) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr_fileop_is_nt)selfrrrdry_runZfileoprrr__init__Ls  zScriptMaker.__init__cCs@|ddr<|jr %srspythonwr|rd)!r!r/r1rr rr`rr'Znewerr:ror6r9r*readliner;Zget_command_name FIRST_LINE_REmatchr0groupcloseZ copy_filer$rprqinforseekrUryr7)r)rrsZadjustrvfZ first_linerrIrSlinesrTrtrwrrr _copy_script)sX        zScriptMaker._copy_scriptcCs|jjSr_r'r*)r)rrrr*]szScriptMaker.dry_runcCs ||j_dSr_r)r)valuerrrr*asrcCsHtddkrd}nd}d||f}tddd}t||j}|S) NPZ64Z32z%s%s.exerVrr)structcalcsize__name__rsplitrfindbytes)r)Zkindbitsr"Zdistlib_packagerJrrrrhis zScriptMaker._get_launchercCs6g}t|}|dkr"|||n|j|||d|S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. Nrz)r rr)r) specificationr2rsr]rrrmakews zScriptMaker.makecCs$g}|D]}||||q|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r)Zspecificationsr2rsrrrr make_multipleszScriptMaker.make_multiple)TFN)rLN)N)N)N) r __module__ __qualname____doc__SCRIPT_TEMPLATErYrr+r4rGrHrr=r@rKrUr^_DEFAULT_MANIFESTrarcryrrpropertyr*setterr!r"r#rhrrrrrrrCs6     84 4   r)iorZloggingr!rerrGcompatrrrZ resourcesrutilrr r r r Z getLoggerrr:striprcompilerrrobjectrrrrrs     PK!"xCC __pycache__/index.cpython-38.pycnu[U .eJR@sddlZddlZddlZddlZddlZddlZzddlmZWn ek r`ddl mZYnXddl m Z ddl m Z mZmZmZmZmZddlmZmZmZeeZdZdZGd d d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)cached_propertyzip_dir ServerProxyzhttps://pypi.org/pypipypic@seZdZdZdZd*ddZddZdd Zd d Zd d Z ddZ ddZ d+ddZ d,ddZ d-ddZd.ddZddZd/ddZd0d d!Zd1d"d#Zd$d%Zd&d'Zd2d(d)ZdS)3 PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc Cs|pt|_|t|j\}}}}}}|s<|s<|s<|dkrJtd|jd|_d|_d|_d|_t t j dR}dD]F} z,t j | dg||d} | dkr| |_WqWqttk rYqtXqtW5QRXdS) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. )ZhttpZhttpszinvalid repository: %sNw)gpgZgpg2z --versionstdoutstderrr) DEFAULT_INDEXurlread_configurationrrpassword_handler ssl_verifierrgpg_homeopenosdevnull subprocessZ check_callOSError) selfrZschemenetlocpathZparamsZqueryZfragZsinksrcr%=/usr/lib/python3.8/site-packages/pip/_vendor/distlib/index.py__init__$s(   zPackageIndex.__init__cCs&ddlm}ddlm}|}||S)zs Get the distutils command for interacting with PyPI configurations. :return: the command. r) Distribution) PyPIRCCommand)Zdistutils.corer(Zdistutils.configr))r r(r)dr%r%r&_get_pypirc_commandAs  z PackageIndex._get_pypirc_commandcCsR|}|j|_|}|d|_|d|_|dd|_|d|j|_dS)z Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. usernamepasswordrealmr repositoryN)r+rr/Z _read_pypircgetr,r-r.)r cZcfgr%r%r&rKs  zPackageIndex.read_configurationcCs$||}||j|jdS)z Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. N)check_credentialsr+Z _store_pypircr,r-)r r1r%r%r&save_configurationZszPackageIndex.save_configurationcCs\|jdks|jdkrtdt}t|j\}}}}}}||j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r,r-rrrrZ add_passwordr.rr)r Zpm_r!r%r%r&r2fs zPackageIndex.check_credentialscCs\|||}d|d<||g}||}d|d<||g}||S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. Zverify:actionZsubmit)r2validatetodictencode_requestitems send_request)r metadatar*requestZresponser%r%r&registerrs  zPackageIndex.registercCsF|}|sq:|d}||td||fq|dS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. utf-8z%s: %sN)readlinedecoderstripappendloggerdebugclose)r namestreamZoutbufr#r%r%r&_readers  zPackageIndex._readerc Cs|jdddg}|dkr|j}|r.|d|g|dk rF|dddgt}tj|tj|d }|d d d |d ||gt dd|||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. --status-fd2--no-ttyN --homedirz--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--output invoking: %s ) rrextendtempfileZmkdtemprr"joinbasenamerCrD)r filenamesigner sign_passwordkeystorecmdZtdZsfr%r%r&get_sign_commands" zPackageIndex.get_sign_commandc Cstjtjd}|dk r tj|d<g}g}tj|f|}t|jd|j|fd}|t|jd|j|fd}||dk r|j ||j | | | |j ||fS)a Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. rNstdinr)targetargsr)rPIPEPopenrrHrstartrrZwriterEwaitrR returncode) r rXZ input_datakwargsrrpt1t2r%r%r& run_commands&    zPackageIndex.run_commandc CsD|||||\}}|||d\}}} |dkr@td||S)aR Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. r>rz&sign command failed with error code %s)rYrgencoder) r rTrUrVrWrXsig_filer$rrr%r%r& sign_files  zPackageIndex.sign_filesdistsourcec Cs(|tj|s td|||}d} |rZ|jsJt dn| ||||} t |d} | } W5QRXt | } t | } |dd||| | ddtj|| fg}| rt | d} | }W5QRX|d tj| |fttj| |||}||S) a Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. z not found: %sNz)no signing program available - not signedrbZ file_upload1)r5Zprotocol_versionfiletype pyversion md5_digest sha256_digestcontentZ gpg_signature)r2rr"existsrr6r7rrCZwarningrjrreadhashlibmd5 hexdigestZsha256updaterSrBshutilZrmtreedirnamer8r9r:)r r;rTrUrVrorprWr*rifZ file_datarqrrfilesZsig_datar<r%r%r& upload_filesD      zPackageIndex.upload_filec Cs|tj|s td|tj|d}tj|sFtd|||j|j }}t | }dd|fd|fg}d||fg}| ||} | | S)a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r)r5Z doc_uploadrFversionrs)r2rr"isdirrrRrtr6rFrr getvaluer8r:) r r;Zdoc_dirfnrFrZzip_datafieldsr}r<r%r%r&upload_documentation(s        z!PackageIndex.upload_documentationcCsT|jdddg}|dkr|j}|r.|d|g|d||gtdd||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. rIrJrKNrLz--verifyrNrO)rrrPrCrDrR)r signature_filename data_filenamerWrXr%r%r&get_verify_commandDszPackageIndex.get_verify_commandcCsH|jstd||||}||\}}}|dkr@td||dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailable)rrz(verify command failed with error code %sr)rrrrg)r rrrWrXr$rrr%r%r&verify_signature\szPackageIndex.verify_signaturec Csl|dkrd}tdn6t|ttfr0|\}}nd}tt|}td|t|d}|t |}z| } d} d} d} d} d | krt | d } |r|| | | | | }|sq| t|7} |||r||| d 7} |r|| | | qW5| XW5QRX| dkr0| | kr0td | | f|rh|}||kr\td ||||ftd|dS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrwzDigest specified: %swbi rzcontent-lengthzContent-Lengthrz1retrieval incomplete: got only %d out of %d bytesz.%s digest mismatch for %s: expected %s, got %szDigest verified: %s)rCrD isinstancelisttuplegetattrrvrr:rrEinfointrulenr`ryrrx)r rZdestfileZdigestZ reporthookZdigesterZhasherZdfpZsfpheadersZ blocksizesizeruZblocknumblockactualr%r%r& download_fileus^           zPackageIndex.download_filecCs:g}|jr||j|jr(||jt|}||S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrBrr r)r ZreqZhandlersZopenerr%r%r&r:s  zPackageIndex.send_requestc Csg}|j}|D]L\}}t|ttfs*|g}|D]*}|d|d|dd|dfq.q|D].\}} } |d|d|| fdd| fq`|d|ddfd|} d|} | tt| d} t |j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"r>z8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrrPrhrRstrrrr)r rr}partsrkvaluesvkeyrTvalueZbodyZctrr%r%r&r8sD     zPackageIndex.encode_requestcCsFt|trd|i}t|jdd}z|||p.dWS|dXdS)NrFg@)ZtimeoutrEand)rr r rsearch)r ZtermsoperatorZ rpc_proxyr%r%r&rs  zPackageIndex.search)N)N)N)N)NNrkrlN)N)N)NN)N)__name__ __module__ __qualname____doc__rr'r+rr3r2r=rHrYrgrjr~rrrrr:r8rr%r%r%r&rs6      #  9   M+r)rvZloggingrrzrrQZ threadingr ImportErrorZdummy_threadingrcompatrrrrr r utilr r r Z getLoggerrrCrZ DEFAULT_REALMobjectrr%r%r%r&s    PK!mm"__pycache__/markers.cpython-38.pycnu[U .e#@sdZddlZddlZddlZddlZddlmZmZmZddl m Z m Z dgZ ddZ Gd d d eZd d ZeZ[eZdd dZdS)zG Parser for the environment markers micro-language defined in PEP 508. N)python_implementationurlparse string_types)in_venv parse_marker interpretcCst|tr|sdS|ddkS)NFr'") isinstancer)or ?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/markers.py _is_literalsrc @sfeZdZdZddddddddddddd dd dd dd dd dddd ZddZdS) Evaluatorz; This class is used to evaluate marker expessions. cCs||kSNr xyr r r $zEvaluator.cCs||kSrr rr r r r%rcCs||kp||kSrr rr r r r&rcCs||kSrr rr r r r'rcCs||kSrr rr r r r(rcCs||kp||kSrr rr r r r)rcCs||kSrr rr r r r*rcCs||kp||kSrr rr r r r+rcCs|o|Srr rr r r r,rcCs|p|Srr rr r r r-rcCs||kSrr rr r r r.rcCs||kSrr rr r r r/r) z==z===z~=z!=z>=andorinznot inc Cst|trB|ddkr$|dd}q||kr8td|||}nt|tsPt|d}||jkrntd||d}|d }t|drt|d rtd |||f|||}|||}|j|||}|S) z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rr rzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison: %s %s %s) r r SyntaxErrordictAssertionError operationsNotImplementedErrorrevaluate) selfexprcontextresultrZelhsZerhsrrr r r r$2s$        zEvaluator.evaluateN)__name__ __module__ __qualname____doc__r"r$r r r r rsrc Csdd}ttdr(|tjj}tjj}nd}d}||tjttt t tt t t t ddtjd }|S)NcSs<d|j|j|jf}|j}|dkr8||dt|j7}|S)Nz%s.%s.%sfinalr)majorminormicro releaselevelstrserial)infoversionZkindr r r format_full_versionNs z,default_context..format_full_versionimplementation0) implementation_nameimplementation_versionZos_nameZplatform_machineZplatform_python_implementationZplatform_releaseZplatform_systemZplatform_versionZplatform_in_venvZpython_full_versionpython_versionZ sys_platform)hasattrsysr7r5nameosplatformmachinerreleasesystemr2rr=)r6r<r;r(r r r default_contextMs(   rFc Cszt|\}}Wn2tk rB}ztd||fW5d}~XYnX|rd|ddkrdtd||ftt}|rz||t||S)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z)Unable to interpret marker syntax: %s: %sNr#z*unexpected trailing data in marker: %s: %s)r Exceptionrr DEFAULT_CONTEXTupdate evaluatorr$)ZmarkerZexecution_contextr&rester'r r r rqs " )N)r,rAr?rBrecompatrrrutilrr__all__robjectrrFrIrKrr r r r s/PK!~Rǻǻ%__pycache__/util.cpython-38.opt-1.pycnu[U .e@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZz ddlZWnek rdZYnXddlZddlZddlZddlZddlZz ddlZWnek rddlZYnXddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e 1e2Z3e 4dZ5e 4dZ6e 4d Z7e 4d Z8e 4d Z9e 4d Z:e 4d Z;e 4dZddZ?ddZ@ddZAdddZBddZCddZDdd ZEejFd!d"ZGejFd#d$ZHejFdd&d'ZIGd(d)d)eJZKd*d+ZLGd,d-d-eJZMd.d/ZNGd0d1d1eJZOe 4d2e jPZQd3d4ZRdd5d6ZSd7d8ZTd9d:ZUd;d<ZVd=d>ZWd?d@ZXe 4dAe jYZZe 4dBZ[ddCdDZ\e 4dEZ]dFdGZ^dHdIZ_dJdKZ`dLZadMdNZbdOdPZcGdQdRdReJZdGdSdTdTeJZeGdUdVdVeJZfdWZgddYdZZhd[d\Zid]ZjGd^d_d_eJZke 4d`Zle 4daZme 4dbZndcddZdedfZoerddglmpZqmrZrmsZsGdhdidie$jtZtGdjdkdkeqZpGdldmdmepe'ZuejvddnZwewdokrGdpdqdqe$jxZxerGdrdsdse$jyZyGdtdudue%jzZzerBGdvdwdwe%j{Z{Gdxdydye%j|Z|dzd{Z}Gd|d}d}eJZ~Gd~dde~ZGddde~ZGddde(ZGdddeJZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cs6ddfddfddfdd|S) ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). cSs.t|}|r,|d}||d}n|s:tdn|d}|dkrVtd|d|d}|dd}|g}|r|d|krqqt|d|kr|||dd}qtt|}|std|||d||d}qtd|}td|||d|}|dd }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqZoqpartssr,.marker_varcs|rR|ddkrR|dd\}}|ddkr@td||dd}nZ|\}}|rt|}|srq|d}||d}|\}}|||d}q^|}||fS)Nr(r)unterminated parenthesis: %soplhsrhs)r%r MARKER_OPrrr)r&r(r4r'r3r5)markerr.r,r- marker_expres       z!parse_marker..marker_exprcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Nandr2)ANDrrr&r4r'r5)r8r,r- marker_andxs   z parse_marker..marker_andcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Norr2)ORrrr;)r<r,r-r7s   zparse_marker..markerr,)Z marker_stringr,)r7r<r8r.r- parse_marker8s $ r?cCs0|}|r|drdSt|}|s4td||d}||d}d}}}}|r:|ddkr:|dd}|dkrtd||d|} ||dd}g}| r0t| }|std | | |d| |d} | sq0| dd krtd | | dd} q|s:d}|r|dd kr|dd}t |}|sztd ||d}t |} | j r| j std|||d}ndd} |ddkr| |\}}n|dd}|dkrtd||d|} ||dd}t| r@| | \}} nXt| }|s\td| |d} | |d} | rtd| d| fg}|r|ddkrtd||dd}t|\}}|r|ddkrtd||s|}nd|ddd|Df}t||||||dS)z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %scSst|}d}|rg}|d}||d}t|}|sLtd||d}|||f||d}|r|ddkrq|dd}t|}|std|q|sd}||fS)z| Return a list of operator, version tuples if any are specified, else None. Nrzinvalid version: %srCrinvalid constraint: %s) COMPARE_OPrrrVERSION_IDENTIFIERr r"r%)Z ver_remainingr'versionsr3vr,r,r- get_versionss*      z'parse_requirement..get_versionsr/r0r1rEz~=;zinvalid requirement: %szunexpected trailing data: %s%s %s, cSsg|] }d|qS)rLr,).0Zconr,r,r- sz%parse_requirement..)nameextrasZ constraintsr7urlZ requirement)strip startswithrrr rrfindr%r" NON_SPACErschemenetlocrFrGr?r$r)reqr&r'ZdistnamerQZ mark_exprrHuriir+trJ_rIZrsr,r,r-parse_requirements                          r^cCsdd}i}|D]\}}}tj||}t|D]p}tj||} t| D]T} ||| } |dkrn|| dqJ||| } |tjjdd} | d| || <qJq0q|S)z%Find destinations for resources filescSs6|tjjd}|tjjd}|t|ddSN/)r!ospathseplenr%)rootrbr,r,r- get_rel_path sz)get_resources_dests..get_rel_pathNr`)rarbr$rpopr!rcrstrip)Zresources_rootZrulesrfZ destinationsbasesuffixdestprefixZabs_baseZabs_globZabs_pathZ resource_fileZrel_pathZrel_destr,r,r-get_resources_dests s    rmcCs(ttdrd}ntjttdtjk}|S)NZ real_prefixT base_prefix)hasattrsysrlgetattrr(r,r,r-in_venv$s rscCs$tjtj}t|ts t|}|SN)rarbnormcaserp executable isinstancerrrrr,r,r-get_executable.s  rxcCsN|}t|}|}|s|r|}|r|d}||kr6qJ|rd|||f}q|S)Nrz %c: %s %s)r lower)promptZ allowed_charsZ error_promptdefaultpr+cr,r,r-proceed>s r~cCs8t|tr|}i}|D]}||kr||||<q|Srt)rwrsplit)dkeysr(keyr,r,r-extract_by_keyNs rcCs`tjddkrtd|}|}t|}z`t|}|ddd}|D]6\}}|D]$\}}d||f}t |} | ||<q`qP|WSt k r| ddYnXdd } t } z| | |Wn<t jk r|t|}t|}| | |YnXi}| D]D} i|| <}| | D]&\} }d| |f}t |} | || <q0q|S) Nrutf-8 extensionszpython.exportsexportsz%s = %scSs$t|dr||n ||dS)N read_file)rorZreadfp)cpstreamr,r,r- read_streamks  z!read_exports..read_stream)rp version_infocodecs getreaderreadr jsonloaditemsget_export_entry Exceptionseekr ConfigParserZMissingSectionHeaderErrorclosetextwrapdedentZsections)rdataZjdatar(groupentrieskrIr+entryrrrrPvaluer,r,r- read_exportsWs@       rcCstjddkrtd|}t}|D]l\}}|||D]P}|j dkr\|j }nd|j |j f}|j rd|d |j f}| ||j|qFq,||dS)Nrrrz%s:%sz%s [%s]rM)rprr getwriterrrrZ add_sectionvaluesrjrlflagsr$setrPwrite)rrrrrIrr+r,r,r- write_exportss   rc cs$t}z |VW5t|XdSrt)tempfilemkdtemprrmtree)Ztdr,r,r-tempdirs rc cs.t}zt|dVW5t|XdSrt)ragetcwdchdir)rcwdr,r,r-rs   rc cs.t}zt|dVW5t|XdSrt)socketZgetdefaulttimeoutZsetdefaulttimeout)ZsecondsZctor,r,r-socket_timeouts   rc@seZdZddZdddZdS)cached_propertycCs ||_dSrt)func)selfrr,r,r-__init__szcached_property.__init__NcCs,|dkr |S||}t||jj||Srt)robject __setattr____name__)robjclsrr,r,r-__get__s  zcached_property.__get__)N)r __module__ __qualname__rrr,r,r,r-rsrcCs~tjdkr|S|s|S|ddkr.td||ddkrFtd||d}tj|krh|tjqP|srtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put 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. r`rzpath '%s' cannot be absolutezpath '%s' cannot end with '/')rarc ValueErrorrcurdirremoverbr$)pathnamepathsr,r,r- convert_paths       rc@seZdZd$ddZddZddZdd Zd%d d Zd&ddZddZ ddZ ddZ ddZ ddZ d'ddZddZddZd d!Zd"d#Zd S)( FileOperatorFcCs||_t|_|dSrt)dry_runrensured _init_record)rrr,r,r-rszFileOperator.__init__cCsd|_t|_t|_dSNF)recordr files_written dirs_createdrr,r,r-rszFileOperator._init_recordcCs|jr|j|dSrt)rradd)rrbr,r,r-record_as_writtenszFileOperator.record_as_writtencCsHtj|s tdtj|tj|s0dSt|jt|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)rarbexistsrabspathstatst_mtime)rsourcetargetr,r,r-newers   zFileOperator.newerTcCs|tj|td|||jsd}|rdtj|rDd|}n tj|rdtj |sdd|}|rtt |dt ||| |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirrarbdirnameloggerinforislinkrisfilerrZcopyfiler)rZinfileoutfilecheckmsgr,r,r- copy_files    zFileOperator.copy_fileNcCst|tj|td|||jsf|dkr:t|d}ntj|d|d}zt ||W5| X| |dS)NzCopying stream %s to %swbwencoding) rrarbrrrropenrrrZ copyfileobjr)rZinstreamrrZ outstreamr,r,r- copy_streams  zFileOperator.copy_streamc Cs\|tj||jsNtj|r.t|t|d}||W5QRX| |dS)Nr) rrarbrrrrrrr)rrbrfr,r,r-write_binary_file!s   zFileOperator.write_binary_filecCs||||dSrt)rencode)rrbrrr,r,r-write_text_file*szFileOperator.write_text_filecCsntjdkstjdkrjtjdkrj|D]F}|jr:td|q"t|j|B|@}td||t||q"dS)Nposixjavazchanging mode of %szchanging mode of %s to %o) rarP_namerrrrst_modechmod)rbitsmaskfilesrmoder,r,r-set_mode-szFileOperator.set_modecCs|dd|S)Nimi)r)r+rr,r,r-9zFileOperator.cCs|tj|}||jkrxtj|sx|j|tj|\}}||t d||j sft ||j rx|j |dS)Nz Creating %s)rarbrrrrrrrrrmkdirrr)rrbrrr,r,r-r;s    zFileOperator.ensure_dirc Cst|| }td|||js||s0|||rJ|s:d}n|t|d}i}|rhttdrhtjj |d<tj |||df|| ||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT) r rrrrrdro py_compiler CHECKED_HASHcompiler) rrboptimizeforcerlZhashed_invalidationZdpathZdiagpathZcompile_kwargsr,r,r- byte_compileGs   zFileOperator.byte_compilecCstj|rtj|r^tj|s^td||js@t ||j r||j kr|j |nPtj|rpd}nd}td|||jst ||j r||j kr|j |dS)NzRemoving directory tree at %slinkfilezRemoving %s %s)rarbrisdirrrdebugrrrrrrr)rrbr+r,r,r-ensure_removedXs"       zFileOperator.ensure_removedcCsDd}|s@tj|r$t|tj}q@tj|}||kr:q@|}q|Sr)rarbraccessW_OKr)rrbr(parentr,r,r- is_writablems  zFileOperator.is_writablecCs|j|jf}||S)zV Commit recorded changes, turn off recording, return changes. )rrr)rr(r,r,r-commitys zFileOperator.commitcCs|jsxt|jD]}tj|rt|qt|jdd}|D]8}t |}|rltj ||d}t |t |q>| dS)NT)reverser) rlistrrarbrrsortedrlistdirr$rmdirr)rrdirsrflistZsdr,r,r-rollbacks     zFileOperator.rollback)F)T)N)FFNF)rrrrrrrrrrrrZset_executable_moderrrrrrr,r,r,r-rs         rcCs^|tjkrtj|}nt|}|dkr,|}n.|d}t||d}|D]}t||}qJ|S)N.r)rpmodules __import__rrqrg)Z module_nameZ dotted_pathmodr(r*r|r,r,r-resolves    rc@s6eZdZddZeddZddZddZej Z d S) ExportEntrycCs||_||_||_||_dSrtrPrlrjr)rrPrlrjrr,r,r-rszExportEntry.__init__cCst|j|jSrt)rrlrjrr,r,r-rszExportEntry.valuecCsd|j|j|j|jfS)Nzrrr,r,r-__repr__s zExportEntry.__repr__cCsDt|tsd}n0|j|jko>|j|jko>|j|jko>|j|jk}|Sr)rwrrPrlrjr)rotherr(r,r,r-__eq__s     zExportEntry.__eq__N) rrrrrrrrr__hash__r,r,r,r-rs   rz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P\w+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cst|}|s0d}d|ks"d|krtd|n|}|d}|d}|d}|dkrf|d}}n"|dkrztd||d\}}|d } | dkrd|ksd|krtd|g} nd d | d D} t|||| }|S) NrArBzInvalid specification '%s'rPcallable:rrrcSsg|] }|qSr,)rS)rNrr,r,r-rOsz$get_export_entry..rC)ENTRY_REsearchr groupdictcountrr) Z specificationr'r(rrPrbZcolonsrlrjrr,r,r-rs8   rcCs|dkr d}tjdkr.dtjkr.tjd}n tjd}tj|rft|tj}|st d|n|dd\}}d|kr.|}n|dd\}}|rJt|}|rVt|}|||fS)NrDrr)rsplitrr)rXZusernameZpasswordrlr,r,r-parse_credentials$sr1cCstd}t||S)N)raumaskrrr,r,r-get_process_umask3s  r4cCs0d}d}t|D]\}}t|tsd}q,q|S)NTF) enumeraterwr)seqr(r[r+r,r,r-is_string_sequence8s r7z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|dd}t|}|r@|d}|d|}|rt|t|dkrtt |d|}|r| }|d|||dd|f}|dkrt |}|r|d|d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\br) rr!PYTHON_VERSIONrrstartrdrerescaperPROJECT_NAME_AND_VERSION)filenameZ project_namer(Zpyverr'nr,r,r-split_filenameGs"   rAz-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCs:t|}|std||}|d|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'rPZver)NAME_VERSION_RErrr rSry)r|r'rr,r,r-parse_name_and_versioncs  rCcCst}t|pg}t|pg}d|kr8|d||O}|D]x}|dkrT||q<|dr|dd}||krtd|||kr||q<||krtd|||q<|S)N*r9rzundeclared extra: %s)rrrrTrr()Z requestedZ availabler(rZunwantedr,r,r- get_extrasrs&        rFc Csi}zNt|}|}|d}|ds8td|ntd|}t |}Wn0t k r}zt d||W5d}~XYnX|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %srz&Failed to get external data for %s: %s) r rgetrTrrrrrrr exception)rRr(ZrespZheadersZctreaderer,r,r-_get_external_datas   rKz'https://www.red-dove.com/pypi/projects/cCs*d|d|f}tt|}t|}|S)Nz%s/%s/project.jsonrupperr _external_data_base_urlrK)rPrRr(r,r,r-get_project_datas rOcCs(d|d||f}tt|}t|S)Nz%s/%s/package-%s.jsonrrL)rPversionrRr,r,r-get_package_datas rQc@s(eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsPtj|st|t|jd@dkr6td|tjtj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rarbrr)rrrr(rnormpathri)rrir,r,r-rs    zCache.__init__cCst|S)zN Converts a resource prefix to a directory name in the cache. )r-)rrlr,r,r- prefix_to_dirszCache.prefix_to_dirc Csg}t|jD]r}tj|j|}z>tj|s>tj|rJt|ntj|r`t |Wqt k r| |YqXq|S)z" Clear the cache. ) rar rirbr$rrrrrrrr")rZ not_removedfnr,r,r-clears  z Cache.clearN)rrr__doc__rrUrWr,r,r,r-rRsrRc@s:eZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dSrt) _subscribersrr,r,r-rszEventMixin.__init__TcCsD|j}||krt|g||<n"||}|r6||n ||dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)rZrr" appendleft)revent subscriberr"subsZsqr,r,r-rs  zEventMixin.addcCs,|j}||krtd||||dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)rZrr)rr\r]r^r,r,r-rs zEventMixin.removecCst|j|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. r,)iterrZrG)rr\r,r,r-get_subscribersszEventMixin.get_subscribersc Oslg}||D]F}z||f||}Wn"tk rHtdd}YnX||qtd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)r`rrrHr"r)rr\argskwargsr(r]rr,r,r-publishs    zEventMixin.publishN)T) rrrrXrrrr`rcr,r,r,r-rYs   rYc@s^eZdZddZddZdddZdd Zd d Zd d ZddZ e ddZ e ddZ dS) SequencercCsi|_i|_t|_dSrt)_preds_succsr_nodesrr,r,r-r"szSequencer.__init__cCs|j|dSrt)rgrrnoder,r,r-add_node'szSequencer.add_nodeFcCs||jkr|j||rt|j|dD]}|||q,t|j|dD]}|||qPt|jD]\}}|sp|j|=qpt|jD]\}}|s|j|=qdS)Nr,)rgrrrerGrfr r)rriZedgesr|r+rrIr,r,r- remove_node*s   zSequencer.remove_nodecCs0|j|t||j|t|dSrt)re setdefaultrrrf)rpredsuccr,r,r-r:sz Sequencer.addcCs|z|j|}|j|}Wn tk r8td|YnXz||||Wn$tk rvtd||fYnXdS)Nz%r not a successor of anythingz%r not a successor of %r)rerfKeyErrorrr)rrmrnpredsZsuccsr,r,r-r?s  zSequencer.removecCs||jkp||jkp||jkSrt)rerfrg)rstepr,r,r-is_stepLszSequencer.is_stepcCs||std|g}g}t}|||r|d}||krb||kr||||q.|||||j|d}| |q.t |S)Nz Unknown: %rrr,) rrrrr"rgrrrerGextendreversed)rfinalr(Ztodoseenrqrpr,r,r- get_stepsPs"         zSequencer.get_stepscsRdggiig|jfddD]}|kr8|q8S)Nrcsd|<d|<dd7<|z |}Wntk rVg}YnX|D]J}|kr|t|||<q\|kr\t|||<q\||krg}}||||krqqt|}|dS)Nrr)r"rminrgtuple)riZ successorsZ successorZconnected_componentZ componentZgraphindexZ index_counterZlowlinksr(stack strongconnectr,r-r}ts,      z3Sequencer.strong_connections..strongconnect)rfrhr,rzr-strong_connectionsis" zSequencer.strong_connectionscCsfdg}|jD]*}|j|}|D]}|d||fqq |jD]}|d|q>|dd|S)Nz digraph G {z %s -> %s;z %s;} )rer"rgr$)rr(rnrprmrir,r,r-dots    z Sequencer.dotN)F) rrrrrjrkrrrrrwpropertyr~rr,r,r,r-rd!s   2rd).tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc sZfdd}tjtd}|dkr|dr>d}nH|drRd}d}n4|drfd }d }n |d rzd }d }n td|z|dkrt|d }|r|}|D] }||qn*t ||}|r| }|D] }||q|dkr*t j ddkr*|D]"} t| jts| jd| _qdd} | |_|W5|rT|XdS)NcsRt|ts|d}tjtj|}|rB|tjkrNt d|dS)Nrzpath outside destination: %r) rwrdecoderarbrr$rTrcr)rbr|dest_dirZplenr,r- check_paths   zunarchive..check_path)rrzip)rrZtgzzr:gz)rrZtbzzr:bz2rZtarrEzUnknown format for %rrrrc SsDzt||WStjk r>}ztt|W5d}~XYnXdS)z:Run tarfile.tar_fillter, but raise the expected ValueErrorN)tarfileZ tar_filterZ FilterErrorrstr)memberrbexcr,r,r-extraction_filtersz$unarchive..extraction_filter)rarbrrdr.rrrZnamelistrrZgetnamesrprZ getmembersrwrPrrrZ extractall) Zarchive_filenamerformatrrarchivernamesrPZtarinforr,rr- unarchivesL           rc Cs~t}t|}t|dZ}t|D]H\}}}|D]8}tj||}||d} tj| |} ||| q4q&W5QRX|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOrdrrawalkrbr$r) Z directoryr(ZdlenZzfrerrrPZfullZrelrkr,r,r-zip_dirs  r)rKMGTPc@sreZdZdZdddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressZUNKNOWNrdcCs(||_|_||_d|_d|_d|_dS)NrF)rxcurmaxstartedelapseddone)rZminvalZmaxvalr,r,r-r s  zProgress.__init__cCs0||_t}|jdkr ||_n ||j|_dSrt)rtimerr)rZcurvalZnowr,r,r-updates  zProgress.updatecCs||j|dSrt)rr)rZincrr,r,r- incrementszProgress.incrementcCs||j|Srt)rrxrr,r,r-r;s zProgress.startcCs |jdk r||jd|_dS)NT)rrrrr,r,r-stop#s  z Progress.stopcCs|jdkr|jS|jSrt)runknownrr,r,r-maximum(szProgress.maximumcCsD|jr d}n4|jdkrd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rrrrx)rr(rIr,r,r- percentage,s zProgress.percentagecCs:|dkr|jdks|j|jkr$d}ntdt|}|S)Nrz??:??:??z%H:%M:%S)rrrxrstrftimegmtime)rZdurationr(r,r,r-format_duration7szProgress.format_durationcCs|jrd}|j}n^d}|jdkr&d}nJ|jdks<|j|jkrBd}n.t|j|j}||j|j}|d|j}d|||fS)NZDonezETA rrrz%s: %s)rrrrrxfloatr)rrlr\r,r,r-ETA@s z Progress.ETAcCsL|jdkrd}n|j|j|j}tD]}|dkr6q@|d}q&d||fS)Nrgig@@z%d %sB/s)rrrxUNITS)rr(Zunitr,r,r-speedSs  zProgress.speedN)rr)rrrrrrrr;rrrrrrrr,r,r,r-rs      rz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<t|rd}t||t|r4d}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrr_CHECK_MISMATCH_SET_iglob) path_globrr,r,r-rhs    rc cst|d}t|dkrT|\}}}|dD]$}td|||fD] }|VqDq,nd|krrt|D] }|Vqdn~|dd\}}|dkrd}|dkrd}n|d}|d}t|D]4\}}} tj |}ttj ||D] } | VqqdS) NrrCrz**rrDr`\) RICH_GLOBrrdrr$ std_iglobr%rarrbrT) rZrich_path_globrlrrjitemrbZradicaldirrrVr,r,r-rss(         r) HTTPSHandlermatch_hostnameCertificateErrorc@seZdZdZdZddZdS)HTTPSConnectionNTcCsRt|j|jf|j}t|ddr0||_|tt dsp|j rHt j }nt j }t j ||j|j|t j|j d|_nxt t j}|jt jO_|jr||j|ji}|j rt j |_|j|j dtt ddr|j|d<|j |f||_|j rN|jrNz$t|j|jtd|jWn0tk rL|jtj|jYnXdS) NZ _tunnel_hostF SSLContext) cert_reqsZ ssl_versionca_certs)ZcafileZHAS_SNIZserver_hostnamezHost verified: %s) rZcreate_connectionhostporttimeoutrqsockZ_tunnelrosslrZ CERT_REQUIREDZ CERT_NONEZ wrap_socketZkey_fileZ cert_fileZPROTOCOL_SSLv23rZoptionsZ OP_NO_SSLv2Zload_cert_chainZ verify_modeZload_verify_locations check_domainrZ getpeercertrrrZshutdownZ SHUT_RDWRr)rrrcontextrbr,r,r-connects@       zHTTPSConnection.connect)rrrrrrr,r,r,r-rsrc@s&eZdZd ddZddZddZdS) rTcCst|||_||_dSrt)BaseHTTPSHandlerrrr)rrrr,r,r-rs zHTTPSHandler.__init__cOs$t||}|jr |j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr)rrarbr(r,r,r- _conn_makers zHTTPSHandler._conn_makerc CsXz||j|WStk rR}z$dt|jkr@td|jnW5d}~XYnXdS)Nzcertificate verify failedz*Unable to verify server certificate for %s)Zdo_openrrrreasonrr)rrYrJr,r,r- https_openszHTTPSHandler.https_openN)T)rrrrrrr,r,r,r-rs rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrYr,r,r- http_openszHTTPSOnlyHandler.http_openN)rrrrr,r,r,r-rsrrc@seZdZdddZdS)HTTPrNcKs&|dkr d}||j||f|dSNr_setupZ_connection_classrrrrbr,r,r-rsz HTTP.__init__)rNrrrrr,r,r,r-rsrc@seZdZdddZdS)HTTPSrNcKs&|dkr d}||j||f|dSrrrr,r,r-rszHTTPS.__init__)rNrr,r,r,r-rsrc@seZdZdddZddZdS) TransportrcCs||_tj||dSrt)rrrrrr use_datetimer,r,r-rszTransport.__init__cCs`||\}}}tdkr(t||jd}n4|jr<||jdkrR||_|t|f|_|jd}|S)Nr)rrr) get_host_info _ver_inforr _connection_extra_headersrZHTTPConnection)rrhehZx509r(r,r,r-make_connection s zTransport.make_connectionN)rrrrrrr,r,r,r-rs rc@seZdZdddZddZdS) SafeTransportrcCs||_tj||dSrt)rrrrrr,r,r-rszSafeTransport.__init__cCsx||\}}}|si}|j|d<tdkr:t|df|}n:|jrN||jdkrj||_|tj|df|f|_|jd}|S)Nrrrr)rrrrrrrr)rrrrrbr(r,r,r-rs   zSafeTransport.make_connectionN)rrr,r,r,r-rs rc@seZdZddZdS) ServerProxyc Kst|dd|_}|dk r^t|\}}|dd}|dkr@t}nt}|||d|d<}||_tjj ||f|dS)NrrrZhttps)r transport) rgrrrGrrrrrr) rrZrbrrWr]rZtclsr\r,r,r-r,s  zServerProxy.__init__Nrr,r,r,r-r+srcKs6tjddkr|d7}nd|d<d|d<t||f|S)Nrrbrnewlinerr)rprr)rVrrbr,r,r- _csv_open@s  rc@s4eZdZedededdZddZddZd S) CSVBaserC"r)Z delimiterZ quotecharZlineterminatorcCs|Srtr,rr,r,r- __enter__RszCSVBase.__enter__cGs|jdSrt)rr)rr$r,r,r-__exit__UszCSVBase.__exit__N)rrrrdefaultsrrr,r,r,r-rKs rc@s(eZdZddZddZddZeZdS) CSVReadercKs\d|kr4|d}tjddkr,td|}||_nt|dd|_tj|jf|j|_dS)NrrrrrbrE) rprrrrrcsvrIr)rrbrr,r,r-rZszCSVReader.__init__cCs|Srtr,rr,r,r-__iter__eszCSVReader.__iter__cCsFt|j}tjddkrBt|D] \}}t|ts |d||<q |SNrrr)nextrIrprr5rwrr)rr(r[rr,r,r-rhs   zCSVReader.nextN)rrrrrr__next__r,r,r,r-rYs rc@seZdZddZddZdS) CSVWritercKs$t|d|_tj|jf|j|_dS)Nr)rrrwriterr)rrVrbr,r,r-rss zCSVWriter.__init__cCsNtjddkr>g}|D]"}t|tr.|d}||q|}|j|dSr)rprrwrrr"rwriterow)rrowrErr,r,r-rws   zCSVWriter.writerowN)rrrrrr,r,r,r-rrsrcsHeZdZeejZded<d fdd ZddZdd Zd d Z Z S) Configurator inc_convertZincNcs"tt|||pt|_dSrt)superrrrarri)rconfigri __class__r,r-rszConfigurator.__init__c sfddd}t|s*|}dd}dd}|r\tfdd|D}fd dD}t|}|||}|r|D]\}} t||| q|S) Ncsvt|ttfr*t|fdd|D}nHt|trhd|krH|}qri}|D]}||||<qPn |}|S)Ncsg|] }|qSr,r,)rNr[convertr,r-rOszBConfigurator.configure_custom..convert..())rwr rytypedictconfigure_customr)or(r)rrr,r-rs   z.Configurator.configure_custom..convertrrz[]r,csg|] }|qSr,r,)rNr rr,r-rOsz1Configurator.configure_custom..cs$g|]}t|r||fqSr,)r)rNr)rrr,r-rOs)rgrrryrrsetattr) rrr}Zpropsrarrbr(r@rIr,)rrrr-r s     zConfigurator.configure_customcCs4|j|}t|tr0d|kr0|||j|<}|S)Nr)rrwrr )rrr(r,r,r- __getitem__s zConfigurator.__getitem__c CsFtj|stj|j|}tj|ddd}t|}W5QRX|S)z*Default converter for the inc:// protocol.rErr) rarbisabsr$rirrrr)rrrr(r,r,r-rs  zConfigurator.inc_convert)N) rrrrrZvalue_convertersrr r r __classcell__r,r,rr-rs  rc@s*eZdZdZd ddZddZdd ZdS) SubprocessMixinzC Mixin for running subprocesses and capturing their output FNcCs||_||_dSrt)verboseprogress)rrrr,r,r-rszSubprocessMixin.__init__cCsj|j}|j}|}|sq^|dk r.|||q |s@tjdntj|dtjq |dS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nrr) rrreadlinerpstderrrrflushr)rrrrrr+r,r,r-rIs  zSubprocessMixin.readercKstj|ftjtjd|}tj|j|jdfd}|tj|j|jdfd}|| | | |j dk r| ddn|j rt jd|S)N)stdoutrr)rrarzdone.mainzdone. ) subprocessPopenPIPE threadingZThreadrIrr;rwaitr$rrrpr)rcmdrbr|t1t2r,r,r- run_commands"   zSubprocessMixin.run_command)FN)rrrrXrrIrr,r,r,r-rs rcCstdd|S)z,Normalize a python package name a la PEP 503z[-_.]+r9)r<subry)rPr,r,r-normalize_namesr!)NN)r)N)N)NT)r collectionsr contextlibrZglobrrrrZloggingrarr<rr ImportErrorrrprrrrZdummy_threadingrrrcompatrrrr r r r r rrrrrrrrrrrrrZ getLoggerrrrrrGrFr6r>r:rVr#r?r^rmrsrxr~rrrcontextmanagerrrrrrrrrrVERBOSErrr+r-r/r1r4r7Ir>r:rArBrCrFrKrNrOrQrRrYrdZARCHIVE_EXTENSIONSrrrrrrrrrrrrrrrrrrrrrrrrrrrr!r,r,r,r-s      \         Yy   /   8 )    ,H  C]    *)   7.PK!Z==__pycache__/util.cpython-38.pycnu[U .e@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZz ddlZWnek rdZYnXddlZddlZddlZddlZddlZz ddlZWnek rddlZYnXddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e 1e2Z3e 4dZ5e 4dZ6e 4d Z7e 4d Z8e 4d Z9e 4d Z:e 4d Z;e 4dZddZ?ddZ@ddZAdddZBddZCddZDdd ZEejFd!d"ZGejFd#d$ZHejFdd&d'ZIGd(d)d)eJZKd*d+ZLGd,d-d-eJZMd.d/ZNGd0d1d1eJZOe 4d2e jPZQd3d4ZRdd5d6ZSd7d8ZTd9d:ZUd;d<ZVd=d>ZWd?d@ZXe 4dAe jYZZe 4dBZ[ddCdDZ\e 4dEZ]dFdGZ^dHdIZ_dJdKZ`dLZadMdNZbdOdPZcGdQdRdReJZdGdSdTdTeJZeGdUdVdVeJZfdWZgddYdZZhd[d\Zid]ZjGd^d_d_eJZke 4d`Zle 4daZme 4dbZndcddZdedfZoerddglmpZqmrZrmsZsGdhdidie$jtZtGdjdkdkeqZpGdldmdmepe'ZuejvddnZwewdokrGdpdqdqe$jxZxerGdrdsdse$jyZyGdtdudue%jzZzerBGdvdwdwe%j{Z{Gdxdydye%j|Z|dzd{Z}Gd|d}d}eJZ~Gd~dde~ZGddde~ZGddde(ZGdddeJZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cs6ddfddfddfdd|S) ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). cSs.t|}|r,|d}||d}n|s:tdn|d}|dkrVtd|d|d}|dd}|g}|r|d|krqqt|d|kr|||dd}qtt|}|std|||d||d}qtd|}td|||d|}|dd }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqZoqpartssr,.marker_varcs|rR|ddkrR|dd\}}|ddkr@td||dd}nZ|\}}|rt|}|srq|d}||d}|\}}|||d}q^|}||fS)Nr(r)unterminated parenthesis: %soplhsrhs)r%r MARKER_OPrrr)r&r(r4r'r3r5)markerr.r,r- marker_expres       z!parse_marker..marker_exprcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Nandr2)ANDrrr&r4r'r5)r8r,r- marker_andxs   z parse_marker..marker_andcsR|\}}|rJt|}|s qJ||d}|\}}d||d}q ||fS)Norr2)ORrrr;)r<r,r-r7s   zparse_marker..markerr,)Z marker_stringr,)r7r<r8r.r- parse_marker8s $ r?cCs0|}|r|drdSt|}|s4td||d}||d}d}}}}|r:|ddkr:|dd}|dkrtd||d|} ||dd}g}| r0t| }|std | | |d| |d} | sq0| dd krtd | | dd} q|s:d}|r|dd kr|dd}t |}|sztd ||d}t |} | j r| j std|||d}ndd} |ddkr| |\}}n|dd}|dkrtd||d|} ||dd}t| r@| | \}} nXt| }|s\td| |d} | |d} | rtd| d| fg}|r|ddkrtd||dd}t|\}}|r|ddkrtd||s|}nd|ddd|Df}t||||||dS)z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %scSst|}d}|rg}|d}||d}t|}|sLtd||d}|||f||d}|r|ddkrq|dd}t|}|std|q|sd}||fS)z| Return a list of operator, version tuples if any are specified, else None. Nrzinvalid version: %srCrinvalid constraint: %s) COMPARE_OPrrrVERSION_IDENTIFIERr r"r%)Z ver_remainingr'versionsr3vr,r,r- get_versionss*      z'parse_requirement..get_versionsr/r0r1rEz~=;zinvalid requirement: %szunexpected trailing data: %s%s %s, cSsg|] }d|qS)rLr,).0Zconr,r,r- sz%parse_requirement..)nameextrasZ constraintsr7urlZ requirement)strip startswithrrr rrfindr%r" NON_SPACErschemenetlocrFrGr?r$r)reqr&r'ZdistnamerQZ mark_exprrHuriir+trJ_rIZrsr,r,r-parse_requirements                          r^cCsdd}i}|D]\}}}tj||}t|D]p}tj||} t| D]T} ||| } |dkrn|| dqJ||| } |tjjdd} | d| || <qJq0q|S)z%Find destinations for resources filescSsD|tjjd}|tjjd}||s.t|t|ddSN/)r!ospathseprTAssertionErrorlenr%)rootrbr,r,r- get_rel_path sz)get_resources_dests..get_rel_pathNr`)rarbr$rpopr!rcrstrip)Zresources_rootZrulesrgZ destinationsbasesuffixdestprefixZabs_baseZabs_globZabs_pathZ resource_fileZrel_pathZrel_destr,r,r-get_resources_dests s    rncCs(ttdrd}ntjttdtjk}|S)NZ real_prefixT base_prefix)hasattrsysrmgetattrr(r,r,r-in_venv$s rtcCs$tjtj}t|ts t|}|SN)rarbnormcaserq executable isinstancerrrsr,r,r-get_executable.s  rycCsN|}t|}|}|s|r|}|r|d}||kr6qJ|rd|||f}q|S)Nrz %c: %s %s)r lower)promptZ allowed_charsZ error_promptdefaultpr+cr,r,r-proceed>s rcCs8t|tr|}i}|D]}||kr||||<q|Sru)rxrsplit)dkeysr(keyr,r,r-extract_by_keyNs rcCsztjddkrtd|}|}t|}zlt|}|ddd}|D]B\}}|D]0\}}d||f}t |} | dk st | ||<q`qP|WSt k r| ddYnXdd } t } z| | |Wn<t jk r|t|}t|}| | |YnXi}| D]R} i|| <}| | D]4\} }d| |f}t |} | dk sft | || <q<q"|S) Nrutf-8 extensionszpython.exportsexportsz%s = %scSs$t|dr||n ||dS)N read_file)rprZreadfp)cpstreamr,r,r- read_streamks  z!read_exports..read_stream)rq version_infocodecs getreaderreadr jsonloaditemsget_export_entryrd Exceptionseekr ConfigParserZMissingSectionHeaderErrorclosetextwrapdedentZsections)rdataZjdatar(groupentrieskrIr+entryrrrrPvaluer,r,r- read_exportsWsD        rcCstjddkrtd|}t}|D]l\}}|||D]P}|j dkr\|j }nd|j |j f}|j rd|d |j f}| ||j|qFq,||dS)Nrrrz%s:%sz%s [%s]rM)rqrr getwriterrrrZ add_sectionvaluesrkrmflagsr$setrPwrite)rrrrrIrr+r,r,r- write_exportss   rc cs$t}z |VW5t|XdSru)tempfilemkdtemprrmtree)Ztdr,r,r-tempdirs rc cs.t}zt|dVW5t|XdSru)ragetcwdchdir)rcwdr,r,r-rs   rc cs.t}zt|dVW5t|XdSru)socketZgetdefaulttimeoutZsetdefaulttimeout)ZsecondsZctor,r,r-socket_timeouts   rc@seZdZddZdddZdS)cached_propertycCs ||_dSru)func)selfrr,r,r-__init__szcached_property.__init__NcCs,|dkr |S||}t||jj||Sru)robject __setattr____name__)robjclsrr,r,r-__get__s  zcached_property.__get__)N)r __module__ __qualname__rrr,r,r,r-rsrcCs~tjdkr|S|s|S|ddkr.td||ddkrFtd||d}tj|krh|tjqP|srtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put 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. r`rzpath '%s' cannot be absolutezpath '%s' cannot end with '/')rarc ValueErrorrcurdirremoverbr$)pathnamepathsr,r,r- convert_paths       rc@seZdZd$ddZddZddZdd Zd%d d Zd&ddZddZ ddZ ddZ ddZ ddZ d'ddZddZddZd d!Zd"d#Zd S)( FileOperatorFcCs||_t|_|dSru)dry_runrensured _init_record)rrr,r,r-rszFileOperator.__init__cCsd|_t|_t|_dSNF)recordr files_written dirs_createdrr,r,r-rszFileOperator._init_recordcCs|jr|j|dSru)rradd)rrbr,r,r-record_as_writtenszFileOperator.record_as_writtencCsHtj|s tdtj|tj|s0dSt|jt|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)rarbexistsrabspathstatst_mtime)rsourcetargetr,r,r-newers   zFileOperator.newerTcCs|tj|td|||jsd}|rdtj|rDd|}n tj|rdtj |sdd|}|rtt |dt ||| |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirrarbdirnameloggerinforislinkrisfilerrZcopyfiler)rZinfileoutfilecheckmsgr,r,r- copy_files    zFileOperator.copy_fileNcCstj|rt|tj|td|||jsv|dkrJt |d}nt j |d|d}zt ||W5| X||dS)NzCopying stream %s to %swbwencoding)rarbisdirrdrrrrropenrrrZ copyfileobjr)rZinstreamrrZ outstreamr,r,r- copy_streams  zFileOperator.copy_streamc Cs\|tj||jsNtj|r.t|t|d}||W5QRX| |dS)Nr) rrarbrrrrrrr)rrbrfr,r,r-write_binary_file!s   zFileOperator.write_binary_filecCs||||dSru)rencode)rrbrrr,r,r-write_text_file*szFileOperator.write_text_filecCsntjdkstjdkrjtjdkrj|D]F}|jr:td|q"t|j|B|@}td||t||q"dS)Nposixjavazchanging mode of %szchanging mode of %s to %o) rarP_namerrrrst_modechmod)rbitsmaskfilesrmoder,r,r-set_mode-szFileOperator.set_modecCs|dd|S)Nimi)r)r+rr,r,r-9zFileOperator.cCs|tj|}||jkrxtj|sx|j|tj|\}}||t d||j sft ||j rx|j |dS)Nz Creating %s)rarbrrrrrrrrrmkdirrr)rrbrrr,r,r-r;s    zFileOperator.ensure_dirc Cst|| }td|||js|s0|||rX|s:d}n||sHt|t|d}i}|rvtt drvt j j |d<t j |||df|| ||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT)r rrrrrTrdrerp py_compiler CHECKED_HASHcompiler) rrboptimizeforcermZhashed_invalidationZdpathZdiagpathZcompile_kwargsr,r,r- byte_compileGs   zFileOperator.byte_compilecCstj|rtj|r^tj|s^td||js@t ||j r||j kr|j |nPtj|rpd}nd}td|||jst ||j r||j kr|j |dS)NzRemoving directory tree at %slinkfilezRemoving %s %s)rarbrrrrdebugrrrrrrr)rrbr+r,r,r-ensure_removedXs"       zFileOperator.ensure_removedcCsDd}|s@tj|r$t|tj}q@tj|}||kr:q@|}q|Sr)rarbraccessW_OKr)rrbr(parentr,r,r- is_writablems  zFileOperator.is_writablecCs"|js t|j|jf}||S)zV Commit recorded changes, turn off recording, return changes. )rrdrrr)rr(r,r,r-commitys  zFileOperator.commitcCs|jst|jD]}tj|rt|qt|jdd}|D]F}t |}|rz|dgks^t tj ||d}t |t |q>| dS)NT)reverse __pycache__r)rlistrrarbrrsortedrlistdirrdr$rmdirr)rrdirsrflistZsdr,r,r-rollbacks     zFileOperator.rollback)F)T)N)FFNF)rrrrrrrrrrrrZset_executable_moderrrrr rr,r,r,r-rs         rcCs^|tjkrtj|}nt|}|dkr,|}n.|d}t||d}|D]}t||}qJ|S)N.r)rqmodules __import__rrrrh)Z module_nameZ dotted_pathmodr(r*r}r,r,r-resolves    rc@s6eZdZddZeddZddZddZej Z d S) ExportEntrycCs||_||_||_||_dSrurPrmrkr)rrPrmrkrr,r,r-rszExportEntry.__init__cCst|j|jSru)rrmrkrr,r,r-rszExportEntry.valuecCsd|j|j|j|jfS)Nzrrr,r,r-__repr__s zExportEntry.__repr__cCsDt|tsd}n0|j|jko>|j|jko>|j|jko>|j|jk}|Sr)rxrrPrmrkr)rotherr(r,r,r-__eq__s     zExportEntry.__eq__N) rrrrrrrrr__hash__r,r,r,r-rs   rz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P\w+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cst|}|s0d}d|ks"d|krtd|n|}|d}|d}|d}|dkrf|d}}n"|dkrztd||d\}}|d } | dkrd|ksd|krtd|g} nd d | d D} t|||| }|S) NrArBzInvalid specification '%s'rPcallable:rrrcSsg|] }|qSr,)rS)rNrr,r,r-rOsz$get_export_entry..rC)ENTRY_REsearchr groupdictcountrr) Z specificationr'r(rrPrbZcolonsrmrkrr,r,r-rs8   rcCs|dkr d}tjdkr.dtjkr.tjd}n tjd}tj|rft|tj}|st d|n|dd\}}d|kr.|}n|dd\}}|rJt|}|rVt|}|||fS)NrDrr)rsplitrr)rXZusernameZpasswordrmr,r,r-parse_credentials$sr3cCstd}t||S)N)raumaskrsr,r,r-get_process_umask3s  r6cCs<d}d}t|D]\}}t|tsd}q,q|dk s8t|S)NTF) enumeraterxrrd)seqr(r[r+r,r,r-is_string_sequence8s  r9z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|dd}t|}|r@|d}|d|}|rt|t|dkrtt |d|}|r| }|d|||dd|f}|dkrt |}|r|d|d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\br) rr!PYTHON_VERSIONr!rstartrererescaperPROJECT_NAME_AND_VERSION)filenameZ project_namer(Zpyverr'nr,r,r-split_filenameGs"   rCz-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCs:t|}|std||}|d|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'rPZver)NAME_VERSION_RErrr"rSrz)r}r'rr,r,r-parse_name_and_versioncs  rEcCst}t|pg}t|pg}d|kr8|d||O}|D]x}|dkrT||q<|dr|dd}||krtd|||kr||q<||krtd|||q<|S)N*r;rzundeclared extra: %s)rrrrTrr*)Z requestedZ availabler(rZunwantedr,r,r- get_extrasrs&        rHc Csi}zNt|}|}|d}|ds8td|ntd|}t |}Wn0t k r}zt d||W5d}~XYnX|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %srz&Failed to get external data for %s: %s) r rgetrTrrrrrrr exception)rRr(ZrespZheadersZctreaderer,r,r-_get_external_datas   rMz'https://www.red-dove.com/pypi/projects/cCs*d|d|f}tt|}t|}|S)Nz%s/%s/project.jsonrupperr _external_data_base_urlrM)rPrRr(r,r,r-get_project_datas rQcCs(d|d||f}tt|}t|S)Nz%s/%s/package-%s.jsonrrN)rPversionrRr,r,r-get_package_datas rSc@s(eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsPtj|st|t|jd@dkr6td|tjtj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rarbrr+rrrr*rnormpathrj)rrjr,r,r-rs    zCache.__init__cCst|S)zN Converts a resource prefix to a directory name in the cache. )r/)rrmr,r,r- prefix_to_dirszCache.prefix_to_dirc Csg}t|jD]r}tj|j|}z>tj|s>tj|rJt|ntj|r`t |Wqt k r| |YqXq|S)z" Clear the cache. ) rarrjrbr$rrrrrrrr")rZ not_removedfnr,r,r-clears  z Cache.clearN)rrr__doc__rrWrYr,r,r,r-rTsrTc@s:eZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dSru) _subscribersrr,r,r-rszEventMixin.__init__TcCsD|j}||krt|g||<n"||}|r6||n ||dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)r\rr" appendleft)revent subscriberr"subsZsqr,r,r-rs  zEventMixin.addcCs,|j}||krtd||||dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)r\rr)rr^r_r`r,r,r-rs zEventMixin.removecCst|j|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. r,)iterr\rI)rr^r,r,r-get_subscribersszEventMixin.get_subscribersc Oslg}||D]F}z||f||}Wn"tk rHtdd}YnX||qtd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)rbrrrJr"r)rr^argskwargsr(r_rr,r,r-publishs    zEventMixin.publishN)T) rrrrZrrrrbrer,r,r,r-r[s   r[c@s^eZdZddZddZdddZdd Zd d Zd d ZddZ e ddZ e ddZ dS) SequencercCsi|_i|_t|_dSru)_preds_succsr_nodesrr,r,r-r"szSequencer.__init__cCs|j|dSru)rirrnoder,r,r-add_node'szSequencer.add_nodeFcCs||jkr|j||rt|j|dD]}|||q,t|j|dD]}|||qPt|jD]\}}|sp|j|=qpt|jD]\}}|s|j|=qdS)Nr,)rirrrgrIrhr r)rrkZedgesr}r+rrIr,r,r- remove_node*s   zSequencer.remove_nodecCs<||ks t|j|t||j|t|dSru)rdrg setdefaultrrrh)rpredsuccr,r,r-r:s z Sequencer.addcCs||ks tz|j|}|j|}Wn tk rDtd|YnXz||||Wn$tk rtd||fYnXdS)Nz%r not a successor of anythingz%r not a successor of %r)rdrgrhKeyErrorrr)rrorppredsZsuccsr,r,r-r?s   zSequencer.removecCs||jkp||jkp||jkSru)rgrhri)rstepr,r,r-is_stepLszSequencer.is_stepcCs||std|g}g}t}|||r|d}||krb||kr||||q.|||||j|d}| |q.t |S)Nz Unknown: %rrr,) rtrrr"rhrrrgrIextendreversed)rfinalr(Ztodoseenrsrrr,r,r- get_stepsPs"         zSequencer.get_stepscsRdggiig|jfddD]}|kr8|q8S)Nrcsd|<d|<dd7<|z |}Wntk rVg}YnX|D]J}|kr|t|||<q\|kr\t|||<q\||krg}}||||krqqt|}|dS)Nrr)r"rminrhtuple)rkZ successorsZ successorZconnected_componentZ componentZgraphindexZ index_counterZlowlinksr(stack strongconnectr,r-rts,      z3Sequencer.strong_connections..strongconnect)rhrjr,r|r-strong_connectionsis" zSequencer.strong_connectionscCsfdg}|jD]*}|j|}|D]}|d||fqq |jD]}|d|q>|dd|S)Nz digraph G {z %s -> %s;z %s;} )rgr"rir$)rr(rprrrorkr,r,r-dots    z Sequencer.dotN)F) rrrrrlrmrrrtrypropertyrrr,r,r,r-rf!s   2rf).tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc sZfdd}tjtd}|dkr|dr>d}nH|drRd}d}n4|drfd }d }n |d rzd }d }n td|z|dkrt|d }|r|}|D] }||qn*t ||}|r| }|D] }||q|dkr*t j ddkr*|D]"} t| jts| jd| _qdd} | |_|W5|rT|XdS)NcsRt|ts|d}tjtj|}|rB|tjkrNt d|dS)Nrzpath outside destination: %r) rxrdecoderarbrr$rTrcr)rbr}dest_dirZplenr,r- check_paths   zunarchive..check_path)rrzip)rrZtgzzr:gz)rrZtbzzr:bz2rZtarrGzUnknown format for %rrrrc SsDzt||WStjk r>}ztt|W5d}~XYnXdS)z:Run tarfile.tar_fillter, but raise the expected ValueErrorN)tarfileZ tar_filterZ FilterErrorrstr)memberrbexcr,r,r-extraction_filtersz$unarchive..extraction_filter)rarbrrer0rrrZnamelistrrZgetnamesrqrZ getmembersrxrPrrrZ extractall) Zarchive_filenamerformatrrarchivernamesrPZtarinforr,rr- unarchivesL           rc Cs~t}t|}t|dZ}t|D]H\}}}|D]8}tj||}||d} tj| |} ||| q4q&W5QRX|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOrerrawalkrbr$r) Z directoryr(ZdlenZzfrfrrrPZfullZrelrlr,r,r-zip_dirs  r)rKMGTPc@sreZdZdZdddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressZUNKNOWNrdcCs<|dks||kst||_|_||_d|_d|_d|_dS)NrF)rdrzcurmaxstartedelapseddone)rZminvalZmaxvalr,r,r-r s  zProgress.__init__cCsV|j|kst|jdks&||jks&t||_t}|jdkrF||_n ||j|_dSru)rzrdrrtimerr)rZcurvalZnowr,r,r-updates zProgress.updatecCs |dks t||j|dSNr)rdrr)rZincrr,r,r- increments zProgress.incrementcCs||j|Sru)rrzrr,r,r-r=s zProgress.startcCs |jdk r||jd|_dS)NT)rrrrr,r,r-stop#s  z Progress.stopcCs|jdkr|jS|jSru)runknownrr,r,r-maximum(szProgress.maximumcCsD|jr d}n4|jdkrd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rrrrz)rr(rIr,r,r- percentage,s zProgress.percentagecCs:|dkr|jdks|j|jkr$d}ntdt|}|S)Nrz??:??:??z%H:%M:%S)rrrzrstrftimegmtime)rZdurationr(r,r,r-format_duration7szProgress.format_durationcCs|jrd}|j}n^d}|jdkr&d}nJ|jdks<|j|jkrBd}n.t|j|j}||j|j}|d|j}d|||fS)NZDonezETA rrrz%s: %s)rrrrrzfloatr)rrmr\r,r,r-ETA@s z Progress.ETAcCsL|jdkrd}n|j|j|j}tD]}|dkr6q@|d}q&d||fS)Nrgig@@z%d %sB/s)rrrzUNITS)rr(Zunitr,r,r-speedSs  zProgress.speedN)rr)rrrrrrrr=rrrrrrrr,r,r,r-rs      rz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<t|rd}t||t|r4d}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBr!r_CHECK_MISMATCH_SET_iglob) path_globrr,r,r-rhs    rc cst|d}t|dkrht|dks,t||\}}}|dD]$}td|||fD] }|VqXq@nd|krt|D] }|Vqxn~|dd\}}|dkrd}|dkrd}n|d}|d }t |D]4\}}} tj |}ttj ||D] } | VqqdS) NrrrCrz**rrFr`\) RICH_GLOBrrerdrr$ std_iglobr%rarrbrV) rZrich_path_globrmrrkitemrbZradicaldirrrXr,r,r-rss*         r) HTTPSHandlermatch_hostnameCertificateErrorc@seZdZdZdZddZdS)HTTPSConnectionNTcCsRt|j|jf|j}t|ddr0||_|tt dsp|j rHt j }nt j }t j ||j|j|t j|j d|_nxt t j}|jt jO_|jr||j|ji}|j rt j |_|j|j dtt ddr|j|d<|j |f||_|j rN|jrNz$t|j|jtd|jWn0tk rL|jtj|jYnXdS) NZ _tunnel_hostF SSLContext) cert_reqsZ ssl_versionca_certs)ZcafileZHAS_SNIZserver_hostnamezHost verified: %s) rZcreate_connectionhostporttimeoutrrsockZ_tunnelrpsslrZ CERT_REQUIREDZ CERT_NONEZ wrap_socketZkey_fileZ cert_fileZPROTOCOL_SSLv23rZoptionsZ OP_NO_SSLv2Zload_cert_chainZ verify_modeZload_verify_locations check_domainrZ getpeercertrrrZshutdownZ SHUT_RDWRr)rrrcontextrdr,r,r-connects@       zHTTPSConnection.connect)rrrrrrr,r,r,r-rsrc@s&eZdZd ddZddZddZdS) rTcCst|||_||_dSru)BaseHTTPSHandlerrrr)rrrr,r,r-rs zHTTPSHandler.__init__cOs$t||}|jr |j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr)rrcrdr(r,r,r- _conn_makers zHTTPSHandler._conn_makerc CsXz||j|WStk rR}z$dt|jkr@td|jnW5d}~XYnXdS)Nzcertificate verify failedz*Unable to verify server certificate for %s)Zdo_openrrrreasonrr)rrYrLr,r,r- https_openszHTTPSHandler.https_openN)T)rrrrrrr,r,r,r-rs rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrYr,r,r- http_openszHTTPSOnlyHandler.http_openN)rrrrr,r,r,r-rsrrc@seZdZdddZdS)HTTPrNcKs&|dkr d}||j||f|dSr_setupZ_connection_classrrrrdr,r,r-rsz HTTP.__init__)rNrrrrr,r,r,r-rsrc@seZdZdddZdS)HTTPSrNcKs&|dkr d}||j||f|dSrrrr,r,r-rszHTTPS.__init__)rNrr,r,r,r-rsrc@seZdZdddZddZdS) TransportrcCs||_tj||dSru)rrrrrr use_datetimer,r,r-rszTransport.__init__cCs`||\}}}tdkr(t||jd}n4|jr<||jdkrR||_|t|f|_|jd}|S)Nr)rrr) get_host_info _ver_inforr _connection_extra_headersrZHTTPConnection)rrhehZx509r(r,r,r-make_connection s zTransport.make_connectionN)rrrrrrr,r,r,r-rs rc@seZdZdddZddZdS) SafeTransportrcCs||_tj||dSru)rrrrrr,r,r-rszSafeTransport.__init__cCsx||\}}}|si}|j|d<tdkr:t|df|}n:|jrN||jdkrj||_|tj|df|f|_|jd}|S)Nrrrr)rrrrrrrr)rrrrrdr(r,r,r-rs   zSafeTransport.make_connectionN)rrr,r,r,r-rs rc@seZdZddZdS) ServerProxyc Kst|dd|_}|dk r^t|\}}|dd}|dkr@t}nt}|||d|d<}||_tjj ||f|dS)NrrrZhttps)r transport) rhrrrIrrrrrr) rrZrdrrWr]rZtclsr\r,r,r-r,s  zServerProxy.__init__Nrr,r,r,r-r+srcKs6tjddkr|d7}nd|d<d|d<t||f|S)Nrrbrnewlinerr)rqrr)rXrrdr,r,r- _csv_open@s  rc@s4eZdZedededdZddZddZd S) CSVBaserC"r)Z delimiterZ quotecharZlineterminatorcCs|Srur,rr,r,r- __enter__RszCSVBase.__enter__cGs|jdSru)rr)rr&r,r,r-__exit__UszCSVBase.__exit__N)rrrrdefaultsrrr,r,r,r-rKs rc@s(eZdZddZddZddZeZdS) CSVReadercKs\d|kr4|d}tjddkr,td|}||_nt|dd|_tj|jf|j|_dS)NrrrrrbrG) rqrrrrrcsvrKr)rrdrr,r,r-rZszCSVReader.__init__cCs|Srur,rr,r,r-__iter__eszCSVReader.__iter__cCsFt|j}tjddkrBt|D] \}}t|ts |d||<q |SNrrr)nextrKrqrr7rxrr)rr(r[rr,r,r-rhs   zCSVReader.nextN)rrrrrr__next__r,r,r,r-rYs rc@seZdZddZddZdS) CSVWritercKs$t|d|_tj|jf|j|_dS)Nr)rrrwriterr)rrXrdr,r,r-rss zCSVWriter.__init__cCsNtjddkr>g}|D]"}t|tr.|d}||q|}|j|dSr)rqrrxrrr"rwriterow)rrowrGrr,r,r-rws   zCSVWriter.writerowN)rrrrrr,r,r,r-rrsrcsHeZdZeejZded<d fdd ZddZdd Zd d Z Z S) Configurator inc_convertZincNcs"tt|||pt|_dSru)superrrrarrj)rconfigrj __class__r,r-rszConfigurator.__init__c sfddd}t|s*|}dd}dd}|r\tfdd|D}fd dD}t|}|||}|r|D]\}} t||| q|S) Ncsvt|ttfr*t|fdd|D}nHt|trhd|krH|}qri}|D]}||||<qPn |}|S)Ncsg|] }|qSr,r,)rNr[convertr,r-rOszBConfigurator.configure_custom..convert..())rxr r{typedictconfigure_customr)or(r)rrr,r-rs   z.Configurator.configure_custom..convertrrz[]r,csg|] }|qSr,r,)rNr rr,r-rOsz1Configurator.configure_custom..cs$g|]}t|r||fqSr,)r)rNr)rrr,r-rOs)rhrrr{r rsetattr) rrr~Zpropsrcrrdr(rBrIr,)rrrr-r s     zConfigurator.configure_customcCs4|j|}t|tr0d|kr0|||j|<}|S)Nr)rrxr r )rrr(r,r,r- __getitem__s zConfigurator.__getitem__c CsFtj|stj|j|}tj|ddd}t|}W5QRX|S)z*Default converter for the inc:// protocol.rGrr) rarbisabsr$rjrrrr)rrrr(r,r,r-rs  zConfigurator.inc_convert)N) rrrr rZvalue_convertersrr rr __classcell__r,r,rr-rs  rc@s*eZdZdZd ddZddZdd ZdS) SubprocessMixinzC Mixin for running subprocesses and capturing their output FNcCs||_||_dSru)verboseprogress)rrrr,r,r-rszSubprocessMixin.__init__cCsj|j}|j}|}|sq^|dk r.|||q |s@tjdntj|dtjq |dS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nrr) rrreadlinerqstderrrrflushr)rrrrrr+r,r,r-rKs  zSubprocessMixin.readercKstj|ftjtjd|}tj|j|jdfd}|tj|j|jdfd}|| | | |j dk r| ddn|j rt jd|S)N)stdoutrr)rrcrzdone.mainzdone. ) subprocessPopenPIPE threadingZThreadrKrr=rwaitr$rrrqr)rcmdrdr}t1t2r,r,r- run_commands"   zSubprocessMixin.run_command)FN)rrrrZrrKr!r,r,r,r-rs rcCstdd|S)z,Normalize a python package name a la PEP 503z[-_.]+r;)r>subrz)rPr,r,r-normalize_namesr#)NN)r)N)N)NT)r collectionsr contextlibrZglobrrrrZloggingrarr>rr ImportErrorrrqrrrrZdummy_threadingrrrcompatrrrr r r r r rrrrrrrrrrrrrZ getLoggerrrrrrGrFr6r>r:rVr#r?r^rnrtryrrrrcontextmanagerrrrrrrrrrVERBOSEr rr-r/r1r3r6r9Ir@r<rCrDrErHrMrPrQrSrTr[rfZARCHIVE_EXTENSIONSrrrrrrrrrrrrrrrrrrrrrrrrrrrr#r,r,r,r-s      \         Yy   /   8 )    ,H  C]    *)   7.PK!wdgg#__pycache__/metadata.cpython-38.pycnu[U .e*@sdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZeeZGd d d e ZGd dde ZGddde ZGddde ZdddgZdZ dZ!e"dZ#e"dZ$dZ%dZ&dZ'dZ(dZ)dZ*d Z+e*d!Z,d"Z-e.Z/e/0e%e/0e&e/0e(e/0e*e/0e,e"d#Z1d$d%Z2d&d'Z3d(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFZ4dGZ5dHZ6dIZ7dJZ8dKZ9dLZ:dMZ;e<Z=e"dNZ>dXdPdQZ?GdRdSdSe<Z@dTZAdUZBdVZCGdWdde<ZDdS)YzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REc@seZdZdZdS)MetadataMissingErrorzA required metadata is missingN__name__ __module__ __qualname____doc__rr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/metadata.pyrsrc@seZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.Nrrrrrr src@seZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.Nrrrrrr$src@seZdZdZdS)MetadataInvalidErrorzA metadata value is invalidNrrrrrr(srMetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONutf-81.1z \| ) Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicense)r r!r"r#Supported-Platformr$r%r&r'r(r)r* Classifier Download-URL ObsoletesProvidesRequires)r.r/r0r,r-)r r!r"r#r+r$r%r&r'r(r) MaintainerMaintainer-emailr*r,r-Obsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-External)r5r6r7r3r8r1r2r4)r r!r"r#r+r$r%r&r'r(r)r1r2r*r,r-r3r4r5r6r7r8Private-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extra)r9r=r:r;r<)Description-Content-Typer0r/)r>z"extra\s*==\s*("([^"]+)"|'([^']+)')cCsL|dkr tS|dkrtS|dkr$tS|dkr4ttS|dkr@tSt|dS)N1.0r1.2)1.32.12.0) _241_FIELDS _314_FIELDS _345_FIELDS _566_FIELDS _426_FIELDSr)versionrrr_version2fieldlistpsrJc CsBdd}g}|D]"\}}|gddfkr,q||qddddd d g}|D]}|tkrvd|krv|dtd ||tkrd|kr|dtd ||tkrd|kr|dtd ||tkrd|kr|dtd||tkrd |kr|dkr|d td||t krLd |krL|d td|qLt |dkrZ|dSt |dkr|td|t dd|ko||t }d|ko||t }d |ko||t}d |ko||t} t|t|t|t| dkrt d|s |s |s | s t|kr tS|r*dS|r4dS|r>d Sd S)z5Detect the best version depending on the fields used.cSs|D]}||krdSqdS)NTFr)keysmarkersmarkerrrr _has_markersz"_best_version.._has_markerUNKNOWNNr?rr@rArCrBzRemoved 1.0 due to %szRemoved 1.1 due to %szRemoved 1.2 due to %szRemoved 1.3 due to %sr%zRemoved 2.1 due to %szRemoved 2.0 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.0/2.1 fields)itemsappendrDremoveloggerdebugrErFrGrHlenr _314_MARKERS _345_MARKERS _566_MARKERS _426_MARKERSintr) fieldsrNrKkeyvalueZpossible_versionsZis_1_1Zis_1_2Zis_2_1Zis_2_0rrr _best_version~s`              & r^r r!r"r#r+r$r%r&r'r(r)r1r2r*r,r-r3r5r6r;r7r8r0r/r.r4r9r:r<r=)metadata_versionnamerIplatformZsupported_platformsummary descriptionkeywords home_pageauthor author_email maintainermaintainer_emaillicense classifier download_urlobsoletes_dist provides_dist requires_distsetup_requires_distrequires_pythonrequires_externalrequiresprovides obsoletes project_urlZprivate_versionZ obsoleted_by extensionZprovides_extra)r6r3r5)r7)r")r#r,r.r0r/r3r5r6r8r4r+r;r=r<)r4)r&)r(r1r$r%z[^A-Za-z0-9.]+FcCs0|r$td|}td|dd}d||fS)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.- .z%s-%s) _FILESAFEsubreplace)r`rIZ for_filenamerrr_get_name_and_versions r~c@s eZdZdZd?ddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZd@ddZddZdd Zd!d"Zd#d$ZdAd%d&ZdBd'd(ZdCd)d*Zd+d,Zefd-d.ZdDd/d0ZdEd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!dS)FLegacyMetadataaaThe legacy metadata of a release. Supports versions 1.0, 1.1 and 1.2 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcCsz|||gddkrtdi|_g|_d|_||_|dk rH||n.|dk r\||n|dk rv||| dS)N'path, fileobj and mapping are exclusive) count TypeError_fieldsZrequires_filesZ _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrrrr__init__s   zLegacyMetadata.__init__cCst|j|jd<dSNr )r^rrrrrr"sz#LegacyMetadata.set_metadata_versioncCs|d||fdS)Nz%s: %s )write)rrr`r]rrr _write_field%szLegacyMetadata._write_fieldcCs ||SN)getrr`rrr __getitem__(szLegacyMetadata.__getitem__cCs |||Sr)set)rr`r]rrr __setitem__+szLegacyMetadata.__setitem__cCs8||}z |j|=Wntk r2t|YnXdSr) _convert_namerKeyError)rr` field_namerrr __delitem__.s   zLegacyMetadata.__delitem__cCs||jkp|||jkSr)rrrrrr __contains__5s zLegacyMetadata.__contains__cCs(|tkr |S|dd}t||S)Nrx_) _ALL_FIELDSr}lower _ATTR2FIELDrrrrrr9szLegacyMetadata._convert_namecCs|tks|tkrgSdS)NrO) _LISTFIELDS_ELEMENTSFIELDrrrr_default_value?szLegacyMetadata._default_valuecCs&|jdkrtd|Std|SdS)Nr?r )r__LINE_PREFIX_PRE_1_2r|_LINE_PREFIX_1_2rr]rrr_remove_line_prefixDs  z"LegacyMetadata._remove_line_prefixcCs|tkr||St|dSr)rAttributeErrorrrrr __getattr__JszLegacyMetadata.__getattr__FcCst|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.r!r")r~)rZfilesaferrr get_fullnameUszLegacyMetadata.get_fullnamecCs||}|tkS)z+return True if name is a valid metadata key)rrrrrris_field[s zLegacyMetadata.is_fieldcCs||}|tkSr)rrrrrris_multi_field`s zLegacyMetadata.is_multi_fieldcCs.tj|ddd}z||W5|XdS)z*Read the metadata values from a file path.rrencodingN)codecsopencloser)rfilepathfprrrrdszLegacyMetadata.readcCst|}|d|jd<tD]p}||kr(q|tkrf||}|tkrX|dk rXdd|D}|||q||}|dk r|dkr|||qdS)z,Read the metadata values from a file object.zmetadata-versionr NcSsg|]}t|dqS,)tuplesplit.0r]rrr ysz,LegacyMetadata.read_file..rO)rrrrZget_all_LISTTUPLEFIELDSr)rZfileobmsgfieldvaluesr]rrrrls zLegacyMetadata.read_filecCs0tj|ddd}z|||W5|XdS)z&Write the metadata fields to filepath.wrrN)rrr write_file)rr skip_unknownrrrrrszLegacyMetadata.writecCs|t|dD]}||}|r8|dgdgfkr8q|tkrV|||d|q|tkr|dkr|jdkr~|dd}n |dd}|g}|t krd d |D}|D]}||||qqd S) z0Write the PKG-INFO format data to a file object.r rOrr%rrrz |cSsg|]}d|qSrjoinrrrrrsz-LegacyMetadata.write_file..N) rrJrrrrrr_r}r)rZ fileobjectrrrr]rrrrs$   zLegacyMetadata.write_filec svfdd}|sn@t|dr:|D]}||||q$n|D]\}}|||q>|rr|D]\}}|||q^dS)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs"|tkr|r||dSr)rrr)r\r]rrr_sets z#LegacyMetadata.update.._setrKN)hasattrrKrP)rotherkwargsrkvrrrrs     zLegacyMetadata.updatecCsh||}|tks|dkrNt|ttfsNt|trHdd|dD}qzg}n,|tkrzt|ttfszt|trv|g}ng}t t j r<|d}t |j }|tkr|dk r|D](}||ddstd |||qnb|tkr |dk r ||s.rr!N;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r%)rr isinstancelistrrrrrSZ isEnabledForloggingZWARNINGr r_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrr)rr`r]Z project_namerrrrrrsV           zLegacyMetadata.setcCs||}||jkr*|tkr&||}|S|tkr@|j|}|S|tkr|j|}|dkr^gSg}|D].}|tkr~||qf||d|dfqf|S|tkr|j|}t |t r| dS|j|S)zGet a metadata field.Nrrr) rr_MISSINGrrrrrQrrrr)rr`rr]resvalrrrrs.         zLegacyMetadata.getc s|gg}}dD]}||kr||q|rP|gkrPdd|}t|dD]}||krT||qT|ddkr||fSt|jfdd}t|ftjft j ffD]@\}}|D]2} | | d } | d k r|| s|d | | fqq||fS) zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are provided)r!r"zmissing required metadata: %s, )r'r(r r@cs(|D]}|ddsdSqdS)NrrFT)rr)r]rrrrare_valid_constraints#sz3LegacyMetadata.check..are_valid_constraintsNzWrong value for '%s': %s) rrQrrr rrrrrrr) rstrictmissingwarningsattrrrr[Z controllerrr]rrrcheck s8         zLegacyMetadata.checkcCs|d}i}|D]"\}}|r*||jkr||||<q|ddkrd}|D]B\}}|rb||jkrL|dkrx||||<qLdd||D||<qLn8|ddkrd }|D]"\}}|r||jkr||||<q|S) zReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). ) )r_r )r`r!)rIr")rbr$)rer')rfr()rgr))rjr*)rcr%)rdr&)rar#) classifiersr,)rlr-r r@))ror6)rqr7)rrr8)rnr5)rmr3)rvr4)rhr1)rir2rvcSsg|]}d|qSrr)rurrrrbsz)LegacyMetadata.todict..r))rtr/)rsr0)rur.)rr)rZ skip_missingZ mapping_1_0datar\rZ mapping_1_2Z mapping_1_1rrrtodict5s&     zLegacyMetadata.todictcCs8|ddkr$dD]}||kr||=q|d|7<dS)Nr r)r.r0r/r6r)r requirementsrrrradd_requirementsps  zLegacyMetadata.add_requirementscCstt|dSr)rrJrrrrrK{szLegacyMetadata.keysccs|D] }|VqdSrrK)rr\rrr__iter__~s zLegacyMetadata.__iter__csfddDS)Ncsg|] }|qSrrrr\rrrrsz)LegacyMetadata.values..rrrrrrszLegacyMetadata.valuescsfddDS)Ncsg|]}||fqSrrrrrrrsz(LegacyMetadata.items..rrrrrrPszLegacyMetadata.itemscCsd|jj|j|jfS)Nz <%s %s %s>) __class__rr`rIrrrr__repr__s zLegacyMetadata.__repr__)NNNr)F)F)F)N)F)F)"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrKrrrPrrrrrrs@      ,  , ; rz pydist.jsonz metadata.jsonZMETADATAc@seZdZdZedZedejZe Z edZ dZ de Zdddd Zd Zd Zedfedfe dfe dfd Zd ZdDddZedZdefZdefZdefdefeeedefeeeedefddd Z[[ddZdEddZddZed d!Z ed"d#Z!e!j"d$d#Z!dFd%d&Z#ed'd(Z$ed)d*Z%e%j"d+d*Z%d,d-Z&d.d/Z'd0d1Z(d2d3Z)d4d5d6d7d8dd9Z*d:d;Z+dGd>d?Z,d@dAZ-dBdCZ.dS)Hrz The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z .{1,2047}rCz distlib (%s)r)legacy)r`rIrbzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)r_r`rIrb)_legacy_datarNrc Cs0|||gddkrtdd|_d|_||_|dk rzz|||||_Wn*tk rvt||d|_|YnXnd}|rt |d}| }W5QRXn |r| }|dkr|j |j d|_ndt |ts|d}zt||_||j|Wn0tk r*tt||d|_|YnXdS)Nrr)rrrbr_ generatorr)rr)rrrrr_validate_mappingrrvalidaterrMETADATA_VERSION GENERATORrr decodejsonloads ValueErrorr)rrrrrrfrrrrs@       zMetadata.__init__)r`rIrjrdrbr6r;r=r,)r-N)r N) run_requiresbuild_requires dev_requiresZ test_requires meta_requiresextrasmodules namespacesexportscommandsrZ source_urlr_c CsXt|d}t|d}||kr||\}}|jr^|dkrP|dkrHdn|}n |j|}n|dkrjdn|}|dkr|j||}nt}|}|jd} | r |dkr| d|}nP|dkr| d} | r| ||}n,| d } | s|jd } | r | ||}||krT|}n:||kr2t||}n"|jrH|j|}n |j|}|S) N common_keys mapped_keysr rrrr extensionsr python.commandsrpython.detailspython.exports)object__getattribute__rrr) rr\commonmappedlkZmakerresultr]sentineldrrrrsD            zMetadata.__getattribute__cCsH||jkrD|j|\}}|p |j|krD||}|sDtd||fdS)Nz.'%s' is an invalid value for the '%s' property)SYNTAX_VALIDATORSrmatchr)rr\r]rpattern exclusionsmrrr_validate_value+s  zMetadata._validate_valuecCs*|||t|d}t|d}||kr||\}}|jrV|dkrJt||j|<nf|dkrj||j|<nR|jdi}|dkr||d<n2|dkr|di}|||<n|d i}|||<nh||krt|||nP|d krt|t r| }|r| }ng}|jr||j|<n ||j|<dS) Nr r r r r rrrrrd) rrrrNotImplementedErrorr setdefault __setattr__rrrr)rr\r]rrrrrrrrr!5s<               zMetadata.__setattr__cCst|j|jdSNT)r~r`rIrrrrname_and_version\szMetadata.name_and_versioncCsF|jr|jd}n|jdg}d|j|jf}||krB|||S)Nr5rtz%s (%s))rrr r`rIrQ)rrsrrrrt`s  zMetadata.providescCs |jr||jd<n ||jd<dS)Nr5rt)rrrrrrrtks c Cs|jr |}ng}t|pg|j}|D]d}d|kr>d|kr>d}n8d|krLd}n|d|k}|rv|d}|rvt||}|r$||dq$dD]F}d|} | |kr|| |jd|g}||j|||dq|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrs)ZbuildZdevZtestz:%s:z %s_requires)renv) rr rrr extendrRrget_requirements) rreqtsrr'rrZincluderMr\errrr)rs2      zMetadata.get_requirementscCs|jr|S|jSr)r _from_legacyrrrrr dictionaryszMetadata.dictionarycCs|jr tnt|j|jSdSr)rrr rDEPENDENCY_KEYSrrrr dependenciesszMetadata.dependenciescCs|jr tn |j|dSr)rrrrrrrrr/sc Cs|d|jkrtg}|jD]"\}}||kr$||kr$||q$|rbdd|}t||D]\}}||||qjdS)Nr_zMissing metadata items: %sr) rrrMANDATORY_KEYSrPrQrrr) rrrrr\rrrrrrrrs zMetadata._validate_mappingcCsB|jr.|jd\}}|s|r>td||n||j|jdS)NTz#Metadata: missing: %s, warnings: %s)rrrSrrrr)rrrrrrrszMetadata.validatecCs(|jr|jdSt|j|j}|SdSr")rrr r INDEX_KEYS)rrrrrrs zMetadata.todictc Cs|jr |jrt|j|jd}|jd}dD]*}||kr.|dkrHd}n|}||||<q.|dg}|dgkrtg}||d<d }|D]*\}}||kr||rd ||ig||<q|j|d <i}i} |S) NrT)r`rIrjrbrcrkrkrr&rd))ror)rprrsrt)rrAssertionErrorrrrrrt) rrZlmdrnkkwrKokrfrhrrrr,s.     zMetadata._from_legacyr!r"r*r$r%)r`rIrjrbrcrcCsdd}|jr|jrtt}|j}|jD]\}}||kr.||||<q.||j|j}||j|j }|j rt |j |d<t ||d<t ||d<|S)NcSst}|D]|}|d}|d}|d}|D]V}|sF|sF||q.d}|rVd|}|rp|rld||f}n|}|d||fq.q |S)Nr%r&rsr2z extra == "%s"z (%s) and %sr)rraddr)entriesr*r+r%r'ZrlistrrMrrrprocess_entriess"   z,Metadata._to_legacy..process_entriesr=r6r;) rrr3rLEGACY_MAPPINGrPrrrrrsorted)rr9rZnmdr4r6Zr1Zr2rrr _to_legacys  zMetadata._to_legacyFTc Cs||gddkrtd||r`|jr4|j}n|}|rP|j||dq|j||dn^|jrp|}n|j}|rt j ||ddddn.t |dd}t j ||ddddW5QRXdS) Nrz)Exactly one of path and fileobj is needed)rTr)Z ensure_asciiindentZ sort_keysrr) rrrrr<rrr,rrdumprr)rrrrrZ legacy_mdrrrrrrs*   zMetadata.writecCs|jr|j|nr|jdg}d}|D]}d|kr*d|kr*|}qHq*|dkrfd|i}|d|n t|dt|B}t||d<dS)Nrr&r%rsr)rrrr insertrr;)rrralwaysentryZrsetrrrr3szMetadata.add_requirementscCs*|jpd}|jpd}d|jj|j||fS)Nz (no name)z no versionz<%s %s %s (%s)>)r`rIrrr_)rr`rIrrrrDs  zMetadata.__repr__)NNNr)N)NN)NNFT)/rrrrrecompileZMETADATA_VERSION_MATCHERIZ NAME_MATCHERrZVERSION_MATCHERZSUMMARY_MATCHERrrrr0r1r.r __slots__rrr rZ none_listdictZ none_dictr rrr!propertyr#rtsetterr)r-r/rrrr,r:r<rrrrrrrrs   -+ '    *     % )F)ErZ __future__rrZemailrrrrBr2rrcompatrrr rLr utilr r rIr rZ getLoggerrrSrrrr__all__rrrCrrrDrErVrFrWrHrYrGrXrrrZEXTRA_RErJr^rrrrrrrrrrr{r~rZMETADATA_FILENAMEZWHEEL_METADATA_FILENAMEZLEGACY_METADATA_FILENAMErrrrrs              H!   PK!X~Icc __pycache__/wheel.cpython-38.pycnu[U .e@sddlmZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlm Z m!Z!m"Z"dd l#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,dd l-m.Z.m/Z/e 0e1Z2da3e4ed r8d Z5n*ej67d rLdZ5nej6dkr^dZ5ndZ5e8dZ9e9sdej:ddZ9de9Z;e5e9Zdd>ddZ?e8dZ@e@re@7dre@>ddZ@nddZAeAZ@[AeBdejCejDBZEeBdejCejDBZFeBdZGeBd ZHd!ZId"ZJe jKd#krBd$d%ZLnd&d%ZLGd'd(d(eMZNeNZOGd)d*d*eMZPd+d,ZQeQZR[Qd/d-d.ZSdS)0)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir)NormalizedVersionUnsupportedVersionErrorZpypy_version_infoZppjavaZjyZcliZipcpZpy_version_nodotz%s%spy-_.ZSOABIzcpython-cCsRdtg}tdr|dtdr0|dtddkrH|dd |S) NrZPy_DEBUGdZ WITH_PYMALLOCmZPy_UNICODE_SIZEu) VER_SUFFIXrget_config_varappendjoin)partsr,=/usr/lib/python3.8/site-packages/pip/_vendor/distlib/wheel.py _derive_abi;s     r.zz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/cCs|SNr,or,r,r-]r3cCs|tjdS)Nr/)replaceossepr1r,r,r-r3_r4c@s6eZdZddZddZddZd dd Zd d ZdS) MountercCsi|_i|_dSr0) impure_wheelslibsselfr,r,r-__init__cszMounter.__init__cCs||j|<|j|dSr0)r9r:update)r<pathname extensionsr,r,r-addgs z Mounter.addcCs0|j|}|D]\}}||jkr|j|=qdSr0)r9popr:)r<r?r@kvr,r,r-removeks   zMounter.removeNcCs||jkr|}nd}|Sr0)r:)r<fullnamepathresultr,r,r- find_moduleqs zMounter.find_modulecCsj|tjkrtj|}nP||jkr,td|t||j|}||_|dd}t|dkrf|d|_ |S)Nzunable to find extension for %sr!rr) sysmodulesr: ImportErrorimpZ load_dynamic __loader__rsplitlen __package__)r<rFrHr+r,r,r- load_modulexs       zMounter.load_module)N)__name__ __module__ __qualname__r=rArErIrRr,r,r,r-r8bs  r8c@seZdZdZdZdZd4ddZedd Zed d Z ed d Z e ddZ ddZ e ddZddZd5ddZddZddZddZd6ddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd7d,d-Zd.d/Zd0d1Zd8d2d3ZdS)9Wheelz@ Class to build and install from Wheel files (PEP 427). rrZsha256NFcCs8||_||_d|_tg|_dg|_dg|_t|_ |dkrRd|_ d|_ |j |_ nt|}|r|d}|d|_ |dd d |_ |d |_|j |_ ntj|\}}t|}|std ||rtj||_ ||_ |d}|d|_ |d|_ |d |_|d d|_|dd|_|dd|_dS)zB Initialise an instance using a (valid) filename. r&noneanyNZdummyz0.1ZnmZvnr rZbnzInvalid name or filename: %rrr!ZbiZar)signZ should_verifybuildverPYVERpyverabiarchr6getcwddirnamenameversionfilenameZ _filenameNAME_VERSION_REmatch groupdictr5rGsplit FILENAME_RErabspath)r<rdrZverifyr#inforar,r,r-r=sD            zWheel.__init__cCs^|jrd|j}nd}d|j}d|j}d|j}|jdd}d|j|||||fS)zJ Build and return a filename from the various components. rr&r!r z%s-%s%s-%s-%s-%s.whl)r[r*r]r^r_rcr5rb)r<r[r]r^r_rcr,r,r-rds     zWheel.filenamecCstj|j|j}tj|Sr0)r6rGr*rardisfile)r<rGr,r,r-existssz Wheel.existsccs4|jD](}|jD]}|jD]}|||fVqqqdSr0)r]r^r_)r<r]r^r_r,r,r-tagss   z Wheel.tagsc Cstj|j|j}d|j|jf}d|}td}t |d}| |}|d dd}t dd |D}|d krt td g} nt tg} d} | D]f} zLt|| } || ,} || }t|d } | rW5QRWqW5QRXWqtk rYqXq| std d| W5QRX| S)N%s-%s %s.dist-infoutf-8r Wheel-Versionr!rcSsg|] }t|qSr,int.0ir,r,r- sz"Wheel.metadata..rWZMETADATA)Zfileobjz8Invalid wheel, because metadata is missing: looked in %sz, )r6rGr*rardrbrccodecs getreaderrget_wheel_metadatarhtuplerr posixpathopenr KeyError ValueError)r<r?name_verinfo_dirwrapperzfwheel_metadatawv file_versionZfnsrHfnmetadata_filenamebfwfr,r,r-metadatas6       zWheel.metadatac CsXd|j|jf}d|}t|d}||}td|}t|}W5QRXt|S)NrprqWHEELrr) rbrcrr*rr{r|rdict)r<rrrrrrmessager,r,r-r}s  zWheel.get_wheel_metadatac Cs6tj|j|j}t|d}||}W5QRX|S)Nrs)r6rGr*rardrr})r<r?rrHr,r,r-rls z Wheel.infoc Cst|}|r||}|d|||d}}d|krBt}nt}t|}|rfd|d}nd}||}||}nT|d}|d} |dks|| krd} n|||dd krd } nd} t| |}|S) Nspythonw r4  rrs ) SHEBANG_RErfendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) r<datar#rZshebangZdata_after_shebangZshebang_pythonargsZcrZlfZtermr,r,r-process_shebangs,       zWheel.process_shebangcCsh|dkr|j}ztt|}Wn tk r<td|YnX||}t|d d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64Zurlsafe_b64encoderstripdecode)r<rrhasherrHr,r,r-get_hash"s zWheel.get_hashc Cs^t|}ttj||}||ddf|t|}|D]}||q@W5QRXdS)Nr&) listto_posixr6rGrelpathr)sortrZwriterow)r<recordsZ record_pathbasepwriterrowr,r,r- write_record-s zWheel.write_recordc Csg}|\}}tt|j}|D]P\}} t| d} | } W5QRXd|| } tj| } | || | fqtj |d} | || |t tj |d}| || fdS)Nrbz%s=%sRECORD) rrrrreadrr6rGgetsizer)r*rr)r<rllibdir archive_pathsrdistinforraprfrrsizer,r,r- write_records6s    zWheel.write_recordsc CsFt|dtj.}|D]"\}}td|||||qW5QRXdS)NwzWrote %s to %s in wheel)rzipfileZ ZIP_DEFLATEDloggerdebugwrite)r<r?rrrrr,r,r- build_zipFs zWheel.build_zipc! s~|dkr i}ttfdddd}|dkrFd}tg}tg}tg}nd}tg}d g}d g}|d ||_|d ||_|d ||_ |} d|j |j f} d| } d| } g} dD]}|krq|}t j |rt |D]\}}}|D]}tt j ||}t j ||}tt j | ||}| ||f|dkr|dst|d}|}W5QRX||}t|d}||W5QRXqqq| }d}t |D]\}}}||kr t|D]8\}}t|}|drt j ||}||=qq|s td|D]H}t|dr(qt j ||}tt j ||}| ||fqqt |}|D]B}|dkrltt j ||}tt j | |}| ||fqld|p|jdtd|g}|jD] \}}}|d|||fqt j |d}t|d}|d |W5QRXtt j | d}| ||f| || f| | t j |j!|j"} |#| | | S)!z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Ncs|kSr0r,r1pathsr,r-r3Tr4zWheel.build..)purelibplatlibrrZfalsetruerXrYr]r^r_rp%s.datarq)rZheadersscriptsr.exerwbz .dist-infoz(.dist-info directory expected, not found)z.pycz.pyo)rZ INSTALLERZSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %sz Tag: %s-%s-%srr )$rr IMPVERABIARCHr\getr]r^r_rbrcr6rGisdirwalkr r*rrr)endswithrrrr enumerateAssertionErrorlistdir wheel_versionrrorrardr)!r<rrorZlibkeyZis_pureZ default_pyverZ default_abiZ default_archrrdata_dirrrkeyrGrootdirsfilesrrrprrrrrydnrr]r^r_r?r,rr-buildLs           z Wheel.buildcCs |dS)zl Determine whether an archive entry should be skipped when verifying or installing. )r/z /RECORD.jws)r)r<arcnamer,r,r- skip_entryszWheel.skip_entrycC Ksf|j}|d}|dd}|dd}tj|j|j}d|j|jf} d| } d| } t | t } t | d} t | d }t d }t |d }|| }||}t|}W5QRX|d d d}tdd|D}||jkr|r||j||ddkr|d}n|d}i}||8}t|d"}|D]}|d}|||<q8W5QRXW5QRXt | d}t | d}t | dd}t|d}d|_tj } g}!t}"|"|_d|_zz\|D]}#|#j}$t|$t r|$}%n |$!d }%|"|%rq||%}|dr4t#|#j$|dkr4t%d|%|dr|ddd\}&}'||$}|&}(W5QRX|'|(|&\})}*|*|'krt%d|$|r|%(||frt)*d |%q|%(|o|%+d! }+|%(|r |%d"d\})},}-tj||,t,|-}.n$|%| |fkrqtj|t,|%}.|+s ||$}|-||.W5QRX|!.|.|s|drt|.d#4}|&}(|'|(|&\})}/|/|*krt%d$|.W5QRX| r~|.+d%r~z|j/|.|d&}0|!.|0Wn$t0k rt)j1d'dd(YnXnttj2t,|$}1tj|"|1}2||$}|-||2W5QRXtj|.\}3}1|3|_|3|1}4|4|4|!5|4q|rt)*d)d}5nnd}6|j6d }|d*krzt | d+}7z||7}t7|}8W5QRXi}6d,D]l}9d-|9}:|:|8kri|6d.|9<};|8|:8D]6}|6d6i}?|>s|?r|dd}@tj>|@s*t?d7|@|_|>@D]*\}:}.zRoot-Is-Purelibrrrstreamrr&r)dry_runTNrsize mismatch for %s=digest mismatch for %szlib_only: skipping %srr/rzdigest mismatch on write for %sz.py)Zhashed_invalidationzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txt)Zconsoleguiz %s_scriptszwrap_%sz%s:%sz %szAUnable to read legacy script metadata, so cannot generate scriptsr@zpython.commandsz8Unable to read JSON metadata, so cannot generate scriptsZ wrap_consoleZwrap_guizValid script path not specifiedz%s = %srlibprefixzinstallation failed.)Grrr6rGr*rardrbrcrrr{r|rrrrhr~rrrrecordrJdont_write_bytecodetempfileZmkdtempZ source_dirZ target_dirshutilZrmtreeinfolist isinstancer rrstr file_sizerrr startswithrrrrZ copy_streamr)Z byte_compile ExceptionZwarningbasenameZmakeZset_executable_modeextendrlrvaluesrsuffixflagsjsonloadrritemsr rZwrite_shared_locationsZwrite_installed_filesZ exceptionZrollback)Cr<rZmakerkwargsrrrZbc_hashed_invalidationr?rrr metadata_namewheel_metadata_name record_namerrbwfrrrrrrrreaderrrZdata_pfxZinfo_pfxZ script_pfxZfileopZbcZoutfilesworkdirzinfor u_arcnamekindvaluerr rZ is_scriptwhererZoutfileZ newdigestZpycrZworknamer filenamesZdistZcommandsZepZepdatarrCr"rDsZconsole_scriptsZ gui_scriptsZ script_dirZscriptZoptionsr,r,r-installsT                                                     z Wheel.installcCs4tdkr0tjttdtjdd}t|atS)Nz dylib-cache) cacher6rGr*rrrJrcr)r<rr,r,r-_get_dylib_caches  zWheel._get_dylib_cachec Cshtj|j|j}d|j|jf}d|}t|d}t d}g}t |d}z| |}||} t | } |} | |} tj| j| } tj| st| | D]\}}tj| t|}tj|sd}n6t|j}tj|}||}tj|j}||k}|r&||| |||fqW5QRXWntk rXYnXW5QRX|S)NrprqZ EXTENSIONSrrrsT)r6rGr*rardrbrcrr{r|rrrrrZ prefix_to_dirrrmakedirsrrrnstatst_mtimedatetimeZ fromtimestampZgetinfoZ date_timeextractr)r)r<r?rrrrrHrrrr@rrZ cache_baserbrdestrZ file_timerlZ wheel_timer,r,r-_get_extensionss>             zWheel._get_extensionscCst|S)zM Determine if a wheel is compatible with the running system. ) is_compatibler;r,r,r-rszWheel.is_compatiblecCsdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr,r;r,r,r- is_mountableszWheel.is_mountablecCstjtj|j|j}|s2d|}t||sJd|}t||t jkrbt d|nN|rtt j |nt j d||}|rtt jkrt j tt||dS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)r6rGrjr*rardrrrrJrrr)insertr_hook meta_pathrA)r<r)r?msgr@r,r,r-mounts"   z Wheel.mountcCsrtjtj|j|j}|tjkr2td|n.rrr/..invalid entry in wheel: %rrrrr)r6rGr*rardrbrcrrr{r|rrrrhr~rrrr rrrrrrr)r<r?rrrrrrrrr rrrrrrr rrr rr rrrr rr,r,r-rks\                z Wheel.verifyc Ksdd}dd}tj|j|j}d|j|jf}d|}t|d} t} t |d|} i} | D]h} | j}t |t r|}n | d }|| krqhd |krtd || | | tj| t|}|| |<qhW5QRX|| |\}}|| f|}|r|| |\}}|r$||kr$||||d krNtjd d| d\}}t|n*tj|shtd|tj||j}t| }tj| |}||f}||| |||||d krt||W5QRX|S)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. cSsHd}}d|tf}||kr$d|}||kr@||}t|dj}||fS)Nz%s/%sz %s/PKG-INFOrG)rr rc)path_maprrcrGrr,r,r- get_versionKs  z!Wheel.update..get_versioncSsd}z|t|}|d}|dkr*d|}nTdd||dddD}|dd7<d |d|dd d |Df}Wn tk rtd |YnX|rt|d }||_| t  }|j ||dtd||dS)Nrrz%s+1cSsg|] }t|qSr,ru)rxrr,r,r-rz]sz8Wheel.update..update_version..rr!rz%s+%scss|]}t|VqdSr0)rrwr,r,r- `sz7Wheel.update..update_version..z0Cannot update non-compliant (PEP-440) version %rr()rGlegacyzVersion updated from %r to %r) rrrhr*rrrr rcrrr)rcrGupdatedrDryr+Zmdr,r,r,r-update_versionUs.        z$Wheel.update..update_versionrprqrrsrrr&r'Nz.whlz wheel-update-)rrdirzNot a directory: %r)r6rGr*rardrbrcrrrrrr rrrrrZmkstempcloserrrrrrZcopyfile)r<ZmodifierZdest_dirrr*r.r?rrrr rr)r rr rGZoriginal_versionr ZmodifiedZcurrent_versionfdnewpathrrrlr,r,r-r>:s\                 z Wheel.update)NFF)N)NN)F)N)rSrTrU__doc__rrr=propertyrdrnrorrr}rlrrrrrrrrrrrrr$r%rkr>r,r,r,r-rVs@ )         hg "  8rVc Csxtg}td}ttjddddD]}|d|t|gq$g}tD]*\}}}| drN|| dddqN| t dkr| dt |dg}tg}tjd krtd t}|r|\} }}} t|}| g} | d kr| d | d kr | d| dkr | d| dkr4| d| dkrH| d|dkr| D]*} d| ||| f} | tkrV|| qV|d8}qH|D]0}|D]$} |dt|df|| fqqt|D]L\}}|dt|fddf|dkr|dt|dfddfqt|D]L\}}|dd|fddf|dkr"|dd|dfddfq"t|S)zG Return (pyver, abi, arch) tuples compatible with this Python. rrrr&z.abir!rrXdarwinz(\w+)_(\d+)_(\d+)_(\w+)$)i386ppcZfat)r6r7x86_64Zfat3)ppc64r8Zfat64)r6r8intel)r6r8r:r7r9Z universalz %s_%s_%s_%srYr)r'rangerJ version_infor)r*rrMZ get_suffixesrrhrrr rplatformrerfrrv IMP_PREFIXrset)ZversionsmajorminorZabisrr rHZarchesr#rbr_Zmatchesrfrr^ryrcr,r,r-compatible_tagss`                 & " "rCcCs\t|tst|}d}|dkr"t}|D]0\}}}||jkr&||jkr&||jkr&d}qXq&|S)NFT)rrVCOMPATIBLE_TAGSr]r^r_)ZwheelrorHZverr^r_r,r,r-rs r)N)TZ __future__rrr{rZdistutils.utilZ distutilsZemailrrrMrZloggingr6rr>rrJrrr&rrcompatrrr r r Zdatabaser rr rrutilrrrrrrrrrrcrrZ getLoggerrSrrhasattrr?r=rr(r'r<r\rZ get_platformr5rrr.compile IGNORECASEVERBOSErirerrrrr7robjectr8r!rVrCrDrr,r,r,r-s   ,             #>PK!"xCC&__pycache__/index.cpython-38.opt-1.pycnu[U .eJR@sddlZddlZddlZddlZddlZddlZzddlmZWn ek r`ddl mZYnXddl m Z ddl m Z mZmZmZmZmZddlmZmZmZeeZdZdZGd d d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)cached_propertyzip_dir ServerProxyzhttps://pypi.org/pypipypic@seZdZdZdZd*ddZddZdd Zd d Zd d Z ddZ ddZ d+ddZ d,ddZ d-ddZd.ddZddZd/ddZd0d d!Zd1d"d#Zd$d%Zd&d'Zd2d(d)ZdS)3 PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc Cs|pt|_|t|j\}}}}}}|s<|s<|s<|dkrJtd|jd|_d|_d|_d|_t t j dR}dD]F} z,t j | dg||d} | dkr| |_WqWqttk rYqtXqtW5QRXdS) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. )ZhttpZhttpszinvalid repository: %sNw)gpgZgpg2z --versionstdoutstderrr) DEFAULT_INDEXurlread_configurationrrpassword_handler ssl_verifierrgpg_homeopenosdevnull subprocessZ check_callOSError) selfrZschemenetlocpathZparamsZqueryZfragZsinksrcr%=/usr/lib/python3.8/site-packages/pip/_vendor/distlib/index.py__init__$s(   zPackageIndex.__init__cCs&ddlm}ddlm}|}||S)zs Get the distutils command for interacting with PyPI configurations. :return: the command. r) Distribution) PyPIRCCommand)Zdistutils.corer(Zdistutils.configr))r r(r)dr%r%r&_get_pypirc_commandAs  z PackageIndex._get_pypirc_commandcCsR|}|j|_|}|d|_|d|_|dd|_|d|j|_dS)z Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. usernamepasswordrealmr repositoryN)r+rr/Z _read_pypircgetr,r-r.)r cZcfgr%r%r&rKs  zPackageIndex.read_configurationcCs$||}||j|jdS)z Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. N)check_credentialsr+Z _store_pypircr,r-)r r1r%r%r&save_configurationZszPackageIndex.save_configurationcCs\|jdks|jdkrtdt}t|j\}}}}}}||j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r,r-rrrrZ add_passwordr.rr)r Zpm_r!r%r%r&r2fs zPackageIndex.check_credentialscCs\|||}d|d<||g}||}d|d<||g}||S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. Zverify:actionZsubmit)r2validatetodictencode_requestitems send_request)r metadatar*requestZresponser%r%r&registerrs  zPackageIndex.registercCsF|}|sq:|d}||td||fq|dS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. utf-8z%s: %sN)readlinedecoderstripappendloggerdebugclose)r namestreamZoutbufr#r%r%r&_readers  zPackageIndex._readerc Cs|jdddg}|dkr|j}|r.|d|g|dk rF|dddgt}tj|tj|d }|d d d |d ||gt dd|||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. --status-fd2--no-ttyN --homedirz--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--output invoking: %s ) rrextendtempfileZmkdtemprr"joinbasenamerCrD)r filenamesigner sign_passwordkeystorecmdZtdZsfr%r%r&get_sign_commands" zPackageIndex.get_sign_commandc Cstjtjd}|dk r tj|d<g}g}tj|f|}t|jd|j|fd}|t|jd|j|fd}||dk r|j ||j | | | |j ||fS)a Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. rNstdinr)targetargsr)rPIPEPopenrrHrstartrrZwriterEwaitrR returncode) r rXZ input_datakwargsrrpt1t2r%r%r& run_commands&    zPackageIndex.run_commandc CsD|||||\}}|||d\}}} |dkr@td||S)aR Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. r>rz&sign command failed with error code %s)rYrgencoder) r rTrUrVrWrXsig_filer$rrr%r%r& sign_files  zPackageIndex.sign_filesdistsourcec Cs(|tj|s td|||}d} |rZ|jsJt dn| ||||} t |d} | } W5QRXt | } t | } |dd||| | ddtj|| fg}| rt | d} | }W5QRX|d tj| |fttj| |||}||S) a Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. z not found: %sNz)no signing program available - not signedrbZ file_upload1)r5Zprotocol_versionfiletype pyversion md5_digest sha256_digestcontentZ gpg_signature)r2rr"existsrr6r7rrCZwarningrjrreadhashlibmd5 hexdigestZsha256updaterSrBshutilZrmtreedirnamer8r9r:)r r;rTrUrVrorprWr*rifZ file_datarqrrfilesZsig_datar<r%r%r& upload_filesD      zPackageIndex.upload_filec Cs|tj|s td|tj|d}tj|sFtd|||j|j }}t | }dd|fd|fg}d||fg}| ||} | | S)a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r)r5Z doc_uploadrFversionrs)r2rr"isdirrrRrtr6rFrr getvaluer8r:) r r;Zdoc_dirfnrFrZzip_datafieldsr}r<r%r%r&upload_documentation(s        z!PackageIndex.upload_documentationcCsT|jdddg}|dkr|j}|r.|d|g|d||gtdd||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. rIrJrKNrLz--verifyrNrO)rrrPrCrDrR)r signature_filename data_filenamerWrXr%r%r&get_verify_commandDszPackageIndex.get_verify_commandcCsH|jstd||||}||\}}}|dkr@td||dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailable)rrz(verify command failed with error code %sr)rrrrg)r rrrWrXr$rrr%r%r&verify_signature\szPackageIndex.verify_signaturec Csl|dkrd}tdn6t|ttfr0|\}}nd}tt|}td|t|d}|t |}z| } d} d} d} d} d | krt | d } |r|| | | | | }|sq| t|7} |||r||| d 7} |r|| | | qW5| XW5QRX| dkr0| | kr0td | | f|rh|}||kr\td ||||ftd|dS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrwzDigest specified: %swbi rzcontent-lengthzContent-Lengthrz1retrieval incomplete: got only %d out of %d bytesz.%s digest mismatch for %s: expected %s, got %szDigest verified: %s)rCrD isinstancelisttuplegetattrrvrr:rrEinfointrulenr`ryrrx)r rZdestfileZdigestZ reporthookZdigesterZhasherZdfpZsfpheadersZ blocksizesizeruZblocknumblockactualr%r%r& download_fileus^           zPackageIndex.download_filecCs:g}|jr||j|jr(||jt|}||S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrBrr r)r ZreqZhandlersZopenerr%r%r&r:s  zPackageIndex.send_requestc Csg}|j}|D]L\}}t|ttfs*|g}|D]*}|d|d|dd|dfq.q|D].\}} } |d|d|| fdd| fq`|d|ddfd|} d|} | tt| d} t |j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"r>z8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrrPrhrRstrrrr)r rr}partsrkvaluesvkeyrTvalueZbodyZctrr%r%r&r8sD     zPackageIndex.encode_requestcCsFt|trd|i}t|jdd}z|||p.dWS|dXdS)NrFg@)ZtimeoutrEand)rr r rsearch)r ZtermsoperatorZ rpc_proxyr%r%r&rs  zPackageIndex.search)N)N)N)N)NNrkrlN)N)N)NN)N)__name__ __module__ __qualname____doc__rr'r+rr3r2r=rHrYrgrjr~rrrrr:r8rr%r%r%r&rs6      #  9   M+r)rvZloggingrrzrrQZ threadingr ImportErrorZdummy_threadingrcompatrrrrr r utilr r r Z getLoggerrrCrZ DEFAULT_REALMobjectrr%r%r%r&s    PK!2FTT#__pycache__/database.cpython-38.pycnu[U .eU@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z d d d d dgZ!e"e#Z$dZ%dZ&deddde%dfZ'dZ(Gddde)Z*Gddde)Z+Gdd d e)Z,Gdd d e,Z-Gdd d e-Z.Gdd d e-Z/e.Z0e/Z1Gddde)Z2d)d!d"Z3d#d$Z4d%d&Z5d'd(Z6dS)*zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.jsonZ INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc@s(eZdZdZddZddZddZdS) _CachezL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generatedselfr#@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/database.py__init__1sz_Cache.__init__cCs|j|jd|_dS)zC Clear the cache, setting it to its initial state. FN)rclearrr r!r#r#r$r&9s  z _Cache.clearcCs2|j|jkr.||j|j<|j|jg|dS)z` Add a distribution to the cache. :param dist: The distribution to add. N)rr setdefaultkeyappendr"distr#r#r$addAs  z _Cache.addN)__name__ __module__ __qualname____doc__r%r&r,r#r#r#r$r-src@seZdZdZdddZddZdd ZeeeZd d Z d d Z ddZ e ddZ ddZddZdddZddZdddZdS)rzU Represents a set of distributions installed on a path (typically sys.path). NFcCsD|dkrtj}||_d|_||_t|_t|_d|_td|_ dS)a Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. NTdefault) sysr _include_dist _include_eggr_cache _cache_egg_cache_enabledr_scheme)r"rZ include_eggr#r#r$r%Os zDistributionPath.__init__cCs|jSNr7r!r#r#r$_get_cache_enabledcsz#DistributionPath._get_cache_enabledcCs ||_dSr9r:)r"valuer#r#r$_set_cache_enabledfsz#DistributionPath._set_cache_enabledcCs|j|jdS)z, Clears the internal cache. N)r5r&r6r!r#r#r$ clear_cacheks zDistributionPath.clear_cachec csDt}|jD]0}t|}|dkr&q |d}|r |js||jjD] }|Vq0|jrZ|jjD] }|VqNdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r7r\r^r5rvaluesr4r6r*r#r#r$get_distributionss   z"DistributionPath.get_distributionscCsd}|}|js4|D]}|j|kr|}q|qnH|||jjkrZ|jj|d}n"|jr|||jjkr||jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr7r\r(r^r5rr4r6)r"rresultr+r#r#r$get_distributions    z!DistributionPath.get_distributionc csd}|dk rJz|jd||f}Wn$tk rHtd||fYnX|D]p}t|dsntd|qR|j}|D]H}t |\}}|dkr||kr|VqRqx||krx| |rx|VqRqxqRdS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string N%s (%s)zinvalid name or version: %r, %rprovideszNo "provides": %s) r8matcher ValueErrorrrfhasattrrSrTrkrmatch) r"rrcrlr+providedpp_namep_verr#r#r$provides_distributions*    z&DistributionPath.provides_distributioncCs(||}|dkrtd|||S)z5 Return the path to a resource file. Nzno distribution named %r found)ri LookupErrorget_resource_path)r"r relative_pathr+r#r#r$ get_file_path!s  zDistributionPath.get_file_pathccsX|D]J}|j}||kr||}|dk r>||krR||Vq|D] }|VqFqdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)rfexportsre)r"categoryrr+rYdvr#r#r$get_exported_entries*s   z%DistributionPath.get_exported_entries)NF)N)N)r-r.r/r0r%r;r=propertyZ cache_enabledr>r\r^ classmethodrdrfrirtrxr}r#r#r#r$rKs  ,  ) c@seZdZdZdZdZddZeddZeZ eddZ ed d Z d d Z ed dZ eddZeddZeddZeddZddZddZddZddZdS) rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. FcCsL||_|j|_|j|_|j|_d|_d|_d|_d|_t |_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) rDrrgr(rcZlocatordigestextrascontextrHZ download_urlsZdigests)r"rDr#r#r$r%Os zDistribution.__init__cCs|jjS)zH The source archive download URL for this distribution. )rD source_urlr!r#r#r$r`szDistribution.source_urlcCsd|j|jfS)zX A utility property which displays the name and version in parentheses. rjrrcr!r#r#r$name_and_versioniszDistribution.name_and_versioncCs.|jj}d|j|jf}||kr*|||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. rj)rDrkrrcr))r"Zplistsr#r#r$rkps  zDistribution.providescCs8|j}td|t||}t|j||j|jdS)Nz%Getting requirements from metadata %r)rrE) rDrSrTZtodictgetattrrHZget_requirementsrr)r"Zreq_attrmdZreqtsr#r#r$_get_requirements|s   zDistribution._get_requirementscCs |dS)N run_requiresrr!r#r#r$rszDistribution.run_requirescCs |dS)N meta_requiresrr!r#r#r$rszDistribution.meta_requirescCs |dS)Nbuild_requiresrr!r#r#r$rszDistribution.build_requirescCs |dS)N test_requiresrr!r#r#r$rszDistribution.test_requirescCs |dS)N dev_requiresrr!r#r#r$rszDistribution.dev_requiresc Cst|}t|jj}z||j}Wn6tk rZtd|| d}||}YnX|j }d}|j D]D}t |\}} ||krqlz| | }WqWqltk rYqlXql|S)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. +could not read version %r - using name onlyrF)r rrDrCrl requirementrrSwarningsplitr(rkrro) r"reqrYrCrlrrhrqrrrsr#r#r$matches_requirements,       z Distribution.matches_requirementcCs(|jrd|j}nd}d|j|j|fS)zC Return a textual representation of this instance, z [%s]r?z)rrrc)r"suffixr#r#r$__repr__s zDistribution.__repr__cCs>t|t|k rd}n$|j|jko8|j|jko8|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typerrcr)r"otherrhr#r#r$__eq__s   zDistribution.__eq__cCst|jt|jt|jS)zH Compute hash in a way which matches the equality test. )hashrrcrr!r#r#r$__hash__szDistribution.__hash__N)r-r.r/r0Zbuild_time_dependency requestedr%r~rZ download_urlrrkrrrrrrrrrrr#r#r#r$r=s4        " cs0eZdZdZdZdfdd ZdddZZS) rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncs tt||||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr%r dist_path)r"rDrrE __class__r#r$r%s z"BaseInstalledDistribution.__init__cCsd|dkr|j}|dkr"tj}d}ntt|}d|j}||}t|dd}d||fS)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str Nr?z%s==ascii%s%s) hasherhashlibmd5rrbase64Zurlsafe_b64encoderstripdecode)r"datarprefixrr#r#r$get_hashs   z"BaseInstalledDistribution.get_hash)N)N)r-r.r/r0rr%r __classcell__r#r#rr$rscseZdZdZdZd'fdd ZddZdd Zd d Ze d d Z ddZ ddZ ddZ ddZd(ddZddZe ddZd)ddZdd Zd!d"Zd#d$Zd%d&ZejZZS)*ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). Zsha256Nc sJg|_t||_}|dkr*td||rP|jrP||jjkrP|jj|j}nt|dkr| t }|dkrt| t }|dkr| d}|dkrtdt |ft |}t|dd}W5QRXtt|||||r|jr|j|| d}|dk |_tj|d}tj|rFt|d}|} W5QRX| |_dS) Nzfinder unavailable for %sZMETADATAzno %s found in %sr@rAr top_level.txtrb)modulesrrIrXrmr7r5rrDrJr r rPrQrRr rrr%r,rosrOexistsopenread splitlines) r"rrDrErXrYr[rqfrrr#r$r%s8         zInstalledDistribution.__init__cCsd|j|j|jfS)Nz#rrcrr!r#r#r$r=s zInstalledDistribution.__repr__cCsd|j|jfSNz%s %srr!r#r#r$__str__AszInstalledDistribution.__str__c Csg}|d}t|\}t|dF}|D]:}ddtt|dD}||\}}} |||| fq.W5QRXW5QRX|S)a" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). rr[cSsg|]}dqSr9r#).0ir#r#r$ Ssz6InstalledDistribution._get_records..)get_distinfo_resourcerPrQrRrrangelenr)) r"resultsrYr[Z record_readerrowmissingrchecksumsizer#r#r$ _get_recordsDs  &z"InstalledDistribution._get_recordscCsi}|t}|r|}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )rEXPORTS_FILENAMEr)r"rhrYr#r#r$ry[s  zInstalledDistribution.exportsc Cs8i}|t}|r4t|}t|}W5QRX|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. )rrrPrQrRr)r"rhrYr[r#r#r$ris  z"InstalledDistribution.read_exportsc Cs.|t}t|d}t||W5QRXdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_filerrr)r"ryZrfrr#r#r$rxs  z#InstalledDistribution.write_exportsc Cs|d}t|R}t|d<}|D]0\}}||kr*|W5QRW5QRSq*W5QRXW5QRXtd|dS)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. rrz3no resource file with relative path %r is installedN)rrPrQrRrKeyError)r"rwrYr[Zresources_readerrelativeZ destinationr#r#r$rvs   6z'InstalledDistribution.get_resource_pathccs|D] }|VqdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r"rhr#r#r$list_installed_filess z*InstalledDistribution.list_installed_filesFc Cs(tj|d}tj|j}||}tj|d}|d}td||rRdSt|}|D]}tj |sz| drd} } n4dtj |} t |d} | | } W5QRX||s|r||rtj||}||| | fq`||r tj||}||ddfW5QRX|S)z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. r?r creating %sNz.pycz.pyoz%dr)rrrOdirname startswithrrSinforisdirrLgetsizerrrrelpathZwriterow) r"pathsrdry_runbaseZbase_under_prefix record_pathwriterr hash_valuerfpr#r#r$write_installed_filess0       z+InstalledDistribution.write_installed_filesc Csg}tj|j}|d}|D]\}}}tj|sHtj||}||krRq$tj|sr||dddfq$tj |r$t tj |}|r||kr||d||fq$|r$d|kr| ddd}nd }t |d 2} || |} | |kr||d || fW5QRXq$|S)  Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rrTFr=rrNrr)rrrrrisabsrOrr)isfilestrrrrrr) r" mismatchesrrrrrZ actual_sizerrZ actual_hashr#r#r$check_installed_filess.        z+InstalledDistribution.check_installed_filesc Csi}tj|jd}tj|rtj|ddd}|}W5QRX|D]8}|dd\}}|dkr|| |g |qL|||<qL|S)a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rrYutf-8encodingrr namespace) rrrOrcodecsrrrrr'r))r"rh shared_pathrlinesliner(r<r#r#r$shared_locationss  z&InstalledDistribution.shared_locationsc Cstj|jd}td||r$dSg}dD].}||}tj||r,|d||fq,|ddD]}|d|qhtj |d d d }| d |W5QRX|S) aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rrN)rlibZheadersZscriptsrz%s=%srr#z namespace=%srrr ) rrrOrSrrr)getrrwrite) r"rrrrr(rnsrr#r#r$write_shared_locationss  z,InstalledDistribution.write_shared_locationscCsF|tkrtd||jft|j}|dkr.set_name_and_version) rrr7r6rDrrc _get_metadatar,rrr%)r"rrErrDrr#r$r%bs   zEggInfoDistribution.__init__c sd}ddfdd}d}}|drtj|rtj|d}tj|d}t|dd }tj|d } tj|d }|| }npt|} t| d  d } t| dd}z,| d} | d d}| d}Wnt k rd}YnXnf|drPtj|rBtj|d } || }tj|d}tj|d }t|dd }n t d||rl| ||dkr|dk rtj|rt|d} |  d}W5QRX|sg}n|}||_|S)NcSsg}|}|D]}|}|dr6td|qt|}|sPtd|q|jr`td|jst||j qd dd|jD}|d|j |fq|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedz, css|]}d|VqdS)rNr#)rcr#r#r$ szQEggInfoDistribution._get_metadata..parse_requires_data..rj) rstriprrSrr rZ constraintsr)rrO)rreqsrrrYZconsr#r#r$parse_requires_datazs(   z>EggInfoDistribution._get_metadata..parse_requires_datac sHg}z*t|dd}|}W5QRXWntk rBYnX|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rYr)rrrIOError)req_pathrrrr#r$parse_requires_pathsz>EggInfoDistribution._get_metadata..parse_requires_pathrGzEGG-INFOzPKG-INFOr@)rrCz requires.txtrzEGG-INFO/PKG-INFOutf8rAzEGG-INFO/requires.txtzEGG-INFO/top_level.txtrrFz,path must end with .egg-info or .egg, got %rr)rLrrrrOr zipimport zipimporterrget_datarrrZadd_requirementsrrrrr)r"rrequiresr Ztl_pathZtl_datarq meta_pathrDrZzipfrBrrr#rr$rwsX             z!EggInfoDistribution._get_metadatacCsd|j|j|jfS)Nz!rr!r#r#r$rs zEggInfoDistribution.__repr__cCsd|j|jfSrrr!r#r#r$rszEggInfoDistribution.__str__cCs`g}tj|jd}tj|r\|D]2\}}}||kr._md5cSs t|jSr9)rstatst_size)rr#r#r$_sizesz7EggInfoDistribution.list_installed_files.._sizerrYrrzNon-existent file: %srN) rrrOrrrrnormpathrSrrLrr))r"rrrrhrrrqr#r#r$rs"     $z(EggInfoDistribution.list_installed_filesFc cstj|jd}tj|rd}tj|ddd`}|D]T}|}|dkrPd}q6|s6tjtj|j|}||jr6|r|Vq6|Vq6W5QRXdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths rTrYrrz./FN) rrrOrrrrrr)r"Zabsoluterskiprrrqr#r#r$rs   z'EggInfoDistribution.list_distinfo_filescCst|to|j|jkSr9)r]rrrr#r#r$r.s  zEggInfoDistribution.__eq__)N)F)r-r.r/r0rrr%rrrrrrrrrrr#r#rr$rYsZ& c@s^eZdZdZddZddZdddZd d Zd d ZdddZ dddZ ddZ ddZ dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dSr9)adjacency_list reverse_listrr!r#r#r$r%IszDependencyGraph.__init__cCsg|j|<g|j|<dS)zAdd the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` N)rr)r" distributionr#r#r$add_distributionNs z DependencyGraph.add_distributionNcCs6|j|||f||j|kr2|j||dS)aAdd an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` N)rr)r)r"xylabelr#r#r$add_edgeXs zDependencyGraph.add_edgecCs&td|||j|g|dS)a Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` z %s missing %rN)rSrTrr'r))r"rrr#r#r$ add_missinggszDependencyGraph.add_missingcCsd|j|jfSrrr*r#r#r$ _repr_distrszDependencyGraph._repr_distrcCs||g}|j|D]h\}}||}|dk r|d|j|jfq>q|st|dkr|d|d|d|D]}|d |j|d q|d |d dS) a9Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` zdigraph dependencies { rNz"%s" -> "%s" [label="%s"] z "%s" -> "%s" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rz} )rritemsrr)r)r"rZskip_disconnectedZ disconnectedr+adjsrrr#r#r$to_dots(          zDependencyGraph.to_dotcsg}i}|jD]\}}|dd||<qgt|ddD]\}}|sD|||=qDshq|D]\}}fdd|D||<qptdddD|q,|t|fS)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. Ncs g|]\}}|kr||fqSr#r#)rr{rYZ to_remover#r$rsz4DependencyGraph.topological_sort..zMoving to result: %scSsg|]}d|j|jfqS)rjr)rr{r#r#r$rs)rr'listr)rSrTr$keys)r"rhZalistkr|r#r*r$topological_sorts$   z DependencyGraph.topological_sortcCs2g}|jD]\}}|||qd|S)zRepresentation of the graphr)rr'r)r#rO)r"r&r+r(r#r#r$rszDependencyGraph.__repr__)N)r)T) r-r.r/r0r%rr r!r"r#r)r.rr#r#r#r$r9s   rr1c CsVt|}t}i}|D]L}|||jD]6}t|\}}td|||||g||fq*q|D]}|j |j B|j B|j B}|D]} z| | } Wn6tk rtd| | d}| |} YnX| j}d} ||kr>||D]N\}} z| |} Wntk rd} YnX| r||| | d} q>q| s||| qqh|S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %srrFT)rrrrkrrSrTr'r)rrrrrlrrrr(ror r!)distsrCgraphrpr+rqrrcrrrlZmatchedZproviderror#r#r$ make_graphsN       r1cCsv||krtd|jt|}|g}|j|}|rh|}|||j|D]}||krN||qNq.|d|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested 1given distribution %r is not a member of the listr)rrr1rpopr))r/r+r0Zdeptodor{Zsuccr#r#r$get_dependent_distss   r5cCsn||krtd|jt|}g}|j|}|rj|d}|||j|D]}||krP||qPq,|S)zRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested r2r)rrr1rr3r))r/r+r0rr4r{Zpredr#r#r$get_required_distss   r6cKs4|dd}tf|}||_||_|p(d|_t|S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summary)r3r rrcr7r)rrckwargsr7rr#r#r$ make_dist2s    r9)r1)7r0Z __future__rrrrPrZloggingrrNr2r r?rrcompatrrcrrrDr r r r utilr rrrrrr__all__Z getLoggerr-rSrZCOMMANDS_FILENAMErrMrrrrrrrrUrVrr1r5r6r9r#r#r#r$s`  $ s7J] 6PK!#)__pycache__/__init__.cpython-38.opt-1.pycnu[U .eK@snddlZdZGdddeZzddlmZWn&ek rRGdddejZYnXeeZ e edS)Nz 0.2.9.post0c@s eZdZdS)DistlibExceptionN)__name__ __module__ __qualname__rr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/__init__.pyr sr) NullHandlerc@s$eZdZddZddZddZdS)rcCsdSNrselfrecordrrrhandlezNullHandler.handlecCsdSr rr rrremitrzNullHandler.emitcCs d|_dSr )lock)r rrr createLockrzNullHandler.createLockN)rrrr rrrrrrrsr) Zlogging __version__ Exceptionrr ImportErrorZHandlerZ getLoggerrZloggerZ addHandlerrrrrs PK!jdYkOkO"__pycache__/version.cpython-38.pycnu[U .e_[ @sfdZddlZddlZddlmZddlmZdddd d d d d gZee Z Gdd d e Z Gddde ZGddde ZedZddZeZGdddeZddZGdddeZeddfeddfeddfedd fed!d"fed#d"fed$d%fed&d'fed(d)fed*d+ff Zed,dfed-dfed.d%fed$d%fed/dffZed0Zd1d2Zd3d4Zed5ejZd6d6d7d6d8ddd9Zd:d;ZGdejZ"d?d@Z#dAdBZ$GdCd d eZ%GdDd d eZ&GdEdFdFe Z'e'eeee'ee!dGdHe'e$e&edIZ(e(dJe(dK<dLd Z)dS)Mz~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesparse_requirementNormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemec@seZdZdZdS)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__rr?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/version.pyr sc@sxeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZeddZdS)VersioncCs@||_}|||_}t|ts,tt|dksTzMatcher.cCs||kSr)rr>rrrrBUrCcCs||kp||kSr)rr>rrrrBVrCcCs||kp||kSr)rr>rrrrBWrCcCs||kSr)rr>rrrrBXrCcCs||kSr)rr>rrrrBYrCcCs||kp||kSr)rr>rrrrB[rCcCs||kSr)rr>rrrrB\rC)<><=>======~=!=cCst|Sr)rr#rrrraszMatcher.parse_requirementcCs|jdkrtd||_}||}|s:td||j|_|j|_g}|jr|jD]d\}}| dr|dkrtd||ddd}}||n||d}}| |||fq^t ||_ dS) NzPlease specify a version classz Not valid: %rz.*)rHrKz#'.*' not allowed for %r constraintsTF) version_class ValueErrorrrrnamelowerkeyZ constraintsendswithappendrr)rrrZclistopZvnprefixrrrr ds*      zMatcher.__init__cCsxt|tr||}|jD]X\}}}|j|}t|trDt||}|s`d||jjf}t |||||sdSqdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z%r not implemented for %sFT) rrrMr _operatorsgetgetattrr7rr")rversionoperator constraintrVfmsgrrrmatchs       z Matcher.matchcCs6d}t|jdkr2|jdddkr2|jdd}|S)Nrr)rHrI)rr)rresultrrr exact_versions zMatcher.exact_versioncCs0t|t|ks|j|jkr,td||fdS)Nzcannot compare %s and %s)r$rOr%r&rrrr(szMatcher._check_compatiblecCs"|||j|jko |j|jkSr))r(rQrr&rrrr+s zMatcher.__eq__cCs || Sr)r,r&rrrr-szMatcher.__ne__cCst|jt|jSr))r3rQrr4rrrr5szMatcher.__hash__cCsd|jj|jfS)Nz%s(%r)r6r4rrrr8szMatcher.__repr__cCs|jSr)r9r4rrrr:szMatcher.__str__)rrrrMrWrr r_r<rar(r+r-r5r8r:rrrrr=Os* r=zk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c Cs|}t|}|s"td||}tdd|ddD}t|dkrl|ddkrl|dd}qF|dszd}n t|d}|dd }|d d }|d d }|d}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkr*d}nHg} |dD]0} | rTdt| f} nd| f} | | q8t| }|s|s|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %scss|]}t|VqdSr)int.0r?rrr sz_pep_440_key..r.r )NNr)arh)z)_)final) rPEP440_VERSION_REr_r groupsrsplitrrcisdigitrS) rmruZnumsZepochpreZpostdevZlocalrpartrrr _pep_440_keysT          r|c@s6eZdZdZddZedddddgZed d Zd S) raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCs<t|}t|}|}tdd|ddD|_|S)Ncss|]}t|VqdSr)rbrdrrrrfsz*NormalizedVersion.parse..rrg)_normalized_keyrtr_rurrv_release_clause)rrr`rxrurrrr s  zNormalizedVersion.parserpbr@rcrzcstfddjDS)Nc3s |]}|r|djkVqdS)rN) PREREL_TAGS)retr4rrrfsz2NormalizedVersion.is_prerelease..)anyrr4rr4rr;szNormalizedVersion.is_prereleaseN) rrrrrsetrr<r;rrrrrs  cCs>t|}t|}||krdS||s*dSt|}||dkS)NTFrg)str startswithr)xynrrr _match_prefixs rc @sneZdZeZddddddddd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZdS)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)rJrDrErFrGrHrIrKcCsV|rd|ko|jd}n|jd o,|jd}|rN|jddd}||}||fS)N+rhrr)rrrvrM)rrZr\rVZ strip_localrrrr _adjust_local6s zNormalizedMatcher._adjust_localcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrgcSsg|] }t|qSrrreirrr Isz/NormalizedMatcher._match_lt..rr~joinrrrZr\rVZrelease_clauseZpfxrrrrDs zNormalizedMatcher._match_ltcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrgcSsg|] }t|qSrrrrrrrQsz/NormalizedMatcher._match_gt..rrrrrrLs zNormalizedMatcher._match_gtcCs||||\}}||kSr)rrrZr\rVrrrrTszNormalizedMatcher._match_lecCs||||\}}||kSr)rrrrrrXszNormalizedMatcher._match_gecCs.||||\}}|s ||k}n t||}|Sr)rrrrZr\rVr`rrrr\s   zNormalizedMatcher._match_eqcCst|t|kSr)rrrrrrdsz"NormalizedMatcher._match_arbitrarycCs0||||\}}|s ||k}n t|| }|Sr)rrrrrrgs   zNormalizedMatcher._match_necCsf||||\}}||krdS||kr*dS|j}t|dkrH|dd}ddd|D}t||S)NTFrrhrgcSsg|] }t|qSrrrrrrrzsz7NormalizedMatcher._match_compatible..)rr~rrrrrrrros  z#NormalizedMatcher._match_compatibleN)rrrrrMrWrrrrrrrrrrrrrr's& z[.+-]$z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}rgz\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cCsL|}tD]\}}|||}q|s.d}t|}|sFd}|}n|dd}dd|D}t|dkr~| dqft|dkr|| d}n8d dd|ddD|| d}|dd}d d d|D}|}|rt D]\}}|||}q|s|}nd |kr*d nd }|||}t |sHd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rrgcSsg|] }t|qSrrbrrrrrsz-_suggest_semantic_version..NcSsg|] }t|qSrrrrrrrscSsg|] }t|qSrrrrrrrsrz-r)rrP _REPLACEMENTSsub_NUMERIC_PREFIXr_rurvrrSendr_SUFFIX_REPLACEMENTS is_semver)rr`ZpatreplrxrVsuffixseprrr_suggest_semantic_versions:      ,    rcCshzt||WStk r"YnX|}dD]\}}|||}q0tdd|}tdd|}tdd|}tdd |}td d |}|d r|d d}tdd |}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd |}z t|Wntk rbd}YnX|S)!aSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. ))z-alpharp)z-betar)rrp)rr)rr@)z-finalr)z-prer@)z-releaser)z.releaser)z-stabler)rrg)rrrg) r)z.finalr)rsrzpre$Zpre0zdev$Zdev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?rr?rNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$rz\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1)r}r rPreplacererr)rZrsZorigrrrr_suggest_normalized_versions>      rz([a-z]+|\d+|[\.-])r@zfinal-@)ryZpreviewrrrzrrgcCsrdd}g}||D]T}|dr^|dkrD|rD|ddkrD|q*|r^|ddkr^|qD||qt|S)NcSstg}t|D]R}t||}|rd|ddkrBdkrRnn |d}nd|}||q|d|S)N0r9**final) _VERSION_PARTrvrP_VERSION_REPLACErXzfillrS)rr`rArrr get_partsCs     z_legacy_key..get_partsrrrhz*final-Z00000000)rpoprSr)rrr`rArrr _legacy_keyBs      rc@s eZdZddZeddZdS)rcCst|Sr))rr#rrrr]szLegacyVersion.parsecCs8d}|jD](}t|tr |dr |dkr d}q4q |S)NFrrT)rrrr)rr`rrrrr;`s zLegacyVersion.is_prereleaseNrrrrr<r;rrrrr\sc@s4eZdZeZeejZded<e dZ ddZ dS)r rrJz^(\d+(\.\d+)*)cCs`||kr dS|jt|}|s2td||dS|d}d|krV|ddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrrgr) numeric_rer_rloggerZwarningrursplitr)rrZr\rVrxrrrrrss zLegacyMatcher._match_compatibleN) rrrrrMdictr=rWrcompilerrrrrrr ks   zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs t|Sr)) _SEMVER_REr_)rrrrrsrc Csndd}t|}|st||}dd|ddD\}}}||dd||dd}}|||f||fS) NcSs8|dkr|f}n$|ddd}tdd|D}|S)NrrgcSs"g|]}|r|dn|qS)r)rwr)rerArrrrsz5_semantic_key..make_tuple..)rvr)rZabsentr`rrrr make_tuples z!_semantic_key..make_tuplecSsg|] }t|qSrrbrrrrrsz!_semantic_key..r|r)rr ru) rrrxrumajorminorZpatchryZbuildrrr _semantic_keys rc@s eZdZddZeddZdS)r cCst|Sr))rr#rrrrszSemanticVersion.parsecCs|jdddkS)Nrrr)rr4rrrr;szSemanticVersion.is_prereleaseNrrrrrr sc@seZdZeZdS)r N)rrrr rMrrrrr sc@s6eZdZd ddZddZddZdd Zd d ZdS) VersionSchemeNcCs||_||_||_dSr))rQmatcher suggester)rrQrrrrrr szVersionScheme.__init__cCs2z|j|d}Wntk r,d}YnX|SNTF)rrMr rrr`rrris_valid_versions   zVersionScheme.is_valid_versioncCs0z||d}Wntk r*d}YnX|Sr)rr rrrris_valid_matchers   zVersionScheme.is_valid_matchercCs|d|S)z: Used for processing some metadata fields zdummy_name (%s))rr#rrris_valid_constraint_listsz&VersionScheme.is_valid_constraint_listcCs|jdkrd}n ||}|Sr))rrrrrsuggests  zVersionScheme.suggest)N)rrrr rrrrrrrrrs  rcCs|Sr)rr#rrrrBrCrB) normalizedlegacyZsemanticrdefaultcCs|tkrtd|t|S)Nzunknown scheme name: %r)_SCHEMESrN)rOrrrr s )*rZloggingrcompatrutilr__all__Z getLoggerrrrNr objectrr=rrtr|r}rrrrrrrrIrrrrr rrrr r rrr rrrrs   1d =$ W               .r  $ PK!4B́#__pycache__/locators.cpython-38.pycnu[U .e_@sDddlZddlmZddlZddlZddlZddlZddlZz ddlZWne k rdddl ZYnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#m$Z$m%Z%ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/dd l0m1Z1m2Z2dd l3m4Z4m5Z5e6e7Z8e9d Z:e9d ej;Zd-ddZ?GdddeZ@GdddeAZBGdddeBZCGdddeBZDGdddeAZEGdddeBZFGdddeBZGGdd d eBZHGd!d"d"eBZIGd#d$d$eBZJeJeHeFd%d&d'd(d)ZKeKjLZLe9d*ZMGd+d,d,eAZNdS).N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape string_types build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)MetadataMetadataInvalidError) cached_propertyparse_credentials ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.org/pypicCs6|dkr t}t|dd}z |WS|dXdS)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. N@timeoutclose) DEFAULT_INDEXr list_packages)urlclientr.@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/locators.pyget_all_distribution_names)s   r0c@s$eZdZdZddZeZZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c Csd}dD]}||kr||}q"q|dkr.dSt|}|jdkrnt||}t|drf|||n|||<t||||||S)N)locationZurireplace_header)rschemerZ get_full_urlhasattrr4BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersZnewurlkeyZurlpartsr.r.r/r8@s   zRedirectHandler.http_error_302N)__name__ __module__ __qualname____doc__r8Zhttp_error_301Zhttp_error_303Zhttp_error_307r.r.r.r/r17sr1c@seZdZdZdZdZdZdZedZd)dd Z d d Z d d Z ddZ ddZ ddZee eZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd*d'd(ZdS)+LocatorzG A base class for locators - things that locate distributions. )z.tar.gzz.tar.bz2z.tarz.zipz.tgzz.tbz)z.eggz.exe.whl)z.pdfN)rEdefaultcCs,i|_||_tt|_d|_t|_dS)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher5rr1openermatcherr Queueerrors)r9r5r.r.r/__init__fs  zLocator.__init__cCsVg}|jsRz|jd}||Wn|jjk rDYqYnX|jq|S)z8 Return any errors which have occurred. F)rKemptygetappendZEmpty task_done)r9resulter.r.r/ get_errorsys    zLocator.get_errorscCs |dS)z> Clear any errors which may have been logged. N)rSr9r.r.r/ clear_errorsszLocator.clear_errorscCs|jdSN)rGclearrTr.r.r/ clear_cacheszLocator.clear_cachecCs|jSrV_schemerTr.r.r/ _get_schemeszLocator._get_schemecCs ||_dSrVrY)r9valuer.r.r/ _set_schemeszLocator._set_schemecCs tddS)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. Please implement in the subclassNNotImplementedError)r9namer.r.r/ _get_projects zLocator._get_projectcCs tddS)J Return all the distribution names known to this locator. r^Nr_rTr.r.r/get_distribution_namesszLocator.get_distribution_namescCsL|jdkr||}n2||jkr,|j|}n|||}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N)rGrbrU)r9rarQr.r.r/ get_projects      zLocator.get_projectcCs^t|}t|j}d}|d}||j}|rBtt||j}|j dkd|j k||||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. TrEhttpszpypi.org) r posixpathbasenamepathendswithdownloadable_extensionsr%r$ wheel_tagsr5netloc)r9r,trhZ compatibleZis_wheelZis_downloadabler.r.r/ score_urls   zLocator.score_urlcCsR|}|rN||}||}||kr(|}||kr@td||ntd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rologgerdebug)r9url1url2rQs1s2r.r.r/ prefer_urls   zLocator.prefer_urlcCs t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r9filename project_namer.r.r/rszLocator.split_filenamec Csdd}d}t|\}}}}} } | drz~t |}t ||j std |nX|dkrd }n ||j |}|r|j |j |jt||||| d fd dd|jDd}Wn0tk r:}ztd|W5d}~XYnXn||jsZtd|nt|}}|jD]}||rn|dt| }|||}|std|nH|\}}}|r|||r|||t||||| d fd}|r||d<qqn|r| r| |d| <|S)a See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned. cSst|t|kSrV)r!)Zname1Zname2r.r.r/ same_projectsz:Locator.convert_url_to_download_info..same_projectNzegg=z %s: version hint in fragment: %r)NN/rEzWheel not compatible: %sTr3z, cSs"g|]}dt|ddqS).N)joinlist).0vr.r.r/ sz8Locator.convert_url_to_download_info..)raversionrwr,python-versionzinvalid path for wheel: %szNot downloadable: %sz No match for project/version: %s)rarrwr,r %s_digest)rlower startswithrprq HASHER_HASHmatchgroupsrjr$r%rlrarrwrr~pyver Exceptionwarningrkrgrhlenr)r9r,rxryrQr5rmriparamsqueryfragmalgodigestZorigpathwheelZincluderRrwZextrnrarrr.r.r/convert_url_to_download_infos              z$Locator.convert_url_to_download_infocCs2d}dD]$}d|}||kr|||f}q.q|S)z Get a digest from a dictionary by looking at keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. N)Zsha256md5rr.)r9inforQrr?r.r.r/ _get_digest1s zLocator._get_digestc Cs|d}|d}||kr,||}|j}nt|||jd}|j}|||_}|d}||d|<|j|dkr||j||_|d|t  |||_ |||<dS)z Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. rarr5r,digestsurlsN) popmetadatarr5rr source_urlrv setdefaultsetaddlocator) r9rQrrardistmdrr,r.r.r/_update_version_dataAs   zLocator._update_version_dataFc Csd}t|}|dkr td|t|j}||j|_}td|t|j | |j }t |dkr2g}|j } |D]z} | dkrqxzH|| std|| n*|s| | js|| ntd| |j Wqxtk rtd|| YqxXqxt |d krt||jd }|r2td ||d } || }|r|jrH|j|_|d i| t|_i} |di} |jD]}|| krv| || |<qv| |_d|_|S)a Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)r}rrz%s did not match %rz%skipping pre-release version %s of %szerror matching %s with %rr)r?zsorted list: %srzrr)rrr"r5rI requirementrprqtyper@rerarZ version_classrZ is_prereleaserOrrsortedr?ZextrasrNr download_urlsr)r9r prereleasesrQrr5rIversionsZslistZvclskrdZsdr,r.r.r/locateXsX          zLocator.locate)rF)F)r@rArBrCsource_extensionsbinary_extensionsexcluded_extensionsrlrkrLrSrUrXr[r]propertyr5rbrdrerorvrrrrrr.r.r.r/rDVs.   JrDcs0eZdZdZfddZddZddZZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c s*tt|jf|||_t|dd|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. r&r'N)superrrLbase_urlr r-r9r,kwargs __class__r.r/rLszPyPIRPCLocator.__init__cCst|jSrc)rr-r+rTr.r.r/rdsz%PyPIRPCLocator.get_distribution_namesc Csiid}|j|d}|D]}|j||}|j||}t|jd}|d|_|d|_|d|_ |dg|_ |d|_ t |}|r|d } | d |_ || |_||_|||<|D]:} | d } || } |d |t| | |d | <qq|S) NrTrrarlicensekeywordssummaryrr,rr)r-Zpackage_releasesZ release_urlsZ release_datarr5rarrNrrrrrrrrrrr) r9rarQrrrdatarrrr,rr.r.r/rbs0         zPyPIRPCLocator._get_projectr@rArBrCrLrdrb __classcell__r.r.rr/rs rcs0eZdZdZfddZddZddZZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c s tt|jf|t||_dSrV)rrrLrrrrr.r/rLszPyPIJSONLocator.__init__cCs tddSrczNot available from this locatorNr_rTr.r.r/rdsz&PyPIJSONLocator.get_distribution_namesc Cs iid}t|jdt|}z|j|}|}t|}t |j d}|d}|d|_ |d|_ | d|_| dg|_| d |_t|}||_|d } |||j <|d D]T} | d }|j||| |j|<|d |j t||| |d |<q|d D]\} } | |j kr4qt |j d} |j | _ | | _ t| }||_||| <| D]T} | d }|j||| |j|<|d | t||| |d |<qhqWn@tk r}z |jt|td|W5d}~XYnX|S)Nrz%s/jsonrrrarrrrrr,rZreleaseszJSON fetch failed: %s) rrr rHopenreaddecodejsonloadsrr5rarrNrrrrrrrrrrritemsrrKputrrp exception)r9rarQr,resprrrrrrrZinfosZomdodistrRr.r.r/rbsT                zPyPIJSONLocator._get_projectrr.r.rr/rs rc@s`eZdZdZedejejBejBZ edejejBZ ddZ edejZ e ddZd S) Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)cCs4||_||_|_|j|j}|r0|d|_dS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr,_basesearchgroup)r9rr,rr.r.r/rLs  z Page.__init__z[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsdd}t}|j|jD]}|d}|dpX|dpX|dpX|dpX|dpX|d }|d pp|d pp|d }t|j|}t|}|j d d|}| ||fqt |dddd}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs,t|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r,r5rmrirrrr.r.r/clean-s  zPage.links..cleanr3Zrel1Zrel2Zrel3Zrel4Zrel5Zrel6rrrsZurl3cSsdt|dS)Nz%%%2xr)ordr)rr.r.r/;zPage.links..cSs|dS)Nrr.)rnr.r.r/r?rT)r?reverse) r_hreffinditerr groupdictrrr _clean_resubrr)r9rrQrrrelr,r.r.r/links&s$  z Page.linksN)r@rArBrCrecompileISXrrrLrrrr.r.r.r/r s rcseZdZdZejdddddZdfdd Zd d Zd d Z ddZ e de j ZddZddZddZddZddZe dZddZZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. cCstjttdS)N)Zfileobj)gzipZGzipFilerrrbr.r.r/rMrzSimpleScrapingLocator.cCs|SrVr.rr.r.r/rNr)ZdeflaterZnoneN c sltt|jf|t||_||_i|_t|_t |_ t|_ d|_ ||_t|_t|_d|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FN)rrrLrrr( _page_cacher_seenr rJ _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplockplatform_check)r9r,r(rrrr.r/rLQs     zSimpleScrapingLocator.__init__cCsFg|_t|jD]0}tj|jd}|d||j|qdS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsrangerrZThread_fetchZ setDaemonstartrO)r9irnr.r.r/_prepare_threadsls  z&SimpleScrapingLocator._prepare_threadscCs6|jD]}|jdq|jD] }|qg|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)rrrr~)r9rnr.r.r/ _wait_threadsys    z#SimpleScrapingLocator._wait_threadsc Csiid}|jx||_||_t|jdt|}|j|j| z&t d||j ||j W5| X|`W5QRX|S)Nrz%s/z Queueing %s)rrQrxrrr rrWrrrrprqrrr~)r9rarQr,r.r.r/rbs      z"SimpleScrapingLocator._get_projectz<\b(linux_(i\d86|x86_64|arm\w+)|win(32|_amd64)|macosx_?\d+)\bcCs |j|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r9r,r.r.r/_is_platform_dependentsz,SimpleScrapingLocator._is_platform_dependentc CsZ|jr||rd}n|||j}td|||rV|j||j|W5QRX|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s) rrrrxrprqrrrQ)r9r,rr.r.r/_process_downloads z'SimpleScrapingLocator._process_downloadc Cst|\}}}}}}||j|j|jr2d}n||jrJ||jsJd}nd||js\d}nR|dkrjd}nD|dkrxd}n6||rd}n&| ddd} | dkrd}nd}t d |||||S) z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. F)ZhomepageZdownload)ZhttprfZftp:rrZ localhostTz#should_queue: %s (%s) from %s -> %s) rrjrrrrrrrsplitrrprq) r9linkZreferrerrr5rmri_rQhostr.r.r/ _should_queues0    z#SimpleScrapingLocator._should_queuec Cs|j}zz|r||}|dkr,WWq|jD]j\}}||jkr2zB|j|||s||||rt d|||j |Wq2t k rYq2Xq2Wn2t k r}z|j t|W5d}~XYnXW5|jX|sqqdS)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)rrNrPget_pagerrrrrrprqrrrrKr)r9r,pagerrrRr.r.r/rs,       & zSimpleScrapingLocator._fetchc CsXt|\}}}}}}|dkr:tjt|r:tt|d}||jkr`|j|}t d||n| ddd}d}||j krt d||nt |d d id }zzt d ||j j||jd } t d|| } | dd} t| r| } | } | d}|r"|j|}|| } d}t| }|r@|d}z| |} Wn tk rn| d} YnXt| | }||j| <Wntk r}z|jdkrtd||W5d}~XYnt k r}z0td|||j!|j "|W5QRXW5d}~XYn2t#k rB}ztd||W5d}~XYnXW5||j|<X|S)a Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). filez index.htmlzReturning %s from cache: %srrrNzSkipping %s due to bad host %szAccept-encodingZidentity)r>z Fetching %sr'z Fetched %sz Content-Typer3zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosriisdirrrrrrprqrrrrHrr(rrNHTML_CONTENT_TYPErZgeturlrdecodersCHARSETrrr UnicodeErrorrrr<rrrrr)r9r,r5rmrirrQrr:rr>Z content_typeZ final_urlrencodingdecoderrrRr.r.r/rsZ              &$ zSimpleScrapingLocator.get_pagez]*>([^<]+)[\w-]+)\s*\(\s*(==\s*)?(?P[^)]+)\)$c@sLeZdZdZdddZddZddZd d Zd d Zd dZ dddZ dS)DependencyFinderz0 Locate dependencies for distributions. NcCs|pt|_t|jj|_dS)zf Initialise an instance, using the specified locator to locate distributions. N)default_locatorrr"r5r)r.r.r/rL*s zDependencyFinder.__init__cCsrtd||j}||j|<||j||jf<|jD]:}t|\}}td||||j |t  ||fq2dS)z Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. zadding distribution %szAdd to provided: %s, %s, %sN) rprqr? dists_by_namedistsrprovidesrprovidedrrr)r9rraprr.r.r/add_distribution2s    z!DependencyFinder.add_distributioncCsxtd||j}|j|=|j||jf=|jD]D}t|\}}td||||j|}| ||f|s.|j|=q.dS)z Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. zremoving distribution %sz Remove from provided: %s, %s, %sN) rprqr?r0r1rr2rr3remove)r9rrar4rsr.r.r/remove_distributionAs    z$DependencyFinder.remove_distributioncCsBz|j|}Wn,tk r<|d}|j|}YnX|S)z Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). r)r5rIr#r)r9reqtrIrar.r.r/ get_matcherSs  zDependencyFinder.get_matcherc Cst||}|j}t}|j}||krp||D]B\}}z||}Wntk rZd}YnX|r,||qpq,|S)z Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. F)r:r?rr3rr#r) r9r9rIrarQr3rproviderrr.r.r/find_providerscs   zDependencyFinder.find_providersc Cs|j|}t}|D]$}||}||js||q|rZ|d||t|fd}n@|||j|=|D]}|j|t|qp| |d}|S)a Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. Z cantreplaceFT) reqtsrr:rrr frozensetr8rr5) r9r;otherproblemsZrlistZ unmatchedr7rIrQr.r.r/try_to_replace{s$       zDependencyFinder.try_to_replaceFcCsi|_i|_i|_i|_t|p g}d|krH|d|tdddgO}t|trh|}}t d|n4|j j ||d}}|dkrt d|t d |d |_ t}t|g}t|g}|r|}|j} | |jkr||n"|j| } | |kr||| ||j|jB} |j} t} |r`||kr`d D]*}d |}||kr4| t|d |O} q4| | B| B}|D].}||}|sFt d||j j ||d}|dkr|s|j j |d d}|dkrt d||d|fn^|j|j}}||f|jkr|||||| krF||krF||t d|j|D]R}|j} | |jkrx|j|t|n"|j| } | |krJ||| |qJqpqt|j}|D]&}||k|_|jrt d|jqt d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:z:test:z:build:z:dev:zpassed %s as requirement)rNzUnable to locate %rz located %sT)ZtestZbuildZdevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %rZ unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)r3r1r0r=rr6r#rrprqrrrZ requestedrr?r5rAZ run_requiresZ meta_requiresZbuild_requiresgetattrr<rrZname_and_versionrvaluesZbuild_time_dependency)r9rZ meta_extrasrrrr@ZtodoZ install_distsrar?ZireqtsZsreqtsZereqtsr?rRZ all_reqtsrZ providersr;nrr4r1r.r.r/finds                            zDependencyFinder.find)N)NF) r@rArBrCrLr5r8r:r<rArEr.r.r.r/r.%s (r.)N)OriorrZloggingr rgrr ImportErrorZdummy_threadingrr3rcompatrrrrr r r r r rrr7rrrrZdatabaserrrrrrutilrrrrrrrr r!rr"r#rr$r%Z getLoggerr@rprrrr r r*r0r1objectrDrrrrrrr"r&r/rZNAME_VERSION_REr.r.r.r.r/s^   D,    @0E:zA&[ PK!JE**(__pycache__/scripts.cpython-38.opt-1.pycnu[U .e?@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZeeZdZedZd Zd d ZGd d d eZdS))BytesION) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executablein_venva s^#!.*pythonw?[0-9.]*([ ].*)?$z# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) cCsXd|krT|drB|dd\}}d|krT|dsTd||f}n|dsTd|}|S)N z /usr/bin/env r"z%s "%s"z"%s") startswithsplit) executableenvZ _executabler?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/scripts.py_enquote_executable3s  rc@seZdZdZeZdZd'ddZddZe j d rBd d Z d d Z ddZd(ddZddZeZddZddZd)ddZddZeddZejddZejd ksejd krejd krd!d"Zd*d#d$Zd+d%d&ZdS), ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFcCsz||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t d|_ |pRt ||_ tjdkprtjdkortjdk|_ dS)NFposixjava)X.Ynt) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr_fileop_is_nt)selfrrrdry_runZfileoprrr__init__Ls  zScriptMaker.__init__cCs@|ddr<|jr %srspythonwr|rd)!r!r/r1rr rr`rr'Znewerr:ror6r9r*readliner;Zget_command_name FIRST_LINE_REmatchr0groupcloseZ copy_filer$rprqinforseekrUryr7)r)rrsZadjustrvfZ first_linerrIrSlinesrTrtrwrrr _copy_script)sX        zScriptMaker._copy_scriptcCs|jjSr_r'r*)r)rrrr*]szScriptMaker.dry_runcCs ||j_dSr_r)r)valuerrrr*asrcCsHtddkrd}nd}d||f}tddd}t||j}|S) NPZ64Z32z%s%s.exerVrr)structcalcsize__name__rsplitrfindbytes)r)Zkindbitsr"Zdistlib_packagerJrrrrhis zScriptMaker._get_launchercCs6g}t|}|dkr"|||n|j|||d|S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. Nrz)r rr)r) specificationr2rsr]rrrmakews zScriptMaker.makecCs$g}|D]}||||q|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r)Zspecificationsr2rsrrrr make_multipleszScriptMaker.make_multiple)TFN)rLN)N)N)N) r __module__ __qualname____doc__SCRIPT_TEMPLATErYrr+r4rGrHrr=r@rKrUr^_DEFAULT_MANIFESTrarcryrrpropertyr*setterr!r"r#rhrrrrrrrCs6     84 4   r)iorZloggingr!rerrGcompatrrrZ resourcesrutilrr r r r Z getLoggerrr:striprcompilerrrobjectrrrrrs     PK!2FTT)__pycache__/database.cpython-38.opt-1.pycnu[U .eU@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z d d d d dgZ!e"e#Z$dZ%dZ&deddde%dfZ'dZ(Gddde)Z*Gddde)Z+Gdd d e)Z,Gdd d e,Z-Gdd d e-Z.Gdd d e-Z/e.Z0e/Z1Gddde)Z2d)d!d"Z3d#d$Z4d%d&Z5d'd(Z6dS)*zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.jsonZ INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc@s(eZdZdZddZddZddZdS) _CachezL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generatedselfr#@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/database.py__init__1sz_Cache.__init__cCs|j|jd|_dS)zC Clear the cache, setting it to its initial state. FN)rclearrr r!r#r#r$r&9s  z _Cache.clearcCs2|j|jkr.||j|j<|j|jg|dS)z` Add a distribution to the cache. :param dist: The distribution to add. N)rr setdefaultkeyappendr"distr#r#r$addAs  z _Cache.addN)__name__ __module__ __qualname____doc__r%r&r,r#r#r#r$r-src@seZdZdZdddZddZdd ZeeeZd d Z d d Z ddZ e ddZ ddZddZdddZddZdddZdS)rzU Represents a set of distributions installed on a path (typically sys.path). NFcCsD|dkrtj}||_d|_||_t|_t|_d|_td|_ dS)a Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. NTdefault) sysr _include_dist _include_eggr_cache _cache_egg_cache_enabledr_scheme)r"rZ include_eggr#r#r$r%Os zDistributionPath.__init__cCs|jSNr7r!r#r#r$_get_cache_enabledcsz#DistributionPath._get_cache_enabledcCs ||_dSr9r:)r"valuer#r#r$_set_cache_enabledfsz#DistributionPath._set_cache_enabledcCs|j|jdS)z, Clears the internal cache. N)r5r&r6r!r#r#r$ clear_cacheks zDistributionPath.clear_cachec csDt}|jD]0}t|}|dkr&q |d}|r |js||jjD] }|Vq0|jrZ|jjD] }|VqNdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r7r\r^r5rvaluesr4r6r*r#r#r$get_distributionss   z"DistributionPath.get_distributionscCsd}|}|js4|D]}|j|kr|}q|qnH|||jjkrZ|jj|d}n"|jr|||jjkr||jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr7r\r(r^r5rr4r6)r"rresultr+r#r#r$get_distributions    z!DistributionPath.get_distributionc csd}|dk rJz|jd||f}Wn$tk rHtd||fYnX|D]p}t|dsntd|qR|j}|D]H}t |\}}|dkr||kr|VqRqx||krx| |rx|VqRqxqRdS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string N%s (%s)zinvalid name or version: %r, %rprovideszNo "provides": %s) r8matcher ValueErrorrrfhasattrrSrTrkrmatch) r"rrcrlr+providedpp_namep_verr#r#r$provides_distributions*    z&DistributionPath.provides_distributioncCs(||}|dkrtd|||S)z5 Return the path to a resource file. Nzno distribution named %r found)ri LookupErrorget_resource_path)r"r relative_pathr+r#r#r$ get_file_path!s  zDistributionPath.get_file_pathccsX|D]J}|j}||kr||}|dk r>||krR||Vq|D] }|VqFqdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)rfexportsre)r"categoryrr+rYdvr#r#r$get_exported_entries*s   z%DistributionPath.get_exported_entries)NF)N)N)r-r.r/r0r%r;r=propertyZ cache_enabledr>r\r^ classmethodrdrfrirtrxr}r#r#r#r$rKs  ,  ) c@seZdZdZdZdZddZeddZeZ eddZ ed d Z d d Z ed dZ eddZeddZeddZeddZddZddZddZddZdS) rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. FcCsL||_|j|_|j|_|j|_d|_d|_d|_d|_t |_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) rDrrgr(rcZlocatordigestextrascontextrHZ download_urlsZdigests)r"rDr#r#r$r%Os zDistribution.__init__cCs|jjS)zH The source archive download URL for this distribution. )rD source_urlr!r#r#r$r`szDistribution.source_urlcCsd|j|jfS)zX A utility property which displays the name and version in parentheses. rjrrcr!r#r#r$name_and_versioniszDistribution.name_and_versioncCs.|jj}d|j|jf}||kr*|||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. rj)rDrkrrcr))r"Zplistsr#r#r$rkps  zDistribution.providescCs8|j}td|t||}t|j||j|jdS)Nz%Getting requirements from metadata %r)rrE) rDrSrTZtodictgetattrrHZget_requirementsrr)r"Zreq_attrmdZreqtsr#r#r$_get_requirements|s   zDistribution._get_requirementscCs |dS)N run_requiresrr!r#r#r$rszDistribution.run_requirescCs |dS)N meta_requiresrr!r#r#r$rszDistribution.meta_requirescCs |dS)Nbuild_requiresrr!r#r#r$rszDistribution.build_requirescCs |dS)N test_requiresrr!r#r#r$rszDistribution.test_requirescCs |dS)N dev_requiresrr!r#r#r$rszDistribution.dev_requiresc Cst|}t|jj}z||j}Wn6tk rZtd|| d}||}YnX|j }d}|j D]D}t |\}} ||krqlz| | }WqWqltk rYqlXql|S)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. +could not read version %r - using name onlyrF)r rrDrCrl requirementrrSwarningsplitr(rkrro) r"reqrYrCrlrrhrqrrrsr#r#r$matches_requirements,       z Distribution.matches_requirementcCs(|jrd|j}nd}d|j|j|fS)zC Return a textual representation of this instance, z [%s]r?z)rrrc)r"suffixr#r#r$__repr__s zDistribution.__repr__cCs>t|t|k rd}n$|j|jko8|j|jko8|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typerrcr)r"otherrhr#r#r$__eq__s   zDistribution.__eq__cCst|jt|jt|jS)zH Compute hash in a way which matches the equality test. )hashrrcrr!r#r#r$__hash__szDistribution.__hash__N)r-r.r/r0Zbuild_time_dependency requestedr%r~rZ download_urlrrkrrrrrrrrrrr#r#r#r$r=s4        " cs0eZdZdZdZdfdd ZdddZZS) rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncs tt||||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr%r dist_path)r"rDrrE __class__r#r$r%s z"BaseInstalledDistribution.__init__cCsd|dkr|j}|dkr"tj}d}ntt|}d|j}||}t|dd}d||fS)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str Nr?z%s==ascii%s%s) hasherhashlibmd5rrbase64Zurlsafe_b64encoderstripdecode)r"datarprefixrr#r#r$get_hashs   z"BaseInstalledDistribution.get_hash)N)N)r-r.r/r0rr%r __classcell__r#r#rr$rscseZdZdZdZd'fdd ZddZdd Zd d Ze d d Z ddZ ddZ ddZ ddZd(ddZddZe ddZd)ddZdd Zd!d"Zd#d$Zd%d&ZejZZS)*ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). Zsha256Nc sJg|_t||_}|dkr*td||rP|jrP||jjkrP|jj|j}nt|dkr| t }|dkrt| t }|dkr| d}|dkrtdt |ft |}t|dd}W5QRXtt|||||r|jr|j|| d}|dk |_tj|d}tj|rFt|d}|} W5QRX| |_dS) Nzfinder unavailable for %sZMETADATAzno %s found in %sr@rAr top_level.txtrb)modulesrrIrXrmr7r5rrDrJr r rPrQrRr rrr%r,rosrOexistsopenread splitlines) r"rrDrErXrYr[rqfrrr#r$r%s8         zInstalledDistribution.__init__cCsd|j|j|jfS)Nz#rrcrr!r#r#r$r=s zInstalledDistribution.__repr__cCsd|j|jfSNz%s %srr!r#r#r$__str__AszInstalledDistribution.__str__c Csg}|d}t|\}t|dF}|D]:}ddtt|dD}||\}}} |||| fq.W5QRXW5QRX|S)a" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). rr[cSsg|]}dqSr9r#).0ir#r#r$ Ssz6InstalledDistribution._get_records..)get_distinfo_resourcerPrQrRrrangelenr)) r"resultsrYr[Z record_readerrowmissingrchecksumsizer#r#r$ _get_recordsDs  &z"InstalledDistribution._get_recordscCsi}|t}|r|}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )rEXPORTS_FILENAMEr)r"rhrYr#r#r$ry[s  zInstalledDistribution.exportsc Cs8i}|t}|r4t|}t|}W5QRX|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. )rrrPrQrRr)r"rhrYr[r#r#r$ris  z"InstalledDistribution.read_exportsc Cs.|t}t|d}t||W5QRXdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_filerrr)r"ryZrfrr#r#r$rxs  z#InstalledDistribution.write_exportsc Cs|d}t|R}t|d<}|D]0\}}||kr*|W5QRW5QRSq*W5QRXW5QRXtd|dS)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. rrz3no resource file with relative path %r is installedN)rrPrQrRrKeyError)r"rwrYr[Zresources_readerrelativeZ destinationr#r#r$rvs   6z'InstalledDistribution.get_resource_pathccs|D] }|VqdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r"rhr#r#r$list_installed_filess z*InstalledDistribution.list_installed_filesFc Cs(tj|d}tj|j}||}tj|d}|d}td||rRdSt|}|D]}tj |sz| drd} } n4dtj |} t |d} | | } W5QRX||s|r||rtj||}||| | fq`||r tj||}||ddfW5QRX|S)z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. r?r creating %sNz.pycz.pyoz%dr)rrrOdirname startswithrrSinforisdirrLgetsizerrrrelpathZwriterow) r"pathsrdry_runbaseZbase_under_prefix record_pathwriterr hash_valuerfpr#r#r$write_installed_filess0       z+InstalledDistribution.write_installed_filesc Csg}tj|j}|d}|D]\}}}tj|sHtj||}||krRq$tj|sr||dddfq$tj |r$t tj |}|r||kr||d||fq$|r$d|kr| ddd}nd }t |d 2} || |} | |kr||d || fW5QRXq$|S)  Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rrTFr=rrNrr)rrrrrisabsrOrr)isfilestrrrrrr) r" mismatchesrrrrrZ actual_sizerrZ actual_hashr#r#r$check_installed_filess.        z+InstalledDistribution.check_installed_filesc Csi}tj|jd}tj|rtj|ddd}|}W5QRX|D]8}|dd\}}|dkr|| |g |qL|||<qL|S)a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rrYutf-8encodingrr namespace) rrrOrcodecsrrrrr'r))r"rh shared_pathrlinesliner(r<r#r#r$shared_locationss  z&InstalledDistribution.shared_locationsc Cstj|jd}td||r$dSg}dD].}||}tj||r,|d||fq,|ddD]}|d|qhtj |d d d }| d |W5QRX|S) aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rrN)rlibZheadersZscriptsrz%s=%srr#z namespace=%srrr ) rrrOrSrrr)getrrwrite) r"rrrrr(rnsrr#r#r$write_shared_locationss  z,InstalledDistribution.write_shared_locationscCsF|tkrtd||jft|j}|dkr.set_name_and_version) rrr7r6rDrrc _get_metadatar,rrr%)r"rrErrDrr#r$r%bs   zEggInfoDistribution.__init__c sd}ddfdd}d}}|drtj|rtj|d}tj|d}t|dd }tj|d } tj|d }|| }npt|} t| d  d } t| dd}z,| d} | d d}| d}Wnt k rd}YnXnf|drPtj|rBtj|d } || }tj|d}tj|d }t|dd }n t d||rl| ||dkr|dk rtj|rt|d} |  d}W5QRX|sg}n|}||_|S)NcSsg}|}|D]}|}|dr6td|qt|}|sPtd|q|jr`td|jst||j qd dd|jD}|d|j |fq|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedz, css|]}d|VqdS)rNr#)rcr#r#r$ szQEggInfoDistribution._get_metadata..parse_requires_data..rj) rstriprrSrr rZ constraintsr)rrO)rreqsrrrYZconsr#r#r$parse_requires_datazs(   z>EggInfoDistribution._get_metadata..parse_requires_datac sHg}z*t|dd}|}W5QRXWntk rBYnX|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rYr)rrrIOError)req_pathrrrr#r$parse_requires_pathsz>EggInfoDistribution._get_metadata..parse_requires_pathrGzEGG-INFOzPKG-INFOr@)rrCz requires.txtrzEGG-INFO/PKG-INFOutf8rAzEGG-INFO/requires.txtzEGG-INFO/top_level.txtrrFz,path must end with .egg-info or .egg, got %rr)rLrrrrOr zipimport zipimporterrget_datarrrZadd_requirementsrrrrr)r"rrequiresr Ztl_pathZtl_datarq meta_pathrDrZzipfrBrrr#rr$rwsX             z!EggInfoDistribution._get_metadatacCsd|j|j|jfS)Nz!rr!r#r#r$rs zEggInfoDistribution.__repr__cCsd|j|jfSrrr!r#r#r$rszEggInfoDistribution.__str__cCs`g}tj|jd}tj|r\|D]2\}}}||kr._md5cSs t|jSr9)rstatst_size)rr#r#r$_sizesz7EggInfoDistribution.list_installed_files.._sizerrYrrzNon-existent file: %srN) rrrOrrrrnormpathrSrrLrr))r"rrrrhrrrqr#r#r$rs"     $z(EggInfoDistribution.list_installed_filesFc cstj|jd}tj|rd}tj|ddd`}|D]T}|}|dkrPd}q6|s6tjtj|j|}||jr6|r|Vq6|Vq6W5QRXdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths rTrYrrz./FN) rrrOrrrrrr)r"Zabsoluterskiprrrqr#r#r$rs   z'EggInfoDistribution.list_distinfo_filescCst|to|j|jkSr9)r]rrrr#r#r$r.s  zEggInfoDistribution.__eq__)N)F)r-r.r/r0rrr%rrrrrrrrrrr#r#rr$rYsZ& c@s^eZdZdZddZddZdddZd d Zd d ZdddZ dddZ ddZ ddZ dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dSr9)adjacency_list reverse_listrr!r#r#r$r%IszDependencyGraph.__init__cCsg|j|<g|j|<dS)zAdd the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` N)rr)r" distributionr#r#r$add_distributionNs z DependencyGraph.add_distributionNcCs6|j|||f||j|kr2|j||dS)aAdd an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` N)rr)r)r"xylabelr#r#r$add_edgeXs zDependencyGraph.add_edgecCs&td|||j|g|dS)a Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` z %s missing %rN)rSrTrr'r))r"rrr#r#r$ add_missinggszDependencyGraph.add_missingcCsd|j|jfSrrr*r#r#r$ _repr_distrszDependencyGraph._repr_distrcCs||g}|j|D]h\}}||}|dk r|d|j|jfq>q|st|dkr|d|d|d|D]}|d |j|d q|d |d dS) a9Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` zdigraph dependencies { rNz"%s" -> "%s" [label="%s"] z "%s" -> "%s" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rz} )rritemsrr)r)r"rZskip_disconnectedZ disconnectedr+adjsrrr#r#r$to_dots(          zDependencyGraph.to_dotcsg}i}|jD]\}}|dd||<qgt|ddD]\}}|sD|||=qDshq|D]\}}fdd|D||<qptdddD|q,|t|fS)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. Ncs g|]\}}|kr||fqSr#r#)rr{rYZ to_remover#r$rsz4DependencyGraph.topological_sort..zMoving to result: %scSsg|]}d|j|jfqS)rjr)rr{r#r#r$rs)rr'listr)rSrTr$keys)r"rhZalistkr|r#r*r$topological_sorts$   z DependencyGraph.topological_sortcCs2g}|jD]\}}|||qd|S)zRepresentation of the graphr)rr'r)r#rO)r"r&r+r(r#r#r$rszDependencyGraph.__repr__)N)r)T) r-r.r/r0r%rr r!r"r#r)r.rr#r#r#r$r9s   rr1c CsVt|}t}i}|D]L}|||jD]6}t|\}}td|||||g||fq*q|D]}|j |j B|j B|j B}|D]} z| | } Wn6tk rtd| | d}| |} YnX| j}d} ||kr>||D]N\}} z| |} Wntk rd} YnX| r||| | d} q>q| s||| qqh|S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %srrFT)rrrrkrrSrTr'r)rrrrrlrrrr(ror r!)distsrCgraphrpr+rqrrcrrrlZmatchedZproviderror#r#r$ make_graphsN       r1cCsv||krtd|jt|}|g}|j|}|rh|}|||j|D]}||krN||qNq.|d|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested 1given distribution %r is not a member of the listr)rrr1rpopr))r/r+r0Zdeptodor{Zsuccr#r#r$get_dependent_distss   r5cCsn||krtd|jt|}g}|j|}|rj|d}|||j|D]}||krP||qPq,|S)zRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested r2r)rrr1rr3r))r/r+r0rr4r{Zpredr#r#r$get_required_distss   r6cKs4|dd}tf|}||_||_|p(d|_t|S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summary)r3r rrcr7r)rrckwargsr7rr#r#r$ make_dist2s    r9)r1)7r0Z __future__rrrrPrZloggingrrNr2r r?rrcompatrrcrrrDr r r r utilr rrrrrr__all__Z getLoggerr-rSrZCOMMANDS_FILENAMErrMrrrrrrrrUrVrr1r5r6r9r#r#r#r$s`  $ s7J] 6PK!q~~e'e')__pycache__/manifest.cpython-38.opt-1.pycnu[U .e9@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ e eZedejZed ejejBZejdd ZGd ddeZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode convert_pathManifestz\\w* z#.*?(?= )| (?=$)c@szeZdZdZdddZddZddZd d Zdd d ZddZ ddZ ddZ dddZ d ddZ d!ddZddZdS)"rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. NcCs>tjtj|pt|_|jtj|_d|_t |_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfrr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/manifest.py__init__*szManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}|r|}t |} | D]R} tj || } t| } | j } || r|t | qN|| rN|| sN|| qNq6dS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrrpopappendr listdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"   zManifest.findallcCs4||jstj|j|}|jtj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrr r rrraddr )ritemrrrr*Ts z Manifest.addcCs|D]}||qdS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r*)ritemsr+rrradd_many^szManifest.add_manyFcsbfddtj}|rFt}|D]}|tj|q&||O}ddtdd|DDS)z8 Return sorted files in directory order cs>||td||jkr:tj|\}}||dS)Nzadd_dir added %s)r*loggerdebugrr r split)dirsdparent_add_dirrrrr6ls    z Manifest.sorted..add_dircSsg|]}tjj|qSr)r r r).0Z path_tuplerrr zsz#Manifest.sorted..css|]}tj|VqdS)N)r r r0)r7r rrr {sz"Manifest.sorted..)rrr r dirnamesorted)rZwantdirsresultr1frr5rr;gs zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}szManifest.clearcCsj||\}}}}|dkrB|D]}|j|ddstd|qn$|dkrf|D]}|j|dd}qNn|dkr|D]}|j|ddsrtd|qrn|d kr|D]}|j|dd}qn|d kr|D] }|j||d std ||qn|d kr |D]}|j||d }qn\|dkr2|jd|d sftd|n4|dkrZ|jd|d sftd|n td|dS)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludeglobal-includeFz3no files found matching %r anywhere in distributionglobal-excluderecursive-include)rz-no files found matching %r under directory %rrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr.Zwarning_exclude_patternr)r directiveactionpatternsthedirZ dirpatternpatternfoundrrrprocess_directivesP   zManifest.process_directivecCs|}t|dkr,|ddkr,|dd|d}d}}}|dkrxt|dkr`td|d d |ddD}n~|d krt|d krtd |t|d}dd |ddD}n:|dkrt|dkrtd|t|d}n td|||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rr)r?rArBrCrDrErFrGr?N)r?rArBrCrz$%r expects ...cSsg|] }t|qSrrr7Zwordrrrr8sz-Manifest._parse_directive..)rDrEz*%r expects ...cSsg|] }t|qSrrrRrrrr8s)rFrGz!%r expects a single zunknown action %r)r0leninsertrr)rrKZwordsrLrMrNZ dir_patternrrrrHs4       zManifest._parse_directiveTcCsPd}|||||}|jdkr&||jD]}||r,|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. FNT)_translate_patternrr(searchrr*)rrOr@ris_regexrP pattern_rer%rrrrIs    zManifest._include_patterncCsBd}|||||}t|jD]}||r|j|d}q|S)atRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)rVlistrrWremove)rrOr@rrXrPrYr=rrrrJ)s   zManifest._exclude_patternc Csv|rt|trt|S|Stdkr:|dd\}}}|rR||}tdkrVnd}ttj |j d} |dk r4tdkr|d} ||dt |  } n&||} | t |t | t |} tj } tj dkrd} tdkrd| | | d|f}n0|t |t |t |}d || | | ||f}n8|rltdkrRd| |}nd || |t |df}t|S) aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). )rSrr4N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionescaper r rrrTr) rrOr@rrXstartr4endrYrZ empty_patternZ prefix_rerrrrrV=sF             zManifest._translate_patterncCs8t|}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). r]z\\\\z\1[^%s]z((?rQrHrIrJrVrdrrrrr%s&   O/ )  7)roriZloggingr rasysr\rcompatrutilr__all__Z getLoggerrlr.rbMZ_COLLAPSE_PATTERNSZ_COMMENTED_LINE version_inforcobjectrrrrrs    PK!FaX}}'__pycache__/compat.cpython-38.opt-1.pycnu[U .e @sBddlmZddlZddlZddlZz ddlZWnek rHdZYnXejddkr~ddlmZe fZ e Z ddl mZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#d d Zddl$Z$dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-er&dd l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;ddZ<nddl=mZe>fZ e>Z ddl=m?ZddlZddlZddlZddl@mZmZmZmd?Zod@dAZiYnXzddBlpmqZqWn"ek rddBlrmqZqYnXejddCdDkr:e3jsZsn ddElpmsZszddFl`mtZtWndek rddGl`muZuzddHlvmwZxWn ek rdedJdKZxYnXGdLdMdMeuZtYnXzddNlymzZzWnHek rzddNl{mzZzWn ek rdfdOdPZzYnXYnXzddQl`m|Z|Wnek rzddRl}m~ZWn"ek rjddRlm~ZYnXzddSlmZmZmZWnek rYnXGdTdUdUeZ|YnXzddVlmZmZWnvek r<emdWejZdXdYZGdZd[d[eZdgd\d]ZGd^d_d_eZGd`dadaeZGdbdcdceQZYnXdS)h)absolute_importN)StringIO)FileType)shutil)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCst|tr|d}t|S)Nutf-8) isinstanceunicodeencode_quote)sr>/usr/lib/python3.8/site-packages/pip/_vendor/distlib/compat.pyrs  r) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalsecCs<tdkrddl}|dat|}|r4|ddSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz ^(.*)@(.*)$r) _userprogrecompilematchgroup)Zhostr+r-rrr splituser4s   r/) TextIOWrapper) rr r r/rrr r r) rr rrrr r!r"r#r$)rrr) filterfalse)match_hostnameCertificateErrorc@s eZdZdS)r3N)__name__ __module__ __qualname__rrrrr3^sr3c Csg}|s dS|d}|d|dd}}|d}||krNtdt||sb||kS|dkrv|dn>|d s|d r|t|n|t| d d |D]}|t|qt d d |dtj } | |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)splitcountr3reprlowerappend startswithr+escapereplacer,join IGNORECASEr-) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsfragZpatrrr_dnsname_matchbs*    rFcCs|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. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNamerZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %s, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrFr=lenr3rAmapr;)ZcertrCZdnsnamesZsankeyvaluesubrrrr2s2         r2)SimpleNamespacec@seZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|j|dSN__dict__update)selfkwargsrrr__init__szContainer.__init__N)r4r5r6__doc__rWrrrrrPsrP)whichc s"dd}tjr&||r"SdS|dkr>tjdtj}|sFdS|tj}tj dkrtj |krt| dtj tjddtj}t fd d |Drg}q‡fd d |D}ng}t }|D]P}tj|}||kr|||D](} tj|| } || |r| SqqdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cSs&tj|o$t||o$tj| SrQ)ospathexistsaccessisdir)fnmoderrr _access_checks zwhich.._access_checkNPATHZwin32rZPATHEXTc3s |]}|VqdSrQ)r<endswith.0extcmdrr szwhich..csg|] }|qSrrrerhrr szwhich..)rZr[dirnameenvironrIdefpathr9pathsepsysplatformcurdirinsertanysetnormcaseaddrA) rir`r[raZpathextfilesseendirZnormdirZthefilenamerrhrrYs8         rY)ZipFile __enter__) ZipExtFilec@s$eZdZddZddZddZdS)r~cCs|j|jdSrQrR)rUbaserrrrWszZipExtFile.__init__cCs|SrQrrUrrrr}szZipExtFile.__enter__cGs |dSrQcloserUexc_inforrr__exit__szZipExtFile.__exit__N)r4r5r6rWr}rrrrrr~sr~c@s$eZdZddZddZddZdS)r|cCs|SrQrrrrrr}"szZipFile.__enter__cGs |dSrQrrrrrr%szZipFile.__exit__cOstj|f||}t|SrQ) BaseZipFileopenr~)rUargsrVrrrrr)sz ZipFile.openN)r4r5r6r}rrrrrrr|!sr|)python_implementationcCs0dtjkrdStjdkrdStjdr,dSdS)z6Return a string identifying the Python implementation.ZPyPyjavaZJythonZ IronPythonZCPython)rpversionrZr{r>rrrrr0s   r) sysconfig)CallablecCs t|tSrQ)rr)objrrrcallableDsrrmbcsstrictsurrogateescapecCs:t|tr|St|tr$|ttStdt|jdSNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper4filenamerrrfsencodeXs   rcCs:t|tr|St|tr$|ttStdt|jdSr) rrrdecoderrrrr4rrrrfsdecodeas   r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|dddd}|dks*|dr.dS|dks@|drDd S|S) z(Imitates get_normal_name in tokenizer.c.N _-rzutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)r<r@r>)orig_encencrrr_get_normal_namersrcsz jjWntk r$dYnXdd}d}fdd}fdd}|}|trpd|d d}d }|s||gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFrcs$zWStk rYdSXdS)N) StopIterationr)readlinerr read_or_stopsz%detect_encoding..read_or_stopcsz|d}Wn4tk rBd}dk r6d|}t|YnXt|}|sVdSt|d}z t|}Wn:tk rdkrd|}n d|}t|YnXr|j dkr؈dkrd}n d}t||d 7}|S) Nrz'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr{)line line_stringmsgZmatchesencodingcodec) bom_foundrrr find_cookies8       z$detect_encoding..find_cookieTrz utf-8-sig)__self__r{AttributeErrorr>r)rrdefaultrrfirstsecondr)rrrrr}s4   &     r)r?r))r)unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtfdd}td|_td|_td|_tdi|_|S)Nc sBt|tf}|krS|z |}W5|X|SrQ)id get_identrwdiscard)rUrLresult) fillvalue repr_running user_functionrrwrappers   z=_recursive_repr..decorating_function..wrapperr5rXr4__annotations__)rugetattrr5rXr4r)rrr)rrrdecorating_functions   z,_recursive_repr..decorating_functionr)rrrrr_recursive_reprs rc@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|p ig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)rUrrrrrWszChainMap.__init__cCs t|dSrQ)KeyErrorrUrLrrr __missing__szChainMap.__missing__c Cs:|jD](}z||WStk r,YqXq||SrQ)rrr)rUrLmappingrrr __getitem__s  zChainMap.__getitem__NcCs||kr||S|SrQrrUrLrrrrrI%sz ChainMap.getcCsttj|jSrQ)rJruunionrrrrr__len__(szChainMap.__len__cCsttj|jSrQ)iterrurrrrrr__iter__+szChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdSrQr)rfmrLrrrj/sz(ChainMap.__contains__..rtrrrrr __contains__.szChainMap.__contains__cCs t|jSrQrrrrr__bool__1szChainMap.__bool__cCsd|dtt|jS)Nz{0.__class__.__name__}({1})rG)rrArKr;rrrrr__repr__4szChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr9szChainMap.fromkeyscCs$|j|jdf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopyrrrrr>sz ChainMap.copycCs|jif|jS)z;New ChainMap with a new dict followed by all previous maps.rrrrrr new_childDszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rNrrrrrparentsHszChainMap.parentscCs||jd|<dS)Nr)r)rUrLrMrrr __setitem__MszChainMap.__setitem__cCs8z|jd|=Wn"tk r2td|YnXdS)Nr(Key not found in the first mapping: {!r})rrrrrrr __delitem__PszChainMap.__delitem__cCs2z|jdWStk r,tdYnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)rpopitemrrrrrrVszChainMap.popitemcGs@z|jdj|f|WStk r:td|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rrN)rpoprr)rUrLrrrrr]sz ChainMap.popcCs|jddS)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrrrrrdszChainMap.clear)N)r4r5r6rXrWrrrIrrrrrr classmethodrr__copy__rpropertyrrrrrrrrrrrs.     r)cache_from_sourcecCs"|dkr d}|rd}nd}||S)NFcor)r[debug_overridesuffixrrrrns r) OrderedDict)r)KeysView ValuesView ItemsViewc@seZdZdZddZejfddZejfddZdd Zd d Z d d Z d6ddZ ddZ ddZ ddZddZddZddZddZeZeZefdd Zd7d"d#Zd8d$d%Zd&d'Zd(d)Zed9d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S):rz)Dictionary that remembers insertion ordercOsnt|dkrtdt|z |jWn6tk r\g|_}||dg|dd<i|_YnX|j||dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. rz$expected at most 1 arguments, got %dN)rJr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rUrkwdsrootrrrrWs    zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rr)rUrLrMZ dict_setitemrlastrrrrs  zOrderedDict.__setitem__cCs0||||j|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rr)rUrLZ dict_delitem link_prev link_nextrrrrs zOrderedDict.__delitem__ccs.|j}|d}||k r*|dV|d}qdS)zod.__iter__() <==> iter(od)rr)NrrUrZcurrrrrrs  zOrderedDict.__iter__ccs.|j}|d}||k r*|dV|d}qdS)z#od.__reversed__() <==> reversed(od)rr)Nrrrrr __reversed__s  zOrderedDict.__reversed__cCsdz@|jD]}|dd=q |j}||dg|dd<|jWntk rTYnXt|dS)z.od.clear() -> None. Remove all items from od.N)r itervaluesrrrr)rUZnoderrrrrs zOrderedDict.clearTcCs||s td|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=t||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrrr))rrrrr)rUrrlinkrrrLrMrrrrs   zOrderedDict.popitemcCst|S)zod.keys() -> list of keys in od)rrrrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|] }|qSrrrfrLrrrrksz&OrderedDict.values..rrrrrvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrrr rrrrksz%OrderedDict.items..rrrrritemsszOrderedDict.itemscCst|S)z0od.iterkeys() -> an iterator over the keys in od)rrrrriterkeysszOrderedDict.iterkeysccs|D]}||VqdS)z2od.itervalues -> an iterator over the values in odNrrUkrrrr szOrderedDict.itervaluesccs|D]}|||fVqdS)z=od.iteritems -> an iterator over the (key, value) items in odNrrrrr iteritemsszOrderedDict.iteritemscOst|dkr tdt|fn |s,td|d}d}t|dkrL|d}t|trn|D]}||||<qZn None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v r)z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrrr N)rJrrrhasattrr r)rrrUotherrLrMrrrrTs(       zOrderedDict.updatecCs0||kr||}||=|S||jkr,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)rUrLrrrrrr*s zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odrrrrr setdefault7szOrderedDict.setdefaultcCsf|si}t|tf}||kr"dSd||<z.|sBd|jjfWSd|jj|fWS||=XdS)zod.__repr__() <==> repr(od)rrz%s()z%s(%r)N)r _get_identrr4r)rUZ _repr_runningZcall_keyrrrr>szOrderedDict.__repr__csXfddD}t}ttD]}||dq(|rLj|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrrrfrrrrrkNsz*OrderedDict.__reduce__..N)varsrrrr)rUrZ inst_dictrrrr __reduce__Ls zOrderedDict.__reduce__cCs ||S)z!od.copy() -> a shallow copy of od)rrrrrrVszOrderedDict.copycCs|}|D] }|||<q |S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrMdrLrrrrZs zOrderedDict.fromkeyscCs6t|tr*t|t|ko(||kSt||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrJrr__eq__rUrrrrres  zOrderedDict.__eq__cCs ||k SrQrrrrr__ne__nszOrderedDict.__ne__cCst|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)rrrrrviewkeyssszOrderedDict.viewkeyscCst|S)z an object providing a view on od's values)rrrrr viewvalueswszOrderedDict.viewvaluescCst|S)zBod.viewitems() -> a set-like object providing a view on od's items)rrrrr viewitems{szOrderedDict.viewitems)T)N)N)N)"r4r5r6rXrWrrrrr rrr rrrr rrTrobjectrrrrrrrrrrr r!r"rrrrrs:         r)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCst|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr-rH)rrrrrr%s  r%c@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsJt||}|j|}||k rF|||<t|tttfkrF||_||_ |SrQ) rr configuratorconvertrr'ConvertingListConvertingTupleparentrLrUrLrMrrrrrs   zConvertingDict.__getitem__NcCsLt|||}|j|}||k rH|||<t|tttfkrH||_||_ |SrQ) rrIr(r)rr'r*r+r,rLrUrLrrMrrrrrIs  zConvertingDict.get)N)r4r5r6rXrrIrrrrr's r'cCsDt|||}|j|}||k r@t|tttfkr@||_||_ |SrQ) rrr(r)rr'r*r+r,rLr.rrrrs  rc@s"eZdZdZddZdddZdS) r*zA converting list wrapper.cCsJt||}|j|}||k rF|||<t|tttfkrF||_||_ |SrQ) rrr(r)rr'r*r+r,rLr-rrrrs   zConvertingList.__getitem__cCs<t||}|j|}||k r8t|tttfkr8||_|SrQ) rrr(r)rr'r*r+r,)rUidxrMrrrrrs   zConvertingList.popN)r/)r4r5r6rXrrrrrrr*s r*c@seZdZdZddZdS)r+zA converting tuple wrapper.cCsBt||}|j|}||k r>t|tttfkr>||_||_ |SrQ) tuplerr(r)rr'r*r+r,rLr-rrrrs   zConvertingTuple.__getitem__N)r4r5r6rXrrrrrr+sr+c@seZdZdZedZedZedZedZ edZ ddd Z e e Zd d Zd d ZddZddZddZddZddZdS)r$zQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)rgZcfgcCst||_||j_dSrQ)r'configr()rUr4rrrrWs zBaseConfigurator.__init__c Cs|d}|d}z^||}|D]H}|d|7}zt||}Wq$tk rj||t||}Yq$Xq$|WStk rtdd\}}td||f}|||_ |_ |YnXdS)zl Resolve strings to objects using standard import and attribute syntax. r7rrNzCannot resolve %r: %s) r9rimporterrr ImportErrorrprrH __cause__ __traceback__) rUrr{ZusedfoundrEetbvrrrresolves"     zBaseConfigurator.resolvecCs ||S)z*Default converter for the ext:// protocol.)r=rUrMrrrr2 szBaseConfigurator.ext_convertcCs|}|j|}|dkr&td|n||d}|j|d}|r|j|}|rn||d}nd|j|}|r|d}|j|s||}n2zt |}||}Wnt k r||}YnX|r||d}qHtd||fqH|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr-rHendr4groups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)rUrMrestrrr0nrrrr3s4       zBaseConfigurator.cfg_convertcCst|ts$t|tr$t|}||_nt|tsHt|trHt|}||_nzt|tslt|trlt|}||_nVt|tr|j |}|r| }|d}|j |d}|r|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr)rr'rr(r*rr+r1 string_typesCONVERT_PATTERNr- groupdictvalue_convertersrIr)rUrMrrrHZ converterrrrrr)2s,    zBaseConfigurator.convertcsnd}t|s||}dd}tfddD}|f|}|rj|D]\}}t|||qT|S)z1Configure an object with a user-supplied factory.z()r7Ncs g|]}t|r||fqSr)r%rr4rrrkUsz5BaseConfigurator.configure_custom..)rrr=rrsetattr)rUr4rZpropsrVrr{rMrrMrconfigure_customNs    z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrr1r>rrras_tuple\s zBaseConfigurator.as_tupleN)r4r5r6rXr+r,rJr?rBrCrDrL staticmethod __import__r5rWr=r2r3r)rOrPrrrrr$s"     "r$)r)r)N)N)Z __future__rrZr+rpZsslr6 version_inforZ basestringrIrrtypesrZ file_typeZ __builtin__builtinsZ ConfigParserZ configparserZ _backportrrr r r r Zurllibr rrrrrrrZurllib2rrrrr r!r"r#r$r%ZhttplibZ xmlrpclibZQueueZqueuer&ZhtmlentitydefsZ raw_input itertoolsr'filterr(r1r*r/iostrr0Z urllib.parseZurllib.requestZ urllib.errorZ http.clientZclientZrequestZ xmlrpc.clientZ html.parserZ html.entitiesZentitiesinputr2r3rHrFrOrPr#rYF_OKX_OKZzipfiler|rrr~ZBaseZipExtFilerqrrr NameError collectionsrrrrgetfilesystemencodingrrtokenizercodecsrrr,rrZhtmlr?Zcgirrrreprlibrrimportlib.utilrZimprthreadrrZ dummy_threadZ_abcollrrrrZlogging.configr$r%Ir&r'rrr*r1r+rrrrs,      $,      ,0        2+A              [   b w  PK!x}}!__pycache__/compat.cpython-38.pycnu[U .e @sBddlmZddlZddlZddlZz ddlZWnek rHdZYnXejddkr~ddlmZe fZ e Z ddl mZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#d d Zddl$Z$dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-er&dd l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;ddZ<nddl=mZe>fZ e>Z ddl=m?ZddlZddlZddlZddl@mZmZmZmd?Zod@dAZiYnXzddBlpmqZqWn"ek rddBlrmqZqYnXejddCdDkr:e3jsZsn ddElpmsZszddFl`mtZtWndek rddGl`muZuzddHlvmwZxWn ek rdedJdKZxYnXGdLdMdMeuZtYnXzddNlymzZzWnHek rzddNl{mzZzWn ek rdfdOdPZzYnXYnXzddQl`m|Z|Wnek rzddRl}m~ZWn"ek rjddRlm~ZYnXzddSlmZmZmZWnek rYnXGdTdUdUeZ|YnXzddVlmZmZWnvek r<emdWejZdXdYZGdZd[d[eZdgd\d]ZGd^d_d_eZGd`dadaeZGdbdcdceQZYnXdS)h)absolute_importN)StringIO)FileType)shutil)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCst|tr|d}t|S)Nutf-8) isinstanceunicodeencode_quote)sr>/usr/lib/python3.8/site-packages/pip/_vendor/distlib/compat.pyrs  r) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalsecCs<tdkrddl}|dat|}|r4|ddSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz ^(.*)@(.*)$r) _userprogrecompilematchgroup)Zhostr+r-rrr splituser4s   r/) TextIOWrapper) rr r r/rrr r r) rr rrrr r!r"r#r$)rrr) filterfalse)match_hostnameCertificateErrorc@s eZdZdS)r3N)__name__ __module__ __qualname__rrrrr3^sr3c Csg}|s dS|d}|d|dd}}|d}||krNtdt||sb||kS|dkrv|dn>|d s|d r|t|n|t| d d |D]}|t|qt d d |dtj } | |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)splitcountr3reprlowerappend startswithr+escapereplacer,join IGNORECASEr-) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsfragZpatrrr_dnsname_matchbs*    rFcCs|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. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNamerZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %s, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrFr=lenr3rAmapr;)ZcertrCZdnsnamesZsankeyvaluesubrrrr2s2         r2)SimpleNamespacec@seZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|j|dSN__dict__update)selfkwargsrrr__init__szContainer.__init__N)r4r5r6__doc__rWrrrrrPsrP)whichc s"dd}tjr&||r"SdS|dkr>tjdtj}|sFdS|tj}tj dkrtj |krt| dtj tjddtj}t fd d |Drg}q‡fd d |D}ng}t }|D]P}tj|}||kr|||D](} tj|| } || |r| SqqdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cSs&tj|o$t||o$tj| SrQ)ospathexistsaccessisdir)fnmoderrr _access_checks zwhich.._access_checkNPATHZwin32rZPATHEXTc3s |]}|VqdSrQ)r<endswith.0extcmdrr szwhich..csg|] }|qSrrrerhrr szwhich..)rZr[dirnameenvironrIdefpathr9pathsepsysplatformcurdirinsertanysetnormcaseaddrA) rir`r[raZpathextfilesseendirZnormdirZthefilenamerrhrrYs8         rY)ZipFile __enter__) ZipExtFilec@s$eZdZddZddZddZdS)r~cCs|j|jdSrQrR)rUbaserrrrWszZipExtFile.__init__cCs|SrQrrUrrrr}szZipExtFile.__enter__cGs |dSrQcloserUexc_inforrr__exit__szZipExtFile.__exit__N)r4r5r6rWr}rrrrrr~sr~c@s$eZdZddZddZddZdS)r|cCs|SrQrrrrrr}"szZipFile.__enter__cGs |dSrQrrrrrr%szZipFile.__exit__cOstj|f||}t|SrQ) BaseZipFileopenr~)rUargsrVrrrrr)sz ZipFile.openN)r4r5r6r}rrrrrrr|!sr|)python_implementationcCs0dtjkrdStjdkrdStjdr,dSdS)z6Return a string identifying the Python implementation.ZPyPyjavaZJythonZ IronPythonZCPython)rpversionrZr{r>rrrrr0s   r) sysconfig)CallablecCs t|tSrQ)rr)objrrrcallableDsrrmbcsstrictsurrogateescapecCs:t|tr|St|tr$|ttStdt|jdSNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper4filenamerrrfsencodeXs   rcCs:t|tr|St|tr$|ttStdt|jdSr) rrrdecoderrrrr4rrrrfsdecodeas   r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|dddd}|dks*|dr.dS|dks@|drDd S|S) z(Imitates get_normal_name in tokenizer.c.N _-rzutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)r<r@r>)orig_encencrrr_get_normal_namersrcsz jjWntk r$dYnXdd}d}fdd}fdd}|}|trpd|d d}d }|s||gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFrcs$zWStk rYdSXdS)N) StopIterationr)readlinerr read_or_stopsz%detect_encoding..read_or_stopcsz|d}Wn4tk rBd}dk r6d|}t|YnXt|}|sVdSt|d}z t|}Wn:tk rdkrd|}n d|}t|YnXr|j dkr؈dkrd}n d}t||d 7}|S) Nrz'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr{)line line_stringmsgZmatchesencodingcodec) bom_foundrrr find_cookies8       z$detect_encoding..find_cookieTrz utf-8-sig)__self__r{AttributeErrorr>r)rrdefaultrrfirstsecondr)rrrrr}s4   &     r)r?r))r)unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtfdd}td|_td|_td|_tdi|_|S)Nc sBt|tf}|krS|z |}W5|X|SrQ)id get_identrwdiscard)rUrLresult) fillvalue repr_running user_functionrrwrappers   z=_recursive_repr..decorating_function..wrapperr5rXr4__annotations__)rugetattrr5rXr4r)rrr)rrrdecorating_functions   z,_recursive_repr..decorating_functionr)rrrrr_recursive_reprs rc@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|p ig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)rUrrrrrWszChainMap.__init__cCs t|dSrQ)KeyErrorrUrLrrr __missing__szChainMap.__missing__c Cs:|jD](}z||WStk r,YqXq||SrQ)rrr)rUrLmappingrrr __getitem__s  zChainMap.__getitem__NcCs||kr||S|SrQrrUrLrrrrrI%sz ChainMap.getcCsttj|jSrQ)rJruunionrrrrr__len__(szChainMap.__len__cCsttj|jSrQ)iterrurrrrrr__iter__+szChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdSrQr)rfmrLrrrj/sz(ChainMap.__contains__..rtrrrrr __contains__.szChainMap.__contains__cCs t|jSrQrrrrr__bool__1szChainMap.__bool__cCsd|dtt|jS)Nz{0.__class__.__name__}({1})rG)rrArKr;rrrrr__repr__4szChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr9szChainMap.fromkeyscCs$|j|jdf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopyrrrrr>sz ChainMap.copycCs|jif|jS)z;New ChainMap with a new dict followed by all previous maps.rrrrrr new_childDszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rNrrrrrparentsHszChainMap.parentscCs||jd|<dS)Nr)r)rUrLrMrrr __setitem__MszChainMap.__setitem__cCs8z|jd|=Wn"tk r2td|YnXdS)Nr(Key not found in the first mapping: {!r})rrrrrrr __delitem__PszChainMap.__delitem__cCs2z|jdWStk r,tdYnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)rpopitemrrrrrrVszChainMap.popitemcGs@z|jdj|f|WStk r:td|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rrN)rpoprr)rUrLrrrrr]sz ChainMap.popcCs|jddS)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrrrrrdszChainMap.clear)N)r4r5r6rXrWrrrIrrrrrr classmethodrr__copy__rpropertyrrrrrrrrrrrs.     r)cache_from_sourcecCs0|dst|dkrd}|r$d}nd}||S)Nz.pyTco)rdAssertionError)r[debug_overridesuffixrrrrnsr) OrderedDict)r)KeysView ValuesView ItemsViewc@seZdZdZddZejfddZejfddZdd Zd d Z d d Z d6ddZ ddZ ddZ ddZddZddZddZddZeZeZefdd Zd7d"d#Zd8d$d%Zd&d'Zd(d)Zed9d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S):rz)Dictionary that remembers insertion ordercOsnt|dkrtdt|z |jWn6tk r\g|_}||dg|dd<i|_YnX|j||dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. rz$expected at most 1 arguments, got %dN)rJr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rUrkwdsrootrrrrWs    zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rr)rUrLrMZ dict_setitemrlastrrrrs  zOrderedDict.__setitem__cCs0||||j|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rr)rUrLZ dict_delitem link_prev link_nextrrrrs zOrderedDict.__delitem__ccs.|j}|d}||k r*|dV|d}qdS)zod.__iter__() <==> iter(od)rr)NrrUrZcurrrrrrs  zOrderedDict.__iter__ccs.|j}|d}||k r*|dV|d}qdS)z#od.__reversed__() <==> reversed(od)rr)Nrr rrr __reversed__s  zOrderedDict.__reversed__cCsdz@|jD]}|dd=q |j}||dg|dd<|jWntk rTYnXt|dS)z.od.clear() -> None. Remove all items from od.N)r itervaluesrrrr)rUZnoderrrrrs zOrderedDict.clearTcCs||s td|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=t||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrrr))rrrrr)rUrrlinkrrrLrMrrrrs   zOrderedDict.popitemcCst|S)zod.keys() -> list of keys in od)rrrrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|] }|qSrrrfrLrrrrksz&OrderedDict.values..rrrrrvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrrrrrrrksz%OrderedDict.items..rrrrritemsszOrderedDict.itemscCst|S)z0od.iterkeys() -> an iterator over the keys in od)rrrrriterkeysszOrderedDict.iterkeysccs|D]}||VqdS)z2od.itervalues -> an iterator over the values in odNrrUkrrrr szOrderedDict.itervaluesccs|D]}|||fVqdS)z=od.iteritems -> an iterator over the (key, value) items in odNrrrrr iteritemsszOrderedDict.iteritemscOst|dkr tdt|fn |s,td|d}d}t|dkrL|d}t|trn|D]}||||<qZn None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v r)z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrrr N)rJrrrhasattrr r)rrrUotherrLrMrrrrTs(       zOrderedDict.updatecCs0||kr||}||=|S||jkr,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)rUrLrrrrrr*s zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odrrrrr setdefault7szOrderedDict.setdefaultcCsf|si}t|tf}||kr"dSd||<z.|sBd|jjfWSd|jj|fWS||=XdS)zod.__repr__() <==> repr(od)rrz%s()z%s(%r)N)r _get_identrr4r)rUZ _repr_runningZcall_keyrrrr>szOrderedDict.__repr__csXfddD}t}ttD]}||dq(|rLj|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrrrfrrrrrkNsz*OrderedDict.__reduce__..N)varsrrrr)rUrZ inst_dictrrrr __reduce__Ls zOrderedDict.__reduce__cCs ||S)z!od.copy() -> a shallow copy of od)rrrrrrVszOrderedDict.copycCs|}|D] }|||<q |S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrMdrLrrrrZs zOrderedDict.fromkeyscCs6t|tr*t|t|ko(||kSt||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrJrr__eq__rUrrrrres  zOrderedDict.__eq__cCs ||k SrQrrrrr__ne__nszOrderedDict.__ne__cCst|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)rrrrrviewkeyssszOrderedDict.viewkeyscCst|S)z an object providing a view on od's values)rrrrr viewvalueswszOrderedDict.viewvaluescCst|S)zBod.viewitems() -> a set-like object providing a view on od's items)rrrrr viewitems{szOrderedDict.viewitems)T)N)N)N)"r4r5r6rXrWrrrrr rrr rrrr rrTrobjectrrrrrrrrrr r!r"r#rrrrrs:         r)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCst|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr-rH)rrrrrr&s  r&c@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsJt||}|j|}||k rF|||<t|tttfkrF||_||_ |SrQ) rr configuratorconvertrr(ConvertingListConvertingTupleparentrLrUrLrMrrrrrs   zConvertingDict.__getitem__NcCsLt|||}|j|}||k rH|||<t|tttfkrH||_||_ |SrQ) rrIr)r*rr(r+r,r-rLrUrLrrMrrrrrIs  zConvertingDict.get)N)r4r5r6rXrrIrrrrr(s r(cCsDt|||}|j|}||k r@t|tttfkr@||_||_ |SrQ) rrr)r*rr(r+r,r-rLr/rrrrs  rc@s"eZdZdZddZdddZdS) r+zA converting list wrapper.cCsJt||}|j|}||k rF|||<t|tttfkrF||_||_ |SrQ) rrr)r*rr(r+r,r-rLr.rrrrs   zConvertingList.__getitem__cCs<t||}|j|}||k r8t|tttfkr8||_|SrQ) rrr)r*rr(r+r,r-)rUidxrMrrrrrs   zConvertingList.popN)r0)r4r5r6rXrrrrrrr+s r+c@seZdZdZddZdS)r,zA converting tuple wrapper.cCsBt||}|j|}||k r>t|tttfkr>||_||_ |SrQ) tuplerr)r*rr(r+r,r-rLr.rrrrs   zConvertingTuple.__getitem__N)r4r5r6rXrrrrrr,sr,c@seZdZdZedZedZedZedZ edZ ddd Z e e Zd d Zd d ZddZddZddZddZddZdS)r%zQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)rgZcfgcCst||_||j_dSrQ)r(configr))rUr5rrrrWs zBaseConfigurator.__init__c Cs|d}|d}z^||}|D]H}|d|7}zt||}Wq$tk rj||t||}Yq$Xq$|WStk rtdd\}}td||f}|||_ |_ |YnXdS)zl Resolve strings to objects using standard import and attribute syntax. r7rrNzCannot resolve %r: %s) r9rimporterrr ImportErrorrprrH __cause__ __traceback__) rUrr{ZusedfoundrEetbvrrrresolves"     zBaseConfigurator.resolvecCs ||S)z*Default converter for the ext:// protocol.)r>rUrMrrrr3 szBaseConfigurator.ext_convertcCs|}|j|}|dkr&td|n||d}|j|d}|r|j|}|rn||d}nd|j|}|r|d}|j|s||}n2zt |}||}Wnt k r||}YnX|r||d}qHtd||fqH|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr-rHendr5groups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)rUrMrestrrr1nrrrr4s4       zBaseConfigurator.cfg_convertcCst|ts$t|tr$t|}||_nt|tsHt|trHt|}||_nzt|tslt|trlt|}||_nVt|tr|j |}|r| }|d}|j |d}|r|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr)rr(rr)r+rr,r2 string_typesCONVERT_PATTERNr- groupdictvalue_convertersrIr)rUrMrrrIZ converterrrrrr*2s,    zBaseConfigurator.convertcsnd}t|s||}dd}tfddD}|f|}|rj|D]\}}t|||qT|S)z1Configure an object with a user-supplied factory.z()r7Ncs g|]}t|r||fqSr)r&rr5rrrkUsz5BaseConfigurator.configure_custom..)rrr>rrsetattr)rUr5rZpropsrVrr{rMrrNrconfigure_customNs    z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrr2r?rrras_tuple\s zBaseConfigurator.as_tupleN)r4r5r6rXr+r,rKr@rCrDrErM staticmethod __import__r6rWr>r3r4r*rPrQrrrrr%s"     "r%)r)r)N)N)Z __future__rrZr+rpZsslr7 version_inforZ basestringrJrrtypesrZ file_typeZ __builtin__builtinsZ ConfigParserZ configparserZ _backportrrr r r r Zurllibr rrrrrrrZurllib2rrrrr r!r"r#r$r%ZhttplibZ xmlrpclibZQueueZqueuer&ZhtmlentitydefsZ raw_input itertoolsr'filterr(r1r*r/iostrr0Z urllib.parseZurllib.requestZ urllib.errorZ http.clientZclientZrequestZ xmlrpc.clientZ html.parserZ html.entitiesZentitiesinputr2r3rHrFrOrPr$rYF_OKX_OKZzipfiler|rrr~ZBaseZipExtFilerqrrr NameError collectionsrrrrgetfilesystemencodingrrtokenizercodecsrrr,rrZhtmlr?Zcgirrrreprlibrrimportlib.utilrZimprthreadrrZ dummy_threadZ_abcollrrrrZlogging.configr%r&Ir'r(rrr+r2r,rrrrs,      $,      ,0        2+A              [   b w  PK! u:''#__pycache__/manifest.cpython-38.pycnu[U .e9@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ e eZedejZed ejejBZejdd ZGd ddeZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode convert_pathManifestz\\w* z#.*?(?= )| (?=$)c@szeZdZdZdddZddZddZd d Zdd d ZddZ ddZ ddZ dddZ d ddZ d!ddZddZdS)"rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. NcCs>tjtj|pt|_|jtj|_d|_t |_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfrr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/manifest.py__init__*szManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}|r|}t |} | D]R} tj || } t| } | j } || r|t | qN|| rN|| sN|| qNq6dS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrrpopappendr listdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"   zManifest.findallcCs4||jstj|j|}|jtj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrr r rrraddr )ritemrrrr*Ts z Manifest.addcCs|D]}||qdS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r*)ritemsr+rrradd_many^szManifest.add_manyFcsbfddtj}|rFt}|D]}|tj|q&||O}ddtdd|DDS)z8 Return sorted files in directory order csJ||td||jkrFtj|\}}|dks.add_dircSsg|]}tjj|qSr)r r r).0Z path_tuplerrr zsz#Manifest.sorted..css|]}tj|VqdS)N)r r r2)r:r rrr {sz"Manifest.sorted..)rrr r dirnamesorted)rZwantdirsresultr4frr8rr>gs zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}szManifest.clearcCsj||\}}}}|dkrB|D]}|j|ddstd|qn$|dkrf|D]}|j|dd}qNn|dkr|D]}|j|ddsrtd|qrn|d kr|D]}|j|dd}qn|d kr|D] }|j||d std ||qn|d kr |D]}|j||d }qn\|dkr2|jd|d sftd|n4|dkrZ|jd|d sftd|n td|dS)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludeglobal-includeFz3no files found matching %r anywhere in distributionglobal-excluderecursive-include)rz-no files found matching %r under directory %rrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr0Zwarning_exclude_patternr)r directiveactionpatternsthedirZ dirpatternpatternfoundrrrprocess_directivesP   zManifest.process_directivecCs|}t|dkr,|ddkr,|dd|d}d}}}|dkrxt|dkr`td|d d |ddD}n~|d krt|d krtd |t|d}dd |ddD}n:|dkrt|dkrtd|t|d}n td|||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rr)rBrDrErFrGrHrIrJrBN)rBrDrErFrz$%r expects ...cSsg|] }t|qSrrr:Zwordrrrr;sz-Manifest._parse_directive..)rGrHz*%r expects ...cSsg|] }t|qSrrrUrrrr;s)rIrJz!%r expects a single zunknown action %r)r2leninsertrr)rrNZwordsrOrPrQZ dir_patternrrrrKs4       zManifest._parse_directiveTcCsPd}|||||}|jdkr&||jD]}||r,|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. FNT)_translate_patternrr(searchrr*)rrRrCris_regexrS pattern_rer%rrrrLs    zManifest._include_patterncCsBd}|||||}t|jD]}||r|j|d}q|S)atRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)rYlistrrZremove)rrRrCrr[rSr\r@rrrrM)s   zManifest._exclude_patternc Cs|rt|trt|S|Stdkr:|dd\}}}|rj||}tdkrn||rd||snt nd}t t j |jd} |dk rftdkr|d} ||dt|  } n>||} | |r| |st | t|t| t|} t j} t jdkrd} tdkr4d| | | d|f}n0|t|t|t|}d || | | ||f}n8|rtdkrd| |}nd || |t|df}t|S) aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). )rVrr7r.N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionr)endswithr3escaper r rrrWr) rrRrCrr[startr7endr\rZ empty_patternZ prefix_rerrrrrY=sH             zManifest._translate_patterncCs8t|}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). r_z\\\\z\1[^%s]z((?rArTrKrLrMrYrfrrrrr%s&   O/ )  7)rrrlZloggingr rcsysr.rcompatrutilr__all__Z getLoggerror0rdMZ_COLLAPSE_PATTERNSZ_COMMENTED_LINE version_inforeobjectrrrrrs    PK!**$__pycache__/resources.cpython-38.pycnu[U .e* @sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZeeZdaGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZedee jeiZzFz ddl Z!Wne"k r$ddl#Z!YnXeee!j$<eee!j%<[!Wne"e&fk rXYnXddZ'iZ(ddZ)e *e+dZ,ddZ-dS))unicode_literalsN)DistlibException)cached_propertyget_cache_basepath_to_cache_dirCachecs.eZdZdfdd ZddZddZZS) ResourceCacheNcs0|dkrtjttd}tt||dS)Nzresource-cache)ospathjoinrstrsuperr __init__)selfbase __class__A/usr/lib/python3.8/site-packages/pip/_vendor/distlib/resources.pyrszResourceCache.__init__cCsdS)z Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Trrresourcer rrris_stale#s zResourceCache.is_stalec Cs|j|\}}|dkr|}n~tj|j|||}tj|}tj|sXt |tj |sjd}n | ||}|rt |d}| |jW5QRX|S)z Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTwb)finderget_cache_infor r r rZ prefix_to_dirdirnameisdirmakedirsexistsropenwritebytes)rrprefixr resultrZstalefrrrget.s      zResourceCache.get)N)__name__ __module__ __qualname__rrr& __classcell__rrrrr s r c@seZdZddZdS) ResourceBasecCs||_||_dSN)rname)rrr-rrrrIszResourceBase.__init__N)r'r(r)rrrrrr+Hsr+c@s@eZdZdZdZddZeddZeddZed d Z d S) Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. FcCs |j|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_streamrrrr as_streamVszResource.as_streamcCstdkrtat|Sr,)cacher r&r0rrr file_path_szResource.file_pathcCs |j|Sr,)r get_bytesr0rrrr"fszResource.bytescCs |j|Sr,)rget_sizer0rrrsizejsz Resource.sizeN) r'r(r)__doc__ is_containerr1rr3r"r6rrrrr.Ns   r.c@seZdZdZeddZdS)ResourceContainerTcCs |j|Sr,)r get_resourcesr0rrr resourcesrszResourceContainer.resourcesN)r'r(r)r8rr;rrrrr9osr9c@seZdZdZejdrdZndZddZddZ d d Z d d Z d dZ ddZ ddZddZddZddZddZeejjZddZdS)ResourceFinderz4 Resource finder for file system resources. java).pyc.pyoz.class)r>r?cCs.||_t|dd|_tjt|dd|_dS)N __loader____file__)modulegetattrloaderr r rr)rrCrrrrszResourceFinder.__init__cCs tj|Sr,)r r realpathrr rrr _adjust_pathszResourceFinder._adjust_pathcCsBt|trd}nd}||}|d|jtjj|}||S)N//r) isinstancer"splitinsertrr r r rH)r resource_nameseppartsr$rrr _make_paths   zResourceFinder._make_pathcCs tj|Sr,)r r rrGrrr_findszResourceFinder._findcCs d|jfSr,)r rrrrrrszResourceFinder.get_cache_infocCsD||}||sd}n&||r0t||}n t||}||_|Sr,)rQrR _is_directoryr9r.r )rrNr r$rrrfinds     zResourceFinder.findcCs t|jdSNrb)r r rSrrrr/szResourceFinder.get_streamc Cs,t|jd}|W5QRSQRXdSrV)r r read)rrr%rrrr4szResourceFinder.get_bytescCstj|jSr,)r r getsizerSrrrr5szResourceFinder.get_sizecs*fddtfddt|jDS)Ncs|dko|j S)N __pycache__)endswithskipped_extensions)r%r0rralloweds z-ResourceFinder.get_resources..allowedcsg|]}|r|qSrr).0r%)r]rr sz0ResourceFinder.get_resources..)setr listdirr rSr)r]rrr:s zResourceFinder.get_resourcescCs ||jSr,)rTr rSrrrr8szResourceFinder.is_containerccs||}|dk r|g}|r|d}|V|jr|j}|jD]>}|sL|}nd||g}||}|jrv||q>|Vq>qdS)NrrJ)rUpopr8r-r;r append)rrNrZtodoZrnamer-new_nameZchildrrriterators      zResourceFinder.iteratorN)r'r(r)r7sysplatform startswithr\rrHrQrRrrUr/r4r5r:r8 staticmethodr r rrTrerrrrr<ws"    r<cs`eZdZdZfddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ Z S)ZipResourceFinderz6 Resource finder for resources in .zip files. csZtt|||jj}dt||_t|jdr>|jj|_n t j ||_t |j|_ dS)Nr_files) rrjrrEarchivelen prefix_lenhasattrrk zipimport_zip_directory_cachesortedindex)rrCrlrrrrs   zZipResourceFinder.__init__cCs|Sr,rrGrrrrHszZipResourceFinder._adjust_pathcCs||jd}||jkrd}nX|r:|dtjkr:|tj}t|j|}z|j||}Wntk rtd}YnX|st d||j j nt d||j j |S)NTFz_find failed: %r %rz_find worked: %r %r) rnrkr rObisectrsrh IndexErrorloggerdebugrEr#)rr r$irrrrRs   zZipResourceFinder._findcCs&|jj}|jdt|d}||fS)Nr)rErlr rm)rrr#r rrrrsz ZipResourceFinder.get_cache_infocCs|j|jSr,)rEget_datar rSrrrr4szZipResourceFinder.get_bytescCst||Sr,)ioBytesIOr4rSrrrr/szZipResourceFinder.get_streamcCs|j|jd}|j|dS)N)r rnrkrrrrr5szZipResourceFinder.get_sizecCs|j|jd}|r,|dtjkr,|tj7}t|}t}t|j|}|t|jkr|j||shq|j||d}| | tjdd|d7}qH|S)Nrtrr) r rnr rOrmr`rursrhaddrL)rrr Zplenr$rysrrrr:s  zZipResourceFinder.get_resourcescCsj||jd}|r*|dtjkr*|tj7}t|j|}z|j||}Wntk rdd}YnX|S)NrtF)rnr rOrursrhrv)rr ryr$rrrrTs  zZipResourceFinder._is_directory)r'r(r)r7rrHrRrr4r/r5r:rTr*rrrrrjs rjcCs|tt|<dSr,)_finder_registrytype)rE finder_makerrrrregister_finder0srcCs|tkrt|}nv|tjkr$t|tj|}t|dd}|dkrJtdt|dd}tt|}|dkrxtd|||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packager@zUnable to locate finder for %r) _finder_cacherfmodules __import__rDrrr&r)packager$rCr rErrrrr6s      rZ __dummy__cCsRd}t|tj|}tt|}|rNt}tj |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. NrB) pkgutilZ get_importerrfpath_importer_cacher&rr _dummy_moduler r r rAr@)r r$rErrCrrrfinder_for_pathRs  r).Z __future__rrur{Zloggingr rZshutilrftypesrprBrutilrrrrZ getLoggerr'rwr2r objectr+r.r9r<rjr zipimporterr_frozen_importlib_externalZ_fi ImportError_frozen_importlibSourceFileLoader FileFinderAttributeErrorrrr ModuleTyper rrrrrrsN   ,!ZN   PK!E] WW)__pycache__/locators.cpython-38.opt-1.pycnu[U .e_@sDddlZddlmZddlZddlZddlZddlZddlZz ddlZWne k rdddl ZYnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#m$Z$m%Z%ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/dd l0m1Z1m2Z2dd l3m4Z4m5Z5e6e7Z8e9d Z:e9d ej;Zd-ddZ?GdddeZ@GdddeAZBGdddeBZCGdddeBZDGdddeAZEGdddeBZFGdddeBZGGdd d eBZHGd!d"d"eBZIGd#d$d$eBZJeJeHeFd%d&d'd(d)ZKeKjLZLe9d*ZMGd+d,d,eAZNdS).N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape string_types build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)MetadataMetadataInvalidError) cached_propertyparse_credentials ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.org/pypicCs6|dkr t}t|dd}z |WS|dXdS)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. N@timeoutclose) DEFAULT_INDEXr list_packages)urlclientr.@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/locators.pyget_all_distribution_names)s   r0c@s$eZdZdZddZeZZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c Csd}dD]}||kr||}q"q|dkr.dSt|}|jdkrnt||}t|drf|||n|||<t||||||S)N)locationZurireplace_header)rschemerZ get_full_urlhasattrr4BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersZnewurlkeyZurlpartsr.r.r/r8@s   zRedirectHandler.http_error_302N)__name__ __module__ __qualname____doc__r8Zhttp_error_301Zhttp_error_303Zhttp_error_307r.r.r.r/r17sr1c@seZdZdZdZdZdZdZedZd)dd Z d d Z d d Z ddZ ddZ ddZee eZddZddZddZddZddZddZd d!Zd"d#Zd$d%Zd*d'd(ZdS)+LocatorzG A base class for locators - things that locate distributions. )z.tar.gzz.tar.bz2z.tarz.zipz.tgzz.tbz)z.eggz.exe.whl)z.pdfN)rEdefaultcCs,i|_||_tt|_d|_t|_dS)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher5rr1openermatcherr Queueerrors)r9r5r.r.r/__init__fs  zLocator.__init__cCsVg}|jsRz|jd}||Wn|jjk rDYqYnX|jq|S)z8 Return any errors which have occurred. F)rKemptygetappendZEmpty task_done)r9resulter.r.r/ get_errorsys    zLocator.get_errorscCs |dS)z> Clear any errors which may have been logged. N)rSr9r.r.r/ clear_errorsszLocator.clear_errorscCs|jdSN)rGclearrTr.r.r/ clear_cacheszLocator.clear_cachecCs|jSrV_schemerTr.r.r/ _get_schemeszLocator._get_schemecCs ||_dSrVrY)r9valuer.r.r/ _set_schemeszLocator._set_schemecCs tddS)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. Please implement in the subclassNNotImplementedError)r9namer.r.r/ _get_projects zLocator._get_projectcCs tddS)J Return all the distribution names known to this locator. r^Nr_rTr.r.r/get_distribution_namesszLocator.get_distribution_namescCsL|jdkr||}n2||jkr,|j|}n|||}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N)rGrbrU)r9rarQr.r.r/ get_projects      zLocator.get_projectcCs^t|}t|j}d}|d}||j}|rBtt||j}|j dkd|j k||||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. TrEhttpszpypi.org) r posixpathbasenamepathendswithdownloadable_extensionsr%r$ wheel_tagsr5netloc)r9r,trhZ compatibleZis_wheelZis_downloadabler.r.r/ score_urls   zLocator.score_urlcCsR|}|rN||}||}||kr(|}||kr@td||ntd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rologgerdebug)r9url1url2rQs1s2r.r.r/ prefer_urls   zLocator.prefer_urlcCs t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r9filename project_namer.r.r/rszLocator.split_filenamec Csdd}d}t|\}}}}} } | drz~t |}t ||j std |nX|dkrd }n ||j |}|r|j |j |jt||||| d fd dd|jDd}Wn0tk r:}ztd|W5d}~XYnXn||jsZtd|nt|}}|jD]}||rn|dt| }|||}|std|nH|\}}}|r|||r|||t||||| d fd}|r||d<qqn|r| r| |d| <|S)a See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned. cSst|t|kSrV)r!)Zname1Zname2r.r.r/ same_projectsz:Locator.convert_url_to_download_info..same_projectNzegg=z %s: version hint in fragment: %r)NN/rEzWheel not compatible: %sTr3z, cSs"g|]}dt|ddqS).N)joinlist).0vr.r.r/ sz8Locator.convert_url_to_download_info..)raversionrwr,python-versionzinvalid path for wheel: %szNot downloadable: %sz No match for project/version: %s)rarrwr,r %s_digest)rlower startswithrprq HASHER_HASHmatchgroupsrjr$r%rlrarrwrr~pyver Exceptionwarningrkrgrhlenr)r9r,rxryrQr5rmriparamsqueryfragmalgodigestZorigpathwheelZincluderRrwZextrnrarrr.r.r/convert_url_to_download_infos              z$Locator.convert_url_to_download_infocCs2d}dD]$}d|}||kr|||f}q.q|S)z Get a digest from a dictionary by looking at keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. N)Zsha256md5rr.)r9inforQrr?r.r.r/ _get_digest1s zLocator._get_digestc Cs|d}|d}||kr,||}|j}nt|||jd}|j}|||_}|d}||d|<|j|dkr||j||_|d|t  |||_ |||<dS)z Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. rarr5r,digestsurlsN) popmetadatarr5rr source_urlrv setdefaultsetaddlocator) r9rQrrardistmdrr,r.r.r/_update_version_dataAs   zLocator._update_version_dataFc Csd}t|}|dkr td|t|j}||j|_}td|t|j | |j }t |dkr2g}|j } |D]z} | dkrqxzH|| std|| n*|s| | js|| ntd| |j Wqxtk rtd|| YqxXqxt |d krt||jd }|r2td ||d } || }|r|jrH|j|_|d i| t|_i} |di} |jD]}|| krv| || |<qv| |_d|_|S)a Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)r}rrz%s did not match %rz%skipping pre-release version %s of %szerror matching %s with %rr)r?zsorted list: %srzrr)rrr"r5rI requirementrprqtyper@rerarZ version_classrZ is_prereleaserOrrsortedr?ZextrasrNr download_urlsr)r9r prereleasesrQrr5rIversionsZslistZvclskrdZsdr,r.r.r/locateXsX          zLocator.locate)rF)F)r@rArBrCsource_extensionsbinary_extensionsexcluded_extensionsrlrkrLrSrUrXr[r]propertyr5rbrdrerorvrrrrrr.r.r.r/rDVs.   JrDcs0eZdZdZfddZddZddZZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c s*tt|jf|||_t|dd|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. r&r'N)superrrLbase_urlr r-r9r,kwargs __class__r.r/rLszPyPIRPCLocator.__init__cCst|jSrc)rr-r+rTr.r.r/rdsz%PyPIRPCLocator.get_distribution_namesc Csiid}|j|d}|D]}|j||}|j||}t|jd}|d|_|d|_|d|_ |dg|_ |d|_ t |}|r|d } | d |_ || |_||_|||<|D]:} | d } || } |d |t| | |d | <qq|S) NrTrrarlicensekeywordssummaryrr,rr)r-Zpackage_releasesZ release_urlsZ release_datarr5rarrNrrrrrrrrrrr) r9rarQrrrdatarrrr,rr.r.r/rbs0         zPyPIRPCLocator._get_projectr@rArBrCrLrdrb __classcell__r.r.rr/rs rcs0eZdZdZfddZddZddZZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c s tt|jf|t||_dSrV)rrrLrrrrr.r/rLszPyPIJSONLocator.__init__cCs tddSrczNot available from this locatorNr_rTr.r.r/rdsz&PyPIJSONLocator.get_distribution_namesc Cs iid}t|jdt|}z|j|}|}t|}t |j d}|d}|d|_ |d|_ | d|_| dg|_| d |_t|}||_|d } |||j <|d D]T} | d }|j||| |j|<|d |j t||| |d |<q|d D]\} } | |j kr4qt |j d} |j | _ | | _ t| }||_||| <| D]T} | d }|j||| |j|<|d | t||| |d |<qhqWn@tk r}z |jt|td|W5d}~XYnX|S)Nrz%s/jsonrrrarrrrrr,rZreleaseszJSON fetch failed: %s) rrr rHopenreaddecodejsonloadsrr5rarrNrrrrrrrrrrritemsrrKputrrp exception)r9rarQr,resprrrrrrrZinfosZomdodistrRr.r.r/rbsT                zPyPIJSONLocator._get_projectrr.r.rr/rs rc@s`eZdZdZedejejBejBZ edejejBZ ddZ edejZ e ddZd S) Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)cCs4||_||_|_|j|j}|r0|d|_dS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr,_basesearchgroup)r9rr,rr.r.r/rLs  z Page.__init__z[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsdd}t}|j|jD]}|d}|dpX|dpX|dpX|dpX|dpX|d }|d pp|d pp|d }t|j|}t|}|j d d|}| ||fqt |dddd}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs,t|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r,r5rmrirrrr.r.r/clean-s  zPage.links..cleanr3Zrel1Zrel2Zrel3Zrel4Zrel5Zrel6rrrsZurl3cSsdt|dS)Nz%%%2xr)ordr)rr.r.r/;zPage.links..cSs|dS)Nrr.)rnr.r.r/r?rT)r?reverse) r_hreffinditerr groupdictrrr _clean_resubrr)r9rrQrrrelr,r.r.r/links&s$  z Page.linksN)r@rArBrCrecompileISXrrrLrrrr.r.r.r/r s rcseZdZdZejdddddZdfdd Zd d Zd d Z ddZ e de j ZddZddZddZddZddZe dZddZZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. cCstjttdS)N)Zfileobj)gzipZGzipFilerrrbr.r.r/rMrzSimpleScrapingLocator.cCs|SrVr.rr.r.r/rNr)ZdeflaterZnoneN c sltt|jf|t||_||_i|_t|_t |_ t|_ d|_ ||_t|_t|_d|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FN)rrrLrrr( _page_cacher_seenr rJ _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplockplatform_check)r9r,r(rrrr.r/rLQs     zSimpleScrapingLocator.__init__cCsFg|_t|jD]0}tj|jd}|d||j|qdS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsrangerrZThread_fetchZ setDaemonstartrO)r9irnr.r.r/_prepare_threadsls  z&SimpleScrapingLocator._prepare_threadscCs6|jD]}|jdq|jD] }|qg|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)rrrr~)r9rnr.r.r/ _wait_threadsys    z#SimpleScrapingLocator._wait_threadsc Csiid}|jx||_||_t|jdt|}|j|j| z&t d||j ||j W5| X|`W5QRX|S)Nrz%s/z Queueing %s)rrQrxrrr rrWrrrrprqrrr~)r9rarQr,r.r.r/rbs      z"SimpleScrapingLocator._get_projectz<\b(linux_(i\d86|x86_64|arm\w+)|win(32|_amd64)|macosx_?\d+)\bcCs |j|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r9r,r.r.r/_is_platform_dependentsz,SimpleScrapingLocator._is_platform_dependentc CsZ|jr||rd}n|||j}td|||rV|j||j|W5QRX|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s) rrrrxrprqrrrQ)r9r,rr.r.r/_process_downloads z'SimpleScrapingLocator._process_downloadc Cst|\}}}}}}||j|j|jr2d}n||jrJ||jsJd}nd||js\d}nR|dkrjd}nD|dkrxd}n6||rd}n&| ddd} | dkrd}nd}t d |||||S) z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. F)ZhomepageZdownload)ZhttprfZftp:rrZ localhostTz#should_queue: %s (%s) from %s -> %s) rrjrrrrrrrsplitrrprq) r9linkZreferrerrr5rmri_rQhostr.r.r/ _should_queues0    z#SimpleScrapingLocator._should_queuec Cs|j}zz|r||}|dkr,WWq|jD]j\}}||jkr2zB|j|||s||||rt d|||j |Wq2t k rYq2Xq2Wn2t k r}z|j t|W5d}~XYnXW5|jX|sqqdS)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)rrNrPget_pagerrrrrrprqrrrrKr)r9r,pagerrrRr.r.r/rs,       & zSimpleScrapingLocator._fetchc CsXt|\}}}}}}|dkr:tjt|r:tt|d}||jkr`|j|}t d||n| ddd}d}||j krt d||nt |d d id }zzt d ||j j||jd } t d|| } | dd} t| r| } | } | d}|r"|j|}|| } d}t| }|r@|d}z| |} Wn tk rn| d} YnXt| | }||j| <Wntk r}z|jdkrtd||W5d}~XYnt k r}z0td|||j!|j "|W5QRXW5d}~XYn2t#k rB}ztd||W5d}~XYnXW5||j|<X|S)a Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). filez index.htmlzReturning %s from cache: %srrrNzSkipping %s due to bad host %szAccept-encodingZidentity)r>z Fetching %sr'z Fetched %sz Content-Typer3zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosriisdirrrrrrprqrrrrHrr(rrNHTML_CONTENT_TYPErZgeturlrdecodersCHARSETrrr UnicodeErrorrrr<rrrrr)r9r,r5rmrirrQrr:rr>Z content_typeZ final_urlrencodingdecoderrrRr.r.r/rsZ              &$ zSimpleScrapingLocator.get_pagez]*>([^<]+)[\w-]+)\s*\(\s*(==\s*)?(?P[^)]+)\)$c@sLeZdZdZdddZddZddZd d Zd d Zd dZ dddZ dS)DependencyFinderz0 Locate dependencies for distributions. NcCs|pt|_t|jj|_dS)zf Initialise an instance, using the specified locator to locate distributions. N)default_locatorrr"r5r'r.r.r/rL*s zDependencyFinder.__init__cCsrtd||j}||j|<||j||jf<|jD]:}t|\}}td||||j |t  ||fq2dS)z Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. zadding distribution %szAdd to provided: %s, %s, %sN) rprqr? dists_by_namedistsrprovidesrprovidedrrr)r9rraprr.r.r/add_distribution2s    z!DependencyFinder.add_distributioncCsxtd||j}|j|=|j||jf=|jD]D}t|\}}td||||j|}| ||f|s.|j|=q.dS)z Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. zremoving distribution %sz Remove from provided: %s, %s, %sN) rprqr?r.r/rr0rr1remove)r9rrar2rsr.r.r/remove_distributionAs    z$DependencyFinder.remove_distributioncCsBz|j|}Wn,tk r<|d}|j|}YnX|S)z Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). r)r5rIr#r)r9reqtrIrar.r.r/ get_matcherSs  zDependencyFinder.get_matcherc Cst||}|j}t}|j}||krp||D]B\}}z||}Wntk rZd}YnX|r,||qpq,|S)z Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. F)r8r?rr1rr#r) r9r7rIrarQr1rproviderrr.r.r/find_providerscs   zDependencyFinder.find_providersc Cs|j|}t}|D]$}||}||js||q|rZ|d||t|fd}n@|||j|=|D]}|j|t|qp| |d}|S)a Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. Z cantreplaceFT) reqtsrr8rrr frozensetr6rr3) r9r9otherproblemsZrlistZ unmatchedr5rIrQr.r.r/try_to_replace{s$       zDependencyFinder.try_to_replaceFcCsi|_i|_i|_i|_t|p g}d|krH|d|tdddgO}t|trh|}}t d|n4|j j ||d}}|dkrt d|t d |d |_ t}t|g}t|g}|r|}|j} | |jkr||n"|j| } | |kr||| ||j|jB} |j} t} |r`||kr`d D]*}d |}||kr4| t|d |O} q4| | B| B}|D].}||}|sFt d||j j ||d}|dkr|s|j j |d d}|dkrt d||d|fn^|j|j}}||f|jkr|||||| krF||krF||t d|j|D]R}|j} | |jkrx|j|t|n"|j| } | |krJ||| |qJqpqt|j}|D]&}||k|_|jrt d|jqt d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:z:test:z:build:z:dev:zpassed %s as requirement)rNzUnable to locate %rz located %sT)ZtestZbuildZdevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %rZ unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)r1r/r.r;rr4 isinstancerrprqrrrZ requestedrr?r3r?Z run_requiresZ meta_requiresZbuild_requiresgetattrr:rrZname_and_versionrvaluesZbuild_time_dependency)r9rZ meta_extrasrrrr>ZtodoZ install_distsrar=ZireqtsZsreqtsZereqtsr?rRZ all_reqtsrZ providersr9nrr2r/r.r.r/finds                            zDependencyFinder.find)N)NF) r@rArBrCrLr3r6r8r:r?rDr.r.r.r/r,%s (r,)N)OriorrZloggingr rgrr ImportErrorZdummy_threadingrr3rcompatrrrrr r r r r rrr7rrrrZdatabaserrrrrrutilrrrrrrrr r!rr"r#rr$r%Z getLoggerr@rprrrr r r*r0r1objectrDrrrrrrr"r$r-rZNAME_VERSION_REr,r.r.r.r/s^   D,    @0E:zA&[ PK!D̎dcdc&__pycache__/wheel.cpython-38.opt-1.pycnu[U .e@sddlmZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlm Z m!Z!m"Z"dd l#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,dd l-m.Z.m/Z/e 0e1Z2da3e4ed r8d Z5n*ej67d rLdZ5nej6dkr^dZ5ndZ5e8dZ9e9sdej:ddZ9de9Z;e5e9Zdd>ddZ?e8dZ@e@re@7dre@>ddZ@nddZAeAZ@[AeBdejCejDBZEeBdejCejDBZFeBdZGeBd ZHd!ZId"ZJe jKd#krBd$d%ZLnd&d%ZLGd'd(d(eMZNeNZOGd)d*d*eMZPd+d,ZQeQZR[Qd/d-d.ZSdS)0)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir)NormalizedVersionUnsupportedVersionErrorZpypy_version_infoZppjavaZjyZcliZipcpZpy_version_nodotz%s%spy-_.ZSOABIzcpython-cCsRdtg}tdr|dtdr0|dtddkrH|dd |S) NrZPy_DEBUGdZ WITH_PYMALLOCmZPy_UNICODE_SIZEu) VER_SUFFIXrget_config_varappendjoin)partsr,=/usr/lib/python3.8/site-packages/pip/_vendor/distlib/wheel.py _derive_abi;s     r.zz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/cCs|SNr,or,r,r-]r3cCs|tjdS)Nr/)replaceossepr1r,r,r-r3_r4c@s6eZdZddZddZddZd dd Zd d ZdS) MountercCsi|_i|_dSr0) impure_wheelslibsselfr,r,r-__init__cszMounter.__init__cCs||j|<|j|dSr0)r9r:update)r<pathname extensionsr,r,r-addgs z Mounter.addcCs0|j|}|D]\}}||jkr|j|=qdSr0)r9popr:)r<r?r@kvr,r,r-removeks   zMounter.removeNcCs||jkr|}nd}|Sr0)r:)r<fullnamepathresultr,r,r- find_moduleqs zMounter.find_modulecCsj|tjkrtj|}nP||jkr,td|t||j|}||_|dd}t|dkrf|d|_ |S)Nzunable to find extension for %sr!rr) sysmodulesr: ImportErrorimpZ load_dynamic __loader__rsplitlen __package__)r<rFrHr+r,r,r- load_modulexs       zMounter.load_module)N)__name__ __module__ __qualname__r=rArErIrRr,r,r,r-r8bs  r8c@seZdZdZdZdZd4ddZedd Zed d Z ed d Z e ddZ ddZ e ddZddZd5ddZddZddZddZd6ddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd7d,d-Zd.d/Zd0d1Zd8d2d3ZdS)9Wheelz@ Class to build and install from Wheel files (PEP 427). rrZsha256NFcCs8||_||_d|_tg|_dg|_dg|_t|_ |dkrRd|_ d|_ |j |_ nt|}|r|d}|d|_ |dd d |_ |d |_|j |_ ntj|\}}t|}|std ||rtj||_ ||_ |d}|d|_ |d|_ |d |_|d d|_|dd|_|dd|_dS)zB Initialise an instance using a (valid) filename. r&noneanyNZdummyz0.1ZnmZvnr rZbnzInvalid name or filename: %rrr!ZbiZar)signZ should_verifybuildverPYVERpyverabiarchr6getcwddirnamenameversionfilenameZ _filenameNAME_VERSION_REmatch groupdictr5rGsplit FILENAME_RErabspath)r<rdrZverifyr#inforar,r,r-r=sD            zWheel.__init__cCs^|jrd|j}nd}d|j}d|j}d|j}|jdd}d|j|||||fS)zJ Build and return a filename from the various components. rr&r!r z%s-%s%s-%s-%s-%s.whl)r[r*r]r^r_rcr5rb)r<r[r]r^r_rcr,r,r-rds     zWheel.filenamecCstj|j|j}tj|Sr0)r6rGr*rardisfile)r<rGr,r,r-existssz Wheel.existsccs4|jD](}|jD]}|jD]}|||fVqqqdSr0)r]r^r_)r<r]r^r_r,r,r-tagss   z Wheel.tagsc Cstj|j|j}d|j|jf}d|}td}t |d}| |}|d dd}t dd |D}|d krt td g} nt tg} d} | D]f} zLt|| } || ,} || }t|d } | rW5QRWqW5QRXWqtk rYqXq| std d| W5QRX| S)N%s-%s %s.dist-infoutf-8r Wheel-Versionr!rcSsg|] }t|qSr,int.0ir,r,r- sz"Wheel.metadata..rWZMETADATA)Zfileobjz8Invalid wheel, because metadata is missing: looked in %sz, )r6rGr*rardrbrccodecs getreaderrget_wheel_metadatarhtuplerr posixpathopenr KeyError ValueError)r<r?name_verinfo_dirwrapperzfwheel_metadatawv file_versionZfnsrHfnmetadata_filenamebfwfr,r,r-metadatas6       zWheel.metadatac CsXd|j|jf}d|}t|d}||}td|}t|}W5QRXt|S)NrprqWHEELrr) rbrcrr*rr{r|rdict)r<rrrrrrmessager,r,r-r}s  zWheel.get_wheel_metadatac Cs6tj|j|j}t|d}||}W5QRX|S)Nrs)r6rGr*rardrr})r<r?rrHr,r,r-rls z Wheel.infoc Cst|}|r||}|d|||d}}d|krBt}nt}t|}|rfd|d}nd}||}||}nT|d}|d} |dks|| krd} n|||dd krd } nd} t| |}|S) Nspythonw r4  rrs ) SHEBANG_RErfendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) r<datar#rZshebangZdata_after_shebangZshebang_pythonargsZcrZlfZtermr,r,r-process_shebangs,       zWheel.process_shebangcCsh|dkr|j}ztt|}Wn tk r<td|YnX||}t|d d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64Zurlsafe_b64encoderstripdecode)r<rrhasherrHr,r,r-get_hash"s zWheel.get_hashc Cs^t|}ttj||}||ddf|t|}|D]}||q@W5QRXdS)Nr&) listto_posixr6rGrelpathr)sortrZwriterow)r<recordsZ record_pathbasepwriterrowr,r,r- write_record-s zWheel.write_recordc Csg}|\}}tt|j}|D]P\}} t| d} | } W5QRXd|| } tj| } | || | fqtj |d} | || |t tj |d}| || fdS)Nrbz%s=%sRECORD) rrrrreadrr6rGgetsizer)r*rr)r<rllibdir archive_pathsrdistinforraprfrrsizer,r,r- write_records6s    zWheel.write_recordsc CsFt|dtj.}|D]"\}}td|||||qW5QRXdS)NwzWrote %s to %s in wheel)rzipfileZ ZIP_DEFLATEDloggerdebugwrite)r<r?rrrrr,r,r- build_zipFs zWheel.build_zipc! sp|dkr i}ttfdddd}|dkrFd}tg}tg}tg}nd}tg}d g}d g}|d ||_|d ||_|d ||_ |} d|j |j f} d| } d| } g} dD]}|krq|}t j |rt |D]\}}}|D]}tt j ||}t j ||}tt j | ||}| ||f|dkr|dst|d}|}W5QRX||}t|d}||W5QRXqqq| }d}t |D]\}}}||krt|D]8\}}t|}|drt j ||}||=qq|D]H}t|drqt j ||}tt j ||}| ||fqqt |}|D]B}|dkr^tt j ||}tt j | |}| ||fq^d|p|jdtd|g}|jD] \}}}|d|||fqt j |d}t|d}|d|W5QRXtt j | d}| ||f||| f| | t j |j |j!} |"| | | S) z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Ncs|kSr0r,r1pathsr,r-r3Tr4zWheel.build..)purelibplatlibrrZfalsetruerXrYr]r^r_rp%s.datarq)rZheadersscriptsr.exerwbz .dist-info)z.pycz.pyo)rZ INSTALLERZSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %sz Tag: %s-%s-%srr )#rr IMPVERABIARCHr\getr]r^r_rbrcr6rGisdirwalkr r*rrr)endswithrrrr enumeratelistdir wheel_versionrrorrardr)!r<rrorZlibkeyZis_pureZ default_pyverZ default_abiZ default_archrrdata_dirrrkeyrGrootdirsfilesrrrprrrrrydnrr]r^r_r?r,rr-buildLs           z Wheel.buildcCs |dS)zl Determine whether an archive entry should be skipped when verifying or installing. )r/z /RECORD.jws)r)r<arcnamer,r,r- skip_entryszWheel.skip_entrycC Ksf|j}|d}|dd}|dd}tj|j|j}d|j|jf} d| } d| } t | t } t | d} t | d }t d }t |d }|| }||}t|}W5QRX|d d d}tdd|D}||jkr|r||j||ddkr|d}n|d}i}||8}t|d"}|D]}|d}|||<q8W5QRXW5QRXt | d}t | d}t | dd}t|d}d|_tj } g}!t}"|"|_d|_zz\|D]}#|#j}$t|$t r|$}%n |$!d }%|"|%rq||%}|dr4t#|#j$|dkr4t%d|%|dr|ddd\}&}'||$}|&}(W5QRX|'|(|&\})}*|*|'krt%d|$|r|%(||frt)*d |%q|%(|o|%+d! }+|%(|r |%d"d\})},}-tj||,t,|-}.n$|%| |fkrqtj|t,|%}.|+s ||$}|-||.W5QRX|!.|.|s|drt|.d#4}|&}(|'|(|&\})}/|/|*krt%d$|.W5QRX| r~|.+d%r~z|j/|.|d&}0|!.|0Wn$t0k rt)j1d'dd(YnXnttj2t,|$}1tj|"|1}2||$}|-||2W5QRXtj|.\}3}1|3|_|3|1}4|4|4|!5|4q|rt)*d)d}5nnd}6|j6d }|d*krzt | d+}7z||7}t7|}8W5QRXi}6d,D]l}9d-|9}:|:|8kri|6d.|9<};|8|:8D]6}|6d6i}?|>s|?r|dd}@tj>|@s*t?d7|@|_|>@D]*\}:}.zRoot-Is-Purelibrrrstreamrr&r)dry_runTNrsize mismatch for %s=digest mismatch for %szlib_only: skipping %srr/rzdigest mismatch on write for %sz.py)Zhashed_invalidationzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txt)Zconsoleguiz %s_scriptszwrap_%sz%s:%sz %szAUnable to read legacy script metadata, so cannot generate scriptsr@zpython.commandsz8Unable to read JSON metadata, so cannot generate scriptsZ wrap_consoleZwrap_guizValid script path not specifiedz%s = %srlibprefixzinstallation failed.)Grrr6rGr*rardrbrcrrr{r|rrrrhr~rrrrecordrJdont_write_bytecodetempfileZmkdtempZ source_dirZ target_dirshutilZrmtreeinfolist isinstancer rrstr file_sizerrr startswithrrrrZ copy_streamr)Z byte_compile ExceptionZwarningbasenameZmakeZset_executable_modeextendrlrvaluesrsuffixflagsjsonloadrritemsr rZwrite_shared_locationsZwrite_installed_filesZ exceptionZrollback)Cr<rZmakerkwargsrrrZbc_hashed_invalidationr?rrr metadata_namewheel_metadata_name record_namerrbwfrrrrrrrreaderrrZdata_pfxZinfo_pfxZ script_pfxZfileopZbcZoutfilesworkdirzinfor u_arcnamekindvaluerr rZ is_scriptwhererZoutfileZ newdigestZpycrZworknamer filenamesZdistZcommandsZepZepdatarrCr"rDsZconsole_scriptsZ gui_scriptsZ script_dirZscriptZoptionsr,r,r-installsT                                                     z Wheel.installcCs4tdkr0tjttdtjdd}t|atS)Nz dylib-cache) cacher6rGr*rrrJrcr)r<rr,r,r-_get_dylib_caches  zWheel._get_dylib_cachec Cshtj|j|j}d|j|jf}d|}t|d}t d}g}t |d}z| |}||} t | } |} | |} tj| j| } tj| st| | D]\}}tj| t|}tj|sd}n6t|j}tj|}||}tj|j}||k}|r&||| |||fqW5QRXWntk rXYnXW5QRX|S)NrprqZ EXTENSIONSrrrsT)r6rGr*rardrbrcrr{r|rrrrrZ prefix_to_dirrrmakedirsrrrnstatst_mtimedatetimeZ fromtimestampZgetinfoZ date_timeextractr)r)r<r?rrrrrHrrrr@rrZ cache_baserbrdestrZ file_timerlZ wheel_timer,r,r-_get_extensionss>             zWheel._get_extensionscCst|S)zM Determine if a wheel is compatible with the running system. ) is_compatibler;r,r,r-rszWheel.is_compatiblecCsdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr,r;r,r,r- is_mountableszWheel.is_mountablecCstjtj|j|j}|s2d|}t||sJd|}t||t jkrbt d|nN|rtt j |nt j d||}|rtt jkrt j tt||dS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)r6rGrjr*rardrrrrJrrr)insertr_hook meta_pathrA)r<r)r?msgr@r,r,r-mounts"   z Wheel.mountcCsrtjtj|j|j}|tjkr2td|n.rrr/..invalid entry in wheel: %rrrrr)r6rGr*rardrbrcrrr{r|rrrrhr~rrrr rrrrrrr)r<r?rrrrrrrrrrrrrrrr rrr rr r rrr rr,r,r-rks\                z Wheel.verifyc Ksdd}dd}tj|j|j}d|j|jf}d|}t|d} t} t |d|} i} | D]h} | j}t |t r|}n | d }|| krqhd |krtd || | | tj| t|}|| |<qhW5QRX|| |\}}|| f|}|r|| |\}}|r$||kr$||||d krNtjd d| d\}}t|n*tj|shtd|tj||j}t| }tj| |}||f}||| |||||d krt||W5QRX|S)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. cSsHd}}d|tf}||kr$d|}||kr@||}t|dj}||fS)Nz%s/%sz %s/PKG-INFOrG)rr rc)path_maprrcrGrr,r,r- get_versionKs  z!Wheel.update..get_versioncSsd}z|t|}|d}|dkr*d|}nTdd||dddD}|dd7<d |d|dd d |Df}Wn tk rtd |YnX|rt|d }||_| t  }|j ||dtd||dS)Nrrz%s+1cSsg|] }t|qSr,ru)rxrr,r,r-rz]sz8Wheel.update..update_version..rr!rz%s+%scss|]}t|VqdSr0)rrwr,r,r- `sz7Wheel.update..update_version..z0Cannot update non-compliant (PEP-440) version %rr')rGlegacyzVersion updated from %r to %r) rrrhr*rrrr rcrrr)rcrGupdatedrDryr+Zmdr+r,r,r-update_versionUs.        z$Wheel.update..update_versionrprqrrsrrr%r&Nz.whlz wheel-update-)rrdirzNot a directory: %r)r6rGr*rardrbrcrrrrrr rrrrrZmkstempcloserrrrrrZcopyfile)r<ZmodifierZdest_dirrr)r-r?rrrr rr(r rr rGZoriginal_versionr ZmodifiedZcurrent_versionfdnewpathrrrlr,r,r-r>:s\                 z Wheel.update)NFF)N)NN)F)N)rSrTrU__doc__rrr=propertyrdrnrorrr}rlrrrrrrrrrrrrr#r$rkr>r,r,r,r-rVs@ )         hg "  8rVc Csxtg}td}ttjddddD]}|d|t|gq$g}tD]*\}}}| drN|| dddqN| t dkr| dt |dg}tg}tjd krtd t}|r|\} }}} t|}| g} | d kr| d | d kr | d| dkr | d| dkr4| d| dkrH| d|dkr| D]*} d| ||| f} | tkrV|| qV|d8}qH|D]0}|D]$} |dt|df|| fqqt|D]L\}}|dt|fddf|dkr|dt|dfddfqt|D]L\}}|dd|fddf|dkr"|dd|dfddfq"t|S)zG Return (pyver, abi, arch) tuples compatible with this Python. rrrr&z.abir!rrXdarwinz(\w+)_(\d+)_(\d+)_(\w+)$)i386ppcZfat)r5r6x86_64Zfat3)ppc64r7Zfat64)r5r7intel)r5r7r9r6r8Z universalz %s_%s_%s_%srYr)r'rangerJ version_infor)r*rrMZ get_suffixesrrhrrrrplatformrerfrrv IMP_PREFIXrset)ZversionsmajorminorZabisrr rHZarchesr#rbr_Zmatchesrfrr^ryrcr,r,r-compatible_tagss`                 & " "rBcCs\t|tst|}d}|dkr"t}|D]0\}}}||jkr&||jkr&||jkr&d}qXq&|S)NFT)rrVCOMPATIBLE_TAGSr]r^r_)ZwheelrorHZverr^r_r,r,r-rs r)N)TZ __future__rrr{rZdistutils.utilZ distutilsZemailrrrMrZloggingr6rr=rrJrrr&rrcompatrrr r r Zdatabaser rr rrutilrrrrrrrrrrcrrZ getLoggerrSrrhasattrr>r<rr(r'r;r\rZ get_platformr5rrr.compile IGNORECASEVERBOSErirerrrrr7robjectr8r rVrBrCrr,r,r,r-s   ,             #>PK!***__pycache__/resources.cpython-38.opt-1.pycnu[U .e* @sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZeeZdaGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZedee jeiZzFz ddl Z!Wne"k r$ddl#Z!YnXeee!j$<eee!j%<[!Wne"e&fk rXYnXddZ'iZ(ddZ)e *e+dZ,ddZ-dS))unicode_literalsN)DistlibException)cached_propertyget_cache_basepath_to_cache_dirCachecs.eZdZdfdd ZddZddZZS) ResourceCacheNcs0|dkrtjttd}tt||dS)Nzresource-cache)ospathjoinrstrsuperr __init__)selfbase __class__A/usr/lib/python3.8/site-packages/pip/_vendor/distlib/resources.pyrszResourceCache.__init__cCsdS)z Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Trrresourcer rrris_stale#s zResourceCache.is_stalec Cs|j|\}}|dkr|}n~tj|j|||}tj|}tj|sXt |tj |sjd}n | ||}|rt |d}| |jW5QRX|S)z Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTwb)finderget_cache_infor r r rZ prefix_to_dirdirnameisdirmakedirsexistsropenwritebytes)rrprefixr resultrZstalefrrrget.s      zResourceCache.get)N)__name__ __module__ __qualname__rrr& __classcell__rrrrr s r c@seZdZddZdS) ResourceBasecCs||_||_dSN)rname)rrr-rrrrIszResourceBase.__init__N)r'r(r)rrrrrr+Hsr+c@s@eZdZdZdZddZeddZeddZed d Z d S) Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. FcCs |j|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_streamrrrr as_streamVszResource.as_streamcCstdkrtat|Sr,)cacher r&r0rrr file_path_szResource.file_pathcCs |j|Sr,)r get_bytesr0rrrr"fszResource.bytescCs |j|Sr,)rget_sizer0rrrsizejsz Resource.sizeN) r'r(r)__doc__ is_containerr1rr3r"r6rrrrr.Ns   r.c@seZdZdZeddZdS)ResourceContainerTcCs |j|Sr,)r get_resourcesr0rrr resourcesrszResourceContainer.resourcesN)r'r(r)r8rr;rrrrr9osr9c@seZdZdZejdrdZndZddZddZ d d Z d d Z d dZ ddZ ddZddZddZddZddZeejjZddZdS)ResourceFinderz4 Resource finder for file system resources. java).pyc.pyoz.class)r>r?cCs.||_t|dd|_tjt|dd|_dS)N __loader____file__)modulegetattrloaderr r rr)rrCrrrrszResourceFinder.__init__cCs tj|Sr,)r r realpathrr rrr _adjust_pathszResourceFinder._adjust_pathcCsBt|trd}nd}||}|d|jtjj|}||S)N//r) isinstancer"splitinsertrr r r rH)r resource_nameseppartsr$rrr _make_paths   zResourceFinder._make_pathcCs tj|Sr,)r r rrGrrr_findszResourceFinder._findcCs d|jfSr,)r rrrrrrszResourceFinder.get_cache_infocCsD||}||sd}n&||r0t||}n t||}||_|Sr,)rQrR _is_directoryr9r.r )rrNr r$rrrfinds     zResourceFinder.findcCs t|jdSNrb)r r rSrrrr/szResourceFinder.get_streamc Cs,t|jd}|W5QRSQRXdSrV)r r read)rrr%rrrr4szResourceFinder.get_bytescCstj|jSr,)r r getsizerSrrrr5szResourceFinder.get_sizecs*fddtfddt|jDS)Ncs|dko|j S)N __pycache__)endswithskipped_extensions)r%r0rralloweds z-ResourceFinder.get_resources..allowedcsg|]}|r|qSrr).0r%)r]rr sz0ResourceFinder.get_resources..)setr listdirr rSr)r]rrr:s zResourceFinder.get_resourcescCs ||jSr,)rTr rSrrrr8szResourceFinder.is_containerccs||}|dk r|g}|r|d}|V|jr|j}|jD]>}|sL|}nd||g}||}|jrv||q>|Vq>qdS)NrrJ)rUpopr8r-r;r append)rrNrZtodoZrnamer-new_nameZchildrrriterators      zResourceFinder.iteratorN)r'r(r)r7sysplatform startswithr\rrHrQrRrrUr/r4r5r:r8 staticmethodr r rrTrerrrrr<ws"    r<cs`eZdZdZfddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ Z S)ZipResourceFinderz6 Resource finder for resources in .zip files. csZtt|||jj}dt||_t|jdr>|jj|_n t j ||_t |j|_ dS)Nr_files) rrjrrEarchivelen prefix_lenhasattrrk zipimport_zip_directory_cachesortedindex)rrCrlrrrrs   zZipResourceFinder.__init__cCs|Sr,rrGrrrrHszZipResourceFinder._adjust_pathcCs||jd}||jkrd}nX|r:|dtjkr:|tj}t|j|}z|j||}Wntk rtd}YnX|st d||j j nt d||j j |S)NTFz_find failed: %r %rz_find worked: %r %r) rnrkr rObisectrsrh IndexErrorloggerdebugrEr#)rr r$irrrrRs   zZipResourceFinder._findcCs&|jj}|jdt|d}||fS)Nr)rErlr rm)rrr#r rrrrsz ZipResourceFinder.get_cache_infocCs|j|jSr,)rEget_datar rSrrrr4szZipResourceFinder.get_bytescCst||Sr,)ioBytesIOr4rSrrrr/szZipResourceFinder.get_streamcCs|j|jd}|j|dS)N)r rnrkrrrrr5szZipResourceFinder.get_sizecCs|j|jd}|r,|dtjkr,|tj7}t|}t}t|j|}|t|jkr|j||shq|j||d}| | tjdd|d7}qH|S)Nrtrr) r rnr rOrmr`rursrhaddrL)rrr Zplenr$rysrrrr:s  zZipResourceFinder.get_resourcescCsj||jd}|r*|dtjkr*|tj7}t|j|}z|j||}Wntk rdd}YnX|S)NrtF)rnr rOrursrhrv)rr ryr$rrrrTs  zZipResourceFinder._is_directory)r'r(r)r7rrHrRrr4r/r5r:rTr*rrrrrjs rjcCs|tt|<dSr,)_finder_registrytype)rE finder_makerrrrregister_finder0srcCs|tkrt|}nv|tjkr$t|tj|}t|dd}|dkrJtdt|dd}tt|}|dkrxtd|||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packager@zUnable to locate finder for %r) _finder_cacherfmodules __import__rDrrr&r)packager$rCr rErrrrr6s      rZ __dummy__cCsRd}t|tj|}tt|}|rNt}tj |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. NrB) pkgutilZ get_importerrfpath_importer_cacher&rr _dummy_moduler r r rAr@)r r$rErrCrrrfinder_for_pathRs  r).Z __future__rrur{Zloggingr rZshutilrftypesrprBrutilrrrrZ getLoggerr'rwr2r objectr+r.r9r<rjr zipimporterr_frozen_importlib_externalZ_fi ImportError_frozen_importlibSourceFileLoader FileFinderAttributeErrorrrr ModuleTyper rrrrrrsN   ,!ZN   PK!AS)O)O(__pycache__/version.cpython-38.opt-1.pycnu[U .e_[ @sfdZddlZddlZddlmZddlmZdddd d d d d gZee Z Gdd d e Z Gddde ZGddde ZedZddZeZGdddeZddZGdddeZeddfeddfeddfedd fed!d"fed#d"fed$d%fed&d'fed(d)fed*d+ff Zed,dfed-dfed.d%fed$d%fed/dffZed0Zd1d2Zd3d4Zed5ejZd6d6d7d6d8ddd9Zd:d;ZGdejZ"d?d@Z#dAdBZ$GdCd d eZ%GdDd d eZ&GdEdFdFe Z'e'eeee'ee!dGdHe'e$e&edIZ(e(dJe(dK<dLd Z)dS)Mz~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesparse_requirementNormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemec@seZdZdZdS)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__rr?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/version.pyr sc@sxeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZeddZdS)VersioncCs"||_}|||_}dSN)strip_stringparse_parts)selfspartsrrr__init__szVersion.__init__cCs tddS)Nzplease implement in a subclassNotImplementedErrorrrrrrr%sz Version.parsecCs$t|t|kr td||fdS)Nzcannot compare %r and %r)type TypeErrorrotherrrr_check_compatible(szVersion._check_compatiblecCs|||j|jkSrr%rr#rrr__eq__,s zVersion.__eq__cCs || Srr'r#rrr__ne__0szVersion.__ne__cCs|||j|jkSrr&r#rrr__lt__3s zVersion.__lt__cCs||p|| Srr*r'r#rrr__gt__7szVersion.__gt__cCs||p||Srr+r#rrr__le__:szVersion.__le__cCs||p||Sr)r,r'r#rrr__ge__=szVersion.__ge__cCs t|jSr)hashrrrrr__hash__AszVersion.__hash__cCsd|jj|jfS)Nz%s('%s') __class__rrr0rrr__repr__DszVersion.__repr__cCs|jSrrr0rrr__str__GszVersion.__str__cCs tddS)NzPlease implement in subclasses.rr0rrr is_prereleaseJszVersion.is_prereleaseN)rrrrrr%r'r)r*r,r-r.r1r4r6propertyr7rrrrrsrc @seZdZdZddddddddddddd dd dd Zd d ZddZddZeddZ ddZ ddZ ddZ ddZ ddZddZdS) MatcherNcCs||kSrrvcprrrTzMatcher.cCs||kSrrr:rrrr>Ur?cCs||kp||kSrrr:rrrr>Vr?cCs||kp||kSrrr:rrrr>Wr?cCs||kSrrr:rrrr>Xr?cCs||kSrrr:rrrr>Yr?cCs||kp||kSrrr:rrrr>[r?cCs||kSrrr:rrrr>\r?)<><=>======~=!=cCst|Srrr rrrraszMatcher.parse_requirementcCs|jdkrtd||_}||}|s:td||j|_|j|_g}|jr|jD]d\}}| dr|dkrtd||ddd}}||n||d}}| |||fq^t ||_ dS) NzPlease specify a version classz Not valid: %rz.*)rDrGz#'.*' not allowed for %r constraintsTF) version_class ValueErrorrrrnamelowerkeyZ constraintsendswithappendtupler)rrrZclistopZvnprefixrrrrds*      zMatcher.__init__cCsxt|tr||}|jD]X\}}}|j|}t|trDt||}|s`d||jjf}t |||||sdSqdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z%r not implemented for %sFT) isinstancerrIr _operatorsgetgetattrr3rr)rversionoperator constraintrSfmsgrrrmatchs       z Matcher.matchcCs6d}t|jdkr2|jdddkr2|jdd}|S)Nrr)rDrE)lenr)rresultrrr exact_versions zMatcher.exact_versioncCs0t|t|ks|j|jkr,td||fdS)Nzcannot compare %s and %s)r!rKr"r#rrrr%szMatcher._check_compatiblecCs"|||j|jko |j|jkSr)r%rMrr#rrrr's zMatcher.__eq__cCs || Srr(r#rrrr)szMatcher.__ne__cCst|jt|jSr)r/rMrr0rrrr1szMatcher.__hash__cCsd|jj|jfS)Nz%s(%r)r2r0rrrr4szMatcher.__repr__cCs|jSrr5r0rrrr6szMatcher.__str__)rrrrIrUrrr]r8r`r%r'r)r1r4r6rrrrr9Os* r9zk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c Cs|}t|}|s"td||}tdd|ddD}t|dkrl|ddkrl|dd}qF|dszd}n t|d}|dd }|d d }|d d }|d}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkrd}n|dt|df}|dkr*d}nHg} |dD]0} | rTdt| f} nd| f} | | q8t| }|s|s|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %scss|]}t|VqdSrint.0r;rrr sz_pep_440_key..r.r )NNr)arg)z)_)final) rPEP440_VERSION_REr]r groupsrPsplitr^rbisdigitrO) rmrtZnumsZepochpreZpostdevZlocalrpartrrr _pep_440_keysT          r{c@s6eZdZdZddZedddddgZed d Zd S) raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCs<t|}t|}|}tdd|ddD|_|S)Ncss|]}t|VqdSrrarcrrrresz*NormalizedVersion.parse..rrf)_normalized_keyrsr]rtrPru_release_clause)rrr_rwrtrrrr s  zNormalizedVersion.parserobr<rcrycstfddjDS)Nc3s |]}|r|djkVqdS)rN) PREREL_TAGS)rdtr0rrresz2NormalizedVersion.is_prerelease..)anyrr0rr0rr7szNormalizedVersion.is_prereleaseN) rrrrrsetrr8r7rrrrrs  cCs>t|}t|}||krdS||s*dSt|}||dkS)NTFrf)str startswithr^)xynrrr _match_prefixs rc @sneZdZeZddddddddd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZdS)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)rFr@rArBrCrDrErGcCsV|rd|ko|jd}n|jd o,|jd}|rN|jddd}||}||fS)N+rgrr)rrrurI)rrXrZrSZ strip_localrrrr _adjust_local6s zNormalizedMatcher._adjust_localcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrfcSsg|] }t|qSrrrdirrr Isz/NormalizedMatcher._match_lt..rr}joinrrrXrZrSZrelease_clauseZpfxrrrrDs zNormalizedMatcher._match_ltcCsD||||\}}||krdS|j}ddd|D}t|| S)NFrfcSsg|] }t|qSrrrrrrrQsz/NormalizedMatcher._match_gt..rrrrrrLs zNormalizedMatcher._match_gtcCs||||\}}||kSrrrrXrZrSrrrrTszNormalizedMatcher._match_lecCs||||\}}||kSrrrrrrrXszNormalizedMatcher._match_gecCs.||||\}}|s ||k}n t||}|SrrrrrXrZrSr_rrrr\s   zNormalizedMatcher._match_eqcCst|t|kSrrrrrrrdsz"NormalizedMatcher._match_arbitrarycCs0||||\}}|s ||k}n t|| }|Srrrrrrrgs   zNormalizedMatcher._match_necCsf||||\}}||krdS||kr*dS|j}t|dkrH|dd}ddd|D}t||S)NTFrrgrfcSsg|] }t|qSrrrrrrrzsz7NormalizedMatcher._match_compatible..)rr}r^rrrrrrros  z#NormalizedMatcher._match_compatibleN)rrrrrIrUrrrrrrrrrrrrrr's& z[.+-]$z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}rfz\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cCsL|}tD]\}}|||}q|s.d}t|}|sFd}|}n|dd}dd|D}t|dkr~| dqft|dkr|| d}n8d dd|ddD|| d}|dd}d d d|D}|}|rt D]\}}|||}q|s|}nd |kr*d nd }|||}t |sHd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rrfcSsg|] }t|qSrrarrrrrsz-_suggest_semantic_version..NcSsg|] }t|qSrrrrrrrscSsg|] }t|qSrrrrrrrsry-r)rrL _REPLACEMENTSsub_NUMERIC_PREFIXr]rtrur^rOendr_SUFFIX_REPLACEMENTS is_semver)rr_ZpatreplrwrSsuffixseprrr_suggest_semantic_versions:      ,    rcCshzt||WStk r"YnX|}dD]\}}|||}q0tdd|}tdd|}tdd|}tdd |}td d |}|d r|d d}tdd |}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd|}tdd |}z t|Wntk rbd}YnX|S)!aSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. ))z-alpharo)z-betar~)rro)rr~)rr<)z-finalr)z-prer<)z-releaser)z.releaser)z-stabler)rrf)rqrf) r)z.finalr)rrrzpre$Zpre0zdev$Zdev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?rr;rNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$rz\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1)r|r rLreplacererr)rZrsZorigrrrr_suggest_normalized_versions>      rz([a-z]+|\d+|[\.-])r<zfinal-@)rxZpreviewrrryrrfcCsrdd}g}||D]T}|dr^|dkrD|rD|ddkrD|q*|r^|ddkr^|qD||qt|S)NcSstg}t|D]R}t||}|rd|ddkrBdkrRnn |d}nd|}||q|d|S)N0r9**final) _VERSION_PARTrurL_VERSION_REPLACErVzfillrO)rr_r=rrr get_partsCs     z_legacy_key..get_partsrrrgz*final-Z00000000)rpoprOrP)rrr_r=rrr _legacy_keyBs      rc@s eZdZddZeddZdS)rcCst|Sr)rr rrrr]szLegacyVersion.parsecCs8d}|jD](}t|tr |dr |dkr d}q4q |S)NFrrT)rrTrr)rr_rrrrr7`s zLegacyVersion.is_prereleaseNrrrrr8r7rrrrr\sc@s4eZdZeZeejZded<e dZ ddZ dS)r rrFz^(\d+(\.\d+)*)cCs`||kr dS|jt|}|s2td||dS|d}d|krV|ddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrrfr) numeric_rer]rloggerZwarningrtrsplitr)rrXrZrSrwrrrrrss zLegacyMatcher._match_compatibleN) rrrrrIdictr9rUrcompilerrrrrrr ks   zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs t|Sr) _SEMVER_REr])rrrrrsrc Csndd}t|}|st||}dd|ddD\}}}||dd||dd}}|||f||fS) NcSs8|dkr|f}n$|ddd}tdd|D}|S)NrrfcSs"g|]}|r|dn|qS)r)rvr)rdr=rrrrsz5_semantic_key..make_tuple..)rurP)rZabsentr_rrrr make_tuples z!_semantic_key..make_tuplecSsg|] }t|qSrrarrrrrsz!_semantic_key..r|r)rr rt) rrrwrtmajorminorZpatchrxZbuildrrr _semantic_keys rc@s eZdZddZeddZdS)r cCst|Sr)rr rrrrszSemanticVersion.parsecCs|jdddkS)Nrrr)rr0rrrr7szSemanticVersion.is_prereleaseNrrrrrr sc@seZdZeZdS)r N)rrrr rIrrrrr sc@s6eZdZd ddZddZddZdd Zd d ZdS) VersionSchemeNcCs||_||_||_dSr)rMmatcher suggester)rrMrrrrrrszVersionScheme.__init__cCs2z|j|d}Wntk r,d}YnX|SNTF)rrIr rrr_rrris_valid_versions   zVersionScheme.is_valid_versioncCs0z||d}Wntk r*d}YnX|Sr)rr rrrris_valid_matchers   zVersionScheme.is_valid_matchercCs|d|S)z: Used for processing some metadata fields zdummy_name (%s))rr rrris_valid_constraint_listsz&VersionScheme.is_valid_constraint_listcCs|jdkrd}n ||}|Sr)rrrrrsuggests  zVersionScheme.suggest)N)rrrrrrrrrrrrrs  rcCs|Srrr rrrr>r?r>) normalizedlegacyZsemanticrdefaultcCs|tkrtd|t|S)Nzunknown scheme name: %r)_SCHEMESrJ)rKrrrr s )*rZloggingrcompatrutilr__all__Z getLoggerrrrJr objectrr9rrsr{r|rrrrrrrrIrrrrr rrrr r rrr rrrrs   1d =$ W               .r  $ PK!*zHH(__pycache__/markers.cpython-38.opt-1.pycnu[U .e#@sdZddlZddlZddlZddlZddlmZmZmZddl m Z m Z dgZ ddZ Gd d d eZd d ZeZ[eZdd dZdS)zG Parser for the environment markers micro-language defined in PEP 508. N)python_implementationurlparse string_types)in_venv parse_marker interpretcCst|tr|sdS|ddkS)NFr'") isinstancer)or ?/usr/lib/python3.8/site-packages/pip/_vendor/distlib/markers.py _is_literalsrc @sfeZdZdZddddddddddddd dd dd dd dd dddd ZddZdS) Evaluatorz; This class is used to evaluate marker expessions. cCs||kSNr xyr r r $zEvaluator.cCs||kSrr rr r r r%rcCs||kp||kSrr rr r r r&rcCs||kSrr rr r r r'rcCs||kSrr rr r r r(rcCs||kp||kSrr rr r r r)rcCs||kSrr rr r r r*rcCs||kp||kSrr rr r r r+rcCs|o|Srr rr r r r,rcCs|p|Srr rr r r r-rcCs||kSrr rr r r r.rcCs||kSrr rr r r r/r) z==z===z~=z!=z>=andorinznot inc Cst|trB|ddkr$|dd}q||kr8td|||}n|d}||jkr`td||d}|d }t|drt|d rtd |||f|||}|||}|j|||}|S) z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rr rzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison: %s %s %s)r r SyntaxError operationsNotImplementedErrorrevaluate) selfexprcontextresultrZelhsZerhsrrr r r r"2s"        zEvaluator.evaluateN)__name__ __module__ __qualname____doc__r r"r r r r rsrc Csdd}ttdr(|tjj}tjj}nd}d}||tjttt t tt t t t ddtjd }|S)NcSs<d|j|j|jf}|j}|dkr8||dt|j7}|S)Nz%s.%s.%sfinalr)majorminormicro releaselevelstrserial)infoversionZkindr r r format_full_versionNs z,default_context..format_full_versionimplementation0) implementation_nameimplementation_versionZos_nameZplatform_machineZplatform_python_implementationZplatform_releaseZplatform_systemZplatform_versionZplatform_in_venvZpython_full_versionpython_versionZ sys_platform)hasattrsysr5r3nameosplatformmachinerreleasesystemr0rr;)r4r:r9r&r r r default_contextMs(   rDc Cszt|\}}Wn2tk rB}ztd||fW5d}~XYnX|rd|ddkrdtd||ftt}|rz||t||S)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z)Unable to interpret marker syntax: %s: %sNr#z*unexpected trailing data in marker: %s: %s)r ExceptionrdictDEFAULT_CONTEXTupdate evaluatorr")ZmarkerZexecution_contextr$rester%r r r rqs " )N)r*r?r=r@recompatrrrutilrr__all__robjectrrDrHrJrr r r r s/PK!+Zgg)__pycache__/metadata.cpython-38.opt-1.pycnu[U .e*@sdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZeeZGd d d e ZGd dde ZGddde ZGddde ZdddgZdZ dZ!e"dZ#e"dZ$dZ%dZ&dZ'dZ(dZ)dZ*d Z+e*d!Z,d"Z-e.Z/e/0e%e/0e&e/0e(e/0e*e/0e,e"d#Z1d$d%Z2d&d'Z3d(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;dd?d@dAdBdCdDdEdFZ4dGZ5dHZ6dIZ7dJZ8dKZ9dLZ:dMZ;e<Z=e"dNZ>dXdPdQZ?GdRdSdSe<Z@dTZAdUZBdVZCGdWdde<ZDdS)YzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REc@seZdZdZdS)MetadataMissingErrorzA required metadata is missingN__name__ __module__ __qualname____doc__rr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/metadata.pyrsrc@seZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.Nrrrrrr src@seZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.Nrrrrrr$src@seZdZdZdS)MetadataInvalidErrorzA metadata value is invalidNrrrrrr(srMetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONutf-81.1z \| ) Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicense)r r!r"r#Supported-Platformr$r%r&r'r(r)r* Classifier Download-URL ObsoletesProvidesRequires)r.r/r0r,r-)r r!r"r#r+r$r%r&r'r(r) MaintainerMaintainer-emailr*r,r-Obsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-External)r5r6r7r3r8r1r2r4)r r!r"r#r+r$r%r&r'r(r)r1r2r*r,r-r3r4r5r6r7r8Private-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extra)r9r=r:r;r<)Description-Content-Typer0r/)r>z"extra\s*==\s*("([^"]+)"|'([^']+)')cCsL|dkr tS|dkrtS|dkr$tS|dkr4ttS|dkr@tSt|dS)N1.0r1.2)1.32.12.0) _241_FIELDS _314_FIELDS _345_FIELDS _566_FIELDS _426_FIELDSr)versionrrr_version2fieldlistpsrJc CsBdd}g}|D]"\}}|gddfkr,q||qddddd d g}|D]}|tkrvd|krv|dtd ||tkrd|kr|dtd ||tkrd|kr|dtd ||tkrd|kr|dtd||tkrd |kr|dkr|d td||t krLd |krL|d td|qLt |dkrZ|dSt |dkr|td|t dd|ko||t }d|ko||t }d |ko||t}d |ko||t} t|t|t|t| dkrt d|s |s |s | s t|kr tS|r*dS|r4dS|r>d Sd S)z5Detect the best version depending on the fields used.cSs|D]}||krdSqdS)NTFr)keysmarkersmarkerrrr _has_markersz"_best_version.._has_markerUNKNOWNNr?rr@rArCrBzRemoved 1.0 due to %szRemoved 1.1 due to %szRemoved 1.2 due to %szRemoved 1.3 due to %sr%zRemoved 2.1 due to %szRemoved 2.0 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.0/2.1 fields)itemsappendrDremoveloggerdebugrErFrGrHlenr _314_MARKERS _345_MARKERS _566_MARKERS _426_MARKERSintr) fieldsrNrKkeyvalueZpossible_versionsZis_1_1Zis_1_2Zis_2_1Zis_2_0rrr _best_version~s`              & r^r r!r"r#r+r$r%r&r'r(r)r1r2r*r,r-r3r5r6r;r7r8r0r/r.r4r9r:r<r=)metadata_versionnamerIplatformZsupported_platformsummary descriptionkeywords home_pageauthor author_email maintainermaintainer_emaillicense classifier download_urlobsoletes_dist provides_dist requires_distsetup_requires_distrequires_pythonrequires_externalrequiresprovides obsoletes project_urlZprivate_versionZ obsoleted_by extensionZprovides_extra)r6r3r5)r7)r")r#r,r.r0r/r3r5r6r8r4r+r;r=r<)r4)r&)r(r1r$r%z[^A-Za-z0-9.]+FcCs0|r$td|}td|dd}d||fS)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.- .z%s-%s) _FILESAFEsubreplace)r`rIZ for_filenamerrr_get_name_and_versions r~c@s eZdZdZd?ddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZd@ddZddZdd Zd!d"Zd#d$ZdAd%d&ZdBd'd(ZdCd)d*Zd+d,Zefd-d.ZdDd/d0ZdEd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!dS)FLegacyMetadataaaThe legacy metadata of a release. Supports versions 1.0, 1.1 and 1.2 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcCsz|||gddkrtdi|_g|_d|_||_|dk rH||n.|dk r\||n|dk rv||| dS)N'path, fileobj and mapping are exclusive) count TypeError_fieldsZrequires_filesZ _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrrrr__init__s   zLegacyMetadata.__init__cCst|j|jd<dSNr )r^rrrrrr"sz#LegacyMetadata.set_metadata_versioncCs|d||fdS)Nz%s: %s )write)rrr`r]rrr _write_field%szLegacyMetadata._write_fieldcCs ||SN)getrr`rrr __getitem__(szLegacyMetadata.__getitem__cCs |||Sr)set)rr`r]rrr __setitem__+szLegacyMetadata.__setitem__cCs8||}z |j|=Wntk r2t|YnXdSr) _convert_namerKeyError)rr` field_namerrr __delitem__.s   zLegacyMetadata.__delitem__cCs||jkp|||jkSr)rrrrrr __contains__5s zLegacyMetadata.__contains__cCs(|tkr |S|dd}t||S)Nrx_) _ALL_FIELDSr}lower _ATTR2FIELDrrrrrr9szLegacyMetadata._convert_namecCs|tks|tkrgSdS)NrO) _LISTFIELDS_ELEMENTSFIELDrrrr_default_value?szLegacyMetadata._default_valuecCs&|jdkrtd|Std|SdS)Nr?r )r__LINE_PREFIX_PRE_1_2r|_LINE_PREFIX_1_2rr]rrr_remove_line_prefixDs  z"LegacyMetadata._remove_line_prefixcCs|tkr||St|dSr)rAttributeErrorrrrr __getattr__JszLegacyMetadata.__getattr__FcCst|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.r!r")r~)rZfilesaferrr get_fullnameUszLegacyMetadata.get_fullnamecCs||}|tkS)z+return True if name is a valid metadata key)rrrrrris_field[s zLegacyMetadata.is_fieldcCs||}|tkSr)rrrrrris_multi_field`s zLegacyMetadata.is_multi_fieldcCs.tj|ddd}z||W5|XdS)z*Read the metadata values from a file path.rrencodingN)codecsopencloser)rfilepathfprrrrdszLegacyMetadata.readcCst|}|d|jd<tD]p}||kr(q|tkrf||}|tkrX|dk rXdd|D}|||q||}|dk r|dkr|||qdS)z,Read the metadata values from a file object.zmetadata-versionr NcSsg|]}t|dqS,)tuplesplit.0r]rrr ysz,LegacyMetadata.read_file..rO)rrrrZget_all_LISTTUPLEFIELDSr)rZfileobmsgfieldvaluesr]rrrrls zLegacyMetadata.read_filecCs0tj|ddd}z|||W5|XdS)z&Write the metadata fields to filepath.wrrN)rrr write_file)rr skip_unknownrrrrrszLegacyMetadata.writecCs|t|dD]}||}|r8|dgdgfkr8q|tkrV|||d|q|tkr|dkr|jdkr~|dd}n |dd}|g}|t krd d |D}|D]}||||qqd S) z0Write the PKG-INFO format data to a file object.r rOrr%rrrz |cSsg|]}d|qSrjoinrrrrrsz-LegacyMetadata.write_file..N) rrJrrrrrr_r}r)rZ fileobjectrrrr]rrrrs$   zLegacyMetadata.write_filec svfdd}|sn@t|dr:|D]}||||q$n|D]\}}|||q>|rr|D]\}}|||q^dS)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs"|tkr|r||dSr)rrr)r\r]rrr_sets z#LegacyMetadata.update.._setrKN)hasattrrKrP)rotherkwargsrkvrrrrs     zLegacyMetadata.updatecCsh||}|tks|dkrNt|ttfsNt|trHdd|dD}qzg}n,|tkrzt|ttfszt|trv|g}ng}t t j r<|d}t |j }|tkr|dk r|D](}||ddstd |||qnb|tkr |dk r ||s.rr!N;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r%)rr isinstancelistrrrrrSZ isEnabledForloggingZWARNINGr r_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrr)rr`r]Z project_namerrrrrrsV           zLegacyMetadata.setcCs||}||jkr*|tkr&||}|S|tkr@|j|}|S|tkr|j|}|dkr^gSg}|D].}|tkr~||qf||d|dfqf|S|tkr|j|}t |t r| dS|j|S)zGet a metadata field.Nrrr) rr_MISSINGrrrrrQrrrr)rr`rr]resvalrrrrs.         zLegacyMetadata.getc s|gg}}dD]}||kr||q|rP|gkrPdd|}t|dD]}||krT||qT|ddkr||fSt|jfdd}t|ftjft j ffD]@\}}|D]2} | | d } | d k r|| s|d | | fqq||fS) zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are provided)r!r"zmissing required metadata: %s, )r'r(r r@cs(|D]}|ddsdSqdS)NrrFT)rr)r]rrrrare_valid_constraints#sz3LegacyMetadata.check..are_valid_constraintsNzWrong value for '%s': %s) rrQrrr rrrrrrr) rstrictmissingwarningsattrrrr[Z controllerrr]rrrcheck s8         zLegacyMetadata.checkcCs|d}i}|D]"\}}|r*||jkr||||<q|ddkrd}|D]B\}}|rb||jkrL|dkrx||||<qLdd||D||<qLn8|ddkrd }|D]"\}}|r||jkr||||<q|S) zReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). ) )r_r )r`r!)rIr")rbr$)rer')rfr()rgr))rjr*)rcr%)rdr&)rar#) classifiersr,)rlr-r r@))ror6)rqr7)rrr8)rnr5)rmr3)rvr4)rhr1)rir2rvcSsg|]}d|qSrr)rurrrrbsz)LegacyMetadata.todict..r))rtr/)rsr0)rur.)rr)rZ skip_missingZ mapping_1_0datar\rZ mapping_1_2Z mapping_1_1rrrtodict5s&     zLegacyMetadata.todictcCs8|ddkr$dD]}||kr||=q|d|7<dS)Nr r)r.r0r/r6r)r requirementsrrrradd_requirementsps  zLegacyMetadata.add_requirementscCstt|dSr)rrJrrrrrK{szLegacyMetadata.keysccs|D] }|VqdSrrK)rr\rrr__iter__~s zLegacyMetadata.__iter__csfddDS)Ncsg|] }|qSrrrr\rrrrsz)LegacyMetadata.values..rrrrrrszLegacyMetadata.valuescsfddDS)Ncsg|]}||fqSrrrrrrrsz(LegacyMetadata.items..rrrrrrPszLegacyMetadata.itemscCsd|jj|j|jfS)Nz <%s %s %s>) __class__rr`rIrrrr__repr__s zLegacyMetadata.__repr__)NNNr)F)F)F)N)F)F)"rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrKrrrPrrrrrrs@      ,  , ; rz pydist.jsonz metadata.jsonZMETADATAc@seZdZdZedZedejZe Z edZ dZ de Zdddd Zd Zd Zedfedfe dfe dfd Zd ZdDddZedZdefZdefZdefdefeeedefeeeedefddd Z[[ddZdEddZddZed d!Z ed"d#Z!e!j"d$d#Z!dFd%d&Z#ed'd(Z$ed)d*Z%e%j"d+d*Z%d,d-Z&d.d/Z'd0d1Z(d2d3Z)d4d5d6d7d8dd9Z*d:d;Z+dGd>d?Z,d@dAZ-dBdCZ.dS)Hrz The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z .{1,2047}rCz distlib (%s)r)legacy)r`rIrbzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)r_r`rIrb)_legacy_datarNrc Cs0|||gddkrtdd|_d|_||_|dk rzz|||||_Wn*tk rvt||d|_|YnXnd}|rt |d}| }W5QRXn |r| }|dkr|j |j d|_ndt |ts|d}zt||_||j|Wn0tk r*tt||d|_|YnXdS)Nrr)rrrbr_ generatorr)rr)rrrrr_validate_mappingrrvalidaterrMETADATA_VERSION GENERATORrr decodejsonloads ValueErrorr)rrrrrrfrrrrs@       zMetadata.__init__)r`rIrjrdrbr6r;r=r,)r-N)r N) run_requiresbuild_requires dev_requiresZ test_requires meta_requiresextrasmodules namespacesexportscommandsrZ source_urlr_c CsXt|d}t|d}||kr||\}}|jr^|dkrP|dkrHdn|}n |j|}n|dkrjdn|}|dkr|j||}nt}|}|jd} | r |dkr| d|}nP|dkr| d} | r| ||}n,| d } | s|jd } | r | ||}||krT|}n:||kr2t||}n"|jrH|j|}n |j|}|S) N common_keys mapped_keysr rrrr extensionsr python.commandsrpython.detailspython.exports)object__getattribute__rrr) rr\commonmappedlkZmakerresultr]sentineldrrrrsD            zMetadata.__getattribute__cCsH||jkrD|j|\}}|p |j|krD||}|sDtd||fdS)Nz.'%s' is an invalid value for the '%s' property)SYNTAX_VALIDATORSrmatchr)rr\r]rpattern exclusionsmrrr_validate_value+s  zMetadata._validate_valuecCs*|||t|d}t|d}||kr||\}}|jrV|dkrJt||j|<nf|dkrj||j|<nR|jdi}|dkr||d<n2|dkr|di}|||<n|d i}|||<nh||krt|||nP|d krt|t r| }|r| }ng}|jr||j|<n ||j|<dS) Nr r r r r rrrrrd) rrrrNotImplementedErrorr setdefault __setattr__rrrr)rr\r]rrrrrrrrr!5s<               zMetadata.__setattr__cCst|j|jdSNT)r~r`rIrrrrname_and_version\szMetadata.name_and_versioncCsF|jr|jd}n|jdg}d|j|jf}||krB|||S)Nr5rtz%s (%s))rrr r`rIrQ)rrsrrrrt`s  zMetadata.providescCs |jr||jd<n ||jd<dS)Nr5rt)rrrrrrrtks c Cs|jr |}ng}t|pg|j}|D]d}d|kr>d|kr>d}n8d|krLd}n|d|k}|rv|d}|rvt||}|r$||dq$dD]F}d|} | |kr|| |jd|g}||j|||dq|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrs)ZbuildZdevZtestz:%s:z %s_requires)renv) rr rrr extendrRrget_requirements) rreqtsrr'rrZincluderMr\errrr)rs2      zMetadata.get_requirementscCs|jr|S|jSr)r _from_legacyrrrrr dictionaryszMetadata.dictionarycCs|jr tnt|j|jSdSr)rrr rDEPENDENCY_KEYSrrrr dependenciesszMetadata.dependenciescCs|jr tn |j|dSr)rrrrrrrrr/sc Cs|d|jkrtg}|jD]"\}}||kr$||kr$||q$|rbdd|}t||D]\}}||||qjdS)Nr_zMissing metadata items: %sr) rrrMANDATORY_KEYSrPrQrrr) rrrrr\rrrrrrrrs zMetadata._validate_mappingcCsB|jr.|jd\}}|s|r>td||n||j|jdS)NTz#Metadata: missing: %s, warnings: %s)rrrSrrrr)rrrrrrrszMetadata.validatecCs(|jr|jdSt|j|j}|SdSr")rrr r INDEX_KEYS)rrrrrrs zMetadata.todictc Cs|j|jd}|jd}dD]*}||kr|dkr8d}n|}||||<q|dg}|dgkrdg}||d<d }|D]*\}}||krt||rtd ||ig||<qt|j|d <i}i} |S) NrT)r`rIrjrbrcrkrkrr&rd))ror)rprrsrt)rrrrrrt) rrZlmdrnkkwrKokrfrhrrrr,s,     zMetadata._from_legacyr!r"r*r$r%)r`rIrjrbrcrcCsdd}t}|j}|jD]\}}||kr||||<q||j|j}||j|j}|jrpt |j|d<t ||d<t ||d<|S)NcSst}|D]|}|d}|d}|d}|D]V}|sF|sF||q.d}|rVd|}|rp|rld||f}n|}|d||fq.q |S)Nr%r&rsr2z extra == "%s"z (%s) and %sr)rraddr)entriesr*r+r%r'ZrlistrrMrrrprocess_entriess"   z,Metadata._to_legacy..process_entriesr=r6r;) rrLEGACY_MAPPINGrPrrrrrsorted)rr8rZnmdr3r5Zr1Zr2rrr _to_legacys  zMetadata._to_legacyFTc Cs||gddkrtd||r`|jr4|j}n|}|rP|j||dq|j||dn^|jrp|}n|j}|rt j ||ddddn.t |dd}t j ||ddddW5QRXdS) Nrz)Exactly one of path and fileobj is needed)rTr)Z ensure_asciiindentZ sort_keysrr) rrrrr;rrr,rrdumprr)rrrrrZ legacy_mdrrrrrrs*   zMetadata.writecCs|jr|j|nr|jdg}d}|D]}d|kr*d|kr*|}qHq*|dkrfd|i}|d|n t|dt|B}t||d<dS)Nrr&r%rsr)rrrr insertrr:)rrralwaysentryZrsetrrrr3szMetadata.add_requirementscCs*|jpd}|jpd}d|jj|j||fS)Nz (no name)z no versionz<%s %s %s (%s)>)r`rIrrr_)rr`rIrrrrDs  zMetadata.__repr__)NNNr)N)NN)NNFT)/rrrrrecompileZMETADATA_VERSION_MATCHERIZ NAME_MATCHERrZVERSION_MATCHERZSUMMARY_MATCHERrrrr0r1r.r __slots__rrr rZ none_listdictZ none_dictr rrr!propertyr#rtsetterr)r-r/rrrr,r9r;rrrrrrrrs   -+ '    *     % )F)ErZ __future__rrZemailrrrrAr2rrcompatrrr rLr utilr r rIr rZ getLoggerrrSrrrr__all__rrrBrrrDrErVrFrWrHrYrGrXrrrZEXTRA_RErJr^rrrrrrrrrrr{r~rZMETADATA_FILENAMEZWHEEL_METADATA_FILENAMEZLEGACY_METADATA_FILENAMErrrrrs              H!   PK!##__pycache__/__init__.cpython-38.pycnu[U .eK@snddlZdZGdddeZzddlmZWn&ek rRGdddejZYnXeeZ e edS)Nz 0.2.9.post0c@s eZdZdS)DistlibExceptionN)__name__ __module__ __qualname__rr@/usr/lib/python3.8/site-packages/pip/_vendor/distlib/__init__.pyr sr) NullHandlerc@s$eZdZddZddZddZdS)rcCsdSNrselfrecordrrrhandlezNullHandler.handlecCsdSr rr rrremitrzNullHandler.emitcCs d|_dSr )lock)r rrr createLockrzNullHandler.createLockN)rrrr rrrrrrrsr) Zlogging __version__ Exceptionrr ImportErrorZHandlerZ getLoggerrZloggerZ addHandlerrrrrs PK!ɩ""/_backport/__pycache__/misc.cpython-38.opt-1.pycnu[U .e@sdZddlZddlZdddgZzddlmZWnek rLd ddZYnXzeZWn(ek r~dd l m Z d dZYnXz ej Z Wne k rd dZ YnXdS) z/Backports for individual classes and functions.Ncache_from_sourcecallablefsencode)rFcCs|rdp d}||S)Nco)Zpy_filedebugZextrrF/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/misc.pyrs )CallablecCs t|tS)N) isinstancer )objrrr rscCs<t|tr|St|tr&|tStdt|jdS)Nzexpect bytes or str, not %s) r bytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenamerrr r"s  )F) __doc__osr__all__Zimpr ImportErrorr NameError collectionsr rAttributeErrorrrrr s    PK!`==._backport/__pycache__/sysconfig.cpython-38.pycnu[U .eTi @sdZddlZddlZddlZddlZddlmZmZz ddlZWne k r\ddl ZYnXdddddd d d d d dg Z ddZ ej reje ej Zn e eZejdkrdeddkre ejeeZejdkr deddkr e ejeeeZejdkrBdeddkrBe ejeeeZddZeZdaddZeZedZddZejdZ ejdd Z!e de d!Z"ej#ej$Z%ej#ej&Z'da(dZ)d"d#Z*d$d%Z+d&d'Z,d(d)Z-d*d+Z.d,d-Z/dEd.d/Z0d0dZ1d1d2Z2d3d4Z3dFd5dZ4d6dZ5d7d Z6d8d Z7e.dd9fd:d Z8e.dd9fd;dZ9dd ZdBdCZ?e@dDkre?dS)Gz-Access to Python's configuration information.N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hcCs(z t|WStk r"|YSXdSN)rOSError)pathrK/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpath"s rntZpcbuildiz\pc\viz\pcbuild\amd64icCs,dD]"}tjtjtd|rdSqdS)N)z Setup.distz Setup.localZModulesTF)osrisfilejoin _PROJECT_BASE)fnrrris_python_build:srFc Cstsddlm}tddd}||}|d}|s>td|}t |W5QRXt rdD] }t |d d t |d d qdd adS)N)finder.rz sysconfig.cfgzsysconfig.cfg exists) posix_prefixZ posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T) _cfg_readZ resourcesr__name__rsplitfindAssertionErrorZ as_stream_SCHEMESZreadfp _PYTHON_BUILDset)rZbackport_packageZ_finderZ_cfgfilesschemerrr_ensure_cfg_readDs    r-z \{([^{]*?)\}c st|dr|d}nt}|}|D]8}|dkr._replacer) r-Z has_sectionitemstuplesectionsZ has_optionr*Zremove_sectiondict _VAR_REPLsub)configr.r9ZsectionZoptionvaluer6rr4r_expand_globalsYs$       r?rcsfdd}t||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. cs8|d}|kr|S|tjkr.tj|S|dSr/)r1renvironr2 local_varsrrr6s    z_subst_vars.._replacerr;r<)rrCr6rrBr _subst_varss rEcCs0|}|D]\}}||kr"q|||<qdSr)keysr7)Z target_dictZ other_dictZ target_keyskeyr>rrr _extend_dicts rHcCs`i}|dkri}t|tt|D]4\}}tjdkrDtj|}tjt ||||<q&|S)N)posixr) rHrr(r7rr3r expandusernormpathrE)r,varsresrGr>rrr _expand_varss   rNcsfdd}t||S)Ncs$|d}|kr|S|dSr/r0r2rLrrr6s zformat_value.._replacerrD)r>rLr6rrOr format_values rPcCstjdkrdStjS)NrIr )rr3rrrr_get_default_schemes rQcCstjdd}dd}tjdkrBtjdp.d}|r8|S||dStjdkr|td }|r||r`|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjtjj|Sr)rrrJr)argsrrrjoinusersz_getuserbase..joinuserrAPPDATA~PythondarwinZPYTHONFRAMEWORKLibraryz%d.%drz.local)rrAgetr3sysplatformr version_info)env_baserTbaseZ frameworkrrr _getuserbases$     r`c Cstd}td}td}|dkr*i}i}i}tj|ddd}|}W5QRX|D]} | dsZ| d krvqZ|| } | rZ| d d \} } | } | d d } d | kr| || <qZz t | } Wn$t k r| d d || <YqZX| || <qZt | }d}t|dkrt|D]}||}||p>||} | dk r| d } d}| |krpt|| }n| |krd}nx| tjkrtj| }n`| |kr|dr|dd|krd }n$d| |krd}nt|d| }n d || <}|r|| d}|d| ||}d |kr:|||<n~z t |}Wn"t k rh|||<Yn X|||<|||dr|dd|kr|dd}||kr|||<n|||<||qq|D]"\}} t| tr| ||<q|||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. z"([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_]*)}Nzutf-8surrogateescape)encodingerrors#rrz$$$)CFLAGSLDFLAGSZCPPFLAGSrTFZPY_r@)recompilecodecsopen readlines startswithstripmatchr1replaceint ValueErrorlistrFlenr8searchstrrrAendstartremover7 isinstanceupdate)filenamerLZ _variable_rxZ _findvar1_rxZ _findvar2_rxZdoneZnotdoneflineslinemnvZtmpvr5Zrenamed_variablesr3r>founditemZafterkrrr_parse_makefiles                            rcCsDtrtjtdSttdr,dttjf}nd}tjt d|dS)z Return the path of the Makefile.ZMakefileabiflagsz config-%s%sr=stdlib) r)rrrrhasattrr[_PY_VERSION_SHORTrr)Zconfig_dir_namerrrrMs  c Cst}zt||WnJtk r^}z,d|}t|drF|d|j}t|W5d}~XYnXt}z"t|}t||W5QRXWnJtk r}z,d|}t|dr|d|j}t|W5d}~XYnXtr|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N BLDSHAREDZLDSHARED) rrIOErrorrrrrlrr))rLZmakefileemsgZconfig_hr~rrr _init_posixXs&   rcCsVtd|d<td|d<td|d<d|d<d |d <t|d <tjttj|d <d S)z+Initialize the module as appropriate for NTrZLIBDESTZ platstdlibZ BINLIBDESTr!Z INCLUDEPYz.pydZSOz.exeZEXEZVERSIONZBINDIRN)r_PY_VERSION_SHORT_NO_DOTrrdirnamerr[ executablerOrrr_init_non_posixts   rcCs|dkr i}td}td}|}|s.q||}|rx|dd\}}z t|}Wntk rlYnX|||<q ||}|r d||d<q |S)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_]+) [*]/ rrr)rirjreadlinerpr1rrrs)fprLZ define_rxZundef_rxrrrrrrrrs&      cCs:tr$tjdkrtjtd}q,t}ntd}tj|dS)zReturn the path of pyconfig.h.rZPCr"z pyconfig.h)r)rr3rrrr)Zinc_dirrrrrs  cCstttS)z,Return a tuple containing the schemes names.)r8sortedr(r9rrrrr scCs tdS)z*Return a tuple containing the paths names.r )r(Zoptionsrrrrr sTcCs&t|rt||Stt|SdS)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. N)r-rNr:r(r7)r,rLexpandrrrr s cCst||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r3r,rLrrrrrscGstdkrziattd<ttd<ttd<ttd<tdtdtd<ttd <ttd <ttd <ztjtd <Wntk rd td <YnXt j dkrt tt j dkrt ttj dkrttd<dtkrttd<nttdtd<tr\t j dkr\t}z t }Wntk rd}YnXt jtds\||kr\t j|td}t j|td<tjdkrzt d}t|dd}|dkrdD]2}t|}tdd|}tdd|}|t|<qndt jkrt jd}dD]0}t|}tdd|}|d|}|t|<qtdd } td| } | dk rz| d} t j!| szdD]$}t|}tdd|}|t|<qT|rg} |D]} | "t| q| StSdS)ayWith no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS 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. Nprefix exec_prefixZ py_versionZpy_version_shortrrZpy_version_nodotr_ZplatbaseZ projectbaserre)rZos2rIz2.6userbasesrcdirrXr)rhZ BASECFLAGSrgZ PY_CFLAGSrz -arch\s+\w+\s z-isysroot [^ ]*Z ARCHFLAGSrgz-isysroot\s+(\S+)rz-isysroot\s+\S+(\s|$))# _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrrr[rAttributeErrorrr3rrversionr`rr)getcwdrrisabsrrKr\unamerrsplitrir<rArZrvr1existsappend)rSr_cwdrZkernel_versionZ major_versionrGflagsZarchrgrZsdkZvalsr3rrrrs                   cCs t|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rrZ)r3rrrrRscCs^tjdkrnd}tj|}|dkr(tjStjd|}tj|t||}|dkr\dS|dkrhdStjStjd ksttd stjSt \}}}}}| d d }| d d}| d d}|dddkrd||fS|dddkr&|ddkrPd}dt |dd|ddf}n*|dddkrDd||fS|dddkrdd|||fS|ddd krd }t d!} | |} | rP| }n|ddd"krPt} | d#} | } z td$}Wntk rYnJXzt d%|} W5|X| dk r2d&| d'd&dd} | s<| } | rP| }d(}| d&d)krd*td+d krd,}td+}t d-|}ttt|}t|d'kr|d}n^|d.krd,}nN|d/krd0}n>|d1krd2}n.|d3krd4}n|d5krd6}ntd7|fn<|d8kr0tjd9krPd:}n |d;krPtjd9krLd<}nd=}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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit ()Zamd64z win-amd64Zitaniumzwin-ia64rIr/rer_-NZlinuxz%s-%sZsunosr5Zsolarisz%d.%sr@rZirixZaixz%s-%s.%scygwinz[\d.]+rXZMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)rrZmacosxz10.4.z-archrgZfatz -arch\s+(\S+))i386ppc)rx86_64Zintel)rrrZfat3)ppc64rZfat64)rrrrZ universalz%Don't know machine value for archs=%rrlr)ZPowerPCZPower_Macintoshrrz%s-%s-%s) rr3r[rr&r\rulowerrrrqrrrirjrpr1rrZrlrcloservreadrrrofindallr8rr*rsmaxsize)rijZlookZosnameZhostreleasermachineZrel_rerZcfgvarsZmacverZ macreleaser~ZcflagsZarchsrrrr [s     $                    cCstSr)rrrrrr scCsFtt|D]0\}\}}|dkr0td|td||fqdS)Nrz%s: z %s = "%s") enumeraterr7print)titledataindexrGr>rrr _print_dicts rcCsRtdttdttdtttdtttdtdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ VariablesN)rr r rQrr rrrrr_mains r__main__)N)N)A__doc__rkrrir[Zos.pathrrZ configparser ImportErrorZ ConfigParser__all__rrrrrrr3rrrr)r#r-ZRawConfigParserr(rjr;r?rrrrrrKrrrrrZ _USER_BASErErHrNrPrQr`rrrrrrr r r rrrr r rrr$rrrrs  "" #   v     # PK!߿3_backport/__pycache__/__init__.cpython-38.opt-1.pycnu[U .e@sdZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__rrJ/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/__init__.pyPK!"")_backport/__pycache__/misc.cpython-38.pycnu[U .e@sdZddlZddlZdddgZzddlmZWnek rLd ddZYnXzeZWn(ek r~dd l m Z d dZYnXz ej Z Wne k rd dZ YnXdS) z/Backports for individual classes and functions.Ncache_from_sourcecallablefsencode)rTcCs|rdp d}||S)Nco)Zpy_filedebugZextrrF/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/misc.pyrs )CallablecCs t|tS)N) isinstancer )objrrr rscCs<t|tr|St|tr&|tStdt|jdS)Nzexpect bytes or str, not %s) r bytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenamerrr r"s  )T) __doc__osr__all__Zimpr ImportErrorr NameError collectionsr rAttributeErrorrrrr s    PK!=a==4_backport/__pycache__/sysconfig.cpython-38.opt-1.pycnu[U .eTi @sdZddlZddlZddlZddlZddlmZmZz ddlZWne k r\ddl ZYnXdddddd d d d d dg Z ddZ ej reje ej Zn e eZejdkrdeddkre ejeeZejdkr deddkr e ejeeeZejdkrBdeddkrBe ejeeeZddZeZdaddZeZedZddZejdZ ejdd Z!e de d!Z"ej#ej$Z%ej#ej&Z'da(dZ)d"d#Z*d$d%Z+d&d'Z,d(d)Z-d*d+Z.d,d-Z/dEd.d/Z0d0dZ1d1d2Z2d3d4Z3dFd5dZ4d6dZ5d7d Z6d8d Z7e.dd9fd:d Z8e.dd9fd;dZ9dd ZdBdCZ?e@dDkre?dS)Gz-Access to Python's configuration information.N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hcCs(z t|WStk r"|YSXdSN)rOSError)pathrK/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpath"s rntZpcbuildiz\pc\viz\pcbuild\amd64icCs,dD]"}tjtjtd|rdSqdS)N)z Setup.distz Setup.localZModulesTF)osrisfilejoin _PROJECT_BASE)fnrrris_python_build:srFc Csts~ddlm}tddd}||}|d}|}t|W5QRXt rzdD] }t |dd t |d d qXd adS) N)finder.rz sysconfig.cfg) posix_prefixZ posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T) _cfg_readZ resourcesr__name__rsplitfindZ as_stream_SCHEMESZreadfp _PYTHON_BUILDset)rZbackport_packageZ_finderZ_cfgfilesschemerrr_ensure_cfg_readDs   r,z \{([^{]*?)\}c st|dr|d}nt}|}|D]8}|dkr._replacer) r,Z has_sectionitemstuplesectionsZ has_optionr)Zremove_sectiondict _VAR_REPLsub)configr-r8ZsectionZoptionvaluer5rr3r_expand_globalsYs$       r>rcsfdd}t||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. cs8|d}|kr|S|tjkr.tj|S|dSr.)r0renvironr1 local_varsrrr5s    z_subst_vars.._replacerr:r;)rrBr5rrAr _subst_varss rDcCs0|}|D]\}}||kr"q|||<qdSr)keysr6)Z target_dictZ other_dictZ target_keyskeyr=rrr _extend_dicts rGcCs`i}|dkri}t|tt|D]4\}}tjdkrDtj|}tjt ||||<q&|S)N)posixr) rGrr'r6rr2r expandusernormpathrD)r+varsresrFr=rrr _expand_varss   rMcsfdd}t||S)Ncs$|d}|kr|S|dSr.r/r1rKrrr5s zformat_value.._replacerrC)r=rKr5rrNr format_values rOcCstjdkrdStjS)NrHr )rr2rrrr_get_default_schemes rPcCstjdd}dd}tjdkrBtjdp.d}|r8|S||dStjdkr|td }|r||r`|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjtjj|Sr)rrrIr)argsrrrjoinusersz_getuserbase..joinuserrAPPDATA~PythondarwinZPYTHONFRAMEWORKLibraryz%d.%drz.local)rr@getr2sysplatformr version_info)env_baserSbaseZ frameworkrrr _getuserbases$     r_c Cstd}td}td}|dkr*i}i}i}tj|ddd}|}W5QRX|D]} | dsZ| d krvqZ|| } | rZ| d d \} } | } | d d } d | kr| || <qZz t | } Wn$t k r| d d || <YqZX| || <qZt | }d}t|dkrt|D]}||}||p>||} | dk r| d } d}| |krpt|| }n| |krd}nx| tjkrtj| }n`| |kr|dr|dd|krd }n$d| |krd}nt|d| }n d || <}|r|| d}|d| ||}d |kr:|||<n~z t |}Wn"t k rh|||<Yn X|||<|||dr|dd|kr|dd}||kr|||<n|||<||qq|D]"\}} t| tr| ||<q|||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. z"([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_]*)}Nzutf-8surrogateescape)encodingerrors#rrz$$$)CFLAGSLDFLAGSZCPPFLAGSrTFZPY_r?)recompilecodecsopen readlines startswithstripmatchr0replaceint ValueErrorlistrElenr7searchstrrr@endstartremover6 isinstanceupdate)filenamerKZ _variable_rxZ _findvar1_rxZ _findvar2_rxZdoneZnotdoneflineslinemnvZtmpvr4Zrenamed_variablesr2r=founditemZafterkrrr_parse_makefiles                            rcCsDtrtjtdSttdr,dttjf}nd}tjt d|dS)z Return the path of the Makefile.ZMakefileabiflagsz config-%s%sr<stdlib) r(rrrrhasattrrZ_PY_VERSION_SHORTrr)Zconfig_dir_namerrrrMs  c Cst}zt||WnJtk r^}z,d|}t|drF|d|j}t|W5d}~XYnXt}z"t|}t||W5QRXWnJtk r}z,d|}t|dr|d|j}t|W5d}~XYnXtr|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N BLDSHAREDZLDSHARED) rrIOErrorrrrrkrr()rKZmakefileemsgZconfig_hr}rrr _init_posixXs&   rcCsVtd|d<td|d<td|d<d|d<d |d <t|d <tjttj|d <d S)z+Initialize the module as appropriate for NTrZLIBDESTZ platstdlibZ BINLIBDESTr!Z INCLUDEPYz.pydZSOz.exeZEXEZVERSIONZBINDIRN)r_PY_VERSION_SHORT_NO_DOTrrdirnamerrZ executablerNrrr_init_non_posixts   rcCs|dkr i}td}td}|}|s.q||}|rx|dd\}}z t|}Wntk rlYnX|||<q ||}|r d||d<q |S)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_]+) [*]/ rrr)rhrireadlineror0rqrr)fprKZ define_rxZundef_rxrrrrrrrrs&      cCs:tr$tjdkrtjtd}q,t}ntd}tj|dS)zReturn the path of pyconfig.h.rZPCr"z pyconfig.h)r(rr2rrrr)Zinc_dirrrrrs  cCstttS)z,Return a tuple containing the schemes names.)r7sortedr'r8rrrrr scCs tdS)z*Return a tuple containing the paths names.r )r'Zoptionsrrrrr sTcCs&t|rt||Stt|SdS)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. N)r,rMr9r'r6)r+rKexpandrrrr s cCst||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r2r+rKrrrrrscGstdkrziattd<ttd<ttd<ttd<tdtdtd<ttd <ttd <ttd <ztjtd <Wntk rd td <YnXt j dkrt tt j dkrt ttj dkrttd<dtkrttd<nttdtd<tr\t j dkr\t}z t }Wntk rd}YnXt jtds\||kr\t j|td}t j|td<tjdkrzt d}t|dd}|dkrdD]2}t|}tdd|}tdd|}|t|<qndt jkrt jd}dD]0}t|}tdd|}|d|}|t|<qtdd } td| } | dk rz| d} t j!| szdD]$}t|}tdd|}|t|<qT|rg} |D]} | "t| q| StSdS)ayWith no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS 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. Nprefix exec_prefixZ py_versionZpy_version_shortrrZpy_version_nodotr^ZplatbaseZ projectbaserrd)rZos2rHz2.6userbasesrcdirrWr)rgZ BASECFLAGSrfZ PY_CFLAGSrz -arch\s+\w+\s z-isysroot [^ ]*Z ARCHFLAGSrfz-isysroot\s+(\S+)rz-isysroot\s+\S+(\s|$))# _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrrrZrAttributeErrorrr2rrversionr_rr(getcwdrrisabsrrJr[unamerqsplitrhr;r@rYrur0existsappend)rRr^cwdrZkernel_versionZ major_versionrFflagsZarchrfrZsdkZvalsr2rrrrs                   cCs t|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rrY)r2rrrrRscCs^tjdkrnd}tj|}|dkr(tjStjd|}tj|t||}|dkr\dS|dkrhdStjStjd ksttd stjSt \}}}}}| d d }| d d}| d d}|dddkrd||fS|dddkr&|ddkrPd}dt |dd|ddf}n*|dddkrDd||fS|dddkrdd|||fS|ddd krd }t d!} | |} | rP| }n|ddd"krPt} | d#} | } z td$}Wntk rYnJXzt d%|} W5|X| dk r2d&| d'd&dd} | s<| } | rP| }d(}| d&d)krd*td+d krd,}td+}t d-|}ttt|}t|d'kr|d}n^|d.krd,}nN|d/krd0}n>|d1krd2}n.|d3krd4}n|d5krd6}ntd7|fn<|d8kr0tjd9krPd:}n |d;krPtjd9krLd<}nd=}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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit ()Zamd64z win-amd64Zitaniumzwin-ia64rHr/rdr_-NZlinuxz%s-%sZsunosr5Zsolarisz%d.%sr?rZirixZaixz%s-%s.%scygwinz[\d.]+rWZMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)rrZmacosxz10.4.z-archrfZfatz -arch\s+(\S+))i386ppc)rx86_64Zintel)rrrZfat3)ppc64rZfat64)rrrrZ universalz%Don't know machine value for archs=%rrlr)ZPowerPCZPower_Macintoshrrz%s-%s-%s) rr2rZrr&r[rtlowerrrrprqrhriror0rrYrkrcloserureadrrrnfindallr7rr)rrmaxsize)rijZlookZosnameZhostreleasermachineZrel_rerZcfgvarsZmacverZ macreleaser}ZcflagsZarchsrrrr [s     $                    cCstSr)rrrrrr scCsFtt|D]0\}\}}|dkr0td|td||fqdS)Nrz%s: z %s = "%s") enumeraterr6print)titledataindexrFr=rrr _print_dicts rcCsRtdttdttdtttdtttdtdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"ZPathsZ VariablesN)rr r rPrr rrrrr_mains r__main__)N)N)A__doc__rjrrhrZZos.pathrrZ configparser ImportErrorZ ConfigParser__all__rrrrrrr2rrrr(r#r,ZRawConfigParserr'rir:r>rrrrrrJrrrrrZ _USER_BASErDrGrMrOrPr_rrrrrrr r r rrrr r rrr$rrrrs  "" #   v     # PK!߿-_backport/__pycache__/__init__.cpython-38.pycnu[U .e@sdZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__rrJ/usr/lib/python3.8/site-packages/pip/_vendor/distlib/_backport/__init__.pyPK!#__pycache__/database.cpython-35.pycnu[ Res@sBdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z d d d d dgZ!ej"e#Z$dZ%dZ&deddde%dfZ'dZ(Gddde)Z*Gddde)Z+Gdd d e)Z,Gdd d e,Z-Gdd d e-Z.Gdd d e-Z/e.Z0e/Z1Gddde)Z2d d!d"Z3d#d$Z4d%d&Z5d'd(Z6dS))zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.json INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc@s:eZdZdZddZddZddZdS) _CachezL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generated)selfr#/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/database.py__init__1s  z_Cache.__init__cCs'|jj|jjd|_dS)zC Clear the cache, setting it to its initial state. FN)rclearr r!)r"r#r#r$r&9s  z _Cache.clearcCsE|j|jkrA||j|j<|jj|jgj|dS)z` Add a distribution to the cache. :param dist: The distribution to add. N)r r setdefaultkeyappend)r"distr#r#r$addAsz _Cache.addN)__name__ __module__ __qualname____doc__r%r&r+r#r#r#r$r-s   rc@seZdZdZddddZddZdd ZeeeZd d Z d d Z ddZ e ddZ ddZddZdddZddZdddZdS)rzU Represents a set of distributions installed on a path (typically sys.path). NFcCsd|dkrtj}||_d|_||_t|_t|_d|_td|_ dS)a Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. NTdefault) sysr _include_dist _include_eggr_cache _cache_egg_cache_enabledr_scheme)r"r Z include_eggr#r#r$r%Os        zDistributionPath.__init__cCs|jS)N)r6)r"r#r#r$_get_cache_enabledcsz#DistributionPath._get_cache_enabledcCs ||_dS)N)r6)r"valuer#r#r$_set_cache_enabledfsz#DistributionPath._set_cache_enabledcCs|jj|jjdS)z, Clears the internal cache. N)r4r&r5)r"r#r#r$ clear_cacheks zDistributionPath.clear_cachec cst}x|jD]}tj|}|dkr7q|jd}| s|j rZqt|j}xY|D]Q}|j|}| sp|j|krqp|jru|jt rut t t g}x9|D].}t j||} |j| } | rPqWqptj| j} td| dd} WdQRXtjd|j|j|jt|jd| d|Vqp|jrp|jd rptjd|j|j|jt|j|VqpWqWdS) zD Yield .dist-info and/or .egg(-info) distributions. NfileobjschemelegacyzFound %smetadataenv .egg-info.egg)rBrC)setr rfinder_for_pathfind is_containersortedr2endswith DISTINFO_EXTr r r posixpathjoin contextlibclosing as_streamr loggerdebugr+new_dist_classr3old_dist_class) r"seenr finderrZrsetentryZpossible_filenamesZmetadata_filenameZ metadata_pathZpydiststreamr@r#r#r$_yield_distributionsssD       z%DistributionPath._yield_distributionscCs|jj }|jo |jj }|s/|rxF|jD]8}t|trd|jj|q<|jj|q<W|rd|j_|rd|j_dS)zk Scan the path for distributions and populate the cache with those that are found. TN)r4r!r3r5rY isinstancerr+)r"Zgen_distZgen_eggr*r#r#r$_generate_caches   z DistributionPath._generate_cachecCs)|jdd}dj||gtS)ao The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: string-_)replacerLrJ)clsrversionr#r#r$distinfo_dirnamesz!DistributionPath.distinfo_dirnameccs|js(xs|jD] }|VqWnW|jx|jjjD] }|VqEW|jrx|jjjD] }|VqpWdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r6rYr[r4r valuesr3r5)r"r*r#r#r$get_distributionss     z"DistributionPath.get_distributionscCsd}|j}|jsKx|jD]}|j|kr(|}Pq(Wnb|j||jjkr~|jj|d}n/|jr||jjkr|jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr6rYr(r[r4rr3r5)r"rresultr*r#r#r$get_distributions    z!DistributionPath.get_distributionc csd}|dk r]y |jjd||f}Wn(tk r\td||fYnXx|jD]}t|dstjd|qj|j}xb|D]Z}t |\}}|dkr||kr|VPq||kr|j |r|VPqWqjWdS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string Nz%s (%s)zinvalid name or version: %r, %rprovideszNo "provides": %s) r7matcher ValueErrorrrchasattrrPrQrgrmatch) r"rr`rhr*providedpp_namep_verr#r#r$provides_distributions(       z&DistributionPath.provides_distributioncCs8|j|}|dkr+td||j|S)z5 Return the path to a resource file. Nzno distribution named %r found)rf LookupErrorget_resource_path)r"r relative_pathr*r#r#r$ get_file_path!s zDistributionPath.get_file_pathccszxs|jD]e}|j}||kr ||}|dk rV||krr||Vq x|jD] }|VqcWq WdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)rcexportsrb)r"categoryrr*rVdvr#r#r$get_exported_entries*s      z%DistributionPath.get_exported_entries)r,r-r.r/r%r8r:propertyZ cache_enabledr;rYr[ classmethodrarcrfrprtryr#r#r#r$rKs     ,   ) c@seZdZdZdZdZddZeddZeZ eddZ ed d Z d d Z ed dZ eddZeddZeddZeddZddZddZddZddZdS) rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. FcCsp||_|j|_|jj|_|j|_d|_d|_d|_d|_t |_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) r@rrdr(r`locatordigestextrascontextrDZ download_urlsdigests)r"r@r#r#r$r%Os        zDistribution.__init__cCs |jjS)zH The source archive download URL for this distribution. )r@ source_url)r"r#r#r$r`szDistribution.source_urlcCsd|j|jfS)zX A utility property which displays the name and version in parentheses. z%s (%s))rr`)r"r#r#r$name_and_versioniszDistribution.name_and_versioncCs?|jj}d|j|jf}||kr;|j||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. z%s (%s))r@rgrr`r))r"plistsr#r#r$rgps    zDistribution.providescCsS|j}tjd|jt||}t|j|d|jd|jS)Nz%Getting requirements from metadata %rr~rA) r@rPrQZtodictgetattrrDget_requirementsr~r)r"Zreq_attrmdZreqtsr#r#r$_get_requirements|s  zDistribution._get_requirementscCs |jdS)N run_requires)r)r"r#r#r$rszDistribution.run_requirescCs |jdS)N meta_requires)r)r"r#r#r$rszDistribution.meta_requirescCs |jdS)Nbuild_requires)r)r"r#r#r$rszDistribution.build_requirescCs |jdS)N test_requires)r)r"r#r#r$rszDistribution.test_requirescCs |jdS)N dev_requires)r)r"r#r#r$rszDistribution.dev_requiresc Cst|}t|jj}y|j|j}WnAtk rwtjd||j d}|j|}YnX|j }d}x[|j D]P}t |\}} ||krqy|j | }PWqtk rYqXqW|S)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. z+could not read version %r - using name onlyrF)r rr@r>rh requirementrrPwarningsplitr(rgrrk) r"reqrVr>rhrrermrnror#r#r$matches_requirements*       z Distribution.matches_requirementcCs6|jrd|j}nd}d|j|j|fS)zC Return a textual representation of this instance, z [%s]r<z)rrr`)r"suffixr#r#r$__repr__s zDistribution.__repr__cCs[t|t|k r!d}n6|j|jkoT|j|jkoT|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typerr`r)r"otherrer#r#r$__eq__s  zDistribution.__eq__cCs't|jt|jt|jS)zH Compute hash in a way which matches the equality test. )hashrr`r)r"r#r#r$__hash__szDistribution.__hash__N)r,r-r.r/Zbuild_time_dependency requestedr%rzr download_urlrrgrrrrrrrrrrr#r#r#r$r=s$    " cs@eZdZdZdZdfddZdddZS)rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncs,tt|j|||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr%r dist_path)r"r@r rA) __class__r#r$r%s  z"BaseInstalledDistribution.__init__cCs|dkr|j}|dkr3tj}d}ntt|}d|j}||j}tj|jdjd}d||fS)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str Nr<z%s==asciiz%s%s) hasherhashlibmd5rr}base64urlsafe_b64encoderstripdecode)r"datarprefixr}r#r#r$get_hashs      !z"BaseInstalledDistribution.get_hash)r,r-r.r/rr%rr#r#)rr$rs cseZdZdZdZddfddZddZdd Zd d Ze d d Z ddZ ddZ ddZ ddZdddZddZe ddZdddZdd Zd!d"Zd#d$Zd%d&ZejZS)'ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). sha256Nc sg|_tj||_}|dkr;td||rr|jrr||jjkrr|jj|j}n|dkr|j t }|dkr|j t }|dkr|j t }|dkrtdt |ft j|j}td|dd}WdQRXtt|j||||rT|jrT|jj||j d}|dk |_tjj|d}tjj|rt|d}|jjd } WdQRX| j|_dS) Nzfinder unavailable for %szno %s found in %sr=r>r?rz top_level.txtrbzutf-8)modulesrrErUrir6r4r r@rFr r r rMrNrOr rrr%r+rosrLexistsopenreadr splitlines) r"r r@rArUrVrXrmfr)rr#r$r%s6  !      zInstalledDistribution.__init__cCsd|j|j|jfS)Nz#)rr`r )r"r#r#r$r=szInstalledDistribution.__repr__cCsd|j|jfS)Nz%s %s)rr`)r"r#r#r$__str__AszInstalledDistribution.__str__c Csg}|jd}tj|j|}td|c}xY|D]Q}ddtt|dD}||\}}} |j||| fqFWWdQRXWdQRX|S)a" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). rrXcSsg|] }dqS)Nr#).0ir#r#r$ Ss z6InstalledDistribution._get_records..N)get_distinfo_resourcerMrNrOrrangelenr)) r"resultsrVrXZ record_readerrowmissingr checksumsizer#r#r$ _get_recordsDs "(z"InstalledDistribution._get_recordscCs+i}|jt}|r'|j}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )rEXPORTS_FILENAMEr)r"rerVr#r#r$ru[s  zInstalledDistribution.exportsc CsJi}|jt}|rFtj|j}t|}WdQRX|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. N)rrrMrNrOr)r"rerVrXr#r#r$ris z"InstalledDistribution.read_exportsc Cs9|jt}t|d}t||WdQRXdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_filerrr)r"rurfrr#r#r$rxsz#InstalledDistribution.write_exportscCs|jd}tj|jG}td|.}x$|D]\}}||kr@|Sq@WWdQRXWdQRXtd|dS)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. rrXNz3no resource file with relative path %r is installed)rrMrNrOrKeyError)r"rsrVrXZresources_readerZrelativeZ destinationr#r#r$rrs  z'InstalledDistribution.get_resource_pathccs x|jD] }|Vq WdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r"rer#r#r$list_installed_filessz*InstalledDistribution.list_installed_filesFc Cstjj|d}tjj|j}|j|}tjj|d}|jd}tjd||rwdSt|}x|D]}tjj |s|j d rd} } nDdtjj |} t |d} |j | j} WdQRX|j|s)|r>|j|r>tjj||}|j|| | fqW|j|r|tjj||}|j|ddfWdQRX|S) z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. r<rz creating %sN.pyc.pyoz%dr)rr)rr rLdirname startswithrrPinforisdirrIgetsizerrrrelpathwriterow) r"pathsrdry_runbaseZbase_under_prefix record_pathwriterr hash_valuerfpr#r#r$write_installed_filess. ! z+InstalledDistribution.write_installed_filesc Csg}tjj|j}|jd}x`|jD]R\}}}tjj|smtjj||}||kr|q7tjj|s|j|dddfq7tjj |r7t tjj |}|r||kr|j|d||fq7|r7d|kr-|j ddd}nd }t |d D} |j| j|} | |kr|j|d || fWd QRXq7W|S) a Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rrTFr=rrNrr)rr rrrisabsrLrr)isfilestrrrrrr) r" mismatchesrrr rrZ actual_sizerrZ actual_hashr#r#r$check_installed_filess.    $z+InstalledDistribution.check_installed_filesc Csi}tjj|jd}tjj|rtj|ddd}|jj}WdQRXxX|D]P}|jdd\}}|dkr|j |gj |qk|||.set_name_and_version) r rr6r5r@rr` _get_metadatar+rrr%)r"r rArr@)rr#r$r%bs   !zEggInfoDistribution.__init__csd}ddfdd}d}}|jdrgtjj|rtjj|d}tjj|d}td|d d }tjj|d } tjj|d }|| }qtj|} t| j d j d} td| d d }y@| j d} | j dj d}| j d}Wqt k rcd}YqXn|jdrtjj|rtjj|d } || }tjj|d}tjj|d }td|d d }nt d||r|j ||dkrf|dk rftjj|rft|d} | jj d}WdQRX|sug}n |j}||_|S)NcSsg}|j}x|D]}|j}|jdrKtjd|Pt|}|sptjd|q|jrtjd|js|j|j qdj dd|jD}|jd|j |fqW|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedz, css|]}d|VqdS)z%s%sNr#)rcr#r#r$ szQEggInfoDistribution._get_metadata..parse_requires_data..z%s (%s)) rstriprrPrr r~ constraintsr)rrL)rreqsrrrVZconsr#r#r$parse_requires_datazs&        z>EggInfoDistribution._get_metadata..parse_requires_datacsTg}y5tj|dd}|j}WdQRXWntk rOYnX|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rVzutf-8N)rrrIOError)req_pathrr)rr#r$parse_requires_paths z>EggInfoDistribution._get_metadata..parse_requires_pathz.eggzEGG-INFOzPKG-INFOr r>r?z requires.txtz top_level.txtzEGG-INFO/PKG-INFOutf8r=zEGG-INFO/requires.txtzEGG-INFO/top_level.txtzutf-8z .egg-infoz,path must end with .egg-info or .egg, got %rr)rIrr rrLr zipimport zipimporterrget_datarrrZadd_requirementsrrrrr)r"r requiresrZtl_pathZtl_datarm meta_pathr@rZzipfr=rrr#)rr$rwsT          z!EggInfoDistribution._get_metadatacCsd|j|j|jfS)Nz!)rr`r )r"r#r#r$rszEggInfoDistribution.__repr__cCsd|j|jfS)Nz%s %s)rr`)r"r#r#r$rszEggInfoDistribution.__str__cCsg}tjj|jd}tjj|rxW|jD]I\}}}||kr[q=tjj|s=|j|dddfq=W|S)a Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. zinstalled-files.txtrTF)rr rLrrr))r"rrr r]r#r#r$rs  z)EggInfoDistribution.check_installed_filesc Cs-dd}dd}tjj|jd}g}tjj|r)tj|ddd}x|D]}|j}tjjtjj|j|}tjj|stj d ||j d rqjtjj |sj|j |||||fqjWWd QRX|j |d d f|S)z Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) c Ss@t|d}z|j}Wd|jXtj|jS)Nr)rrcloserr hexdigest)r rcontentr#r#r$_md5s  z6EggInfoDistribution.list_installed_files.._md5cSstj|jS)N)rstatst_size)r r#r#r$_sizesz7EggInfoDistribution.list_installed_files.._sizezinstalled-files.txtrVrzutf-8zNon-existent file: %s.pyc.pyoN)rr) rr rLrrrrnormpathrPrrIrr))r"r rrrerrrmr#r#r$rs"    $-z(EggInfoDistribution.list_installed_filesFc cstjj|jd}tjj|rd}tj|ddd}x~|D]v}|j}|dkryd}qR|sRtjjtjj|j|}|j|jrR|r|VqR|VqRWWdQRXdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths zinstalled-files.txtTrVrzutf-8z./FN) rr rLrrrrrr)r"Zabsoluterskiprrrmr#r#r$rs    $z'EggInfoDistribution.list_distinfo_filescCst|to|j|jkS)N)rZrr )r"rr#r#r$r.szEggInfoDistribution.__eq__)r,r-r.r/rrr%rrrrrrrrrr#r#)rr$rYs  Z    & c@seZdZdZddZddZdddZd d Zd d Zd ddZ dddZ ddZ ddZ dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dS)N)adjacency_list reverse_listr)r"r#r#r$r%Is  zDependencyGraph.__init__cCsg|j| "%s" [label="%s"] z "%s" -> "%s" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rz} )rritemsrr)r)r"rZskip_disconnectedZ disconnectedr*adjsrrr#r#r$to_dots&     %     zDependencyGraph.to_dotcsg}i}x1|jjD] \}}|dd||.zMoving to result: %scSs&g|]}d|j|jfqS)z%s (%s))rr`)rrwr#r#r$rs )rr#listr)rPrQrkeys)r"realistkrxr#)r&r$topological_sorts$)  ! z DependencyGraph.topological_sortcCsIg}x3|jjD]"\}}|j|j|qWdj|S)zRepresentation of the graphr)rr#r)rrL)r"r!r*r$r#r#r$rszDependencyGraph.__repr__) r,r-r.r/r%rrrrrr%r+rr#r#r#r$r9s      rr0cCst|}t}i}xv|D]n}|j|xX|jD]M}t|\}}tjd||||j|gj||fq?Wq"Wx.|D]&}|j |j B|j B|j B}x|D]} y|j | } WnAtk r"tjd| | jd}|j |} YnX| j}d} ||krxf||D]Z\}} y| j|} Wntk rd} YnX| rI|j|| | d} PqIW| s|j|| qWqW|S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %sz+could not read version %r - using name onlyrFT)rrrrgrrPrQr'r)rrrrrhrrrr(rkrr)distsr>graphrlr*rmrr`rrrhmatchedZproviderrkr#r#r$ make_graphsD    '        r/cCs||krtd|jt|}|g}|j|}xT|r|j}|j|x.|j|D]}||krq|j|qqWqDW|jd|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested z1given distribution %r is not a member of the listr)rrr/rpopr))r,r*r-deptodorwsuccr#r#r$get_dependent_distss          r4cCs||krtd|jt|}g}|j|}xX|r|jd}|j|x.|j|D]}||krr|j|qrWqAW|S)zRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested z1given distribution %r is not a member of the listr)rrr/rr0r))r,r*r-rr2rwpredr#r#r$get_required_distss       r6cKsI|jdd}t|}||_||_|p9d|_t|S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summary)r0r rr`r7r)rr`kwargsr7rr#r#r$ make_dist2s    r9)7r/ __future__rrrrMrloggingrrKr1rr<rrcompatrr`rrr@r r r r utilr rrrrrr__all__ getLoggerr,rPrZCOMMANDS_FILENAMErrJrrrrrrrrRrSrr/r4r6r9r#r#r#r$sL         "4  7I6  PK!С)@.@."__pycache__/scripts.cpython-35.pycnu[ ReC@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZejeZdjZejdZd Zd d ZeZGd d d eZdS))BytesION) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executablein_venva s^#!.*pythonw?[0-9.]*([ ].*)?$z# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) cCsd|kr{|jdrb|jdd\}}d|kr{|jd r{d||f}n|jds{d|}|S)N z /usr/bin/env r"z%s "%s"z"%s") startswithsplit) executableenv _executabler/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/scripts.pyenquote_executable3s  rc@sNeZdZdZeZdZdddddZddZe j j d rid d Z d d Z ddZddddZddZeZddZddZdddZddZeddZejddZejd ks ejd kr,ejd kr,d!d"Zdd#d$Zdd%d&ZdS)' ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFcCs||_||_||_d|_d|_tjdkpWtjdkoWtjdk|_t d|_ |p{t ||_ tjdkptjdkotjdk|_ tj|_dS)NFposixjavaX.Ynt)rr) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr_fileop_is_ntsys version_info)selfrrrdry_runfileoprrr__init__Ns     !zScriptMaker.__init__cCs^|jddrZ|jrZtjj|\}}|jdd}tjj||}|S)NguiFpythonpythonw)getr)r"pathrreplacejoin)r,roptionsdnfnrrr_get_alternate_executable_s z%ScriptMaker._get_alternate_executablercCs`y-t|}|jddkSWdQRXWn,ttfk r[tjd|dSYnXdS)zl Determine if the specified executable is a script (contains a #! line) z#!NzFailed to open %sF)openreadOSErrorIOErrorloggerwarning)r,rfprrr _is_shellgs zScriptMaker._is_shellcCs^|j|r=ddl}|jjjddkrV|Sn|jjdrV|Sd|S)Nrzos.nameLinuxz jython.exez/usr/bin/env %s)rCrlangSystem getPropertylowerendswith)r,rrrrr_fix_jython_executabless z"ScriptMaker._fix_jython_executablecCstjdkrd}nPt|t|d}tjdkrJd}nd}d|koe||k}|rd||d }n&d }|d ||d 7}|d 7}|S)a Build a shebang line. In the simple case (on Windows, or a shebang line which is not too long or contains spaces) use a simple formulation for the shebang. Otherwise, use /bin/sh as the executable, with a contrived shebang which allows the script to run either under Python or sh, using suitable quoting. Thanks to Harald Nordgren for his input. See also: http://www.in-ulm.de/~mascheck/various/shebang/#length https://hg.mozilla.org/mozilla-central/file/tip/mach rTdarwini s#!s s #!/bin/sh s '''exec' s "$0" "$@" s' ''')r"r#lenr*platform)r,r post_interpsimple_shebangshebang_lengthmax_shebang_lengthresultrrr_build_shebangs      zScriptMaker._build_shebangcCsd}|jr!|j}d}ntjs9t}nqtrptjjtjddtj d}n:tjjtj ddtj dtj df}|r|j ||}t j j d r|j|}|rt|}|jd }t j d kr5d |kr5d |kr5|d7}|j||}y|jd Wn"tk r|td|YnX|d kry|j|Wn(tk rtd||fYnX|S)NTFscriptszpython%sEXEBINDIRz python%s%sVERSIONrzutf-8cliz -X:Framesz -X:FullFramess -X:Framesz,The shebang (%r) is not decodable from utf-8z?The shebang (%r) is not decodable from the script encoding (%r))rris_python_buildr r r"r4r6get_pathget_config_varr:r*rPrrJrencoderVdecodeUnicodeDecodeError ValueError)r,encodingrQr7enquotershebangrrr _get_shebangsJ               zScriptMaker._get_shebangcCs6|jtd|jd|jjddd|jS)Nmodule import_name.rfunc)script_templatedictprefixsuffixr)r,entryrrr_get_script_textszScriptMaker._get_script_textcCstjj|}|j|S)N)r"r4basenamemanifest)r,exenamebaserrr get_manifestszScriptMaker.get_manifestcCs|jo|j}tjjd}|j|s=||7}|sP||}ny|dkrn|jd}n|jd}t} t| d} | j d|WdQRX| j } ||| }x|D]} tj j |j | } |rtj j| \}}|jdr!|} d| } y|jj| |Wqqtk rtjdd | }tj j|rtj|tj| ||jj| |tjd ytj|Wntk rYnXYqqXn|jr| jd | rd | |f} tj j| rB|j rBtjd | q|jj| ||jrq|jj| g|j| qWdS)Nzutf-8pytwz __main__.pyz.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz %s.deletemez0Able to replace executable using .deleteme logicrjz%s.%szSkipping existing file %s)rr)r"linesepr`rI _get_launcherrrwritestrgetvaluer4r6rsplitextrr(write_binary_file Exceptionr@rAexistsremoverenamedebugr!r%set_executable_modeappend)r,namesrf script_bytes filenamesext use_launcherrzlauncherstreamzfzip_datar#outnamenedfnamerrr _write_scriptsX               zScriptMaker._write_scriptc CsLd}|rF|jdg}|rFddj|}|jd}|jd|d|}|j|jd}|j}t} d|jkr| j|d|jkr| jd ||j d fd |jkr| jd ||j d |j d f|r)|jddr)d} nd} |j | |||| dS)NrWinterpreter_argsz %sr zutf-8r7rXz%s%srzX.Yz%s-%s.%srr0Fpywrw) r3r6r`rgrqr#r&r'addr+r) r,rprr7rQargsrfscriptr# scriptnamesrrrr _make_scripts*    zScriptMaker._make_scriptcCs/d}tjj|jt|}tjj|jtjj|}|j r||jj || r|t j d|dSyt |d}Wn$t k r|jsd}YnlX|j}|st jd|j|dStj|jdd}|r!d}|jdpd }|sv|r7|j|jj|||jrf|jj|g|j|nt jd ||j|jjst|j\} } |jd |j| |} d |krd } nd} tjj|} |j| g| |j || |r+|jdS)NFznot copying %s (up-to-date)rbz"%s: %s is an empty file (skipping)s s TrrWzcopying and adjusting %s -> %srspythonwrrw)!r"r4r6rr rrrr r(newerr@rr<r?r-readlinerAget_command_name FIRST_LINE_REmatchr5groupclose copy_filer%rrinforseekrgrr=)r,rradjustrf first_linerrQrdlinesrfrrrrr _copy_script5sR$              "zScriptMaker._copy_scriptcCs |jjS)N)r(r-)r,rrrr-iszScriptMaker.dry_runcCs||j_dS)N)r(r-)r,valuerrrr-msrcCstjddkrd}nd}d||f}tjddd}t|j|}|sd ||f}t||jS) NPZ64Z32z%s%s.exerjrrz(Unable to find resource %s in package %s)structcalcsize__name__rsplitrfindrcbytes)r,kindbitsr#Zdistlib_packageresourcemsgrrrr{us   zScriptMaker._get_launchercCsKg}t|}|dkr1|j||n|j||d||S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. Nr7)r rr)r, specificationr7rrprrrmakes   zScriptMaker.makecCs4g}x'|D]}|j|j||q W|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r,specificationsr7rrrrr make_multiples zScriptMaker.make_multiple) r __module__ __qualname____doc__SCRIPT_TEMPLATErlrr/r:r*rPrrCrJrVrgrq_DEFAULT_MANIFESTrsrvrrrpropertyr-setterr"r#r$r{rrrrrrrEs.   @   4 4- r)iorloggingr"rerr*compatrrr resourcesrutilrr r r r getLoggerrr@striprcompilerrr_enquote_executableobjectrrrrrs     (  PK!j;;"__pycache__/markers.cpython-35.pycnu[ Re#@sdZddlZddlZddlZddlZddlmZmZmZddl m Z m Z dgZ ddZ Gd d d eZd d ZeZ[eZdd dZdS)zG Parser for the environment markers micro-language defined in PEP 508. N)python_implementationurlparse string_types)in_venv parse_marker interpretcCs)t|t s| rdS|ddkS)NFrz'") isinstancer)or /builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/markers.py _is_literalsr c@seZdZdZdddddddddd d dd d dd ddddddddddddddddddddi ZddZdS) Evaluatorz; This class is used to evaluate marker expessions. z==cCs ||kS)Nr )xyr r r $szEvaluator.z===cCs ||kS)Nr )rrr r r r%sz~=cCs||kp||kS)Nr )rrr r r r&sz!=cCs ||kS)Nr )rrr r r r'scCs ||kS)Nr )rrr r r r*sz>=cCs||kp||kS)Nr )rrr r r r+sandcCs |o |S)Nr )rrr r r r,sorcCs |p |S)Nr )rrr r r r-sincCs ||kS)Nr )rrr r r r.sznot incCs ||kS)Nr )rrr r r r/sc Cs$t|tr[|ddkr2|dd }q ||krNtd|||}nt|tspt|d}||jkrtd||d}|d}t|drt|drtd |||f|j||}|j||}|j|||}|S) z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rz'"rzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison: %s %s %s) r r SyntaxErrordictAssertionError operationsNotImplementedErrorr evaluate) selfexprcontextresultrZelhsZerhsrrr r r r 2s$      zEvaluator.evaluateN)__name__ __module__ __qualname____doc__rr r r r r rs            rcCsdd}ttdr<|tjj}tjj}n d}d}d|d|dtjd tjd tjd tj d tj d tjdt t dtj dtj dddtji }|S)NcSsPd|j|j|jf}|j}|dkrL||dt|j7}|S)Nz%s.%s.%sfinalr)majorminormicro releaselevelstrserial)infoversionkindr r r format_full_versionNs   z,default_context..format_full_versionimplementation0implementation_nameimplementation_versionos_nameplatform_machineplatform_python_implementationplatform_releaseplatform_systemplatform_versionZplatform_in_venvpython_full_versionpython_version sys_platform)hasattrsysr4r1nameosplatformmachinerreleasesystemr.rr@)r3r8r7r$r r r default_contextMs&        rKcCsyt|\}}Wn;tk rS}ztd||fWYdd}~XnX|r|ddkrtd||ftt}|r|j|tj||S)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z)Unable to interpret marker syntax: %s: %sNr#z*unexpected trailing data in marker: %s: %s)r ExceptionrrDEFAULT_CONTEXTupdate evaluatorr )markerZexecution_contextr"rester#r r r rqs )  )r(rFrDrGrecompatrrrutilrr__all__r objectrrKrNrPrr r r r  s      /   PK!kkff#__pycache__/__init__.cpython-35.pycnu[ ReE @sddlZdZGdddeZyddlmZWn+ek riGdddejZYnXejeZ e j edS)Nz0.3.1c@seZdZdS)DistlibExceptionN)__name__ __module__ __qualname__rr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/__init__.pyr s r) NullHandlerc@s4eZdZddZddZddZdS)rcCsdS)Nr)selfrecordrrrhandleszNullHandler.handlecCsdS)Nr)r r rrremitszNullHandler.emitcCs d|_dS)N)lock)r rrr createLockszNullHandler.createLockN)rrrr r rrrrrrs   r) logging __version__ Exceptionrr ImportErrorHandler getLoggerrlogger addHandlerrrrrs  PK!nR.R.$__pycache__/resources.cpython-35.pycnu[ Re*@sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZejeZdaGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZedee jeiZyRyddl Z!Wne"k rddl#Z!YnXeee!j$.allowedcs"g|]}|r|qSrr).0r%)rXrr s z0ResourceFinder.get_resources..)setr listdirr )rrr)rXrrr7szResourceFinder.get_resourcescCs|j|jS)N)rPr )rrrrrr5szResourceFinder.is_containerccs|j|}|dk r|g}x|r|jd}|V|jr'|j}xb|jD]W}|sr|}ndj||g}|j|}|jr|j|q]|Vq]Wq'WdS)NrrG)rQpopr5r+r8r append)rrKrtodornamer+new_namechildrrriterators        zResourceFinder.iteratorN)r;r<r=)r;r<)r'r(r)r4sysplatform startswithrWrrErNrOrrQr-r1r2r7r5 staticmethodr r rrPrcrrrrr9ws"           r9cseZdZdZfddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ S)ZipResourceFinderz6 Resource finder for resources in .zip files. cstt|j||jj}dt||_t|jdrY|jj|_nt j ||_t |j|_ dS)Nr_files) rrhrrCarchivelen prefix_lenhasattrri zipimport_zip_directory_cachesortedindex)rrArj)rrrrs zZipResourceFinder.__init__cCs|S)Nr)rr rrrrEszZipResourceFinder._adjust_pathc Cs||jd}||jkr+d}np|rQ|dtjkrQ|tj}tj|j|}y|j|j|}Wntk rd}YnX|stj d||j j ntj d||j j |S)NTrFz_find failed: %r %rz_find worked: %r %r) rlrir rLbisectrqrf IndexErrorloggerdebugrCr")rr r#irrrrOs    zZipResourceFinder._findcCs3|jj}|jdt|d}||fS)Nr)rCrjr rk)rrr"r rrrrs z ZipResourceFinder.get_cache_infocCs|jj|jS)N)rCget_datar )rrrrrr1szZipResourceFinder.get_bytescCstj|j|S)N)ioBytesIOr1)rrrrrr-szZipResourceFinder.get_streamcCs%|j|jd}|j|dS)N)r rlri)rrr rrrr2szZipResourceFinder.get_sizecCs|j|jd}|r<|dtjkr<|tj7}t|}t}tj|j|}xq|t|jkr|j|j|sP|j||d}|j |j tjdd|d7}qiW|S)Nrrrr) r rlr rLrkr[rsrqrfaddrI)rrr plenr#rwsrrrr7s    zZipResourceFinder.get_resourcesc Cs||jd}|r9|dtjkr9|tj7}tj|j|}y|j|j|}Wntk rd}YnX|S)NrFrr)rlr rLrsrqrfrt)rr rwr#rrrrPs   zZipResourceFinder._is_directory) r'r(r)r4rrErOrr1r-r2r7rPrr)rrrhs        rhcCs|tt|zUnable to locate finder for %r) _finder_cacherdmodules __import__rBrrr&r)packager#rAr rCrrrrr6s         r __dummy__cCswd}tj|tjj|}tjt|}|rst}tj j |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. Nr@) pkgutil get_importerrdpath_importer_cacher&rr _dummy_moduler r r r?r>)r r#rCrrArrrfinder_for_pathRs   r). __future__rrsryloggingr rshutilrdtypesrnr@rutilrrrr getLoggerr'rur/r objectr*r,r6r9rhr zipimporterr_frozen_importlib_externalZ_fi ImportError_frozen_importlibSourceFileLoader FileFinderAttributeErrorrrr ModuleTyper rrrrrrsH         ",!ZN      PK!bdHH __pycache__/index.cpython-35.pycnu[ ReJR @sddlZddlZddlZddlZddlZddlZyddlmZWn"ek rddl mZYnXddl m Z ddl m Z mZmZmZmZmZddlmZmZmZejeZdZdZGd d d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)cached_propertyzip_dir ServerProxyzhttps://pypi.org/pypipypic@seZdZdZdZdddZddZdd Zd d Zd d Z ddZ ddZ dddZ dddZ dddZdddddddZddZdddZdd d!Zddd"d#Zd$d%Zd&d'Zdd(d)ZdS)* PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc Cs|p t|_|jt|j\}}}}}}|sX|sX|sX|d krktd|jd|_d|_d|_d|_t t j dh}x^d D]V} y;t j | dgd |d |} | d kr| |_PWqtk rYqXqWWdQRXdS)z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. httphttpszinvalid repository: %sNwgpggpg2z --versionstdoutstderrr)rr)rr) DEFAULT_INDEXurlread_configurationrrpassword_handler ssl_verifierrgpg_homeopenosdevnull subprocess check_callOSError) selfrschemenetlocpathparamsqueryfragZsinksrcr,/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/index.py__init__$s& !         zPackageIndex.__init__cCs3ddlm}ddlm}|}||S)zs Get the distutils command for interacting with PyPI configurations. :return: the command. r) Distribution) PyPIRCCommand)distutils.corer/distutils.configr0)r#r/r0dr,r,r-_get_pypirc_commandAs z PackageIndex._get_pypirc_commandcCsy|j}|j|_|j}|jd|_|jd|_|jdd|_|jd|j|_dS)z Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. usernamepasswordrealmr repositoryN)r4rr8 _read_pypircgetr5r6r7)r#ccfgr,r,r-rKs   zPackageIndex.read_configurationcCs0|j|j}|j|j|jdS)z Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. N)check_credentialsr4 _store_pypircr5r6)r#r;r,r,r-save_configurationZs  zPackageIndex.save_configurationcCs|jdks|jdkr*tdt}t|j\}}}}}}|j|j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r5r6rrrr add_passwordr7rr)r#Zpm_r%r,r,r-r=fs   !zPackageIndex.check_credentialscCs|j|j|j}d|d<|j|jg}|j|}d|d<|j|jg}|j|S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. verifyz:actionsubmit)r=validatetodictencode_requestitems send_request)r#metadatar3requestresponser,r,r-registerrs     zPackageIndex.registercCsaxP|j}|sP|jdj}|j|tjd||fqW|jdS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. zutf-8z%s: %sN)readlinedecoderstripappendloggerdebugclose)r#namestreamZoutbufr*r,r,r-_readers   zPackageIndex._readercCs|jdddg}|dkr*|j}|rC|jd|g|dk re|jdddgtj}tjj|tjj|d }|jd d d |d ||gt j ddj|||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. z --status-fd2z--no-ttyNz --homedirz--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--outputz invoking: %s ) rrextendtempfilemkdtemprr&joinbasenamerQrR)r#filenamesigner sign_passwordkeystorecmdtdZsfr,r,r-get_sign_commands    %zPackageIndex.get_sign_commandc Csdtjdtji}|dk r1tj|d       zPackageIndex.upload_filec Cs|jtjj|s,td|tjj|d}tjj|sctd||j|j|j }}t |j }d d|fd|fg}d||fg}|j ||} |j | S) a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r:action doc_uploadrTversionr)rr)r=rr&isdirrr]rrDrTrr getvaluerFrH) r#rIZdoc_dirfnrTrzip_datafieldsrrJr,r,r-upload_documentation(s  z!PackageIndex.upload_documentationcCsv|jdddg}|dkr*|j}|rC|jd|g|jd||gtjddj||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. z --status-fdrWz--no-ttyNz --homedirz--verifyz invoking: %srY)rrrZrQrRr])r#signature_filename data_filenamerbrcr,r,r-get_verify_commandDs  zPackageIndex.get_verify_commandcCsh|jstd|j|||}|j|\}}}|dkr^td||dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailablerrz(verify command failed with error code %s)rr)rrrrs)r#rrrbrcr+rrr,r,r-verify_signature\s      zPackageIndex.verify_signaturecCs|dkr"d}tjdnMt|ttfrF|\}}nd}tt|}tjd|t|d}|jt |}z|j } d} d} d} d} d | krt | d } |r|| | | xj|j | }|sP| t |7} |j||r8|j|| d7} |r|| | | qWWd|jXWdQRX| dkr| | krtd | | f|r|j}||krtd ||||ftjd |dS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrzDigest specified: %swbi rrzcontent-lengthzContent-Lengthz1retrieval incomplete: got only %d out of %d bytesz.%s digest mismatch for %s: expected %s, got %szDigest verified: %s)rQrR isinstancelisttuplegetattrrrrHrinfointrlenrlrrSrr)r#rdestfiledigest reporthookZdigesterZhasherZdfpZsfpheaders blocksizesizerblocknumblockactualr,r,r- download_fileusV        zPackageIndex.download_filecCsQg}|jr|j|j|jr8|j|jt|}|j|S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrPrr r)r#reqhandlersopenerr,r,r-rHs   zPackageIndex.send_requestcCs7g}|j}xv|D]n\}}t|ttfs@|g}xA|D]9}|jd|d|jdd|jdfqGWqWxG|D]?\}} } |jd|d|| fjdd| fqW|jd|ddfdj|} d|} d| d tt| i} t |j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"zutf-8z8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=z Content-typezContent-length) boundaryrrrrZrtr]strrrr)r#rrpartsrkvaluesvkeyr_valuebodyctrr,r,r-rFs2      zPackageIndex.encode_requestc Cs_t|trd|i}t|jdd}z|j||pEdSWd|dXdS)NrTtimeoutg@andrS)rr r rsearch)r#ZtermsoperatorZ rpc_proxyr,r,r-rs  zPackageIndex.search)__name__ __module__ __qualname____doc__rr.r4rr?r=rLrVrersrvrrrrrrHrFrr,r,r,r-rs*    #8 M  +r)rloggingrrr r[ threadingr ImportErrordummy_threadingrcompatrrrrr r utilr r r getLoggerrrQr DEFAULT_REALMobjectrr,r,r,r-s       .PK!1qq__pycache__/util.cpython-35.pycnu[ Re@sddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZyddlZWnek rdZYnXddlZddlZddlZddlZddlZyddlZWnek r/ddlZYnXddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e j1e2Z3e j4dZ5e j4dZ6e j4d Z7e j4d Z8e j4d Z9e j4d Z:e j4d Z;e j4dZ<ddZ=ddZ>ddZ?ddZ@ddZAddddZBddZCddZDdd ZEejFd!d"ZGejFd#d$ZHejFd%d&d'ZIGd(d)d)eJZKd*d+ZLGd,d-d-eJZMd.d/ZNGd0d1d1eJZOe j4d2e jPZQd3d4ZRdd5d6ZSd7d8ZTd9d:ZUd;d<ZVd=d>ZWd?d@ZXe j4dAe jYZZe j4dBZ[ddCdDZ\e j4dEZ]dFdGZ^dHdIZ_dJdKZ`dLZadMdNZbdOdPZcGdQdRdReJZdGdSdTdTeJZeGdUdVdVeJZfdZgdd^d_d`ZhdadbZidZjGdidjdjeJZke j4dkZle j4dlZme j4dmZndndoZdpdqZoerddrlmpZqmrZrmsZsGdsdtdte$jtZtGdudvdveqZpGdwdxdxepe'ZuejvddyZwewdkrGd{d|d|e$jxZxerGd}d~d~e$jyZyGddde%jzZzerGddde%j{Z{Gddde%j|Z|ddZ}GdddeJZ~Gddde~ZGddde~ZGddde(ZGdddeJZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)csOddfddfddfdd|S) ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). cSstj|}|r>|jd}||jd}nZ|sStdnE|d}|dkrytd|dj|d}|dd}|g}x|rF|d|krPq|d|kr|j||dd}qtj|}|std||j|jd||jd}qWdj|}td||j|dj|}|ddj }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqoqpartssr-/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/util.py marker_varAs:      z parse_marker..marker_varcs|rq|ddkrq|ddj\}}|ddkrXtd||ddj}n|\}}xp|rtj|}|sP|jd}||jd}|\}}d|d|d|i}qW|}||fS) Nr(r)zunterminated parenthesis: %soplhsrhs)r%r MARKER_OPrrr)r&r(r3r'r2r4)markerr/r-r. marker_expres " z!parse_marker..marker_exprcs|\}}x`|rttj|}|s1P||jd}|\}}ddd|d|i}qW||fS)Nr2andr3r4)ANDrr)r&r3r'r4)r7r-r. marker_andxs z parse_marker..marker_andcs|\}}x`|rttj|}|s1P||jd}|\}}ddd|d|i}qW||fS)Nr2orr3r4)ORrr)r&r3r'r4)r:r-r.r6s zparse_marker..markerr-) marker_stringr-)r6r:r7r/r. parse_marker8s $  r>c CsD|j}| s"|jdr&dStj|}|sKtd||jd}||jd}d}}}}|r|ddkr|jdd}|dkrtd||d|} ||ddj}g}x| rtj| }|s%td | |j |jd| |jd} | sYP| dd krytd | | ddj} qW|sd}|rp|dd krM|ddj}t j|}|std ||jd}t |} | j o| j s.td|||jdj}n#dd} |ddkr~| |\}}n|jdd}|dkrtd||d|} ||ddj}tj| r| | \}} nvtj| }|std| |jd} | |jdj} | ratd| d| fg}|r|ddkrtd||ddj}t|\}}|r|ddkrtd||s|}n&d|djdd|Df}td|d|d|d |d!|d"|S)#z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %scSstj|}d}|r g}x|jd}||jd}tj|}|sotd||jd}|j||f||jd}| s|ddkrP|ddj}tj|}|s$td|q$W|s d}||fS)z| Return a list of operator, version tuples if any are specified, else None. Nrzinvalid version: %srBrzinvalid constraint: %s) COMPARE_OPrrrVERSION_IDENTIFIERr r"r%) ver_remainingr'versionsr2vr-r-r. get_versionss,z'parse_requirement..get_versionsr0r1zunterminated parenthesis: %szinvalid constraint: %sz~=;zinvalid requirement: %szunexpected trailing data: %sz%s %sz, cSsg|]}d|qS)z%s %sr-).0conr-r-r. s z%parse_requirement..nameextras constraintsr6url requirement)strip startswithrrr rrfindr%r" NON_SPACErschemenetlocrDrEr>r$r)reqr&r'distnamerO mark_exprrGuriir,trI_rHrsr-r-r.parse_requirements       &racCsdd}i}x|D]\}}}tjj||}xt|D]}tjj||} xt| D]v} ||| } |dkr|j| dqr||| } |jtjjdjd} | d| || .get_rel_pathNrb)rcrdr$rpopr!rerstrip)resources_rootrulesri destinationsbasesuffixdestprefixabs_baseabs_globabs_path resource_filerel_pathrel_destr-r-r.get_resources_dests s  !rycCs:ttdrd}ntjttdtjk}|S)N real_prefixT base_prefix)hasattrsysrrgetattr)r(r-r-r.in_venv$s rcCs4tjjtj}t|ts0t|}|S)N)rcrdnormcaser} executable isinstancerr)r(r-r-r.get_executable.s  rcCsr|}xet|}|}| r.|r.|}|r |dj}||krQP|r d|||f}q W|S)Nrz %c: %s %s)r lower)prompt allowed_chars error_promptdefaultpr,cr-r-r.proceed>s   rcCsPt|tr|j}i}x(|D] }||kr(||||.read_stream)r} version_infocodecs getreaderreadr jsonloaditemsget_export_entryrf Exceptionseekr ConfigParserMissingSectionHeaderErrorclosetextwrapdedentsections)rdatajdatar(groupentrieskrHr,entryrrrrNvaluer-r-r. read_exportsWsD         rcCstjddkr(tjd|}tj}x|jD]\}}|j|x|jD]r}|j dkr|j }nd|j |j f}|j rd|dj |j f}|j ||j|qgWqAW|j|dS)Nrrzutf-8z%s:%sz%s [%s]z, )r}rr getwriterrrr add_sectionvaluesrprrflagsr$setrNwrite)rrrrrHrr,r-r-r. write_exportss    rc cs*tj}z |VWdtj|XdS)N)tempfilemkdtemprrmtree)tdr-r-r.tempdirs  rc cs7tj}ztj|dVWdtj|XdS)N)rcgetcwdchdir)rcwdr-r-r.rs    rc cs7tj}ztj|dVWdtj|XdS)N)socketgetdefaulttimeoutsetdefaulttimeout)secondsctor-r-r.socket_timeouts    rc@s+eZdZddZdddZdS)cached_propertycCs ||_dS)N)func)selfrr-r-r.__init__szcached_property.__init__NcCs<|dkr|S|j|}tj||jj||S)N)robject __setattr____name__)robjclsrr-r-r.__get__s  zcached_property.__get__)r __module__ __qualname__rrr-r-r-r.rs  rcCstjdkr|S|s|S|ddkr=td||ddkr]td||jd}x#tj|kr|jtjqoW|stjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put 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. rbrzpath '%s' cannot be absoluterzpath '%s' cannot end with '/')rcre ValueErrorrcurdirremoverdr$)pathnamepathsr-r-r. convert_paths rc@seZdZdddZddZddZdd Zd d d Zd ddZddZ ddZ ddZ ddZ ddZ ddd dddZddZddZd d!Zd"d#Zd S)$ FileOperatorFcCs#||_t|_|jdS)N)dry_runrensured _init_record)rrr-r-r.rs  zFileOperator.__init__cCs%d|_t|_t|_dS)NF)recordr files_written dirs_created)rr-r-r.rs  zFileOperator._init_recordcCs|jr|jj|dS)N)rradd)rrdr-r-r.record_as_writtens zFileOperator.record_as_writtencCsftjj|s.tdtjj|tjj|sDdStj|jtj|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)rcrdexistsrabspathstatst_mtime)rsourcetargetr-r-r.newers zFileOperator.newerTcCs|jtjj|tjd|||jsd}|rtjj|r`d|}n/tjj|rtjj | rd|}|rt |dt j |||j |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirrcrddirnameloggerinforislinkrisfilerrcopyfiler)rinfileoutfilecheckmsgr-r-r. copy_files  % zFileOperator.copy_fileNc Cstjj| st|jtjj|tjd|||js|dkrlt |d}nt j |dd|}zt j ||Wd|j X|j|dS)NzCopying stream %s to %swbwencoding)rcrdisdirrfrrrrropenrr copyfileobjrr)rinstreamrr outstreamr-r-r. copy_streams   zFileOperator.copy_streamc Csx|jtjj||jsgtjj|rAtj|t|d}|j|WdQRX|j |dS)Nr) rrcrdrrrrrrr)rrdrfr-r-r.write_binary_file!s  zFileOperator.write_binary_filecCs|j||j|dS)N)rencode)rrdrrr-r-r.write_text_file*szFileOperator.write_text_filecCstjdks-tjdkrtjdkrxg|D]_}|jrVtjd|q4tj|j|B|@}tjd||tj||q4WdS)Nposixjavazchanging mode of %szchanging mode of %s to %o) rcrN_namerrrrst_modechmod)rbitsmaskfilesrmoder-r-r.set_mode-s-  zFileOperator.set_modecCs|jdd|S)Nimi)r )r,rr-r-r.9szFileOperator.cCstjj|}||jkrtjj| r|jj|tjj|\}}|j|tj d||j stj ||j r|j j|dS)Nz Creating %s)rcrdrrrrrrrrrmkdirrr)rrdrrr-r-r.r;s"    zFileOperator.ensure_dirc Cst|| }tjd|||js|sD|j||r~|sSd}n+|j|sht|t|d}i}|rtt drt j j |d)rNrrrpr)rr-r-r.__repr__szExportEntry.__repr__cCsdt|tsd}nH|j|jko]|j|jko]|j|jko]|j|jk}|S)NF)rr6rNrrrpr)rotherr(r-r-r.__eq__s zExportEntry.__eq__N) rrrrrrr7r9r__hash__r-r-r-r.r6s    r6z(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cs>tj|}|sFd}d|ks3d|kr:td|n|j}|d}|d}|jd}|dkr|d}}n1|dkrtd||jd\}}|d } | dkr d|ksd|krtd|g} nd d | jd D} t|||| }|S) Nr@rAzInvalid specification '%s'rNcallable:rrrcSsg|]}|jqSr-)rS)rKrr-r-r.rMs z$get_export_entry..rB)ENTRY_REsearchr groupdictcountrr6) specificationr'r(rrNrdcolonsrrrprr-r-r.rs2           rc Cs|dkrd}tjdkrEdtjkrEtjjd}ntjjd}tjj|rtj|tj}|st j d|nHytj |d}Wn.t k rt j d |d dd }YnX|st j}t j d |tjj||S) a Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. Nz.distlibnt LOCALAPPDATAz $localappdata~z(Directory exists but is not writable: %sTzUnable to create %sexc_infoFz#Default location unusable, using %s)rcrNenvironrd expandvars expanduserrrr rwarningmakedirsOSErrorrrr$)rpr(usabler-r-r.get_cache_bases&      rNcCs]tjjtjj|\}}|r<|jdd}|jtjd}||dS)a Convert an absolute path to a directory name for use in a cache. The algorithm used is: #. On Windows, any ``':'`` in the drive is replaced with ``'---'``. #. Any occurrence of ``os.sep`` is replaced with ``'--'``. #. ``'.cache'`` is appended. r<z---z--z.cache)rcrd splitdriverr!re)rdrrr-r-r.path_to_cache_dir s $rPcCs|jds|dS|S)Nrb)endswith)r,r-r-r. ensure_slashsrRcCsd}}d|kr[|jdd\}}d|krC|}n|jdd\}}|rmt|}|rt|}|||fS)NrCrr<)rsplitrr)rXusernamepasswordrrr-r-r.parse_credentials$s      rVcCs tjd}tj||S)N)rcumask)r(r-r-r.get_process_umask3s rYcCsUd}d}x0t|D]"\}}t|tsd}PqW|dk sQt|S)NTF) enumeraterrrf)seqr(r]r,r-r-r.is_string_sequence8sr\z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|jdd}tj|}|r^|jd}|d|j}|rt|t|dkrtjtj |d|}|r|j }|d|||dd|f}|dkrt j|}|r|jd|jd|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\br) rr!PYTHON_VERSIONr>rstartrgrerescaperPROJECT_NAME_AND_VERSION)filename project_namer(pyverr'nr-r-r.split_filenameGs"" ' !rhz-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCsOtj|}|s%td||j}|djj|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'rNver)NAME_VERSION_RErrr?rSr)rr'rr-r-r.parse_name_and_versioncs  rkcCst}t|pg}t|p'g}d|krP|jd||O}x|D]}|dkry|j|qW|jdr|dd}||krtjd|||kr|j|qW||krtjd||j|qWW|S)N*r^rzundeclared extra: %s)rrrrTrrJ) requested availabler(runwantedr-r-r. get_extrasrs&         rqcCsi}yqt|}|j}|jd}|jdsRtjd|n$tjd|}tj |}Wn8t k r}ztj d||WYdd}~XnX|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %szutf-8z&Failed to get external data for %s: %s) r rgetrTrrrrrrr exception)rQr(respheadersctreaderer-r-r._get_external_datas  &ryz'https://www.red-dove.com/pypi/projects/cCs9d|dj|f}tt|}t|}|S)Nz%s/%s/project.jsonr)upperr _external_data_base_urlry)rNrQr(r-r-r.get_project_datas r|cCs6d|dj||f}tt|}t|S)Nz%s/%s/package-%s.jsonr)rzr r{ry)rNversionrQr-r-r.get_package_datasr~c@s:eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsptjj|stj|tj|jd@dkrKtjd|tjjtjj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rcrdrrKrrrrJrnormpathro)rror-r-r.rs  zCache.__init__cCs t|S)zN Converts a resource prefix to a directory name in the cache. )rP)rrrr-r-r. prefix_to_dirszCache.prefix_to_dirc Csg}xtj|jD]}tjj|j|}yWtjj|s^tjj|rntj|ntjj|rt j |Wqt k r|j |YqXqW|S)z" Clear the cache. ) rcr(rordr$rrrrrrrr")r not_removedfnr-r-r.clears$ z Cache.clearN)rrr__doc__rrrr-r-r-r.rs   rc@sUeZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dS)N) _subscribers)rr-r-r.rszEventMixin.__init__TcCs\|j}||kr+t|g||.strongconnect)r)rrr-)rrrrr(rrr.strong_connectionsis  $"  zSequencer.strong_connectionscCsdg}xF|jD];}|j|}x%|D]}|jd||fq-WqWx"|jD]}|jd|q\W|jddj|S)Nz digraph G {z %s -> %s;z %s;} )rr"rr$)rr(rrrrr-r-r.dots    z Sequencer.dotN) rrrrrrrrrrpropertyrrr-r-r-r.r!s      3r.tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc sfdd}tjjtd}|dkr|jdr]d}nj|jdr{d}d }nL|jdrd }d }n.|jdrd}d}ntd|z|dkrt|d}|rT|j}xZ|D]}||qWn?tj ||}|rT|j }x|D]}||q@W|dkrt j ddkrx;|j D]-} t| jts| jjd| _qW|jWd|r|jXdS)Ncsvt|ts|jd}tjjtjj|}|j sb|tjkrrt d|dS)Nzutf-8zpath outside destination: %r) rrdecodercrdrr$rTrer)rdr)dest_dirplenr-r. check_paths !#zunarchive..check_path.zip.whlzip.tar.gz.tgztgzzr:gz.tar.bz2.tbztbzzr:bz2z.tartarrozUnknown format for %rrrzutf-8)rr)rr)rr)rcrdrrgrQrrnamelisttarfilergetnamesr}r getmembersrrNrr extractallr) archive_filenamerformatrrarchiver namesrNtarinfor-)rrr. unarchivesH           rc Cstj}t|}t|d}x{tj|D]j\}}}xX|D]P}tjj||}||d} tjj| |} |j|| qPWq:WWdQRX|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOrgrrcwalkrdr$r) directoryr(dlenzfrhr*r rNfullrelrqr-r-r.zip_dirs   rrKMGTPc@seZdZdZddddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressUNKNOWNrdcCsV|dks||kst||_|_||_d|_d|_d|_dS)NrF)rfrcurmaxstartedelapseddone)rminvalmaxvalr-r-r.rs    zProgress.__init__cCs}|j|kst|jdks9||jks9t||_tj}|jdkri||_n||j|_dS)N)rrfrrtimerr)rcurvalnowr-r-r.updates$   zProgress.updatecCs*|dkst|j|j|dS)Nr)rfrr)rincrr-r-r. incrementszProgress.incrementcCs|j|j|S)N)rr)rr-r-r.r`szProgress.startcCs,|jdk r|j|jd|_dS)NT)rrr)rr-r-r.stopsz Progress.stopcCs|jdkr|jS|jS)N)runknown)rr-r-r.maximumszProgress.maximumcCsZ|jrd}nD|jdkr*d}n,d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rrrr)rr(rHr-r-r. percentages   " zProgress.percentagecCsU|dkr|jdks-|j|jkr6d}ntjdtj|}|S)Nrz??:??:??z%H:%M:%S)rrrrstrftimegmtime)rdurationr(r-r-r.format_duration*s- zProgress.format_durationcCs|jrd}|j}nd}|jdkr9d}ne|jdksZ|j|jkrcd}n;t|j|j}||j|j}|d|j}d||j|fS)NDonezETA rrz%s: %sr)rrrrrfloatr)rrrr^r-r-r.ETA3s   ! z Progress.ETAcCse|jdkrd}n|j|j|j}x%tD]}|dkrIP|d}q6Wd||fS)Nrgig@@z%d %sB/s)rrrUNITS)rr(unitr-r-r.speedFs   zProgress.speedN)rrrrrrrr`rrrrrrrr-r-r-r.rs     rz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCsTtj|r%d}t||tj|rJd}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBr>r_CHECK_MISMATCH_SET_iglob) path_globrr-r-r.r[src cstj|d}t|dkrt|dksBt||\}}}x0|jdD]4}x+tdj|||fD] }|VqWqaWnd|krxt|D] }|VqWn|jdd\}}|dkrd}|dkrd}n|jd}|jd }x]tj |D]L\}}} tj j |}x(ttj j||D] } | VqqWq4WdS) NrrrBrz**r/rlrb\) RICH_GLOBrrgrfrr$ std_iglobr%rcrrdr) r rich_path_globrrrrpitemrdradicaldirr rr-r-r.rfs*%     "r) HTTPSHandlermatch_hostnameCertificateErrorc@s(eZdZdZdZddZdS)HTTPSConnectionNTc Cstj|j|jf|j}t|ddrF||_|jtt ds|j rjt j }n t j }t j ||j|jd|dt jd|j |_nt jt j}tt dr|jt jO_|jr|j|j|ji}|j rKt j |_|jd|j tt d drK|j|d <|j |||_|j r|jry0t|jj|jtjd |jWn5tk r|jjtj|jjYnXdS) N _tunnel_hostF SSLContext cert_reqs ssl_versionca_certs OP_NO_SSLv2cafileHAS_SNIserver_hostnamezHost verified: %s) rcreate_connectionhostporttimeoutr~sock_tunnelr|sslr CERT_REQUIRED CERT_NONE wrap_socketkey_file cert_filePROTOCOL_SSLv23roptionsrload_cert_chain verify_modeload_verify_locations check_domainr getpeercertrrrshutdown SHUT_RDWRr)rr"rcontextrr-r-r.connects@!            zHTTPSConnection.connect)rrrrr/r4r-r-r-r.rs rc@s7eZdZdddZddZddZdS) rTcCs#tj|||_||_dS)N)BaseHTTPSHandlerrrr/)rrr/r-r-r.rs  zHTTPSHandler.__init__cOs4t||}|jr0|j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr/)rrrr(r-r-r. _conn_makers    zHTTPSHandler._conn_makercCsqy|j|j|SWnStk rl}z3dt|jkrWtd|jnWYdd}~XnXdS)Nzcertificate verify failedz*Unable to verify server certificate for %s)do_openr6rstrreasonrr)rrYrxr-r-r. https_openszHTTPSHandler.https_openN)rrrrr6r:r-r-r-r.rs  rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrYr-r-r. http_openszHTTPSOnlyHandler.http_openN)rrrr<r-r-r-r.r;s r;c@s"eZdZddddZdS)HTTPrNcKs2|dkrd}|j|j|||dS)Nr)_setup_connection_class)rrr rr-r-r.rs z HTTP.__init__)rrrrr-r-r-r.r?s r?c@s"eZdZddddZdS)HTTPSrNcKs2|dkrd}|j|j|||dS)Nr)r@rA)rrr rr-r-r.rs zHTTPS.__init__)rrrrr-r-r-r.rBs rBc@s+eZdZdddZddZdS) TransportrcCs ||_tjj||dS)N)r!rrCr)rr! use_datetimer-r-r.rs zTransport.__init__cCs|j|\}}}tdkr<t|d|j}nK|j sY||jdkrz||_|tj|f|_|jd}|S)Nr=r>r!rr)r=r>) get_host_info _ver_infor?r! _connection_extra_headersrHTTPConnection)rrhehx509r(r-r-r.make_connections   zTransport.make_connectionN)rrrrrMr-r-r-r.rCs rCc@s+eZdZdddZddZdS) SafeTransportrcCs ||_tjj||dS)N)r!rrNr)rr!rDr-r-r.r s zSafeTransport.__init__cCs|j|\}}}|s$i}|j|drr)r=r>)rEr!rFrBrGrHrr)rrrJrKrr(r-r-r.rMs    zSafeTransport.make_connectionN)rrrrrMr-r-r-r.rN s rNc@seZdZddZdS) ServerProxyc Ks|jdd|_}|dk rt|\}}|jdd}|dkr^t}nt}||d||d<}||_tjj |||dS)Nr!rDrhttps transport) rjr!rrrrNrCrQrrOr) rr\rr!rWr_rDtclsr^r-r-r.r s    zServerProxy.__init__N)rrrrr-r-r-r.rOs rOcKsDtjddkr |d7}nd|dtjd|}||_nt|dd|_tj|j|j|_dS)Nrrrzutf-8rdro) r}rrrrrUcsvrwr])rrrr-r-r.rNs   zCSVReader.__init__cCs|S)Nr-)rr-r-r.__iter__YszCSVReader.__iter__cCset|j}tjddkrax<t|D].\}}t|ts/|jd||.convert..z())rr&rtypedictconfigure_customrm)or(r)rmrr-r.rms(  z.Configurator.configure_custom..convertz()r/z[]csg|]}|qSr-r-)rKrq)rmr-r.rMs z1Configurator.configure_custom..cs2g|](}t|r||fqSr-)r)rKr)rkrmr-r.rMs )rjr;r5rrorsetattr) rrkrpropsrrrr(rgrHr-)rkrmrr.rps  zConfigurator.configure_customcCsF|j|}t|trBd|krB|j||j|<}|S)Nz())rkrrorp)rrr(r-r-r. __getitem__s zConfigurator.__getitem__c Cs_tjj|s*tjj|j|}tj|ddd}tj|}WdQRX|S)z*Default converter for the inc:// protocol.rorzutf-8N) rcrdisabsr$rorrrr)rrrr(r-r-r.rhs zConfigurator.inc_convert) rrrrorvalue_convertersrrprtrhr-r-)rlr.rgys    rgc@s@eZdZdZddddZddZdd ZdS) SubprocessMixinzC Mixin for running subprocesses and capturing their output FNcCs||_||_dS)N)verboseprogress)rrxryr-r-r.rs zSubprocessMixin.__init__cCs|j}|j}xr|j}|s(P|dk rD|||q|s]tjjdntjj|jdtjjqW|jdS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nr/zutf-8) ryrxreadliner}stderrrrflushr)rrr3ryrxr,r-r-r.rws    zSubprocessMixin.readercKstj|dtjdtj|}tjd|jd|jdf}|jtjd|jd|jdf}|j|j |j |j |j dk r|j ddn|j rt jjd|S)Nstdoutr{rrzdone.mainzdone. ) subprocessPopenPIPE threadingThreadrwr}r`r{waitr$ryrxr}r)rcmdrrt1t2r-r-r. run_commands$ $     zSubprocessMixin.run_command)rrrrrrwrr-r-r-r.rws  rwcCstjdd|jS)z,Normalize a python package name a la PEP 503z[-_.]+r^)rasubr)rNr-r-r.normalize_namesr)rrrrrrr)rrrrrr)r=r>)r collectionsr contextlibr_globrr rrloggingrcrrarr$ ImportErrorrr}rrrrdummy_threadingrrrcompatrrrr r r r r rrrrrrrrrrrrr getLoggerrrrrrErDr5r<r9rVr#r>raryrrrrrrcontextmanagerrrrrrrrr5r6VERBOSEr=rrNrPrRrVrYr\Ircr_rhrjrkrqryr{r|r~rrrARCHIVE_EXTENSIONSrrrrr rrrrr5rrrr;rrFr?rBrCrNrOrUrVr^rcrgrwrr-r-r-r.s                    Y y   /      )           ,H6 ] +)   7.PK!MVN++#__pycache__/manifest.cpython-35.pycnu[ Re9@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ ej eZejdejZejd ejejBZejdd ZGd ddeZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode) convert_pathManifestz\\w* z#.*?(?= )| (?=$)c@seZdZdZdddZddZddZd d Zd d d ZddZ ddZ ddZ ddd ddZ ddd ddZ ddd ddZddZdS)rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. NcCsYtjjtjj|p!tj|_|jtj|_d|_t |_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfr r/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/manifest.py__init__*s- zManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}x|r|}tj |} x| D]x} tj j || } tj| } | j } || r|jt | qu|| ru||  ru|| quWqPWdS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrr popappendrlistdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"          zManifest.findallcCsJ|j|js*tjj|j|}|jjtjj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrrr rr raddr )ritemrrrr)Tsz Manifest.addcCs"x|D]}|j|qWdS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r))ritemsr*rrradd_many^s zManifest.add_manyFcsfddtj}|rgt}x'|D]}|tjj|q:W||O}ddtdd|DDS)z8 Return sorted files in directory order csg|j|tjd||jkrctjj|\}}|dksVt||dS)Nzadd_dir added %s/)r-r.)r)loggerdebugr rr splitAssertionError)dirsdparent_)add_dirrrrr7ls  z Manifest.sorted..add_dircSs"g|]}tjj|qSr)rr r).0Z path_tuplerrr zs z#Manifest.sorted..css!|]}tjj|VqdS)N)rr r1)r8r rrr {sz"Manifest.sorted..)rrrr dirnamesorted)rZwantdirsresultr3fr)r7rrr<gs    zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}s zManifest.clearcCs|j|\}}}}|dkr`x|D]+}|j|dds.tjd|q.Wn|dkrx|D]}|j|dd}qsWno|dkrx`|D]+}|j|ddstjd|qWn*|d krx|D]}|j|dd}qWn|d krWx|D].}|j|d |s"tjd ||q"Wn|d krx|D]}|j|d |}qjWnx|dkr|jdd |stjd|nD|dkr|jdd |stjd|ntd|dS)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeanchorTzno files found matching %rexcludezglobal-includeFz3no files found matching %r anywhere in distributionzglobal-excludezrecursive-includerz-no files found matching %r under directory %rzrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr/warning_exclude_patternr)r directiveactionpatternsthedirZ dirpatternpatternfoundrrrprocess_directivesD                    zManifest.process_directivec Csc|j}t|dkr>|ddkr>|jdd|d}d }}}|dkrt|d krtd |dd|dd D}n|dkrt|dkrtd|t|d}dd|d d D}nQ|dkrCt|d kr0td|t|d}ntd|||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rrr@rBglobal-includeglobal-excluderecursive-includerecursive-excluderCrDNrz$%r expects ...cSsg|]}t|qSr)r)r8wordrrrr9s z-Manifest._parse_directive..z*%r expects ...cSsg|]}t|qSr)r)r8rTrrrr9s z!%r expects a single zunknown action %r)r@rBrPrQrRrSrCrD)r@rBrPrQ)rRrS)rCrD)r1leninsertrr)rrIwordsrJrKrLZ dir_patternrrrrEs:           zManifest._parse_directiveTcCstd}|j||||}|jdkr7|jx6|jD]+}|j|rA|jj|d}qAW|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. FNT)_translate_patternrr'searchrr))rrMrAris_regexrN pattern_rer$rrrrFs  zManifest._include_patterncCsad}|j||||}x<t|jD]+}|j|r.|jj|d}q.W|S)atRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)rYlistrrZremove)rrMrArr[rNr\r>rrrrH)s  zManifest._exclude_patternc CsK|r&t|tr"tj|S|Std krS|jdjd\}}}|r|j|}td kr|j|r|j|st nd}tj t j j |jd} |dk rtdkr |jd} |j|dt|  } nY|j|} | j|r9| j|s?t | t|t| t|} t j} t jdkrd} tdkrd| | j | d |f}q>|t|t|t|}d || | | ||f}nF|r>tdkrd| |}n#d || |t|df}tj|S)aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). rUrr6r-N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s)rUr)rUr)rUr)rUr)rUr) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionr(endswithr2escaperr rr rVr) rrMrArr[startr6endr\r Z empty_patternZ prefix_rerrrrrY=sB   ! '!  #$&  & #zManifest._translate_patterncCsPtj|}tj}tjdkr-d}d|}tjd||}|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). r_z\\\\z\1[^%s]z((? s      PK!kpp __pycache__/wheel.cpython-35.pycnu[ Re@sddlmZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlm Z m!Z!m"Z"m#Z#dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-dd l.m/Z/m0Z0e j1e2Z3da4e5ed rd Z6n9ej7j8d rdZ6nej7dkrdZ6ndZ6ej9dZ:e: r-dej;ddZ:de:Z<e6e:Z=ej$j>j?ddj?ddZ@ej9dZAeAoeAj8dreAj?ddZAnddZBeBZA[BejCdejDejEBZFejCdejDejEBZGejCdZHejCd ZId!ZJd"ZKe jLd#kr9d$d%ZMn d&d%ZMGd'd(d(eNZOeOZPGd)d*d*eNZQd+d,ZReRZS[Rdd-d.ZTdS)/)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir)NormalizedVersionUnsupportedVersionErrorpypy_version_infoppjavajycliipcppy_version_nodotz%s%spy-_.SOABIzcpython-cCssdtg}tjdr(|jdtjdrD|jdtjddkrf|jdd j|S) Nr"Py_DEBUGd WITH_PYMALLOCmPy_UNICODE_SIZEu) VER_SUFFIXrget_config_varappendjoin)partsr7/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/wheel.py _derive_abi<s    r9zz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/cCs|S)Nr7)or7r7r8^sr<cCs|jtjdS)Nr:)replaceossep)r;r7r7r8r<`sc@sOeZdZddZddZddZddd Zd d ZdS) MountercCsi|_i|_dS)N) impure_wheelslibs)selfr7r7r8__init__ds zMounter.__init__cCs!||j|<|jj|dS)N)rArBupdate)rCpathname extensionsr7r7r8addhs z Mounter.addcCsF|jj|}x-|D]%\}}||jkr|j|=qWdS)N)rApoprB)rCrFrGkvr7r7r8removelszMounter.removeNcCs"||jkr|}nd}|S)N)rB)rCfullnamepathresultr7r7r8 find_modulers zMounter.find_modulecCs|tjkrtj|}nr||jkr>td|tj||j|}||_|jdd}t|dkr|d|_ |S)Nzunable to find extension for %sr(rr) sysmodulesrB ImportErrorimpZ load_dynamic __loader__rsplitlen __package__)rCrMrOr6r7r7r8 load_moduleys  zMounter.load_module)__name__ __module__ __qualname__rDrHrLrPrYr7r7r7r8r@cs    r@c@sleZdZdZd4ZdZdddddZedd Zed d Z ed d Z e ddZ ddZ e ddZddZdddZddZddZddZddddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zdd,d-Zd.d/Zd0d1Zdd2d3ZdS)5Wheelz@ Class to build and install from Wheel files (PEP 427). rsha256NFcCs||_||_d|_tg|_dg|_dg|_tj|_ |dkr{d|_ d|_ |j |_ n?tj|}|r|jd}|d|_ |djd d |_ |d |_|j |_ ntjj|\}}tj|}|std ||r9tjj||_ ||_ |jd}|d|_ |d|_ |d |_|d jd|_|djd|_|djd|_dS)zB Initialise an instance using a (valid) filename. r1noneanyNdummyz0.1nmZvnr'r&ZbnzInvalid name or filename: %rr%r(Zbiar)signZ should_verifybuildverPYVERpyverabiarchr>getcwddirnamenameversionfilename _filenameNAME_VERSION_REmatch groupdictr=rNsplit FILENAME_RErabspath)rCrnrdverifyr-inforkr7r7r8rDsB                zWheel.__init__cCs|jrd|j}nd}dj|j}dj|j}dj|j}|jjdd}d|j|||||fS)zJ Build and return a filename from the various components. r&r1r(r'z%s-%s%s-%s-%s-%s.whl)rer5rgrhrirmr=rl)rCrergrhrirmr7r7r8rns zWheel.filenamecCs+tjj|j|j}tjj|S)N)r>rNr5rkrnisfile)rCrNr7r7r8existssz Wheel.existsccsNxG|jD]<}x3|jD](}x|jD]}|||fVq*WqWq WdS)N)rgrhri)rCrgrhrir7r7r8tagssz Wheel.tagscCsMtjj|j|j}d|j|jf}d|}tjd}t |d}|j |}|dj dd}t dd |D}t tg} d} xt| D]l} yQtj|| } |j| )} || }td |} | rPWdQRXWqtk rYqXqW| sBtd d j| WdQRX| S) Nz%s-%sz %s.dist-infozutf-8rz Wheel-Versionr(rcSsg|]}t|qSr7)int).0ir7r7r8 s z"Wheel.metadata..fileobjz8Invalid wheel, because metadata is missing: looked in %sz, )r>rNr5rkrnrlrmcodecs getreaderrget_wheel_metadatarstuplerr posixpathopenr KeyError ValueError)rCrFname_verinfo_dirwrapperzfwheel_metadatawv file_versionfnsrOfnmetadata_filenamebfwfr7r7r8metadatas0       zWheel.metadatac Csvd|j|jf}d|}tj|d}|j|(}tjd|}t|}WdQRXt|S)Nz%s-%sz %s.dist-infoWHEELzutf-8) rlrmrr5rrrrdict)rCrrrrrrmessager7r7r8rs zWheel.get_wheel_metadatac CsGtjj|j|j}t|d}|j|}WdQRX|S)Nr{)r>rNr5rkrnrr)rCrFrrOr7r7r8rwsz Wheel.infoc Cs&tj|}|r|j}|d|||d}}d|jkr]t}nt}tj|}|rd|jd }nd}||}||}nv|jd}|jd} |dks|| krd} n)|||dd krd } nd} t| |}|S) Nspythonw rs s rr$s ) SHEBANG_RErqendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) rCdatar-rshebangZdata_after_shebangZshebang_pythonargsZcrlfZtermr7r7r8process_shebangs, !     zWheel.process_shebangc Cs|dkr|j}ytt|}Wn"tk rLtd|YnX||j}tj|jdj d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64urlsafe_b64encoderstripdecode)rCrrhasherrOr7r7r8get_hash%s   !zWheel.get_hashc Csut|}ttjj||}|j|ddft|%}x|D]}|j|qSWWdQRXdS)Nr1)listto_posixr>rNrelpathr4rwriterow)rCrecords record_pathbasepwriterrowr7r7r8 write_record0s   zWheel.write_recordc Csg}|\}}tt|j}xt|D]l\}} t| d} | j} WdQRXd|j| } tjj| } |j || | fq+Wtjj |d} |j || |t tjj |d}|j || fdS)Nrbz%s=%sRECORD) rrrrreadrr>rNgetsizer4r5rr)rCrwlibdir archive_pathsrdistinforraprfrrsizer7r7r8 write_records8s zWheel.write_recordsc Cs]t|dtjA}x7|D]/\}}tjd|||j||qWWdQRXdS)NwzWrote %s to %s in wheel)rzipfile ZIP_DEFLATEDloggerdebugwrite)rCrFrrrrr7r7r8 build_zipHszWheel.build_zipc"s|dkri}ttfddd(d}|dkrgd}tg}tg}tg}n!d}tg}d g}d g}|jd ||_|jd ||_|jd ||_ |} d|j |j f} d| } d| } g} xDd)D]<}|krq|}t j j|rxt j|D]\}}}x|D]}tt j j||}t j j||}tt j j| ||}| j||f|dkr_|jd r_t|d}|j}WdQRX|j|}t|d}|j|WdQRXq_WqIWqW| }d}xt j|D]\}}}||krxRt|D]D\}}t|}|jdrt j j||}||=PqW|stdxi|D]a}t|jd*r qt j j||}tt j j||}| j||fqWqdWt j|}xc|D][}|d+krltt j j||}tt j j| |}| j||fqlWd|p|jd td!|g}x4|jD])\}}}|jd"|||fqWt j j|d}t|d#}|jd$j|WdQRXtt j j| d}| j||fd%d&} t | d'| } |j!|| f| | t j j|j"|j#}!|j$|!| |!S),z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Ncs |kS)Nr7)r;)pathsr7r8r<VszWheel.build..purelibplatlibrfalsetruer_r`rgrhriz%s-%sz%s.dataz %s.dist-inforheadersscriptsz.exerwbz .dist-infoz(.dist-info directory expected, not found.pyc.pyor INSTALLERSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %sz Tag: %s-%s-%sr cSs9|d}|jd}d|kr/|d7}||fS)Nrr:z .dist-infoi')count)trnr7r7r8sorters    zWheel.build..sorterkey)rr)rrr)rr)rrrr)%rr IMPVERABIARCHrfgetrgrhrirlrmr>rNisdirwalkr r5rrr4endswithrrrr enumerateAssertionErrorlistdir wheel_versionrrzsortedrrkrnr)"rCrrzrZlibkeyis_pureZ default_pyverZ default_abiZ default_archrrdata_dirrrrrNrootdirsfilesrrrprrrrr~dnrrgrhrirrFr7)rr8buildNs %                      z Wheel.buildcCs |jdS)zl Determine whether an archive entry should be skipped when verifying or installing. r: /RECORD.jws)r:r)r)rCarcnamer7r7r8 skip_entryszWheel.skip_entrycCIKs |j}|jd}|jdd}|jdd}tjj|j|j}d|j|jf} d| } d| } t j| t } t j| d} t j| d }t j d }t |d }|j| }||}t|}Wd QRX|d jdd}tdd|D}||jkr]|r]||j||ddkrz|d}n |d}i}|j|E}td|,}x"|D]}|d}|||D]}9d.|9}:|:|8krri|6d/|9<};x^|8|:j6D]L}<d0|<j7|<j8f}=|<j9r|=d1d2j|<j97}=|=|;|<j|6jd8i}?|>s|?r|jdd}@tjj<|@s t=d9|@|_xF|>j>D]8\}:}<d:|:|<f}A|j1|A}4|j2|4qW|?rd-di}BxI|?j>D];\}:}<d:|:|<f}A|j1|A|B}4|j2|4qzWtjj|| }t?|}5t@|}|d=|d=||d;<|5jA||}|r# |!j,||5jB|!|d<||5SWn,t.k rm t'jCd=|jDYnXWd tEjF|"XWd QRXd S)?a~ Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. If kwarg ``bytecode_hashed_invalidation`` is True, written bytecode will try to use file-hash based invalidation (PEP-552) on supported interpreter versions (CPython 2.7+). The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. warnerlib_onlyFZbytecode_hashed_invalidationz%s-%sz%s.dataz %s.dist-inforrzutf-8r{Nz Wheel-Versionr(rcSsg|]}t|qSr7)r|)r}r~r7r7r8rs z!Wheel.install..zRoot-Is-Purelibrrrstreamrr1rdry_runTr$zsize mismatch for %s=zdigest mismatch for %szlib_only: skipping %sz.exer:rzdigest mismatch on write for %sz.pyhashed_invalidationzByte-compilation failedexc_infozlib_only: returning Nonez1.0zentry_points.txtconsoleguiz %s_scriptszwrap_%sz%s:%sz [%s],zAUnable to read legacy script metadata, so cannot generate scriptsrGzpython.commandsz8Unable to read JSON metadata, so cannot generate scriptsZ wrap_consoleZwrap_guizValid script path not specifiedz%s = %slibprefixzinstallation failed.)rr)Grrr>rNr5rkrnrlrmrrrrrrrrsrrrrrecordrQdont_write_bytecodetempfilemkdtemp source_dir target_dirinfolist isinstancer rrstr file_sizerrr startswithrrrr copy_streamr4 byte_compile Exceptionwarningbasenamemakeset_executable_modeextendrwrvaluesrsuffixflagsjsonloadrritemsr rZwrite_shared_locationsZwrite_installed_files exceptionrollbackshutilrmtree)CrCrmakerkwargsrrrZbc_hashed_invalidationrFrrr metadata_namewheel_metadata_name record_namerrbwfrrrrrrrreaderrrZdata_pfxZinfo_pfxZ script_pfxfileopZbcoutfilesworkdirzinfor u_arcnamekindvaluerr'rZ is_scriptwhereroutfileZ newdigestZpycrZworknamer filenamesdistcommandsepZepdatarrJr+rKsconsole_scripts gui_scriptsZ script_dirscriptoptionsr7r7r8installsF                #    "                                z Wheel.installcCsNtdkrJtjjttddtjdd}t|atS)Nz dylib-cachez%s.%sr$) cacher>rNr5rrrQ version_infor)rCrr7r7r8_get_dylib_caches   zWheel._get_dylib_cachecCstjj|j|j}d|j|jf}d|}tj|d}tj d}g}t |ds}yW|j |A}||} t j | } |j} | j|} tjj| j| } tjj| stj| x| jD]\}}tjj| t|}tjj|sEd}nQtj|j}tjj|}|j|}tj|j}||k}|r|j|| |j||fqWWdQRXWntk rYnXWdQRX|S)Nz%s-%sz %s.dist-infoZ EXTENSIONSzutf-8r{T)r>rNr5rkrnrlrmrrrrrrrrA prefix_to_dirrrmakedirsr rrystatst_mtimedatetime fromtimestampgetinfo date_timeextractr4r)rCrFrrrrrOrrrrGr?rZ cache_baserlrdestrJZ file_timerwZ wheel_timer7r7r8_get_extensionss>      "  zWheel._get_extensionscCs t|S)zM Determine if a wheel is compatible with the running system. ) is_compatible)rCr7r7r8rMszWheel.is_compatiblecCsdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr7)rCr7r7r8 is_mountableszWheel.is_mountablecCstjjtjj|j|j}|jsId|}t||jskd|}t||t jkrt j d|nm|rt jj |nt jj d||j}|rtt jkrt jj ttj||dS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)r>rNrur5rkrnrMrrNrQrrr4insertrL_hook meta_pathrH)rCr4rFmsgrGr7r7r8mounts"'       z Wheel.mountcCstjjtjj|j|j}|tjkrItjd|nTtjj ||t j krut j |t j st tj krtj j t dS)Nz%s not in path) r>rNrur5rkrnrQrrrLrPrArQ)rCrFr7r7r8unmounts'  z Wheel.unmountc'Cstjj|j|j}d|j|jf}d|}d|}tj|t}tj|d}tj|d}t j d}t |d} | j |} || } t | } WdQRX| djd d } td d | D}i}| j |E}td |,}x"|D]}|d}|||.rrr:z..zinvalid entry in wheel: %rr$zsize mismatch for %srzdigest mismatch for %s)r>rNr5rkrnrlrmrrrrrrrrsrrrrr rrrrrrr)rCrFrrrr'r(r)rrr*rrrrrrr+rrr/rr0r1r2rr'rr7r7r8rvsV          #   z Wheel.verifycKsdd}dd}tjj|j|j}d|j|jf}d|}tj|d} t} t |d} i} x| j D]} | j}t |t r|}n|j d }|| krqd |krtd || j| | tjj| t|}|| |.get_versionc Ss%d}yt|}|jd}|dkr=d|}nhdd||ddjdD}|dd7.update_version..rr(z%s+%scss|]}t|VqdS)N)r)r}r~r7r7r8 nsz7Wheel.update..update_version..z0Cannot update non-compliant (PEP-440) version %rrNlegacyzVersion updated from %r to %rr) rrrsr5rrrr rmrrr)rmrNupdatedrKr~r6ZmdrXr7r7r8update_versioncs(   *$     z$Wheel.update..update_versionz%s-%sz %s.dist-inforr{zutf-8z..zinvalid entry in wheel: %rNrz.whlrz wheel-update-dirzNot a directory: %r)r>rNr5rkrnrlrmrrrrrr rrrJrr mkstempcloserrr rrr#copyfile)rCmodifierdest_dirr&rVrZrFrrr)r.rrUr/rr0rNZoriginal_versionr'modifiedcurrent_versionfdnewpathrrrwr7r7r8rEHsX            z Wheel.update)rr)rZr[r\__doc__rrrDpropertyrnryrzrrrrwrrrrrrrr>rArLrMrNrSrTrvrEr7r7r7r8r]s4 )     t  "   8r]cCsbtg}td}xGttjddddD](}|jdj|t|gq1Wg}xItjD];\}}}|j drp|j|j dddqpW|j t dkr|j dt |jdg}tg}tjdkrtjd t}|r|j\} }}} t|}| g} | dkr^| jd | dkrw| jd| dkr| jd| dkr| jd| dkr| jdxZ|dkrx=| D]5} d| ||| f} | tkr|j| qW|d8}qWxH|D]@}x7|D]/} |jdjt|df|| fq3Wq&Wxtt|D]f\}}|jdjt|fddf|dkrw|jdjt|dfddfqwWxtt|D]f\}}|jdjd|fddf|dkr|jdjd|dfddfqWt|S)zG Return (pyver, abi, arch) tuples compatible with this Python. rrr1z.abir(r$r_darwinz(\w+)_(\d+)_(\d+)_(\w+)$i386ppcfatx86_64Zfat3ppc64fat64intel universalz %s_%s_%s_%sr`r%rr)rhri)rhrirk)rlrk)rhrk)rhrkrnrirl)r2rangerQr@r4r5rrT get_suffixesrrssortrrOrplatformrerqrr| IMP_PREFIXrset)versionsmajorminorabisrr'rOarchesr-rlrimatchesrqr9rhr~rmr7r7r8compatible_tagss`  $&!                    1% -% -r}cCst|tst|}d}|dkr3t}xK|D]C\}}}||jkr:||jkr:||jkr:d}Pq:W|S)NFT)rr]COMPATIBLE_TAGSrgrhri)wheelrzrOverrhrir7r7r8rMs  -rM)U __future__rrrrFdistutils.util distutilsemailrrrTrloggingr>rrtr#rQr rr1rrcompatrrr r r Zdatabaser rr rrrutilrrrrrrrrrrmrr getLoggerrZrr?hasattrrursrr3r2r@rfr get_platformr=rrr9compile IGNORECASEVERBOSErtrprrrrr?robjectr@rPr]r}r~rMr7r7r7r8s               ("@     '  # ' > PK!Yj4XX"__pycache__/version.cpython-35.pycnu[ Re_[@sdZddlZddlZddlmZddlmZdddd d d d d gZeje Z Gdd d e Z Gddde ZGddde ZejdZddZeZGdddeZddZGdddeZejddfejddfejddfejdd fejd!d"fejd#d"fejd$d%fejd&d'fejd(d)fejd*d+ff Zejd,dfejd-dfejd.d%fejd$d%fejd/dffZejd0Zd1d2Zd3d4Zejd5ejZd6d7d8d7d9d:d;d7d<d=ddd%diZd>d?ZGd@ddeZ GdAd d eZ!ejdBejZ"dCdDZ#dEdFZ$GdGd d eZ%GdHd d eZ&GdIdJdJe Z'dKe'eeedLe'ee!dMdNdOe'e$e&eiZ(e(dKe(dPtt|dksVtdS)Nr)strip_stringparse_parts isinstancetupleAssertionErrorlen)selfspartsrrr__init__szVersion.__init__cCstddS)Nzplease implement in a subclass)NotImplementedError)rrrrrr%sz Version.parsecCs2t|t|kr.td||fdS)Nzcannot compare %r and %r)type TypeError)rotherrrr_check_compatible(szVersion._check_compatiblecCs|j||j|jkS)N)r$r)rr#rrr__eq__,s zVersion.__eq__cCs|j| S)N)r%)rr#rrr__ne__0szVersion.__ne__cCs|j||j|jkS)N)r$r)rr#rrr__lt__3s zVersion.__lt__cCs|j|p|j| S)N)r'r%)rr#rrr__gt__7szVersion.__gt__cCs|j|p|j|S)N)r'r%)rr#rrr__le__:szVersion.__le__cCs|j|p|j|S)N)r(r%)rr#rrr__ge__=szVersion.__ge__cCs t|jS)N)hashr)rrrr__hash__AszVersion.__hash__cCsd|jj|jfS)Nz%s('%s')) __class__r r)rrrr__repr__DszVersion.__repr__cCs|jS)N)r)rrrr__str__GszVersion.__str__cCstddS)NzPlease implement in subclasses.)r )rrrr is_prereleaseJszVersion.is_prereleaseN)r rrrrr$r%r&r'r(r)r*r,r.r/propertyr0rrrrrs             rc@seZdZdZdddddddddd d dd d dd ddddddddiZddZddZddZeddZ ddZ ddZ dd Z d!d"Z d#d$Zd%d&ZdS)'MatcherNTszMatcher.>cCs ||kS)Nr)r4r5r6rrrr7Usz<=cCs||kp||kS)Nr)r4r5r6rrrr7Vsz>=cCs||kp||kS)Nr)r4r5r6rrrr7Wsz==cCs ||kS)Nr)r4r5r6rrrr7Xsz===cCs ||kS)Nr)r4r5r6rrrr7Ysz~=cCs||kp||kS)Nr)r4r5r6rrrr7[sz!=cCs ||kS)Nr)r4r5r6rrrr7\scCs t|S)N)r)rrrrrraszMatcher.parse_requirementcCs+|jdkrtd|j|_}|j|}|sStd||j|_|jj|_g}|jrx|jD]\}}|j dr|d krtd||dd d}}|j|n|j|d }}|j |||fqWt ||_ dS) NzPlease specify a version classz Not valid: %rz.*==!=z#'.*' not allowed for %r constraintsTF)r9r:) version_class ValueErrorrrrnamelowerkey constraintsendswithappendrr)rrrZclistopZvnprefixrrrrds(     zMatcher.__init__cCst|tr|j|}x|jD]}\}}}|jj|}t|trgt||}|sd||jjf}t |||||s(dSq(WdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z%r not implemented for %sFT) rrr=r _operatorsgetgetattrr-r r )rversionoperator constraintrGfmsgrrrmatchs z Matcher.matchcCsGd}t|jdkrC|jdddkrC|jdd}|S)Nrr=====)rQrR)rr)rresultrrr exact_versions,zMatcher.exact_versioncCsDt|t|ks*|j|jkr@td||fdS)Nzcannot compare %s and %s)r!r?r")rr#rrrr$s*zMatcher._check_compatiblecCs/|j||j|jko.|j|jkS)N)r$rAr)rr#rrrr%s zMatcher.__eq__cCs|j| S)N)r%)rr#rrrr&szMatcher.__ne__cCst|jt|jS)N)r+rAr)rrrrr,szMatcher.__hash__cCsd|jj|jfS)Nz%s(%r))r-r r)rrrrr.szMatcher.__repr__cCs|jS)N)r)rrrrr/szMatcher.__str__)r rrr=rHrrrPr1rTr$r%r&r,r.r/rrrrr2Os&                r2zk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c CsQ|j}tj|}|s1td||j}tdd|djdD}x6t|dkr|ddkr|dd}qfW|dsd}nt|d}|dd}|d d }|d d }|d }|dkrf}n|dt|df}|dkr=f}n|dt|df}|dkrlf}n|dt|df}|dkrf}nfg} xQ|jdD]@} | j rdt| f} n d| f} | j | qWt| }|s#| r|rd}nd}|s/d}|s;d}||||||fS)NzNot a valid version: %scss|]}t|VqdS)N)int).0r4rrr sz_pep_440_key..r.r az_finalrd)NN)NN)NNrd)r`rd)ra)rb)rc) rPEP440_VERSION_RErPr groupsrsplitrrUisdigitrD) rmrfnumsepochprepostdevlocalrpartrrr _pep_440_keysT  &%                rqc@sOeZdZdZddZedddddgZed d Zd S) raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCsTt|}tj|}|j}tdd|djdD|_|S)Ncss|]}t|VqdS)N)rU)rVr4rrrrWsz*NormalizedVersion.parse..rrX)_normalized_keyrerPrfrrg_release_clause)rrrSrirfrrrr s   )zNormalizedVersion.parser`br5rcrncs tfddjDS)Nc3s(|]}|r|djkVqdS)rN) PREREL_TAGS)rVt)rrrrWsz2NormalizedVersion.is_prerelease..)anyr)rr)rrr0szNormalizedVersion.is_prereleaseN) r rrrrsetrvr1r0rrrrrs  cCsUt|}t|}||kr(dS|j|s;dSt|}||dkS)NTFrX)str startswithr)xynrrr _match_prefixs    rc@seZdZeZddddddddd d d d d dddiZddZddZddZddZ ddZ ddZ ddZ dd Z d!d"Zd#S)$rz~=_match_compatibler3 _match_ltr8 _match_gtz<= _match_lez>= _match_gez== _match_eqz===_match_arbitraryz!= _match_necCsu|r"d|ko|jd}n|jd o:|jd}|rk|jjddd}|j|}||fS)N+rrrdrdrd)rrrgr=)rrKrMrGZ strip_localrrrr _adjust_local6szNormalizedMatcher._adjust_localcCs^|j|||\}}||kr+dS|j}djdd|D}t|| S)NFrXcSsg|]}t|qSr)rz)rVirrr Is z/NormalizedMatcher._match_lt..)rrsjoinr)rrKrMrGrelease_clausepfxrrrrDs   zNormalizedMatcher._match_ltcCs^|j|||\}}||kr+dS|j}djdd|D}t|| S)NFrXcSsg|]}t|qSr)rz)rVrrrrrQs z/NormalizedMatcher._match_gt..)rrsrr)rrKrMrGrrrrrrLs   zNormalizedMatcher._match_gtcCs%|j|||\}}||kS)N)r)rrKrMrGrrrrTszNormalizedMatcher._match_lecCs%|j|||\}}||kS)N)r)rrKrMrGrrrrXszNormalizedMatcher._match_gecCsC|j|||\}}|s0||k}nt||}|S)N)rr)rrKrMrGrSrrrr\s zNormalizedMatcher._match_eqcCst|t|kS)N)rz)rrKrMrGrrrrdsz"NormalizedMatcher._match_arbitrarycCsD|j|||\}}|s0||k}nt|| }|S)N)rr)rrKrMrGrSrrrrgs zNormalizedMatcher._match_necCs|j|||\}}||kr+dS||kr;dS|j}t|dkrf|dd}djdd|D}t||S)NTFrrXcSsg|]}t|qSr)rz)rVrrrrrzs z7NormalizedMatcher._match_compatible..rd)rrsrrr)rrKrMrGrrrrrros   z#NormalizedMatcher._match_compatibleN)r rrrr=rHrrrrrrrrrrrrrr's$          z[.+-]$z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$z\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}rXz\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cCs|jj}x&tD]\}}|j||}qW|sGd}tj|}|skd}|}n|jdjd}dd|D}x#t|dkr|j dqWt|dkr||j d}nJdj dd|ddD||j d}|dd}dj d d|D}|j}|rx&t D]\}}|j||}qgW|s|}n&d |krd nd }|||}t |sd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rrXcSsg|]}t|qSr)rU)rVrrrrrs z-_suggest_semantic_version..NcSsg|]}t|qSr)rz)rVrrrrrs cSsg|]}t|qSr)rz)rVrrrrrs rn-r)rr@ _REPLACEMENTSsub_NUMERIC_PREFIXrPrfrgrrDendr_SUFFIX_REPLACEMENTS is_semver)rrSpatreplrirGsuffixseprrr_suggest_semantic_versions: :   rcCsyt||SWntk r&YnX|j}x&dBD]\}}|j||}q:Wtjdd|}tjdd|}tjdd|}tjdd|}tjdd|}|jdr|d d!}tjd"d|}tjd#d$|}tjd%d&|}tjd'd|}tjd(d)|}tjd*d)|}tjd+d |}tjd,d-|}tjd.d&|}tjd/d0|}tjd1d2|}yt|Wntk rd!}YnX|S)CaSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. -alphar`-betartrrrur5-finalr-pre-release.release-stablerrXrb .finalrczpre$Zpre0zdev$Zdev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?z\1r4rNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$z\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1rr`rrtrr`rrtrur5rrrr5rrrrrrrrXrbrXrrrrrcr)rrrrrrrrrrrrrrr)rrr r@replacererr{)rrsorigrrrr_suggest_normalized_versionsH      rz([a-z]+|\d+|[\.-])rlr5previewrzfinal-rurn@cCsdd}g}x||D]|}|jdr|dkrgx$|rf|ddkrf|jqCWx$|r|d dkr|jqjW|j|qWt|S) NcSsg}xtj|jD]m}tj||}|rd|ddko[dknrr|jd}n d|}|j|qW|jd|S)N0r9*z*final) _VERSION_PARTrgr@_VERSION_REPLACErIzfillrD)rrSr6rrr get_partsCs&  z_legacy_key..get_partsrz*finalrz*final-00000000rdrd)r{poprDr)rrrSr6rrr _legacy_keyBs  rc@s.eZdZddZeddZdS)rcCs t|S)N)r)rrrrrr]szLegacyVersion.parsecCsOd}xB|jD]7}t|tr|jdr|dkrd}PqW|S)NFrz*finalT)rrrr{)rrSr|rrrr0`s zLegacyVersion.is_prereleaseN)r rrrr1r0rrrrr\s  c@sJeZdZeZeejZded.make_tuple..)rgr)rZabsentrSrrrr make_tuples   z!_semantic_key..make_tuplecSsg|]}t|qSr)rU)rVrrrrrs z!_semantic_key..r|r)rr rf) rrrirfmajorminorpatchrlbuildrrr _semantic_keys   &'rc@s.eZdZddZeddZdS)r cCs t|S)N)r)rrrrrrszSemanticVersion.parsecCs|jdddkS)Nrrr)r)rrrrr0szSemanticVersion.is_prereleaseN)r rrrr1r0rrrrr s  c@seZdZeZdS)r N)r rrr r=rrrrr s c@sOeZdZdddZddZddZdd Zd d ZdS) VersionSchemeNcCs||_||_||_dS)N)rAmatcher suggester)rrArrrrrrs  zVersionScheme.__init__c Cs9y|jj|d}Wntk r4d}YnX|S)NTF)rr=r )rrrSrrris_valid_versions    zVersionScheme.is_valid_versionc Cs6y|j|d}Wntk r1d}YnX|S)NTF)rr )rrrSrrris_valid_matchers     zVersionScheme.is_valid_matchercCs|jd|S)z: Used for processing some metadata fields zdummy_name (%s))r)rrrrris_valid_constraint_listsz&VersionScheme.is_valid_constraint_listcCs+|jdkrd}n|j|}|S)N)r)rrrSrrrsuggests zVersionScheme.suggest)r rrrrrrrrrrrrs    r normalizedlegacycCs|S)Nr)rrrrrr7sr7ZsemanticdefaultcCs$|tkrtd|t|S)Nzunknown scheme name: %r)_SCHEMESr>)r?rrrr s )*rloggingrcompatrutilr__all__ getLoggerr rr>r objectrr2rrerqrrrrrrrrrrIrrrrrrrrr r rrr rrrr s|   1d =$ W  . r       $   PK!Rikk!__pycache__/compat.cpython-35.pycnu[ Re@s ddlmZddlZddlZddlZyddlZWnek r^dZYnXejddkrddlmZe fZ e Z ddl mZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#d d Zddl$Z$dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-erdd l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;ddZ<nddl=mZe>fZ e>Z ddl=m?ZddlZddlZddlZddl@mZmZmZm<Z<mZmZmZmZm#Z#ddlAm&Z&mZm%Z%m Z m!Z!m)Z)m*Z*m+Z+m,Z,m-Z-erdd lAm.Z.ddlBm(Z(m'Z'm"Z"ddlCjDZ/ddlAjEZ$ddlFjDZ0ddl2Z2ddlGm3Z3ddlHjIZ4eJZ5ddl6m:Z:e8Z8yddlmKZKmLZLWnCek rGdddeMZLdddZNddZKYnXyddl mOZPWn(ek r+Gd d!d!eQZPYnXydd"lmRZRWn.ek rpejSejTBdd#d$ZRYnXdd%lUmVZWeXeWd&reWZVn<dd'lUmYZZGd(d)d)eZZYGd*d+d+eWZVydd,l[m\Z\Wnek r d-d.Z\YnXyddl]Z]Wn"ek r>dd/lm]Z]YnXy e^Z^Wn.e_k rydd0l`maZad1d2Z^YnXyejbZbejcZcWnWedk rejepd3Zfefd4krd5Zgnd6Zgd7d8Zbd9d:ZcYnXydd;lhmiZiWn[ek r[dd<ljmkZkmlZlddlZejmd=Znd>d?Zod@dAZiYnXyddBlpmqZqWn"ek rddBlrmqZqYnXejddCddkre3jsZsnddElpmsZsyddFltmuZuWnpek rSddGltmvZvyddHlwmxZyWn!ek r8dIdJdKZyYnXGdLdMdMevZuYnXyddNlzm{Z{WnJek ryddNl|m{Z{Wn!ek rddOdPZ{YnXYnXyddQltm}Z}Wnek rayddRl~mZWn"ek rddRlmZYnXy ddSlmZmZmZWnek rFYnXGdTdUdUeZ}YnXyddVlmZmZWnek r ejmdWejZdXdYZGdZd[d[eZdd\d]ZGd^d_d_eZGd`dadaeZGdbdcdceQZYnXdS)e)absolute_importN)StringIO)FileType)shutil)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCs(t|tr|jd}t|S)Nzutf-8) isinstanceunicodeencode_quote)sr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/compat.pyrsr) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalsecCsVtdkr'ddl}|jdatj|}|rL|jddSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz ^(.*)@(.*)$r) _userprogrecompilematchgroup)hostr*r,rrr splituser4s  r/) TextIOWrapper) rr r r/rrr r r) rr rrrrr r!r"r#)rrr) filterfalse)match_hostnameCertificateErrorc@seZdZdS)r3N)__name__ __module__ __qualname__rrrrr3^s r3c CsVg}|sdS|jd}|d|dd}}|jd}||krktdt||s|j|jkS|dkr|jdnY|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)splitcountr3reprlowerappend startswithr*escapereplacer+join IGNORECASEr,) dnhostname max_wildcardspatspartsleftmost remainder wildcardsfragpatrrr_dnsname_matchbs(  " &rMcCsO|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 ||d fn 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. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDsubjectAltNameDNSNsubject commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrMr=lenr3rAmapr;)certrDdnsnamessankeyvaluesubrrrr2s.   %r2)SimpleNamespacec@s"eZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|jj|dS)N)__dict__update)selfkwargsrrr__init__szContainer.__init__N)r4r5r6__doc__rbrrrrr]s r])whichc sdd}tjjr5||r1SdS|dkrYtjjdtj}|scdS|jtj}tj dkrtj |kr|j dtj tjjddjtj}t fd d |Drg}qfd d |D}n g}t }xr|D]j}tjj|}||kr'|j|x6|D].} tjj|| } || |r_| Sq_Wq'WdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cSs5tjj|o4tj||o4tjj| S)N)ospathexistsaccessisdir)fnmoderrr _access_checks$zwhich.._access_checkNPATHwin32rPATHEXTc3s*|] }jj|jVqdS)N)r<endswith).0ext)cmdrr szwhich..csg|]}|qSrr)rrrs)rtrr s zwhich..)rerfdirnameenvironrSdefpathr9pathsepsysplatformcurdirinsertanysetnormcaseaddrA) rtrkrfrlpathextfilesseendirnormdirthefilenamer)rtrrds8  !        rd)ZipFile __enter__) ZipExtFilec@s4eZdZddZddZddZdS)rcCs|jj|jdS)N)r^r_)r`baserrrrbszZipExtFile.__init__cCs|S)Nr)r`rrrrszZipExtFile.__enter__cGs|jdS)N)close)r`exc_inforrr__exit__szZipExtFile.__exit__N)r4r5r6rbrrrrrrrs   rc@s4eZdZddZddZddZdS)rcCs|S)Nr)r`rrrr"szZipFile.__enter__cGs|jdS)N)r)r`rrrrr%szZipFile.__exit__cOstj|||}t|S)N) BaseZipFileopenr)r`argsrarrrrr)sz ZipFile.openN)r4r5r6rrrrrrrr!s   r)python_implementationcCs@dtjkrdStjdkr&dStjjdr<dSdS)z6Return a string identifying the Python implementation.PyPyjavaJython IronPythonCPython)r{versionrerr>rrrrr0sr) sysconfig)CallablecCs t|tS)N)rr)objrrrcallableDsrzutf-8mbcsstrictsurrogateescapecCsOt|tr|St|tr2|jttStdt|jdS)Nzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper4)filenamerrrfsencodeXs rcCsOt|tr|St|tr2|jttStdt|jdS)Nzexpect bytes or str, not %s) rrrdecoderrrrr4)rrrrfsdecodeas r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsd|ddjjdd}|dks=|jdrAdS|d ks\|jdr`dS|S)z(Imitates get_normal_name in tokenizer.c.N _-zutf-8zutf-8-latin-1 iso-8859-1 iso-latin-1latin-1- iso-8859-1- iso-latin-1-)rrr)rrr)r<r@r>)orig_encencrrr_get_normal_namers" rc syjjWntk r*dYnXdd}d}fdd}fdd}|}|jtrd|d d}d }|s|gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFzutf-8c s(y SWntk r#dSYnXdS)N) StopIterationr)readlinerr read_or_stops  z%detect_encoding..read_or_stopcs0y|jd}WnBtk rWd}dk rGdj|}t|YnXtj|}|sqdSt|d}yt|}WnItk rdkrd|}ndj|}t|YnXr,|j dkr"dkrd}ndj}t||d 7}|S) Nzutf-8z'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr)line line_stringmsgmatchesencodingcodec) bom_foundrrr find_cookies6           z$detect_encoding..find_cookieTrz utf-8-sig)__self__rAttributeErrorr>r)rrdefaultrrfirstsecondr)rrrrr}s4  &       r)r?r()unescape)ChainMap)MutableMapping)recursive_reprz...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csptfdd}td|_td|_td|_tdi|_|S)Nc sWt|tf}|kr%Sj|z|}Wdj|X|S)N)id get_identrdiscard)r`rYresult) fillvalue repr_running user_functionrrwrappers  z=_recursive_repr..decorating_function..wrapperr5rcr4__annotations__)rgetattrr5rcr4r)rr)r)rrrdecorating_functions  z,_recursive_repr..decorating_functionr)rrr)rr_recursive_reprsrc@s eZdZdZddZddZddZdd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)'ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|pig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)r`rrrrrbszChainMap.__init__cCst|dS)N)KeyError)r`rYrrr __missing__szChainMap.__missing__c CsBx2|jD]'}y ||SWq tk r0Yq Xq W|j|S)N)rrr)r`rYmappingrrr __getitem__s    zChainMap.__getitem__NcCs||kr||S|S)Nr)r`rYrrrrrS%sz ChainMap.getcCsttj|jS)N)rTrunionr)r`rrr__len__(szChainMap.__len__cCsttj|jS)N)iterrrr)r`rrr__iter__+szChainMap.__iter__cs tfdd|jDS)Nc3s|]}|kVqdS)Nr)rrm)rYrrru/sz(ChainMap.__contains__..)rr)r`rYr)rYr __contains__.szChainMap.__contains__cCs t|jS)N)rr)r`rrr__bool__1szChainMap.__bool__cCs%dj|djtt|jS)Nz{0.__class__.__name__}({1})z, )rrArUr;r)r`rrr__repr__4szChainMap.__repr__cGs|tj||S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr9szChainMap.fromkeyscCs*|j|jdj|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopy)r`rrrr>sz ChainMap.copycCs|ji|jS)z;New ChainMap with a new dict followed by all previous maps.)rr)r`rrr new_childDszChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rN)rr)r`rrrparentsHszChainMap.parentscCs||jd| od[i]=yrrN)r r )r`rYrZZ dict_setitemrlastrrrrs    &zOrderedDict.__setitem__cCs@||||jj|\}}}||d<||d del od[y]rrN)r r)r`rYZ dict_delitem link_prev link_nextrrrrs  zOrderedDict.__delitem__ccs=|j}|d}x#||k r8|dV|d}qWdS)zod.__iter__() <==> iter(od)rr(N)r )r`rcurrrrrrs    zOrderedDict.__iter__ccs=|j}|d}x#||k r8|dV|d}qWdS)z#od.__reversed__() <==> reversed(od)rr(N)r )r`rrrrr __reversed__s    zOrderedDict.__reversed__c CsyZx$|jjD]}|dd=qW|j}||dg|dd<|jjWntk rnYnXtj|dS)z.od.clear() -> None. Remove all items from od.N)r  itervaluesr rrr)r`noderrrrrs  zOrderedDict.clearTcCs|std|j}|rL|d}|d}||d<||d (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrrr()rr r rr)r`rrlinkrrrYrZrrrrs             zOrderedDict.popitemcCs t|S)zod.keys() -> list of keys in od)r)r`rrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|]}|qSrr)rrrY)r`rrrvs z&OrderedDict.values..r)r`r)r`rvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcs g|]}||fqSrr)rrrY)r`rrrvs z%OrderedDict.items..r)r`r)r`ritemsszOrderedDict.itemscCs t|S)z0od.iterkeys() -> an iterator over the keys in od)r)r`rrriterkeysszOrderedDict.iterkeysccsx|D]}||VqWdS)z2od.itervalues -> an iterator over the values in odNr)r`krrrrs zOrderedDict.itervaluesccs$x|D]}|||fVqWdS)z=od.iteritems -> an iterator over the (key, value) items in odNr)r`rrrr iteritemss zOrderedDict.iteritemscOs t|dkr.tdt|fn|s@td|d}f}t|dkrl|d}t|trxw|D]}|||| None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v r(z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrrN)rTrrrhasattrrr)rrr`otherrYrZrrrr_s&     zOrderedDict.updatecCs@||kr!||}||=|S||jkr<t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)r`rYrrrrrr*s   zOrderedDict.popNcCs"||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr)r`rYrrrr setdefault7s  zOrderedDict.setdefaultc Cs|s i}t|tf}||kr1dSd|| repr(od)z...rz%s()z%s(%r)N)r _get_identrr4r)r`Z _repr_runningZcall_keyrrrr>s  zOrderedDict.__repr__cs~fddD}tj}x'ttD]}|j|dq;W|rnj|f|fSj|ffS)z%Return state information for picklingcs g|]}||gqSrr)rrr)r`rrrvNs z*OrderedDict.__reduce__..N)varsrrrr)r`r inst_dictrr)r`r __reduce__LszOrderedDict.__reduce__cCs |j|S)z!od.copy() -> a shallow copy of od)r)r`rrrrVszOrderedDict.copycCs(|}x|D]}||| New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrZdrYrrrrZs  zOrderedDict.fromkeyscCsMt|tr=t|t|ko<|j|jkStj||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrTrr__eq__)r`r rrrr(es.zOrderedDict.__eq__cCs ||k S)Nr)r`r rrr__ne__nszOrderedDict.__ne__cCs t|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)r )r`rrrviewkeyssszOrderedDict.viewkeyscCs t|S)z an object providing a view on od's values)r )r`rrr viewvalueswszOrderedDict.viewvaluescCs t|S)zBod.viewitems() -> a set-like object providing a view on od's items)r )r`rrr viewitems{szOrderedDict.viewitems)"r4r5r6rcrbrrrrrrrrrrrrrr_robjectr!rr"rr&rrrr(r)r*r+r,rrrrrs:                   r)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCs)tj|}|s%td|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr,rR)rrrrrr/sr/c@s1eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsktj||}|jj|}||k rg|||[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$rs ext_convertcfg cfg_convertcCst||_||j_dS)N)r1configr2)r`r=rrrrbszBaseConfigurator.__init__c Cs|jd}|jd}yz|j|}x`|D]X}|d|7}yt||}Wq7tk r|j|t||}Yq7Xq7W|SWn]tk rtjdd\}}td||f}|||_ |_ |YnXdS)zl Resolve strings to objects using standard import and attribute syntax. r7rrNzCannot resolve %r: %s) r9rimporterrr ImportErrorr{rrR __cause__ __traceback__) r`rrusedfoundrKetbvrrrresolves"    zBaseConfigurator.resolvecCs |j|S)z*Default converter for the ext:// protocol.)rG)r`rZrrrr: szBaseConfigurator.ext_convertc CsY|}|jj|}|dkr7td|n||jd}|j|jd}x|rT|jj|}|r||jd}n|jj|}|r|jd}|jj|s||}n9yt |}||}Wnt k r||}YnX|r;||jd}qgtd||fqgW|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr,rRendr=groups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)r`rZrestrr'r7nrrrr<s2     zBaseConfigurator.cfg_convertcCs&t|t r7t|tr7t|}||_nt|t rnt|trnt|}||_nt|t rt|trt|}||_n}t|tr"|j j |}|r"|j }|d}|j j |d}|r"|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr)rr1rr2r4rr5r9 string_typesCONVERT_PATTERNr, groupdictvalue_convertersrSr)r`rZrr'rQ converterrrrrr32s*          zBaseConfigurator.convertcsjd}t|s*|j|}jdd}tfddD}||}|rx*|jD]\}}t|||qzW|S)z1Configure an object with a user-supplied factory.z()r7Ncs,g|]"}t|r||fqSr)r/)rrr)r=rrrvUs z5BaseConfigurator.configure_custom..)rrrGrrsetattr)r`r=rpropsrarrrZr)r=rconfigure_customNs  z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrr9)r`rZrrras_tuple\s zBaseConfigurator.as_tupleN)r4r5r6rcr*r+rSrHrKrLrMrU staticmethod __import__r>rbrGr:r<r3rYrZrrrrr.s       "  r.)rr) __future__rrer*r{sslr? version_infor basestringrRrrtypesr file_type __builtin__builtins ConfigParser configparserZ _backportrrr r r r urllibr rrrrrrrurllib2rrrrrr r!r"r#r$httplib xmlrpclibQueuequeuer%htmlentitydefs raw_input itertoolsr&filterr'r1r)r/iostrr0 urllib.parseurllib.request urllib.error http.clientclientrequest xmlrpc.client html.parser html.entitiesentitiesinputr2r3rRrMr\r]r-rdF_OKX_OKzipfilerrrrZBaseZipExtFiler|rrr NameErrorcollections.abcrrrrgetfilesystemencodingrrtokenizercodecsrrr+rrhtmlr?cgir collectionsrrreprlibrrimportlib.utilrimprthreadrr# dummy_thread_abcollr r r rlogging.configr.r/Ir0r1rrr4r9r5rrrrs*        (4  @         @F  2+  !A                  [   b           PK!sxpnsns#__pycache__/metadata.cpython-35.pycnu[ Re2@sBdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZejeZGd d d e ZGd dde ZGddde ZGddde ZdddgZdZ dZ!ej"dZ#ej"dZ$ddddddd d!d"d#d$f Z%ddddd%ddd d!d"d#d$d&d'd(d)d*fZ&d(d)d*d&d'fZ'ddddd%ddd d!d"d#d+d,d$d&d'd-d.d/d0d1d2fZ(d/d0d1d-d2d+d,d.fZ)ddddd%ddd d!d"d#d+d,d$d&d'd-d.d/d0d1d2d3d4d5d6d7fZ*d3d7d4d5d6fZ+e*d8d*d)fZ,d8fZ-e.Z/e/j0e%e/j0e&e/j0e(e/j0e*e/j0e,ej"d9Z1d:d;Z2d<d=Z3d>d?e/DZ4d@d?e4j5DZ6d0d-d/fZ7d1fZ8dfZ9dd&d(d*d)d-d/d0d2d.d%d5d7d6fZ:d.fZ;d fZ<d"d+ddfZ=e>Z?ej"dAZ@dBdCdDZAGdEdFdFe>ZBdGZCdHZDdIZEGdJdde>ZFdS)KzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and withdrawn 2.0). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REc@seZdZdZdS)MetadataMissingErrorzA required metadata is missingN)__name__ __module__ __qualname____doc__rr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/metadata.pyrs rc@seZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.N)rrrrrrrrr s rc@seZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.N)rrrrrrrrr$s rc@seZdZdZdS)MetadataInvalidErrorzA metadata value is invalidN)rrrrrrrrr(s rMetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONzutf-8z1.1z \|z zMetadata-VersionNameVersionPlatformSummary DescriptionKeywordsz Home-pageAuthorz Author-emailLicensezSupported-Platform Classifierz Download-URL ObsoletesProvidesRequiresZ MaintainerzMaintainer-emailzObsoletes-Distz Project-URLz Provides-Distz Requires-DistzRequires-PythonzRequires-ExternalzPrivate-Versionz Obsoleted-ByzSetup-Requires-Dist ExtensionzProvides-ExtrazDescription-Content-Typez"extra\s*==\s*("([^"]+)"|'([^']+)')cCsd|dkrtS|dkr tS|dkr0tS|dkrDttS|dkrTtSt|dS)Nz1.0z1.1z1.21.32.1z2.0)r)r*) _241_FIELDS _314_FIELDS _345_FIELDS _566_FIELDS _426_FIELDSr)versionrrr_version2fieldlistps     r1c Csdd}g}x?|jD]1\}}|gddfkrCq|j|qWddddd d g}xX|D]P}|tkrd|kr|jdtjd ||tkrd|kr|jdtjd ||tkrd|kr|jdtjd ||tkrMd|krM|jdtjd||tkrd |kr|dkr|jd tjd||t krsd |krs|jd tjd|qsWt |dkr|dSt |dkrtjd|t dd|ko'||t }d|koB||t }d |ko]||t}d |kox||t} t|t|t|t| dkrt d| r| r| r| rt|krtS|rdS|rdS|rd Sd S)z5Detect the best version depending on the fields used.cSs%x|D]}||krdSqWdS)NTFr)keysmarkersmarkerrrr _has_markers  z"_best_version.._has_markerUNKNOWNNz1.0z1.1z1.2z1.3z2.0z2.1zRemoved 1.0 due to %szRemoved 1.1 due to %szRemoved 1.2 due to %szRemoved 1.3 due to %sr zRemoved 2.1 due to %szRemoved 2.0 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.0/2.1 fields)itemsappendr+removeloggerdebugr,r-r.r/lenr _314_MARKERS _345_MARKERS _566_MARKERS _426_MARKERSintr) fieldsr5r2keyvalueZpossible_versionsZis_1_1Zis_1_2Zis_2_1Zis_2_0rrr _best_version~s`          0  rEcCs+i|]!}||jjddqS)-_)lowerreplace).0namerrr s rLcCsi|]\}}||qSrr)rJattrfieldrrrrLs z[^A-Za-z0-9.]+FcCsD|r6tjd|}tjd|jdd}d||fS)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.rF .z%s-%s) _FILESAFEsubrI)rKr0Z for_filenamerrr_get_name_and_versionsrSc@seZdZdZddddddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZdddZddZdd Zd!d"Zd#d$Zdd%d&Zdd'd(Zdd)d*Zd+d,Zed-d.Zdd/d0Zdd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!dS)?LegacyMetadataaoThe legacy metadata of a release. Supports versions 1.0, 1.1, 1.2, 2.0 and 1.3/2.1 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcCs|||gjddkr*tdi|_g|_d|_||_|dk rj|j|n?|dk r|j|n#|dk r|j||j dS)Nz'path, fileobj and mapping are exclusive) count TypeError_fieldsZrequires_filesZ _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrZrrr__init__s         zLegacyMetadata.__init__cCst|j|jd_s z,LegacyMetadata.read_file..r6r )rrYrorqget_all_LISTTUPLEFIELDSrh get_payload)r_ZfileobmsgrNvaluesrDbodyrrrr\Rs      zLegacyMetadata.read_filec Cs>tj|ddd}z|j||Wd|jXdS)z&Write the metadata fields to filepath.wrzutf-8N)rr write_filer)r_r skip_unknownrrrrrdnszLegacyMetadata.writecCs|jx t|dD]}|j|}|rQ|dgdgfkrQq|tkr||j||dj|q|tkr|dkr|jd kr|jdd}n|jdd }|g}|t krd d |D}x!|D]}|j|||qWqWd S)z0Write the PKG-INFO format data to a file object.zMetadata-Versionr6rr 1.01.1rvz z |cSsg|]}dj|qS)r)join)rJrDrrrrs z-LegacyMetadata.write_file..N)rr) r^r1rfrrrerrqrwrIr)r_ fileobjectrrNrrDrrrrvs$       zLegacyMetadata.write_filec sfdd}|sn^t|drUxL|jD]}||||q7Wn$x!|D]\}}|||q\W|rx'|jD]\}}|||qWdS)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs/|tkr+|r+jj||dS)N)rprhrj)rCrD)r_rr_setsz#LegacyMetadata.update.._setr2N)hasattrr2r7)r_otherkwargsrkvr)r_rr]s zLegacyMetadata.updatecCs|j|}|tks'|dkrtt|ttf rtt|trkdd|jdD}qg}nC|tkrt|ttf rt|tr|g}ng}tj t j r|d}t |j }|tkr@|dk r@x|D]8}|j|jddstjd |||qWn}|tkr|dk r|j|stjd |||n=|tkr|dk r|j|stjd ||||tkr|d kr|j|}||j|.rrN;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r )rjrr isinstancelistrrrrqr: isEnabledForloggingWARNINGr rZ_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrzrY)r_rKrD project_namerZrrrrrhs@          zLegacyMetadata.setcCs|j|}||jkr=|tkr9|j|}|S|tkrZ|j|}|S|tkr|j|}|dkrgSg}xE|D]=}|tkr|j|q|j|d|dfqW|S|tkr |j|}t |t r |j dS|j|S)zGet a metadata field.Nrrr) rjrY_MISSINGrsrrqrr8rrrrr)r_rKrUrDresvalrrrrfs.           zLegacyMetadata.getc sl|jgg}}x'd D]}||kr|j|qW|rr|gkrrddj|}t|x'dD]}||kry|j|qyW|ddkr||fSt|jfd d }xt|ftjft j ffD]_\}}xP|D]H} |j | d } | d k r||  r|jd | | fqWqW||fS)zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are providedrrzmissing required metadata: %sz, Home-pager"zMetadata-Versionz1.2cs5x.|D]&}j|jddsdSqWdS)NrrFT)rr)rDr)rZrrare_valid_constraintss z3LegacyMetadata.check..are_valid_constraintsNzWrong value for '%s': %s)rr)rr") r^r8rrr rZrrrrrrf) r_strictmissingwarningsrMrrrB controllerrNrDr)rZrchecks2           zLegacyMetadata.checkcCs|jt|d}i}xf|D]^}| sC||jkr't|}|dkrj||||.)r^r1rY _FIELD2ATTR)r_Z skip_missingrBdatarlrCrrrtodict s    zLegacyMetadata.todictcCsF|ddkr4x!dD]}||kr||=qW|d|7.)r2)r_r)r_rrIszLegacyMetadata.valuescsfddjDS)Ncs g|]}||fqSrr)rJrC)r_rrrMs z(LegacyMetadata.items..)r2)r_r)r_rr7LszLegacyMetadata.itemscCsd|jj|j|jfS)Nz <%s %s %s>) __class__rrKr0)r_rrr__repr__OszLegacyMetadata.__repr__)"rrrrrcr^rergrirmrnrjrsrzr|r}r~rr[r\rdrr]rhrrfrrrr2rrr7rrrrrrTs>                 ,,    rTz pydist.jsonz metadata.jsonMETADATAc@seZdZdZejdZejdejZe Z ejdZ dZ de Zdfdfd d^iZd Zd Zd effded_fde d`fd e dafiZdbZddddddZedcZdefZdefZddefddefdedededdefd ed!ed"ed#ed$d%efd&ddd dei Z[[d)d*Zdd+d,Zd-d.Zed/d0Z ed1d2Z!e!j"d3d2Z!ddd4d5Z#ed6d7Z$ed8d9Z%e%j"d:d9Z%d;d<Z&d=d>Z'd?d@Z(dAdBZ)ddCddDdfdGd dHdIdJdgdNdhdQdidSd&d'djd%i Z*dTdUZ+dddVdWdXdYZ,dZd[Z-d\d]Z.dS)krz The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z .{1,2047}z2.0z distlib (%s)rKr0summarylegacyzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environmentsrw_legacy_datarZNrUcCs|||gjddkr*tdd|_d|_||_|dk ry|j||||_Wqtk rtd|d||_|jYqXnd}|rt |d}|j }WdQRXn|r|j }|dkrd|j d|j i|_nt |ts6|jd}y)tj||_|j|j|Wn:tk rtd t|d||_|jYnXdS) NrVz'path, fileobj and mapping are exclusiverbrZrbrw generatorzutf-8ra)rWrXrrrZ_validate_mappingrrTvalidaterr[METADATA_VERSION GENERATORrr decodejsonloads ValueErrorr)r_r`rarbrZrfrrrrcs<            zMetadata.__init__licensekeywords run_requiresz Requires-Distbuild_requireszSetup-Requires-Dist dev_requiresZ test_requires meta_requiresextraszProvides-Extramodules namespacesexportscommands classifiersr$ source_url Download-URLMetadata-Versionc Cstj|d}tj|d}||kr||\}}|jr|dkrs|dkrgdn|}q|jj|}q|dkrdn|}|d kr|jj||}qt}|}|jjd} | r|dkr| jd |}nu|dkrE| jd } | r| j||}n?| jd } | sl|jjd } | r| j||}||kr|}nQ||krtj||}n0|jr|jj|}n|jj|}|S) N common_keys mapped_keysrrrrr extensionszpython.commandszpython.detailszpython.exports)rrrrr)object__getattribute__rrfr) r_rCcommonmappedlkmakerresultrDsentineldrrrrsF           zMetadata.__getattribute__cCsf||jkrb|j|\}}|p.|j|krb|j|}|sbtd||fdS)Nz.'%s' is an invalid value for the '%s' property)SYNTAX_VALIDATORSrZmatchr)r_rCrDrZpattern exclusionsmrrr_validate_valueszMetadata._validate_valuecCs|j||tj|d}tj|d}||kr||\}}|jr{|dkrkt||j|             zMetadata.__setattr__cCst|j|jdS)NT)rSrKr0)r_rrrname_and_version#szMetadata.name_and_versioncCsa|jr|jd}n|jjdg}d|j|jf}||kr]|j||S)Nz Provides-Distprovidesz%s (%s))rrrrKr0r8)r_rsrrrr's   zMetadata.providescCs*|jr||jd|D]6}y||}Wqtt fk rd}PYqXqW|rG|||.process_entriesTFzProvides-Extraz Requires-DistzSetup-Requires-Dist)rrrrTLEGACY_MAPPINGr7rrrk IndexErrorrrrrrsorted) r_r rZnmdrrrfoundrZr1Zr2rrr _to_legacys2       zMetadata._to_legacyFTcCs||gjddkr'td|j|r|jrL|j}n |j}|rt|j|d|q|j|d|n|jr|j}n |j}|rt j ||ddddddnAt j |d d )}t j ||ddddddWdQRXdS) Nrz)Exactly one of path and fileobj is neededr ensure_asciiTindentrV sort_keysrzutf-8) rWrrrr%rdrrrrdumprr)r_r`rarrZ legacy_mdrrrrrrds&        zMetadata.writecCs|jr|jj|n|jjdg}d}x-|D]%}d|kr>d|kr>|}Pq>W|dkrd|i}|jd|n*t|dt|B}t||d)rKr0rrrw)r_rKr0rrrrs zMetadata.__repr__)r)r)r)r)rrrZ)rKr0rrr)rN)rN)rrr)rrrr)rrrrrK)rrrrr)rrr)/rrrrrecompileZMETADATA_VERSION_MATCHERIZ NAME_MATCHERrZVERSION_MATCHERZSUMMARY_MATCHERrrrr r rr __slots__rcrhrrZ none_listdictZ none_dictrrrrpropertyrrsetterrrrrrrrr!r%rdrrrrrrrYs       ,         + ' *     2 )Gr __future__rrrrrrr-r rrcompatrrr r3r utilr r r0r r getLoggerrr:rrrr__all__rrr.ryrxr+r,r=r-r>r/r@r.r?rhror]ZEXTRA_REr1rErpr7rrrrrqrrrrrrrQrSrTZMETADATA_FILENAMEZWHEEL_METADATA_FILENAMEZLEGACY_METADATA_FILENAMErrrrr s                                             I             iPK!Pmѣѣ#__pycache__/locators.cpython-35.pycnu[ Re@s0ddlZddlmZddlZddlZddlZddlZddlZyddlZWne k rddl ZYnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#m$Z$m%Z%ddl&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/dd l0m1Z1m2Z2dd l3m4Z4m5Z5ej6e7Z8ej9d Z:ej9d ej;Z<ej9d Z=dZ>dddZ?GdddeZ@GdddeAZBGdddeBZCGdddeBZDGdddeAZEGdddeBZFGdddeBZGGdd d eBZHGd!d"d"eBZIGd#d$d$eBZJeJeHeFd%d&d'd(d)ZKeKjLZLej9d*ZMGd+d,d,eAZNdS)-N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape string_types build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)MetadataMetadataInvalidError) cached_propertyparse_credentials ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.org/pypic CsG|dkrt}t|dd}z|jSWd|dXdS)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. Ntimeoutg@close) DEFAULT_INDEXr list_packages)urlclientr,/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/locators.pyget_all_distribution_names)s  r.c@s0eZdZdZddZeZZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c Csd}x%dD]}||kr ||}Pq W|dkr>dSt|}|jdkrt|j|}t|dr|j||n ||| Clear any errors which may have been logged. N)rb)r9r,r,r- clear_errorsszLocator.clear_errorscCs|jjdS)N)rUclear)r9r,r,r- clear_cacheszLocator.clear_cachecCs|jS)N)_scheme)r9r,r,r- _get_schemeszLocator._get_schemecCs ||_dS)N)rf)r9valuer,r,r- _set_schemeszLocator._set_schemecCstddS)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. z Please implement in the subclassN)NotImplementedError)r9namer,r,r- _get_projects zLocator._get_projectcCstddS)zJ Return all the distribution names known to this locator. z Please implement in the subclassN)rj)r9r,r,r-get_distribution_namesszLocator.get_distribution_namescCsj|jdkr!|j|}nE||jkr@|j|}n&|j|j|}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N)rUrlrc)r9rkr`r,r,r- get_projects  zLocator.get_projectcCst|}tj|j}d}|jd}|j|j}|rctt||j}|j dkd|j k||||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. Tz.whlhttpszpypi.org) r posixpathbasenamepathendswithdownloadable_extensionsr%r$ wheel_tagsr4netloc)r9r*trq compatibleis_wheelZis_downloadabler,r,r- score_urls zLocator.score_urlcCsu|}|rq|j|}|j|}||kr<|}||kr^tjd||ntjd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rzloggerdebug)r9url1url2r`s1s2r,r,r- prefer_urls   zLocator.prefer_urlcCs t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r9filename project_namer,r,r-rszLocator.split_filenamecCsdd}d}t|\}}}}} } | jjdrXtjd|| tj| } | r| j\} } n d\} } |}|r|ddkr|dd}|jdryt |}t ||j stjd |n|dkrd }n||j |}|rd |j d |j d |jdt||||| dfddjdd|jDi}Wqtk r}ztjd|WYdd}~XqXn |j|jstjd|ntj|}}x|jD]}|j|r|dt| }|j||}|s]tjd|nk|\}}}| s|||rd |d |d |dt||||| dfi}|r||d.same_projectNzegg=z %s: version hint in fragment: %rr/z.whlzWheel not compatible: %sTrkversionrr*r2zpython-versionz, cSs/g|]%}djt|ddqS).N)joinlist).0vr,r,r- s z8Locator.convert_url_to_download_info..zinvalid path for wheel: %szNot downloadable: %sz No match for project/version: %sz %s_digest)NNr)rlower startswithr{r| HASHER_HASHmatchgroupsrsr$r%rurkrrrrpyver Exceptionwarningrtrprqlenr)r9r*rrr`r4rvrrparamsqueryfragmalgodigestZorigpathwheelincluderarextrwrkrrr,r,r-convert_url_to_download_infosj            &  z$Locator.convert_url_to_download_infocCsd}d|krJ|d}x+dD]#}||kr#|||f}Pq#W|sx5dD]-}d|}||krW|||f}PqWW|S)z Get a digest from a dictionary by looking at a "digests" dictionary or keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. Ndigestssha256md5z %s_digest)rr)rrr,)r9infor`rrr@r,r,r- _get_digest1s       zLocator._get_digestc Cs|jd}|jd}||kr@||}|j}n!t||d|j}|j}|j||_}|d}||d|<|j|dkr|j|j||_|dj|t j |||_ |||d}t|}|dkr.td|t|j}|j|j|_}tjd|t|j |j |j }t |dkrg}|j } x|D]} | d krqye|j| stjd|| n<|s| | j r|j| ntjd| |j Wqtk rMtjd || YqXqWt |d kryt|d |j}|rtjd ||d} || }|r1|jr|j|_|jdij| t|_i} |jdi} x+|jD] }|| kr| || |= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)rrrz%s did not match %rz%skipping pre-release version %s of %szerror matching %s with %rrr@zsorted list: %s)rrr)rrr"r4rW requirementr{r|typerBrnrkrZ version_classr is_prereleaser]rrsortedr@extrasr\r download_urlsr)r9r prereleasesr`rr4rWversionsslistZvclskrdsdr*r,r,r-locate_sT             $   zLocator.locate)rJrKrLrMrNrO)rPrQrR)rS)rR)rBrCrDrEsource_extensionsbinary_extensionsexcluded_extensionsrurtrZrbrcrergripropertyr4rlrmrnrzrrrrrrr,r,r,r-rIVs.             J  rIcs@eZdZdZfddZddZddZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c s8tt|j|||_t|dd|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. r&g@N)superrrZbase_urlr r+)r9r*kwargs) __class__r,r-rZs zPyPIRPCLocator.__init__cCst|jjS)zJ Return all the distribution names known to this locator. )rr+r))r9r,r,r-rmsz%PyPIRPCLocator.get_distribution_namesc Csqdidii}|jj|d}xC|D];}|jj||}|jj||}td|j}|d|_|d|_|jd|_ |jdg|_ |jd |_ t |}|r.|d } | d |_ |j| |_||_|||[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)cCsJ||_||_|_|jj|j}|rF|jd|_dS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr*_basesearchgroup)r9rr*rr,r,r-rZ s  z Page.__init__z[^a-z0-9$&+,/:;=?@.#%_\\|-]cCs dd}t}x|jj|jD]}|jd}|dpy|dpy|dpy|dpy|dpy|d }|d p|d p|d }t|j|}t|}|jj d d|}|j ||fq+Wt |ddddd}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs@t|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r*r4rvrrrrrr,r,r-clean4szPage.links..cleanr2Zrel1Zrel2Zrel3Zrel4Zrel5Zrel6r}r~Zurl3cSsdt|jdS)Nz%%%2xr)ordr)rr,r,r-BszPage.links..r@cSs|dS)Nrr,)rwr,r,r-rFsreverseT) r_hreffinditerr groupdictrrr _clean_resubrr)r9rr`rrrelr*r,r,r-links-s   z Page.linksN)rBrCrDrErecompileISXrrrZrrrr,r,r,r-rs  rcseZdZdZdejddddddiZdd fd d Zd d ZddZ ddZ e j de j ZddZddZddZddZddZe j dZddZS) SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. deflategzipcCstjdttjS)Nfileobj)rGzipFilerrr)br,r,r-rTszSimpleScrapingLocator.nonecCs|S)Nr,)rr,r,r-rUsN c stt|j|t||_||_i|_t|_t j |_ t|_ d|_ ||_tj|_tj|_d|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FN)rrrZrrr& _page_cacher_seenr rX _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplockplatform_check)r9r*r&rr)rr,r-rZXs       zSimpleScrapingLocator.__init__cCscg|_xSt|jD]B}tjd|j}|jd|j|jj|qWdS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). targetTN) _threadsrangerrThread_fetch setDaemonstartr])r9irwr,r,r-_prepare_threadsss    z&SimpleScrapingLocator._prepare_threadscCsOx!|jD]}|jjdq Wx|jD]}|jq.Wg|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)rrrr)r9rwr,r,r- _wait_threadss z#SimpleScrapingLocator._wait_threadscCsdidii}|j||_||_t|jdt|}|jj|jj|j z1t j d||j j ||j jWd|jX|`WdQRX|S)Nrrz%s/z Queueing %s)rr`rrrr rrdrrr{r|rrrr )r9rkr`r*r,r,r-rls        z"SimpleScrapingLocator._get_projectz<\b(linux_(i\d86|x86_64|arm\w+)|win(32|_amd64)|macosx_?\d+)\bcCs|jj|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r9r*r,r,r-_is_platform_dependentsz,SimpleScrapingLocator._is_platform_dependentc Csw|jr!|j|r!d}n|j||j}tjd|||rs|j|j|j|WdQRX|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s) rr rrr{r|rrr`)r9r*rr,r,r-_process_downloads   z'SimpleScrapingLocator._process_downloadc Cst|\}}}}}}|j|j|j|jrGd}n|jrl|j|j rld}n|j|jsd}ny|d krd}nd|dkrd}nO|j|rd}n7|j ddd } | j d krd}nd }t j d |||||S)z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. Fhomepagedownloadhttproftp:rr localhostTz#should_queue: %s (%s) from %s -> %s)r r)rror) rrsrrrrrrr splitrr{r|) r9linkZreferrerrr4rvrr_r`hostr,r,r- _should_queues*           z#SimpleScrapingLocator._should_queuecCs6x/|jj}zy|r|j|}|dkr<wx|jD]\}}||jkrFy\|jj||j| r|j|||rtj d|||jj |WqFt k rYqFXqFWWn;t k r}z|j j t|WYdd}~XnXWd|jjX|sPqWdS)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)rr\get_pagerrrr rr{r|rrrrYrr_)r9r*pagerrrar,r,r-rs,   -zSimpleScrapingLocator._fetchcCst|\}}}}}}|dkrWtjjt|rWtt|d}||jkr|j|}tj d||nv|j ddd}d}||j krtj d||n5t |d d d i}z y/tj d ||j j|d |j} tj d|| j} | jdd} tj| r| j} | j} | jd}|r|j|}|| } d}tj| }|r|jd}y| j|} Wn!tk r| jd} YnXt| | }||j| zAccept-encodingidentityz Fetching %sr&z Fetched %sz Content-Typer2zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosrrisdirrrrrr{r|rrrrVrr&rr\HTML_CONTENT_TYPErgeturlrdecodersCHARSETrrr UnicodeErrorrrr<rrrrr)r9r*r4rvrrrr`rr:rr> content_typeZ final_urlrencodingdecoderrrar,r,r-rsZ $       % )*zSimpleScrapingLocator.get_pagez]*>([^<]+)[\w-]+)\s*\(\s*(==\s*)?(?P[^)]+)\)$c@sseZdZdZdddZddZddZd d Zd d Zd dZ ddddZ dS)DependencyFinderz0 Locate dependencies for distributions. NcCs(|p t|_t|jj|_dS)zf Initialise an instance, using the specified locator to locate distributions. N)default_locatorrr"r4)r9rr,r,r-rZ1szDependencyFinder.__init__cCstjd||j}||j|<||j||jf= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. Z cantreplaceFT) reqtsrrTrrr frozensetrRrrO) r9rUotherproblemsZrlist unmatchedrQrWr`r,r,r-try_to_replaces"       # zDependencyFinder.try_to_replaceFcCsi|_i|_i|_i|_t|p0g}d|krh|jd|tdddgO}t|tr|}}tj d|nH|j j |d|}}|dkrt d|tj d |d |_ t}t|g}t|g}x|r|j}|j} | |jkrI|j|n,|j| } | |kru|j|| ||j|jB} |j} t} |r||krx;dD]3}d|}||kr| t|d|O} qW| | B| B}x|D]}|j|}|stj d||j j |d|}|dkrj| rj|j j |dd }|dkrtj d||jd|fnz|j|j}}||f|jkr|j||j||| kr||kr|j|tj d|jxt|D]l}|j} | |jkr]|jj|tj|q|j| } | |kr|j|| |qWqWqWt|jj}x9|D]1}||k|_|jrtj d|jqWtj d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:z:test:z:build:z:dev:zpassed %s as requirementrNzUnable to locate %rz located %sTtestbuilddevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %rZ unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)r]r^r_)rMrKrJrWrrPr;rr{r|rrr requestedrr@rOr\Z run_requiresZ meta_requiresZbuild_requiresgetattrrVrrZname_and_versionrvaluesZbuild_time_dependency)r9rZ meta_extrasrrrrZtodoZ install_distsrkrYZireqtsZsreqtsZereqtsr@raZ all_reqtsrZ providersrUnrrNrKr,r,r-finds                              "     zDependencyFinder.find) rBrCrDrErZrOrRrTrVr\rer,r,r,r-rH,s      (rH)Oriorrloggingrrprr ImportErrordummy_threadingr'r2rcompatrrrrr r r r r rrr7rrrrZdatabaserrrrrrutilrrrrrrrr r!rr"r#rr$r% getLoggerrBr{rrrr!rr(r.r/objectrIrrrrr)r4r:r?rIrNAME_VERSION_RErHr,r,r,r-sV        d@F0E:A&[    PK!5et-_backport/__pycache__/__init__.cpython-35.pycnu[ Re@s dZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__rr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/_backport/__init__.pysPK!0Z)_backport/__pycache__/misc.cpython-35.pycnu[ Re@sdZddlZddlZdddgZyddlmZWn!ek rdeddZYnXy eZWn.e k rddl m Z d dZYnXy ej Z Wne k rd dZ YnXdS) z/Backports for individual classes and functions.Ncache_from_sourcecallablefsencode)rcCs|r dpd}||S)Nco)Zpy_filedebugextrr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/_backport/misc.pyrs)CallablecCs t|tS)N) isinstancer )objrrr rscCsRt|tr|St|tr5|jtjStdt|jdS)Nzexpect bytes or str, not %s) r bytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenamerrr r"s )__doc__osr__all__impr ImportError __debug__r NameError collectionsr rAttributeErrorrrrr s        PK!t֠  ,_backport/__pycache__/tarfile.cpython-35.pycnu[ Rei@sRddlmZdZdZdZdZdZdZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZyddlZddlZWnek rdZZYnXeefZyeef7ZWnek rYnXd d d d gZejdd kr5ddlZn ddlZejZdZdZedZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1d Z2d!Z3d"Z4dZ5d#Z6d$Z7e6Z8e&e'e(e)e,e-e.e*e+e/e0e1f Z9e&e'e.e1fZ:e/e0e1fZ;d%d&d'd(d)d*d+d,fZ<e=d%d&d+d,fZ>d-e?d.e?d(e?d)e@d*e@d'e@iZAd/ZBd0ZCd1ZDd2ZEd3ZFd4ZGd5ZHd6ZIdZJd7ZKd8ZLd9ZMd:ZNd;ZOd<ZPd=ZQd$ZRd#ZSe jTd>d?fkr%d@ZUn ejVZUdAdBZWdCdDZXdEdFZYd<e8dGdHZZdIdJZ[ddKdLZ\eBdMfeCdNfeDdOfeEdPfeFdQfeGdRffeKdSffeLdTffeMeHBdUfeHdVfeMdWffeNdSffeOdTffePeIBdUfeIdVfePdWffeQdSffeRdTffeSeJBdXfeJdYfeSdWfff Z]dZd[Z^Gd\d d e_Z`Gd]d^d^e`ZaGd_d`d`e`ZbGdadbdbe`ZcGdcdddde`ZdGdedfdfe`ZeGdgdhdheeZfGdidjdjeeZgGdkdldleeZhGdmdndneeZiGdodpdpeeZjGdqdrdrekZlGdsdtdtekZmGdudvdvekZnGdwdxdxekZoGdydzdzekZpGd{d|d|ekZqGd}d d ekZrGd~d d ekZsGdddekZtdd ZueZvesjZdS))print_functionz $Revision$z0.9.0u"Lars Gustäbel (lars@gustaebel.de)z5$Date: 2011-02-25 17:42:01 +0200 (Fri, 25 Feb 2011) $z?$Id: tarfile.py 88586 2011-02-25 15:42:01Z marc-andre.lemburg $u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.NTarFileTarInfo is_tarfileTarErrorsisustar sustar00d01234567LKSxgXpathlinkpathsizemtimeuidgidunamegnameatimectimeiii`i@i iii@ ntcezutf-8cCs2|j||}|d||t|tS)z8Convert a string to a null-terminated bytes object. N)encodelenNUL)slengthencodingerrorsr5/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/_backport/tarfile.pystnsr7cCs;|jd}|dkr+|d|}|j||S)z8Convert a null-terminated bytes object to a string. srN)finddecode)r1r3r4pr5r5r6ntss r<c Cs|dtdkr_y%tt|ddp1dd}Wqtk r[tdYqXnId}x@tt|dD](}|dK}|t||d7}q|W|S) z/Convert a number field to a python number. rr&asciistrict0r*zinvalid headerr)chrintr< ValueErrorInvalidHeaderErrorranger/ord)r1nir5r5r6ntis%  rHcCsd|kod|dknrHd|d|fjdt}n|tksh|d|dkrttd|dkrtjdtjd |d}t}x6t|dD]$}|j d|d @|dL}qW|j dd |S) z/Convert a python number to a number field. rr*rz%0*or=r%zoverflow in number fieldLlr&) r.r0 GNU_FORMATrBstructunpackpack bytearrayrDinsert)rFdigitsformatr1rGr5r5r6itns $$   " rTcCsdttjd|ddtjd|dd}dttjd|ddtjd |dd}||fS) aCalculate the checksum for a member's header by summing up all characters except for the chksum field which is treated as if it was filled with spaces. According to the GNU tar sources, some tars (Sun and NeXT) calculate chksum with signed char, which will be different if there are chars in the buffer with the high bit set. So we calculate two checksums, unsigned and signed. r%Z148BNZ356BiZ148bZ356b)sumrMrN)bufunsigned_chksum signed_chksumr5r5r6 calc_chksumss @@r[cCs|dkrdS|dkrJx'|jd}|s5P|j|qWdSd}t||\}}xNt|D]@}|j|}t||krtd|j|qrW|dkr|j|}t||krtd|j|dS)zjCopy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. rNr)izend of file reachedi@i@)readwritedivmodrDr/IOError)srcdstr2rXBUFSIZEblocks remainderbr5r5r6 copyfileobjs,      rfrJ-redcr;rwr1SxtTcCsfg}xPtD]H}x?|D]*\}}||@|kr|j|PqW|jdq Wdj|S)zcConvert a file's mode to a string of the form -rwxrwxrwx. Used by TarFile.list() rg)filemode_tableappendjoin)modeZpermtablebitcharr5r5r6filemode8s  rxc@seZdZdZdS)rzBase exception.N)__name__ __module__ __qualname____doc__r5r5r5r6rGs c@seZdZdZdS) ExtractErrorz%General exception for extract errors.N)ryrzr{r|r5r5r5r6r}Js r}c@seZdZdZdS) ReadErrorz&Exception for unreadable tar archives.N)ryrzr{r|r5r5r5r6r~Ms r~c@seZdZdZdS)CompressionErrorz.Exception for unavailable compression methods.N)ryrzr{r|r5r5r5r6rPs rc@seZdZdZdS) StreamErrorz=Exception for unsupported operations on stream-like TarFiles.N)ryrzr{r|r5r5r5r6rSs rc@seZdZdZdS) HeaderErrorz!Base exception for header errors.N)ryrzr{r|r5r5r5r6rVs rc@seZdZdZdS)EmptyHeaderErrorzException for empty headers.N)ryrzr{r|r5r5r5r6rYs rc@seZdZdZdS)TruncatedHeaderErrorz Exception for truncated headers.N)ryrzr{r|r5r5r5r6r\s rc@seZdZdZdS)EOFHeaderErrorz"Exception for end of file headers.N)ryrzr{r|r5r5r5r6r_s rc@seZdZdZdS)rCzException for invalid headers.N)ryrzr{r|r5r5r5r6rCbs rCc@seZdZdZdS)SubsequentHeaderErrorz3Exception for missing and invalid extended headers.N)ryrzr{r|r5r5r5r6res rc@sFeZdZdZddZddZddZdd Zd S) _LowLevelFilezLow-level file object. Supports reading and writing. It is used instead of a regular file object for streaming access. cCsbdtjdtjtjBtjBi|}ttdrF|tjO}tj||d|_dS)NrjrkO_BINARYi) osO_RDONLYO_WRONLYO_CREATO_TRUNChasattrropenfd)selfnamertr5r5r6__init__rs   z_LowLevelFile.__init__cCstj|jdS)N)rcloser)rr5r5r6r{sz_LowLevelFile.closecCstj|j|S)N)rr\r)rrr5r5r6r\~sz_LowLevelFile.readcCstj|j|dS)N)rr]r)rr1r5r5r6r]sz_LowLevelFile.writeN)ryrzr{r|rrr\r]r5r5r5r6rls   rc@seZdZdZddZddZddZdd Zd d Zd d Z ddZ ddZ dddZ dddZ ddZddZdS)_StreamaClass that serves as an adapter between TarFile and a stream-like object. The stream-like object only needs to have a read() or write() method and is accessed blockwise. Use of gzip or bzip2 compression is possible. A stream-like object could be for example: sys.stdin, sys.stdout, a socket, a tape device etc. _Stream is intended to be used only internally. cCsd|_|dkr-t||}d|_|dkrQt|}|j}|pZd|_||_||_||_||_d|_ d|_ d|_ y|dkryddl }Wnt k rtd YnX||_ |jd|_|d kr|jn |j|d kryddl}Wnt k rYtd YnX|d krd|_|j|_n|j|_Wn*|js|jjd|_ YnXdS) z$Construct a _Stream object. TNF*rprgzzzlib module is not availablerjbz2zbz2 module is not available) _extfileobjr _StreamProxy getcomptyperrtcomptypefileobjbufsizerXposclosedzlib ImportErrorrcrc32crc _init_read_gz_init_write_gzrdbufBZ2Decompressorcmp BZ2Compressorr)rrrtrrrrrr5r5r6rsP                          z_Stream.__init__cCs't|dr#|j r#|jdS)Nr)rrr)rr5r5r6__del__sz_Stream.__del__cCs|jjd|jj|jj |jjd|_tjdtt j }|j d|d|j j dr|j dd |_ |j |j j d d tdS) z6Initialize for writing with gzip compression. rzd?Zd@dAZ dBdCZ!dDdEZ"dFdGZ#dHdIZ$dJdKZ%dLdMZ&dNdOZ'dPdQZ(dRdSZ)dTdUZ*dVdWZ+dXdYZ,dZd[Z-d\d]Z.d^d_Z/d`daZ0dbdcZ1dddeZ2dfdgZ3dhS)jraInformational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally. rrtrr rrchksumtypelinknamer!r"devmajordevminorrr pax_headersrr_sparse_structs _link_targetrpcCs||_d|_d|_d|_d|_d|_d|_t|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_i|_dS)zXConstruct a TarInfo object. name is the optional name of the member. irrpN)rrtrr rrrREGTYPErrr!r"rrrrrr)rrr5r5r6rs"                zTarInfo.__init__cCs|jS)N)r)rr5r5r6_getpathszTarInfo._getpathcCs ||_dS)N)r)rrr5r5r6_setpathszTarInfo._setpathcCs|jS)N)r)rr5r5r6 _getlinkpathszTarInfo._getlinkpathcCs ||_dS)N)r)rrr5r5r6 _setlinkpathszTarInfo._setlinkpathcCs d|jj|jt|fS)Nz<%s %r at %#x>) __class__ryrid)rr5r5r6__repr__szTarInfo.__repr__cCsd|jd|jd@d|jd|jd|jd|jd|jd |jd |jd |j d |j d |j d|j i }|d t kr|djd r|dd7<|S)z9Return the TarInfo's attributes as a dictionary. rrtirr rrrrrr!r"rr/)rrtrr rrrrrr!r"rrDIRTYPEr)rinfor5r5r6get_infos             $zTarInfo.get_infosurrogateescapecCsv|j}|tkr+|j|||S|tkrJ|j|||S|tkrf|j||StddS)zy||jd d Wn#tk r||||YnXt|||kr>||||WxdD]}\}}||krd||rr*r r rrrrr)r!r!r()r"r"r(rr*r r*rrrr)rrrr)r rcopyr r r.UnicodeEncodeErrorr/ isinstancefloatstr_create_pax_generic_headerXHDTYPErr) rrr3rrhnamer2rRvalrXr5r5r6rs4      4zTarInfo.create_pax_headercCs|j|tdS)zAReturn the object as a pax global header block sequence. utf8)rXGLTYPE)clsrr5r5r6create_pax_global_headerDsz TarInfo.create_pax_global_headercCs|dtd}x*|r@|ddkr@|dd}qW|t|d}|dd}| st|tkrtd||fS)zUSplit a name longer than 100 chars into a prefix and a name part. Nrrzname is too longr8r8r8) LENGTH_PREFIXr/r rB)rrr r5r5r6r Js zTarInfo._posix_split_namecCst|jddd||t|jddd@d|t|jddd|t|jd dd|t|jd dd |t|jd dd |d |jdtt|jddd|||jdtt|jddd||t|jddd||t|jddd|t|jddd|t|jddd||g}tjdtdj|}t |t dd}|ddd|j d|d d}|S)!zReturn a header block. info is a dictionary with file information, format must be one of the *_FORMAT constants. rrpr rtrir*rr rrrs rrrr!r(r"rrr r z%dsrNilz%06or=ieii) r7getrTrr rMrOrrsr[r.)rrSr3r4partsrXrr5r5r6rYs&$/zTarInfo._create_headercCs=tt|t\}}|dkr9|t|t7}|S)zdReturn the string payload filled with zero bytes up to the next 512 byte border. r)r^r/rr0)payloadrcrdr5r5r6_create_payloadus zTarInfo._create_payloadcCsm|j||t}i}d|d<||dTrs21 hdrcharset=BINARY rrrr= =s z././@PaxHeaderrrrrr) itemsr.rr/rbytesr rrr)) r#rrr3binarykeywordvaluerecordsrJrFr;rr5r5r6rs<      1   z"TarInfo._create_pax_generic_headerc CsNt|dkrtdt|tkr<td|jttkr]tdt|dd}|t|krt d|}t |dd|||_ t|dd |_ t|d d |_ t|d d |_t|d d |_t|d d|_||_|dd |_t |d d|||_t |dd|||_t |dd|||_t|dd|_t|dd|_t |dd||}|jtkr'|j jdr't|_|jtkrd}g}xtdD]u} y<t|||d} t||d|d} Wntk rPYnX|j| | f|d7}qOWt|d} t|dd} || | f|_ |j!r!|j j"d|_ |rJ|jt#krJ|d|j |_ |S)zAConstruct a TarInfo object from a 512 byte bytes object. rz empty headerztruncated headerzend of file headerrUrVz bad checksumr lt|ii i)iIiQiYirir+riii)$r/rrrcountr0rrHr[rCr<rrtrr rrrrrr!r"rrAREGTYPErrGNUTYPE_SPARSErDrBrrboolrisdirrstrip GNU_TYPES)r#rXr3r4robjr rstructsrGrnumbytes isextendedorigsizer5r5r6frombufsZ      ! "  zTarInfo.frombufcCsP|jjt}|j||j|j}|jjt|_|j|S)zOReturn the next TarInfo object from TarFile object tarfile. ) rr\rrDr3r4rr _proc_member)r#rrXr?r5r5r6 fromtarfileszTarInfo.fromtarfilecCst|jttfkr"|j|S|jtkr>|j|S|jtttfkrc|j |S|j |SdS)zYChoose the right processing method depending on the type and call it. N) rrr _proc_gnulongr: _proc_sparserr"SOLARIS_XHDTYPE _proc_pax _proc_builtin)rrr5r5r6rEs   zTarInfo._proc_membercCsu|jj|_|j}|js6|jtkrL||j|j7}||_|j |j |j |j |S)zfProcess a builtin type or an unknown type which will be treated as a regular file. ) rrrisregrSUPPORTED_TYPES_blockrr_apply_pax_inforr3r4)rrrr5r5r6rK$s  zTarInfo._proc_builtinc Cs|jj|j|j}y|j|}Wntk rQtdYnX|j|_|jt krt ||j |j |_ n*|jtkrt ||j |j |_|S)zSProcess the blocks that hold a GNU longname or longlink member. z missing or bad subsequent header)rr\rNrrFrrrrrr<r3r4rrr)rrrXnextr5r5r6rG5s  zTarInfo._proc_gnulongc Cs#|j\}}}|`x|r|jjt}d}xtdD]}y<t|||d}t||d|d} Wntk rPYnX|r| r|j|| f|d7}qFWt|d}qW||_ |jj |_ |j |j |j |_||_ |S)z8Process a GNU sparse header plus extra headers. rrr7i)rrr\rrDrHrBrrr;rrrrNrr) rrr@rBrCrXrrGrrAr5r5r6rHKs( "    zTarInfo._proc_sparsec Cs|jj|j|j}|jtkr9|j}n|jj}tj d|}|dk r|j dj d|d<|j d}|dkr|j }nd}tjd}d}x|j||}|sP|j\} } t| } ||jd d|jd| d} |j| dd|j} | tkrt|j| ||j |j} n|j| dd|j} | || <|| 7}qWy|j|} Wntk rtd YnXd |kr|j| |n_d |kr|j| ||n=|j d dkrY|j ddkrY|j| |||jttfkr| j||j |j|j | _ d|kr| j!} | j"s| jt#kr| | j| j7} | |_ | S)zVProcess an extended or global header as described in POSIX.1-2008. s\d+ hdrcharset=([^\n]+)\nNrr! hdrcharsetBINARYs(\d+) ([^=]+)=rrz missing or bad subsequent headerzGNU.sparse.mapzGNU.sparse.sizezGNU.sparse.major1zGNU.sparse.minorr?r)$rr\rNrrr"rrresearchgroupr:r&r3compilematchgroupsrAendr_decode_pax_fieldr4PAX_NAME_FIELDSrFrr_proc_gnusparse_01_proc_gnusparse_00_proc_gnusparse_10rrIrOrrrLrM)rrrXrrYrRr3regexrr2r/r0rPrr5r5r6rJgs`     .        *    zTarInfo._proc_paxcCsg}x6tjd|D]"}|jt|jdqWg}x6tjd|D]"}|jt|jdqXWtt|||_dS)z?Process a GNU tar extended sparse header, version 0.0. s\d+ GNU.sparse.offset=(\d+)\nrs\d+ GNU.sparse.numbytes=(\d+)\nN)rUfinditerrrrArWlistzipr)rrPrrXoffsetsrYrAr5r5r6r_s  zTarInfo._proc_gnusparse_00cCsVdd|djdD}tt|ddd|ddd|_dS)z?Process a GNU tar extended sparse header, version 0.1. cSsg|]}t|qSr5)rA).0rmr5r5r6 s z.TarInfo._proc_gnusparse_01..zGNU.sparse.map,Nrr)splitrcrdr)rrPrrr5r5r6r^s zTarInfo._proc_gnusparse_01cCsd}g}|jjt}|jdd\}}t|}xgt||dkrd|kr}||jjt7}|jdd\}}|jt|qEW|jj|_t t |ddd|ddd|_ dS)z?Process a GNU tar extended sparse header, version 1.0. Ns rr) rr\rrirAr/rrrrrcrdr)rrPrrfieldsrrXnumberr5r5r6r`s  zTarInfo._proc_gnusparse_10c Cs x|jD]\}}|dkr8t|d|q |dkr]t|dt|q |dkrt|dt|q |tkr |tkryt||}Wntk rd}YnX|dkr|jd}t|||q W|j|_dS) zoReplace fields with supplemental information from a previous pax extended or global header. zGNU.sparse.namerzGNU.sparse.sizerzGNU.sparse.realsizerrN) r,setattrrA PAX_FIELDSPAX_NUMBER_FIELDSrBr=rr)rrr3r4r/r0r5r5r6rOs"        zTarInfo._apply_pax_infoc Cs=y|j|dSWn"tk r8|j||SYnXdS)z1Decode a single field from a pax record. r>N)r:UnicodeDecodeError)rr0r3fallback_encodingfallback_errorsr5r5r6r\s zTarInfo._decode_pax_fieldcCs-t|t\}}|r%|d7}|tS)z_Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024. r)r^r)rr8rcrdr5r5r6rN s zTarInfo._blockcCs |jtkS)N)r REGULAR_TYPES)rr5r5r6rLsz TarInfo.isregcCs |jS)N)rL)rr5r5r6isfileszTarInfo.isfilecCs |jtkS)N)rr)rr5r5r6r<sz TarInfo.isdircCs |jtkS)N)rSYMTYPE)rr5r5r6issymsz TarInfo.issymcCs |jtkS)N)rLNKTYPE)rr5r5r6islnksz TarInfo.islnkcCs |jtkS)N)rCHRTYPE)rr5r5r6ischr sz TarInfo.ischrcCs |jtkS)N)rBLKTYPE)rr5r5r6isblk"sz TarInfo.isblkcCs |jtkS)N)rFIFOTYPE)rr5r5r6isfifo$szTarInfo.isfifocCs |jdk S)N)r)rr5r5r6issparse&szTarInfo.issparsecCs|jtttfkS)N)rrxrzr|)rr5r5r6isdev(sz TarInfo.isdevN)rrtrr rrrrrr!r"rrrrrrrrr)4ryrzr{r| __slots__rrrpropertyrrrrrrDEFAULT_FORMATENCODINGrrrr classmethodr$r  staticmethodrr)rrrDrFrErKrGrHrJr_r^r`rOr\rNrLrsr<rurwryr{r}r~rr5r5r5r6rs`         1  3?    f             c@seZdZdZdZdZdZdZeZ e Z dZ e ZeZdddddddddddddd Zeddded d Zeddd d ZedddddZedddddZddddddiZddZddZddZdd Zdddd!d"Zd#d$d%Zdd#ddd&d'Zdd(d)Z d*dd+d,Z!d-d#d.d/Z"d0d1Z#d#d2d3Z$d4d5Z%d6d7Z&d8d9Z'd:d;Z(d<d=Z)d>d?Z*d@dAZ+dBdCZ,dDdEZ-dFdGZ.dddHdIZ/dJdKZ0ddLdMZ1dNdOZ2dPdQZ3dRdSZ4dTdUZ5dVdWZ6dS)Xrz=The TarFile Class provides an interface to tar archives. rFrNrjrc Cst|dks|dkr*td||_dddddd i||_|s|jdkrtjj| rd|_d |_t||j}d |_nH|d krt |d r|j }t |d r|j|_d|_|r tjj |nd |_ ||_ |d k r1||_ |d k rF||_|d k r[||_|d k rp||_|d k r||_| |_| d k r|j tkr| |_n i|_| d k r| |_| d k r| |_d |_g|_d |_|j j|_i|_y:|jdkrHd |_|j|_|jdkrx|j j|jy&|jj |}|jj!|WqZt"k r|j j|jPYqZt#k r} zt$t%| WYd d } ~ XqZXqZW|jdkrWd|_|jrW|jj&|jj'}|j j(||jt|7_Wn*|jst|j j)d|_YnXd S)aOpen an (uncompressed) tar archive `name'. `mode' is either 'r' to read from an existing archive, 'a' to append data to an existing file or 'w' to create a new file overwriting an existing one. `mode' defaults to 'r'. If `fileobj' is given, it is used for reading or writing data. If it can be determined, `mode' is overridden by `fileobj's mode. `fileobj' is not closed, when TarFile is closed. rrzmode must be 'r', 'a' or 'w'rjrbazr+brkwbFNrrtTaw)*r/rBrt_moderrexists bltn_openrrrabspathrrSr dereference ignore_zerosr3r4rrdebug errorlevelrmembers_loadedrrinodes firstmemberrPrrFrrrrr~rr$rr]r)rrrtrrSrrrr3r4rrrerXr5r5r6rFs   "      !                        )     zTarFile.__init__c Ks;| r| rtd|dkrx|jD]}t||j|}|dk rd|j}y||d||SWq0ttfk r} z!|dk r|j|w0WYdd} ~ Xq0Xq0WtdnSd|kr_|jdd\} }| pd} |pd}||jkr<t||j|}ntd |||| ||Sd |kr |jd d\} }| pd} |pd}| d krtd t|| |||} y||| | |} Wn| j YnXd | _ | S|dkr+|j ||||StddS)a|Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for reading exclusively uncompressed 'r:gz' open for reading with gzip compression 'r:bz2' open for reading with bzip2 compression 'a' or 'a:' open for appending, creating the file if necessary 'w' or 'w:' open for writing without compression 'w:gz' open for writing with gzip compression 'w:bz2' open for writing with bzip2 compression 'r|*' open a stream of tar blocks with transparent compression 'r|' open an uncompressed stream of tar blocks for reading 'r|gz' open a gzip compressed stream of tar blocks 'r|bz2' open a bzip2 compressed stream of tar blocks 'w|' open an uncompressed stream for writing 'w|gz' open a gzip compressed stream for writing 'w|bz2' open a bzip2 compressed stream for writing znothing to openrjr:*Nz%file could not be opened successfully:rrzunknown compression type %r|rwzmode must be 'r' or 'w'Frzundiscernible mode)rjr) rB OPEN_METHrrr~rrrirrrtaropen) r#rrtrrkwargsrfunc saved_posrrxstreamrnr5r5r6rsN                 z TarFile.opencKs=t|dks|dkr*td|||||S)zCOpen uncompressed tar archive name for reading or writing. rrzmode must be 'r', 'a' or 'w')r/rB)r#rrtrrr5r5r6rs zTarFile.taropenrc Ks-t|dks|dkr*tdyddl}|jWn$ttfk rgtdYnX|dk }y8|j||d||}|j||||}Wnqtk r| r|dk r|j |dkrt dYn(| r|dk r|j YnX||_ |S) zkOpen gzip compressed tar archive name for reading or writing. Appending is not allowed. rrzmode must be 'r' or 'w'rNzgzip module is not availablereznot a gzip file) r/rBgzipGzipFilerAttributeErrorrrr_rr~r) r#rrtr compresslevelrrZ extfileobjrnr5r5r6gzopens.         zTarFile.gzopencKst|dks|dkr*tdyddl}Wntk rZtdYnX|dk ryt||}n|j||d|}y|j||||}Wn.tt fk r|j t dYnXd |_ |S) zlOpen bzip2 compressed tar archive name for reading or writing. Appending is not allowed. rrzmode must be 'r' or 'w'.rNzbz2 module is not availablerznot a bzip2 fileF) r/rBrrrrBZ2Filerr_EOFErrorrr~r)r#rrtrrrrrnr5r5r6bz2open$s      zTarFile.bz2openrrrrrrcCs|jr dS|jdkr|jjttd|jtd7_t|jt\}}|dkr|jjtt||j s|jj d|_dS)zlClose the TarFile. In write-mode, two finishing zero blocks are appended to the archive. NrrrT) rrtrr]r0rrr^ RECORDSIZErr)rrcrdr5r5r6rHs    z TarFile.closecCs/|j|}|dkr+td||S)aReturn a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version. Nzfilename %r not found) _getmemberKeyError)rrrr5r5r6 getmember\s zTarFile.getmembercCs$|j|js|j|jS)zReturn the members of the archive as a list of TarInfo objects. The list has the same order as the members in the archive. )_checkr_loadr)rr5r5r6 getmembersgs   zTarFile.getmemberscCsdd|jDS)zReturn the members of the archive as a list of their names. It has the same order as the list returned by getmembers(). cSsg|]}|jqSr5)r)rfrr5r5r6rgus z$TarFile.getnames..)r)rr5r5r6getnamesqszTarFile.getnamesc CsI|jd|dk r"|j}|dkr4|}tjj|\}}|jtjd}|jd}|j}||_ |dkrt tdr|j rtj |}qtj |}ntj|j}d}|j}t j|r|j|jf} |j rd|jdkrd| |jkrd||j| krdt} |j| }qt} | dr||j| zlink to)rprintrxrtr!rr"r ryr{rrrr localtimerrr<rurrw)rverboserr5r5r6rcs&   $)  z TarFile.listc Cs|jd|dkr|}|dk rnddl}|jdtd||rn|jdd|dS|jdk rtjj||jkr|jdd|dS|jd||j ||}|dkr|jdd |dS|dk r2||}|dkr2|jdd|dS|j rjt |d }|j |||j n|jr|j ||rxatj|D]@}|jtjj||tjj||||d |qWn |j |dS) a~Add the file `name' to the archive. `name' may be any type of file (directory, fifo, symbolic link, etc.). If given, `arcname' specifies an alternative name for the file in the archive. Directories are added recursively by default. This can be avoided by setting `recursive' to False. `exclude' is a function that should return True for each filename to be excluded. `filter' is a function that expects a TarInfo object argument and returns the changed TarInfo object, if it returns None the TarInfo object will be excluded from the archive. rNrzuse the filter argument insteadrztarfile: Excluded %rztarfile: Skipped %rrztarfile: Unsupported type %rrfilter)rwarningswarnDeprecationWarning_dbgrrrrrrLraddfilerr<listdiraddrs) rrr recursiveexcluderrrfr5r5r6rsD       *        *z TarFile.addcCs|jdtj|}|j|j|j|j}|jj||jt |7_|dk rt ||j|j t |j t \}}|dkr|jjtt ||d7}|j|t 7_|jj|dS)a]Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. rNrr)rrrrSr3r4rr]rr/rfrr^rr0rrr)rrrrXrcrdr5r5r6r4s    zTarFile.addfile.cCsIg}|dkr|}x\|D]T}|jrV|j|tj|}d|_|j||d|j qW|jddd|jx|D]}tjj ||j }y4|j |||j |||j ||Wqtk r@}z.|jdkrn|jdd|WYdd}~XqXqWdS) aMExtract all members from the archive to the current working directory and set owner, modification time and permissions on directories afterwards. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by getmembers(). Ni set_attrskeycSs|jS)N)r)rr5r5r6dsz$TarFile.extractall..rz tarfile: %s)r<rrrrtextractsortreverserrrsrchownutimechmodr}rr)rrr directoriesrdirpathrr5r5r6 extractallNs*     !  zTarFile.extractallrpcCs^|jdt|tr.|j|}n|}|jr[tjj||j|_ y,|j |tjj||j d|Wnt k r }zc|j dkrnI|jdkr|jdd|jn |jdd|j|jfWYdd}~XnNtk rY}z.|j dkr3n|jdd|WYdd}~XnXdS)axExtract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a TarInfo object. You can specify a different directory using `path'. File attributes (owner, mtime, mode) are set unless `set_attrs' is False. rjrrNrz tarfile: %sztarfile: %s %r)rrrrrwrrrsrr_extract_memberrEnvironmentErrorrfilenamerstrerrorr})rmemberrrrrr5r5r6rts&  ! 2zTarFile.extractcCs|jdt|tr.|j|}n|}|jrP|j||S|jtkro|j||S|js|j rt|j t rt dq|j |j|SndSdS)aExtract a member from the archive as a file object. `member' may be a filename or a TarInfo object. If `member' is a regular file, a file-like object is returned. If `member' is a link, a file-like object is constructed from the link's target. If `member' is none of the above, None is returned. The file-like object is read-only and provides the following methods: read(), readline(), readlines(), seek() and tell() rjz'cannot extract (sym)link as file objectN)rrrrrL fileobjectrrMrwrurrr extractfile_find_link_target)rrrr5r5r6rs  zTarFile.extractfilecCs|jd}|jdtj}tjj|}|r\tjj| r\tj||jst|j r|j dd|j |j fn|j d|j |j r|j||n|jr|j||n|jr|j||n|js|jr2|j||n]|jsJ|j r]|j||n2|jtkr|j||n|j|||r|j|||j s|j|||j||dS)z\Extract the TarInfo object tarinfo to a physical file called targetpath. rrz%s -> %sN)r=rrrrdirnamermakedirsrwrurrrrLmakefiler<makedirr}makefiforyr{makedevmakelinkrrM makeunknownrrr)rr targetpathr upperdirsr5r5r6rs4 #    zTarFile._extract_membercCsUytj|dWn:tk rP}z|jtjkr>WYdd}~XnXdS)z,Make a directory called targetpath. iN)rmkdirrerrnoEEXIST)rrrrr5r5r6rs zTarFile.makedircCs|j}|j|jt|d}|jdk rqxJ|jD])\}}|j|t|||qAWnt|||j|j|j|j|jdS)z'Make a file called targetpath. rN) rrrrrrfrtruncater)rrrsourcetargetrrr5r5r6rs   zTarFile.makefilecCs+|j|||jdd|jdS)zYMake a file from a TarInfo object with an unknown type at targetpath. rz9tarfile: Unknown file type %r, extracted as regular file.N)rrr)rrrr5r5r6r s zTarFile.makeunknowncCs/ttdrtj|n tddS)z'Make a fifo called targetpath. mkfifozfifo not supported by systemN)rrrr})rrrr5r5r6r szTarFile.makefifocCsttd s ttd r,td|j}|jrQ|tjO}n |tjO}tj||tj |j |j dS)z&# &0       1     c@s@eZdZdZddZddZddZeZdS) r zMIterator Class. for tarinfo in TarFile(...): suite... cCs||_d|_dS)z$Construct a TarIter object. rN)rr)rrr5r5r6r s zTarIter.__init__cCs|S)z Return iterator object. r5)rr5r5r6r szTarIter.__iter__c Cs{|jjs6|jj}|shd|j_tn2y|jj|j}Wntk rgtYnX|jd7_|S)zReturn the next item using TarFile's next() method. When all members have been read, set TarFile as _loaded. Tr)rrrP StopIterationrr IndexError)rrr5r5r6__next__ s     zTarIter.__next__N)ryrzr{r|rrr*rPr5r5r5r6r  s    r c Cs;yt|}|jdSWntk r6dSYnXdS)zfReturn True if name points to a tar archive that we are able to handle, else return False. TFN)rrr)rrnr5r5r6r# s    )w __future__r __version__version __author____date__ __cvsid__ __credits__rrrrrrMrrUrrrrNotImplementedErrorrZ WindowsError NameError__all__ version_info __builtin__builtinsr_openr0rrrr r r r%rr9rvrtrxrzrr|CONTTYPErrr:rr"rIrrLrrrMrrr>rmsetr]rrArnS_IFLNKS_IFREGr S_IFDIRr S_IFIFOZTSUIDZTSGIDZTSVTXZTUREADZTUWRITEZTUEXECZTGREADZTGWRITEZTGEXECZTOREADZTOWRITEZTOEXECrrgetfilesystemencodingr7r<rHrTr[rfrqrx Exceptionrr}r~rrrrrrrCrobjectrrrrrrrrr rrr5r5r5r6s,                                                 ?K* PK!ӗZZ+_backport/__pycache__/shutil.cpython-35.pycnu[ Rekd5@sdZddlZddlZddlZddlmZddlZyddlmZWn"e k r~ddl mZYnXddl Z ddl m Z yddlZdZWne k rdZYnXydd lmZWne k rdZYnXydd lmZWne k r)dZYnXd d d ddddddddddddddddddgZGd ddeZGd!ddeZGd"ddeZGd#d$d$eZGd%d&d&eZyeWnek rdZYnXdfd)d Zd*d+Zd,d Z d-d Z!d.dZ"d/dZ#d0dZ$d1dZ%dde$dd2dZ&ddd3dZ'd4d5Z(d6dZ)d7d8Z*d9d:Z+d;d<Z,d=dddddd>d?Z-ddd@dAZ.ddddBdCZ/dDe-dggdFfdGe-dhgdIfdJe-digdKfdLe/gdMfiZ0erue-djgdIfe0dGdS)kzUtility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. N)abspath)Callable)tarfileTF)getpwnam)getgrnam copyfileobjcopyfilecopymodecopystatcopycopy2copytreemovermtreeErrorSpecialFileError ExecError make_archiveget_archive_formatsregister_archive_formatunregister_archive_formatget_unpack_formatsregister_unpack_formatunregister_unpack_formatunpack_archiveignore_patternsc@seZdZdS)rN)__name__ __module__ __qualname__r r /builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/_backport/shutil.pyr/s c@seZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)N)rrr__doc__r r r r!r2s c@seZdZdZdS)rz+Raised when a command could not be executedN)rrrr"r r r r!r6s c@seZdZdZdS) ReadErrorz%Raised when an archive cannot be readN)rrrr"r r r r!r#9s r#c@seZdZdZdS) RegistryErrorzVRaised when a registry operation with the archiving and unpacking registries failsN)rrrr"r r r r!r$<s r$icCs.x'|j|}|sP|j|qWdS)z=copy data from file-like object fsrc to file-like object fdstN)readwrite)fsrcfdstlengthbufr r r!rFs c Cs|ttjdrBytjj||SWntk rAdSYnXtjjtjj|tjjtjj|kS)NsamefileF)hasattrospathr,OSErrornormcaser)srcdstr r r! _samefileNs  r4cCst||r%td||fx^||gD]P}ytj|}Wntk r_Yq2Xtj|jr2td|q2Wt|d-}t|d}t ||WdQRXWdQRXdS)zCopy data from src to dstz`%s` and `%s` are the same filez`%s` is a named piperbwbN) r4rr.statr0S_ISFIFOst_moderopenr)r2r3fnstr(r)r r r!r Zs cCsDttdr@tj|}tj|j}tj||dS)zCopy mode bits from src to dstchmodN)r-r.r7S_IMODEr9r=)r2r3r<moder r r!r nscCstj|}tj|j}ttdrLtj||j|jfttdrktj||ttdrt|drytj ||j WnJt k r}z*tt d s|j t j krWYdd}~XnXdS)zCCopy all stat info (mode bits, atime, mtime, flags) from src to dstutimer=chflagsst_flags EOPNOTSUPPN)r.r7r>r9r-r@st_atimest_mtimer=rArBr0errnorC)r2r3r<r?whyr r r!r uscCsQtjj|r3tjj|tjj|}t||t||dS)zVCopy data and mode bits ("cp src dst"). The destination may be a directory. N)r.r/isdirjoinbasenamer r )r2r3r r r!r s! cCsQtjj|r3tjj|tjj|}t||t||dS)z]Copy data and all stat info ("cp -p src dst"). The destination may be a directory. N)r.r/rHrIrJr r )r2r3r r r!r s! csfdd}|S)zFunction that can be used as copytree() ignore parameter. Patterns is a sequence of glob-style patterns that are used to exclude filescs:g}x'D]}|jtj||q Wt|S)N)extendfnmatchfilterset)r/names ignored_namespattern)patternsr r!_ignore_patternss z)ignore_patterns.._ignore_patternsr )rRrSr )rRr!rscCs:tj|}|dk r-|||}n t}tj|g}xe|D]]} | |kreqPtjj|| } tjj|| } ytjj| rtj| } |rtj| | q0tjj |  r|rwP|| | n8tjj | r#t | | |||n || | WqPt k rl} z|j | jdWYdd} ~ XqPtk r}z!|j| | t|fWYdd}~XqPXqPWyt||Wn_tk r#}z?tdk rt|trn|j ||t|fWYdd}~XnX|r6t |dS)aRecursively copy a directory tree. The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. If the file pointed by the symlink doesn't exist, an exception will be added in the list of errors raised in an Error exception at the end of the copy process. You can set the optional ignore_dangling_symlinks flag to true if you want to silence this exception. Notice that this has no effect on platforms that don't support os.symlink. The optional ignore argument is a callable. If given, it is called with the `src` parameter, which is the directory being visited by copytree(), and `names` which is the list of `src` contents, as returned by os.listdir(): callable(src, names) -> ignored_names Since copytree() is called recursively, the callable will be called once for each directory that is copied. It returns a list of names relative to the `src` directory that should not be copied. The optional copy_function argument is a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. Nr)r.listdirrNmakedirsr/rIislinkreadlinksymlinkexistsrHrrrKargsEnvironmentErrorappendstrr r0 WindowsError isinstance)r2r3symlinksignore copy_functionignore_dangling_symlinksrOrPerrorsnamesrcnamedstnamelinktoerrrGr r r!rsD$     &3/c$Cs|rdd}n|dkr-dd}y"tjj|rNtdWn2tk r|tjj|tjdSYnXg}ytj|}Wn.tjk r|tj|tjYnXx|D]}tjj||}ytj |j }Wntjk r#d}YnXt j |rFt |||qytj|Wqtjk r|tj|tjYqXqWytj|Wn.tjk r|tj|tjYnXdS)aRecursively delete a directory tree. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, path, exc_info) where func is os.listdir, os.remove, or os.rmdir; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info(). If ignore_errors is false and onerror is None, an exception is raised. cWsdS)Nr )rZr r r!onerrorszrmtree..onerrorNcWsdS)Nr )rZr r r!rjsz%Cannot call rmtree on a symbolic linkr)r.r/rVr0sysexc_inforTerrorrIlstatr9r7S_ISDIRrremovermdir)r/ ignore_errorsrjrOrefullnamer?r r r!rs>       "cCstjj|jtjjS)N)r.r/rJrstripsep)r/r r r! _basename*srvc Cs|}tjj|rxt||r;tj||dStjj|t|}tjj|rxtd|ytj||Wnt k rtjj|rt ||rtd||ft ||ddt |nt ||tj|YnXdS)aRecursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics. If the destination is on our current filesystem, then rename() is used. Otherwise, src is copied to the destination and then removed. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over. Nz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.r`T)r.r/rHr4renamerIrvrYrr0 _destinsrcrrr unlink)r2r3real_dstr r r!r/s$   cCsot|}t|}|jtjjs=|tjj7}|jtjjsb|tjj7}|j|S)N)rendswithr.r/ru startswith)r2r3r r r!rxWs  rxc Cs_tdks|dkrdSyt|}Wntk rFd}YnX|dk r[|dSdS)z"Returns a gid, given a group name.N)rKeyError)reresultr r r!_get_gid`s   rc Cs_tdks|dkrdSyt|}Wntk rFd}YnX|dk r[|dSdS)z"Returns an uid, given a user name.Nr})rr~)rerr r r!_get_uidls   rgzipc sgddddi}ddi} tr8d|d._set_uid_gidzw|%srM)_BZ2_SUPPORTED ValueErrorformatgetr.r/dirnamerYinforUrrrr:addclose) base_namebase_dircompressverbosedry_runrrloggertar_compression compress_ext archive_name archive_dirrtarr )rrrrr! _make_tarballxs4             rc Cs~|rd}nd}ddlm}ddlm}y |d|||gd|Wn"|k rytd|YnXdS) Nz-rz-rqr)DistutilsExecError)spawnziprzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utility)distutils.errorsrdistutils.spawnrr)r zip_filenamerr zipoptionsrrr r r!_call_external_zips    rcCs|d}tjj|}tjj|s]|dk rJ|jd||s]tj|yddl}Wntk rd}YnX|dkrt||||n|dk r|jd|||s|j |dd|j }xtj |D]\} } } xm| D]e} tjj tjj | | } tjj| r|j| | |dk r|jd| qWqW|j|S) amCreate 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 ExecError. Returns the name of the output zip file. z.zipNz creating %srz#creating '%s' and adding '%s' to itw compressionz adding '%s')r.r/rrYrrUzipfile ImportErrorrZipFile ZIP_DEFLATEDwalknormpathrIisfiler'r)rrrrrrrrrdirpathdirnames filenamesrer/r r r! _make_zipfiles8           !  rgztarrzgzip'ed tar-filebztarrzbzip2'ed tar-filerzuncompressed tar filerzZIP filecCs'ddtjD}|j|S)zReturns a list of supported formats for archiving and unarchiving. Each element of the returned sequence is a tuple (name, description) cSs&g|]\}}||dfqS)r}r ).0reregistryr r r! s z'get_archive_formats..)_ARCHIVE_FORMATSitemssort)formatsr r r!rs  rcCs|dkrg}t|ts1td|t|ttfsRtdxB|D]:}t|ttf st|dkrYtdqYW|||ft|.)_UNPACK_FORMATSrr)rr r r!rZs  c Csi}x9tjD]+\}}x|dD]}||| s                     Q1  ( =0     6    %    PK!:l.DD._backport/__pycache__/sysconfig.cpython-35.pycnu[ Reh@sdZddlZddlZddlZddlZddlmZmZyddlZWne k r|ddl ZYnXdddddd d d d d dg Z ddZ ej rejje ej Zne ejZejdkr/dedHdjkr/e ejjeeZejdkrxdedIdjkrxe ejjeeeZejdkrdedJdjkre ejjeeeZddZeZdaddZejZejdZddZd ejdd!Zd"ejdd#Z d$ejdd#Z!ejj"ej#Z$ejj"ej%Z&da'dZ(d%d&Z)d'd(Z*d)d*Z+d+d,Z,d-d.Z-d/d0Z.dd1d2Z/d3dZ0d4d5Z1d6d7Z2dd8dZ3d9dZ4d:d Z5d;d Z6e-dd<d=d Z7e-dd<d>dZ8d?dZ9d@dZ:dAd Z;dBd Z<dCdDZ=dEdFZ>e?dGkre>dS)Kz-Access to Python's configuration information.N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hc Cs+yt|SWntk r&|SYnXdS)N)rOSError)pathr/builddir/build/BUILDROOT/alt-python35-pip-20.2.4-5.el8.x86_64/opt/alt/python35/lib/python3.5/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpath"s rntZpcbuildz\pc\v z\pcbuild\amd64cCs=x6dD].}tjjtjjtd|rdSqWdS)N Setup.dist Setup.localModulesTF)rr)osrisfilejoin _PROJECT_BASE)fnrrris_python_build:s $r Fc Cstsddlm}tjddd}||}|jd}|sYtd|j}tj |WdQRXt rx4dD],}tj |d d tj |d d qWdadS)N)finder.rz sysconfig.cfgzsysconfig.cfg exists posix_prefix posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T)r%r&) _cfg_read resourcesr"__name__rsplitfindAssertionError as_stream_SCHEMESreadfp _PYTHON_BUILDset)r"Zbackport_packageZ_finderZ_cfgfilesschemerrr_ensure_cfg_readDs  r6z \{([^{]*?)\}cs*t|jdr(|jd}n t}|j}x\|D]T}|dkrYqDx<|D]4\}}|j||rq`|j|||q`WqDW|jdxz|jD]l}t|j|fdd}x<|j|D]+\}}|j||t j ||qWqWdS)Nglobalscs0|jd}|kr#|S|jdS)Nr$r)group)matchobjname) variablesrr _replaceros z"_expand_globals.._replacer) r6 has_sectionitemstuplesections has_optionr3remove_sectiondict _VAR_REPLsub)configr7r@sectionoptionvaluer<r)r;r_expand_globalsYs$     rJz%s.%s.%sz%s.%sr!z%s%scs"fdd}tj||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. csJ|jd}|kr#|S|tjkr=tj|S|jdS)Nr$r)r8renviron)r9r:) local_varsrrr<s   z_subst_vars.._replacer)rDrE)rrMr<r)rMr _subst_varssrNcCsF|j}x3|jD]%\}}||kr4q|||) target_dict other_dict target_keyskeyrIrrr _extend_dicts   rTcCsi}|dkri}t|tx]tj|D]L\}}tjdkretjj|}tjjt ||||rr:r expandusernormpathrN)r5varsresrSrIrrr _expand_varss #rZcs"fdd}tj||S)Ncs0|jd}|kr#|S|jdS)Nr$r)r8)r9r:)rXrrr<s zformat_value.._replacer)rDrE)rIrXr<r)rXr format_valuesr[cCstjdkrdStjS)NrUr%)rr:rrrr_get_default_schemesr\cCstjjdd}dd}tjdkr_tjjdpEd}|rR|S||dStjdkrtd }|r|r|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjjtjj|S)N)rrrVr)argsrrrjoinusersz_getuserbase..joinuserrAPPDATA~PythondarwinPYTHONFRAMEWORKLibraryz%d.%dr!z.local)rrLgetr:sysplatformr version_info)env_baser_base frameworkrrr _getuserbases"   rmcCstjd}tjd}tjd}|dkr?i}i}i}tj|dddd}|j}WdQRXx|D]} | jd s| jd krq|j| } | r| jd d \} } | j} | j d d } d| kr| || isinstanceupdate)filenamerX _variable_rx _findvar1_rx _findvar2_rxdonenotdoneflineslinemnvtmpvr;renamed_variablesr:rIfounditemafterkrrr_parse_makefiles   !                     rcCs`trtjjtdSttdr>dttjf}nd}tjjt d|dS)z Return the path of the Makefile.Makefileabiflagsz config-%s%srFstdlib) r2rrrrhasattrrg_PY_VERSION_SHORTrr)config_dir_namerrrrKs cCst}yt||Wn[tk rw}z;d|}t|drY|d|j}t|WYdd}~XnXt}y't|}t||WdQRXWn[tk r}z;d|}t|dr|d|j}t|WYdd}~XnXtr|d|d)r5rXexpandrrrr s cCst||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r:r5rXrrrrrscGsutdkr6iattdd$D]D}t|}tjdd|}tjdd|}|t|krd3}qb|d?krd4}qbtd5|fnN|d-kr8tjd@krbd/}n*|dAkrbtjdBkr\d2}nd.}d9|||fS)CaReturn 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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit (r$)amd64z win-amd64itaniumzwin-ia64rUr/rrr_-Nlinuxz%s-%ssunosr5solarisz%d.%srKr!irixaixz%s-%s.%scygwinz[\d.]+rcMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)r#macosxz10.4.z-archrtfatz -arch\s+(\S+)i386ppcx86_64intelZfat3ppc64fat64 universalz%Don't know machine value for archs=%r PowerPCPower_Macintoshz%s-%s-%s)rr)rr)rrr)rr)rrrrl)rrl) rr:rgrr-rhrlowerrrrrrxryrr8rrfr{rrreadcloserrr~findallr?rr3rmaxsize)rijlookosnamehostreleasermachinerel_rerZcfgvarsZmacverZ macreleasercflagsZarchsrrrr Ys #  +     +!               cCstS)N)rrrrrr scCsaxZtt|jD]@\}\}}|dkrEtd|td||fqWdS)Nrz%s: z %s = "%s") enumeraterr>print)titledataindexrSrIrrr _print_dicts+ rcCsetdttdttdtttdtttdtdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"Paths VariablesN)rr r r\rr rrrrr_mainsr__main__iii)@__doc__rzrrxrgos.pathrr configparser ImportError ConfigParser__all__rrrrrrr:rrr r2r)r6RawConfigParserr0ryrDrJrirrrrWrrrrr _USER_BASErNrTrZr[r\rmrrrrrrr r r rrrr r rrr+rrrrs        +++     !    v        PK!M!||'__pycache__/compat.cpython-36.opt-1.pycnu[3 Pfa@s ddlmZddlZddlZddlZy ddlZWnek rHdZYnXejddkr~ddlmZe fZ e Z ddl mZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#d d Zddl$Z$dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-er&dd l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;ddZ<n ddl=mZe>fZ e>Z ddl=m?ZddlZddlZddlZddl@mZmZmZmZod?d@ZiYnXyddAlpmqZqWn"ek r ddAlrmqZqYnXejddBddkr,e3jsZsn ddDlpmsZsyddEl`mtZtWndek rddFl`muZuyddGlvmwZxWn ek rdedIdJZxYnXGdKdLdLeuZtYnXyddMlymzZzWn ek rdfdNdOZzYnXyddPl`m{Z{Wnek rzyddQl|m}Z~Wn"ek r4ddQlm}Z~YnXyddRlmZmZmZWnek rdYnXGdSdTdTeZ{YnXyddUlmZmZWnvek rejmdVejZdWdXZGdYdZdZeZdgd[d\ZGd]d^d^eZGd_d`d`eZGdadbdbeQZYnXdS)h)absolute_importN)StringIO)FileType)shutil)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCst|tr|jd}t|S)Nzutf-8) isinstanceunicodeencode_quote)sr/usr/lib/python3.6/compat.pyrs  r) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalsecCs<tdkrddl}|jdatj|}|r4|jddSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz ^(.*)@(.*)$r) _userprogrecompilematchgroup)hostr*r,rrr splituser4s   r/) TextIOWrapper) rr r r/rrr r r) rr rrrrr r!r"r#)rrr) filterfalse)match_hostnameCertificateErrorc@s eZdZdS)r3N)__name__ __module__ __qualname__rrrrr3^sr3c Csg}|s dS|jd}|d|dd}}|jd}||krNtdt||sb|j|jkS|dkrv|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)splitcountr3reprlowerappend startswithr*escapereplacer+join IGNORECASEr,) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsfragZpatrrr_dnsname_matchbs(    rFcCs|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. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNameZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrFr=lenr3rAmapr;)ZcertrCZdnsnamesZsankeyvaluesubrrrr2s.     r2)SimpleNamespacec@seZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|jj|dS)N)__dict__update)selfkwargsrrr__init__szContainer.__init__N)r4r5r6__doc__rTrrrrrOsrO)whichc s"dd}tjjr&||r"SdS|dkr>tjjdtj}|sFdS|jtj}tj dkrtj |krt|j dtj tjjddjtj}t fd d |Drg}q‡fd d |D}ng}t }xT|D]L}tjj|}||kr|j|x(|D] } tjj|| } || |r| SqWqWdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cSs&tjj|o$tj||o$tjj| S)N)ospathexistsaccessisdir)fnmoderrr _access_checkszwhich.._access_checkNPATHZwin32rZPATHEXTc3s |]}jj|jVqdS)N)r<endswith).0ext)cmdrr szwhich..csg|] }|qSrr)rbrc)rdrr szwhich..)rWrXdirnameenvironrHdefpathr9pathsepsysplatformcurdirinsertanysetnormcaseaddrA) rdr]rXr^ZpathextfilesseendirZnormdirZthefilenamer)rdrrVs8            rV)ZipFile __enter__) ZipExtFilec@s$eZdZddZddZddZdS)rycCs|jj|jdS)N)rPrQ)rRbaserrrrTszZipExtFile.__init__cCs|S)Nr)rRrrrrxszZipExtFile.__enter__cGs |jdS)N)close)rRexc_inforrr__exit__szZipExtFile.__exit__N)r4r5r6rTrxr}rrrrrysryc@s$eZdZddZddZddZdS)rwcCs|S)Nr)rRrrrrx"szZipFile.__enter__cGs |jdS)N)r{)rRr|rrrr}%szZipFile.__exit__cOstj|f||}t|S)N) BaseZipFileopenry)rRargsrSrzrrrr)sz ZipFile.openN)r4r5r6rxr}rrrrrrw!srw)python_implementationcCs0dtjkrdStjdkrdStjjdr,dSdS)z6Return a string identifying the Python implementation.ZPyPyjavaZJythonZ IronPythonZCPython)rkversionrWrvr>rrrrr0s   r) sysconfig)CallablecCs t|tS)N)rr)objrrrcallableDsrmbcsstrictsurrogateescapecCs:t|tr|St|tr$|jttStdt|jdS)Nzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper4)filenamerrrfsencodeRs    rcCs:t|tr|St|tr$|jttStdt|jdS)Nzexpect bytes or str, not %s) rrrdecoderrrrr4)rrrrfsdecode[s    r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|ddjjdd}|dks*|jdr.dS|d ks@|jdrDdS|S)z(Imitates get_normal_name in tokenizer.c.N _-zutf-8zutf-8-latin-1 iso-8859-1 iso-latin-1latin-1- iso-8859-1- iso-latin-1-)rrr)rrr)r<r@r>)orig_encencrrr_get_normal_namels rc sy jjWntk r$dYnXdd}d}fdd}fdd}|}|jtrpd|d d}d }|s||gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFzutf-8c s yStk rdSXdS)N) StopIterationr)readlinerr read_or_stopsz%detect_encoding..read_or_stopcsy|jd}Wn4tk rBd}dk r6dj|}t|YnXtj|}|sVdSt|d}y t|}Wn:tk rdkrd|}n dj|}t|YnXr|j dkr؈dkrd}n dj}t||d 7}|S) Nzutf-8z'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorrv)line line_stringmsgZmatchesencodingcodec) bom_foundrrr find_cookies6       z$detect_encoding..find_cookieTrz utf-8-sig)__self__rvAttributeErrorr>r)rrdefaultrrfirstsecondr)rrrrrws4   &     r)r?r()unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtfdd}td|_td|_td|_tdi|_|S)Nc sBt|tf}|krSj|z |}Wdj|X|S)N)id get_identrrdiscard)rRrKresult) fillvalue repr_running user_functionrrwrappers   z=_recursive_repr..decorating_function..wrapperr5rUr4__annotations__)rpgetattrr5rUr4r)rr)r)rrrdecorating_functions   z,_recursive_repr..decorating_functionr)rrr)rr_recursive_reprs rc@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|p ig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)rRrrrrrT szChainMap.__init__cCs t|dS)N)KeyError)rRrKrrr __missing__szChainMap.__missing__c Cs8x,|jD]"}y||Stk r(YqXqW|j|S)N)rrr)rRrKmappingrrr __getitem__s   zChainMap.__getitem__NcCs||kr||S|S)Nr)rRrKrrrrrHsz ChainMap.getcCsttj|jS)N)rIrpunionr)rRrrr__len__"szChainMap.__len__cCsttj|jS)N)iterrprr)rRrrr__iter__%szChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdS)Nr)rbm)rKrrre)sz(ChainMap.__contains__..)ror)rRrKr)rKr __contains__(szChainMap.__contains__cCs t|jS)N)ror)rRrrr__bool__+szChainMap.__bool__cCsdj|djtt|jS)Nz{0.__class__.__name__}({1})z, )rrArJr;r)rRrrr__repr__.szChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr3szChainMap.fromkeyscCs$|j|jdjf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopy)rRrrrr8sz ChainMap.copycCs|jif|jS)z;New ChainMap with a new dict followed by all previous maps.)rr)rRrrr new_child>szChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rN)rr)rRrrrparentsBszChainMap.parentscCs||jd|<dS)Nr)r)rRrKrLrrr __setitem__GszChainMap.__setitem__c Cs8y|jd|=Wn"tk r2tdj|YnXdS)Nrz(Key not found in the first mapping: {!r})rrr)rRrKrrr __delitem__JszChainMap.__delitem__c Cs0y|jdjStk r*tdYnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)rpopitemr)rRrrrrPszChainMap.popitemc Gs>y|jdj|f|Stk r8tdj|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rz(Key not found in the first mapping: {!r}N)rpoprr)rRrKrrrrrWsz ChainMap.popcCs|jdjdS)z'Clear maps[0], leaving maps[1:] intact.rN)rclear)rRrrrr^szChainMap.clear)N)r4r5r6rUrTrrrHrrrrrr classmethodrr__copy__rpropertyrrrrrrrrrrrs(    r)cache_from_sourcecCs"|dkr d}|rd}nd}||S)NFcor)rXdebug_overridesuffixrrrres r) OrderedDict)r)KeysView ValuesView ItemsViewc@seZdZdZddZejfddZejfddZdd Zd d Z d d Z d6ddZ ddZ ddZ ddZddZddZddZddZeZeZefdd Zd7d"d#Zd8d$d%Zd&d'Zd(d)Zed9d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S):rz)Dictionary that remembers insertion orderc Osnt|dkrtdt|y |jWn6tk r\g|_}||dg|dd<i|_YnX|j||dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. rz$expected at most 1 arguments, got %dN)rIr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rRrkwdsrootrrrrTs    zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rr)rRrKrLZ dict_setitemrlastrrrrs  zOrderedDict.__setitem__cCs0||||jj|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rr)rRrKZ dict_delitem link_prev link_nextrrrrs zOrderedDict.__delitem__ccs2|j}|d}x||k r,|dV|d}qWdS)zod.__iter__() <==> iter(od)rr(N)r)rRrcurrrrrrs   zOrderedDict.__iter__ccs2|j}|d}x||k r,|dV|d}qWdS)z#od.__reversed__() <==> reversed(od)rr(N)r)rRrrrrr __reversed__s   zOrderedDict.__reversed__c CshyDx|jjD]}|dd=qW|j}||dg|dd<|jjWntk rXYnXtj|dS)z.od.clear() -> None. Remove all items from od.N)r itervaluesrrrr)rRZnoderrrrrszOrderedDict.clearTcCs||s td|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=tj||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrrr()rrrrr)rRrrlinkrrrKrLrrrrs   zOrderedDict.popitemcCst|S)zod.keys() -> list of keys in od)r)rRrrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|] }|qSrr)rbrK)rRrrrfsz&OrderedDict.values..r)rRr)rRrvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrr)rbrK)rRrrrfsz%OrderedDict.items..r)rRr)rRritemsszOrderedDict.itemscCst|S)z0od.iterkeys() -> an iterator over the keys in od)r)rRrrriterkeysszOrderedDict.iterkeysccsx|D]}||VqWdS)z2od.itervalues -> an iterator over the values in odNr)rRkrrrrs zOrderedDict.itervaluesccs x|D]}|||fVqWdS)z=od.iteritems -> an iterator over the (key, value) items in odNr)rRrrrr iteritemss zOrderedDict.iteritemscOst|dkr tdt|fn |s,td|d}f}t|dkrL|d}t|trrx^|D]}||||<q\WnDt|drx8|jD]}||||<qWnx|D]\}}|||<qWx|jD]\}}|||<qWdS)aod.update(E, **F) -> None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v r(z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrrN)rIrrrhasattrrr)rrrRotherrKrLrrrrQs&      zOrderedDict.updatecCs0||kr||}||=|S||jkr,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)rRrKrrrrrr!s zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr)rRrKrrrr setdefault.szOrderedDict.setdefaultc Cs^|si}t|tf}||kr"dSd||<z&|s>d|jjfSd|jj|jfS||=XdS)zod.__repr__() <==> repr(od)z...rz%s()z%s(%r)N)r _get_identrr4r)rRZ _repr_runningZcall_keyrrrr5szOrderedDict.__repr__cs\fddD}tj}xttD]}|j|dq*W|rPj|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrr)rbr)rRrrrfEsz*OrderedDict.__reduce__..N)varsrrrr)rRrZ inst_dictrr)rRr __reduce__Cs zOrderedDict.__reduce__cCs |j|S)z!od.copy() -> a shallow copy of od)r)rRrrrrMszOrderedDict.copycCs |}x|D] }|||<q W|S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrLdrKrrrrQs  zOrderedDict.fromkeyscCs6t|tr*t|t|ko(|j|jkStj||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrIrr__eq__)rRrrrrr \s  zOrderedDict.__eq__cCs ||k S)Nr)rRrrrr__ne__eszOrderedDict.__ne__cCst|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)r)rRrrrviewkeysjszOrderedDict.viewkeyscCst|S)z an object providing a view on od's values)r)rRrrr viewvaluesnszOrderedDict.viewvaluescCst|S)zBod.viewitems() -> a set-like object providing a view on od's items)r)rRrrr viewitemsrszOrderedDict.viewitems)T)N)N)N)"r4r5r6rUrTrrrrrrrrrrrrrrQrobjectrrrrr rrrr rrrrrrrrrs:         r)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCstj|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr,rG)rrrrrr|s  rc@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsJtj||}|jj|}||k rF|||<t|tttfkrF||_||_ |S)N) rr configuratorconvertrrConvertingListConvertingTupleparentrK)rRrKrLrrrrrs   zConvertingDict.__getitem__NcCsLtj|||}|jj|}||k rH|||<t|tttfkrH||_||_ |S)N) rrHrrrrrrrrK)rRrKrrLrrrrrHs  zConvertingDict.get)N)r4r5r6rUrrHrrrrrs rcCsDtj|||}|jj|}||k r@t|tttfkr@||_||_ |S)N) rrrrrrrrrrK)rRrKrrLrrrrrs  rc@s"eZdZdZddZd ddZdS) rzA converting list wrapper.cCsJtj||}|jj|}||k rF|||<t|tttfkrF||_||_ |S)N) rrrrrrrrrrK)rRrKrLrrrrrs   zConvertingList.__getitem__rcCs<tj||}|jj|}||k r8t|tttfkr8||_|S)N) rrrrrrrrr)rRidxrLrrrrrs   zConvertingList.popN)r)r4r5r6rUrrrrrrrs rc@seZdZdZddZdS)rzA converting tuple wrapper.cCsBtj||}|jj|}||k r>t|tttfkr>||_||_ |S)N) tuplerrrrrrrrrK)rRrKrLrrrrrs   zConvertingTuple.__getitem__N)r4r5r6rUrrrrrrsrc@seZdZdZejdZejdZejdZejdZ ejdZ ddd Z e e Zd d Zd d ZddZddZddZddZddZdS)rzQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)rcZcfgcCst||_||j_dS)N)rconfigr)rRr!rrrrTs zBaseConfigurator.__init__c Cs|jd}|jd}y`|j|}xP|D]H}|d|7}yt||}Wq&tk rl|j|t||}Yq&Xq&W|Stk rtjdd\}}td||f}|||_ |_ |YnXdS)zl Resolve strings to objects using standard import and attribute syntax. r7rrNzCannot resolve %r: %s) r9rimporterrr ImportErrorrkr|rG __cause__ __traceback__) rRrrvZusedfoundrEetbvrrrresolves"      zBaseConfigurator.resolvecCs |j|S)z*Default converter for the ext:// protocol.)r*)rRrLrrrrszBaseConfigurator.ext_convertc Cs|}|jj|}|dkr&td|n||jd}|j|jd}x|r|jj|}|rp||jd}nd|jj|}|r|jd}|jj|s||}n2yt |}||}Wnt k r||}YnX|r||jd}qJtd||fqJW|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr,rGendr!groups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)rRrLrestrr rnrrrr s2       zBaseConfigurator.cfg_convertcCst|t r&t|tr&t|}||_nt|t rLt|trLt|}||_n|t|t rrt|trrt|}||_nVt|tr|j j |}|r|j }|d}|j j |d}|r|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr)rrrrrrrr string_typesCONVERT_PATTERNr, groupdictvalue_convertersrHr)rRrLrr r4Z converterrrrrr)s*     zBaseConfigurator.convertcsrjd}t|s|j|}jdd}tfddD}|f|}|rnx |jD]\}}t|||qVW|S)z1Configure an object with a user-supplied factory.z()r7Ncs g|]}t|r||fqSr)r)rbr)r!rrrfLsz5BaseConfigurator.configure_custom..)rrr*rrsetattr)rRr!rZpropsrSrrvrLr)r!rconfigure_customEs    z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrr)rRrLrrras_tupleSs zBaseConfigurator.as_tupleN)r4r5r6rUr*r+r6r+r.r/r0r8 staticmethod __import__r"rTr*rr rr:r;rrrrrs      "r)r)rr)r)N)N)Z __future__rrWr*rkZsslr# version_inforZ basestringr5rrtypesrZ file_typeZ __builtin__builtinsZ ConfigParserZ configparserZ _backportrrr r r r Zurllibr rrrrrrrZurllib2rrrrrr r!r"r#r$ZhttplibZ xmlrpclibZQueueZqueuer%ZhtmlentitydefsZ raw_input itertoolsr&filterr'r1r)r/iostrr0Z urllib.parseZurllib.requestZ urllib.errorZ http.clientZclientZrequestZ xmlrpc.clientZ html.parserZ html.entitiesZentitiesinputr2r3rGrFrNrOrrVF_OKX_OKZzipfilerwr~rryZBaseZipExtFilerlrrr NameError collectionsrrrrgetfilesystemencodingrrtokenizercodecsrrr+rrZhtmlr?ZcgirrrreprlibrrZimprrZthreadrr Z dummy_threadZ_abcollrrrrZlogging.configrrIrrrrrrrrrrrs&      $,      ,0        2+A              [   b w  PK!D ' '(__pycache__/scripts.cpython-36.opt-1.pycnu[3 Pfx;@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZejeZdjZejdZd Zd d ZGd d d eZdS))BytesION) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executablein_venva s^#!.*pythonw?[0-9.]*([ ].*)?$a|# -*- coding: utf-8 -*- if __name__ == '__main__': import sys, re def _resolve(module, func): __import__(module) mod = sys.modules[module] parts = func.split('.') result = getattr(mod, parts.pop(0)) for p in parts: result = getattr(result, p) return result try: sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) func = _resolve('%(module)s', '%(func)s') rc = func() # None interpreted as 0 except Exception as e: # only supporting Python >= 2.6 sys.stderr.write('%%s\n' %% e) rc = 1 sys.exit(rc) cCsZd|krV|jdrD|jdd\}}d|krV|jd rVd||f}n|jdsVd|}|S)N z /usr/bin/env r"z%s "%s"z"%s") startswithsplit) executableenvZ _executabler/usr/lib/python3.6/scripts.py_enquote_executableBs  rc@seZdZdZeZdZd%ddZddZe j j d rBd d Z d d Z d&ddZddZeZddZddZd'ddZddZeddZejddZejdksejd krejdkrdd Zd(d!d"Zd)d#d$ZdS)* ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFcCsz||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t d|_ |pRt ||_ tjdkprtjdkortjdk|_ dS)NFposixjavaX.Ynt)rr) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr_fileop_is_nt)selfrrrdry_runZfileoprrr__init__[s   zScriptMaker.__init__cCs@|jddr<|jr|jd}n |jd}t} t| d} | jd|WdQRX| j } |||| }xd|D]Z} tj j |j | } |rrtj j | \}}|jdr|} d| } y|jj| |Wntk rntjdd | }tj j|r tj|tj| ||jj| |tjd ytj|Wntk rhYnXYnXnp|jr| jd | rd | |f} tj j| r|j rtjd | q|jj| ||jr|jj| g|j| qWdS)Nzutf-8pytwz __main__.pyz.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz %s.deletemez0Able to replace executable using .deleteme logic.z%s.%szSkipping existing file %s)rr(r!lineseprM _get_launcherrrZwritestrgetvaluer/r1rsplitextrr'Zwrite_binary_file Exceptionr:r;existsremoverenamedebugr?r r$set_executable_modeappend)r)namesrSZ script_bytes filenamesextZ use_launcherreZlauncherstreamZzfZzip_datar"outnameneZdfnamerrr _write_scriptsT            zScriptMaker._write_scriptc Csd}|r0|jdg}|r0ddj|}|jd}|jd||d}|j|jd}|j}t} d|jkrp| j|d|jkr| jd |t j d fd |jkr| jd |t j dd f|r|jddrd} nd} |j | |||| dS)NrAZinterpreter_argsz %sr zutf-8)r2rXz%s%srzX.Yz%s-%sr,Fpywra) r.r1rMrTr\r"r%r&addrJversionrw) r)r[rqr2rRargsrSscriptr"Z scriptnamesrrrrr _make_scripts(      zScriptMaker._make_scriptcCsd}tjj|jt|}tjj|jtjj|}|j rX|jj || rXt j d|dSyt |d}Wn t k r|js~d}YnLX|j}|st jd|j|dStj|jdd}|rd}|jdpd }|s|r|j|jj|||jr|jj|g|j|nt jd ||j|jjst|j\} } |jd |j| |} d |krbd } nd} tjj|} |j| g| |j || |r|jdS)NFznot copying %s (up-to-date)rbz"%s: %s is an empty file (skipping)s rFTrrAzcopying and adjusting %s -> %srspythonwrzra)!r!r/r1rr rr]rr'Znewerr:rmr6r9r*readliner;Zget_command_name FIRST_LINE_REmatchr0groupcloseZ copy_filer$rnroinforseekrTrwr7)r)r~rqZadjustrtfZ first_linerrRrQlinesrSrrrurrr _copy_scriptsR         zScriptMaker._copy_scriptcCs|jjS)N)r'r*)r)rrrr*JszScriptMaker.dry_runcCs ||j_dS)N)r'r*)r)valuerrrr*NsrcCsHtjddkrd}nd}d||f}tjddd}t|j|j}|S) NPZ64Z32z%s%s.exerdrr)structcalcsize__name__rsplitrfindbytes)r)Zkindbitsr"Zdistlib_packageresultrrrrfVs zScriptMaker._get_launchercCs6g}t|}|dkr"|j||n|j|||d|S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. N)r2)r rr)r) specificationr2rqr[rrrmakeds zScriptMaker.makecCs(g}x|D]}|j|j||q W|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r)Zspecificationsr2rqrrrr make_multiplews zScriptMaker.make_multiple)TFN)rAN)N)N)N)r __module__ __qualname____doc__SCRIPT_TEMPLATErWrr+r4rJrKrr=r@rTr\_DEFAULT_MANIFESTr^r`rwrrpropertyr*setterr!r"r#rfrrrrrrrRs,    82 4  r)iorZloggingr!rerrJcompatrrrZ resourcesrutilrr r r r Z getLoggerrr:striprcompilerrrobjectrrrrrs    PK!O1'')__pycache__/manifest.cpython-36.opt-1.pycnu[3 Pf9@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ ej eZejdejZejd ejejBZejdd ZGd ddeZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode) convert_pathManifestz\\w* z#.*?(?= )| (?=$)c@szeZdZdZdddZddZddZd d Zdd d ZddZ ddZ ddZ dddZ d ddZ d!ddZddZdS)"rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. NcCs>tjjtjj|ptj|_|jtj|_d|_t |_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfr r/usr/lib/python3.6/manifest.py__init__*szManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}xv|r|}tj |} x\| D]T} tj j || } tj| } | j } || r|jt | qR|| rR||  rR|| qRWq8WdS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrr popappendrlistdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"    zManifest.findallcCs4|j|jstjj|j|}|jjtjj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrrr rr raddr )ritemrrrr)Ts z Manifest.addcCsx|D]}|j|qWdS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r))ritemsr*rrradd_many^s zManifest.add_manyFcsffddtj}|rJt}x|D]}|tjj|q(W||O}ddtdd|DDS)z8 Return sorted files in directory order cs>|j|tjd||jkr:tjj|\}}||dS)Nzadd_dir added %s)r)loggerdebugr rr split)dirsdparent_)add_dirrrrr4ls    z Manifest.sorted..add_dircSsg|]}tjj|qSr)rr r).0Z path_tuplerrr zsz#Manifest.sorted..css|]}tjj|VqdS)N)rr r/)r5r rrr {sz"Manifest.sorted..)rrrr dirnamesorted)rZwantdirsresultr0fr)r4rrr9gs  zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}szManifest.clearcCs|j|\}}}}|dkrFx&|D]}|j|dds tjd|q Wn<|dkrnx|D]}|j|dd}qTWn|dkrx&|D]}|j|dds|tjd|q|Wn|d krx|D]}|j|dd}qWn|d krx|D] }|j||d stjd ||qWn|d kr&xz|D]}|j||d }q Wn\|dkrN|jd|d stjd|n4|dkrv|jd|d stjd|n td|dS)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludezglobal-includeFz3no files found matching %r anywhere in distributionzglobal-excludezrecursive-include)rz-no files found matching %r under directory %rzrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr-Zwarning_exclude_patternr)r directiveactionpatternsthedirZ dirpatternpatternfoundrrrprocess_directivesD           zManifest.process_directivec Cs|j}t|dkr,|ddkr,|jdd|d}d }}}|dkrxt|d kr`td |dd|dd D}n|dkrt|dkrtd|t|d}dd|d d D}n<|dkrt|d krtd|t|d}n td|||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rrr=r?global-includeglobal-excluderecursive-includerecursive-excluder@rANrz$%r expects ...cSsg|] }t|qSr)r)r5wordrrrr6sz-Manifest._parse_directive..z*%r expects ...cSsg|] }t|qSr)r)r5rPrrrr6sz!%r expects a single zunknown action %r)r=r?rLrMrNrOr@rA)r=r?rLrM)rNrO)r@rA)r/leninsertrr)rrEZwordsrFrGrHZ dir_patternrrrrBs:           zManifest._parse_directiveTcCsTd}|j||||}|jdkr&|jx(|jD]}|j|r.|jj|d}q.W|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. FNT)_translate_patternrr'searchrr))rrIr>ris_regexrJ pattern_rer$rrrrCs    zManifest._include_patterncCsFd}|j||||}x,t|jD]}|j|r |jj|d}q W|S)atRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)rTlistrrUremove)rrIr>rrVrJrWr;rrrrD)s   zManifest._exclude_patternc Csv|rt|trtj|S|Std kr:|jdjd\}}}|rR|j|}td krVnd}tjtj j |j d} |dk r4tdkr|jd} |j|dt |  } n&|j|} | t |t | t |} tj } tj dkrd} tdkrd| | j | d |f}n0|t |t |t |}d || | | ||f}n8|rltdkrRd| |}nd || |t |df}tj|S)aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). rQrr3N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s)rQr)rQr)rQr)rQr)rQr) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionescaperr rr rRr) rrIr>rrVstartr3endrWr Z empty_patternZ prefix_rerrrrrT=s@             zManifest._translate_patterncCs8tj|}tj}tjdkrd}d|}tjd||}|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). r[z\\\\z\1[^%s]z((? s    PK!uQQ(__pycache__/version.cpython-36.opt-1.pycnu[3 Pf\ @sZdZddlZddlZddlmZddddd d d d gZejeZGd d d e Z Gddde Z Gddde Z ejdZddZeZGddde ZddZGddde Zejddfejddfejddfejddfejd d!fejd"d!fejd#d$fejd%d&fejd'd(fejd)d*ff Zejd+dfejd,dfejd-d$fejd#d$fejd.dffZejd/Zd0d1Zd2d3Zejd4ejZd5d5d6d5d7ddd8Zd9d:ZGd;dde ZGdd?Z!d@dAZ"GdBd d e Z#GdCd d e Z$GdDdEdEe Z%e%eeee%eedFdGe%e"e$edHZ&e&dIe&dJ<dKd Z'dS)Lz~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesNormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemec@seZdZdZdS)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__rr/usr/lib/python3.6/version.pyr sc@sxeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZeddZdS)VersioncCs"|j|_}|j||_}dS)N)strip_stringparse_parts)selfspartsrrr__init__szVersion.__init__cCs tddS)Nzplease implement in a subclass)NotImplementedError)rrrrrr$sz Version.parsecCs$t|t|kr td||fdS)Nzcannot compare %r and %r)type TypeError)rotherrrr_check_compatible'szVersion._check_compatiblecCs|j||j|jkS)N)rr)rrrrr__eq__+s zVersion.__eq__cCs |j| S)N)r )rrrrr__ne__/szVersion.__ne__cCs|j||j|jkS)N)rr)rrrrr__lt__2s zVersion.__lt__cCs|j|p|j| S)N)r"r )rrrrr__gt__6szVersion.__gt__cCs|j|p|j|S)N)r"r )rrrrr__le__9szVersion.__le__cCs|j|p|j|S)N)r#r )rrrrr__ge__<szVersion.__ge__cCs t|jS)N)hashr)rrrr__hash__@szVersion.__hash__cCsd|jj|jfS)Nz%s('%s')) __class__r r)rrrr__repr__CszVersion.__repr__cCs|jS)N)r)rrrr__str__FszVersion.__str__cCs tddS)NzPlease implement in subclasses.)r)rrrr is_prereleaseIszVersion.is_prereleaseN)r r rrrrr r!r"r#r$r%r'r)r*propertyr+rrrrrsrc @seZdZdZejdZejdZejdZddddddd dd dd dd dd ddZ ddZ ddZ e ddZ ddZddZddZddZddZdd ZdS)!MatcherNz^(\w[\s\w'.-]*)(\((.*)\))?z'^(<=|>=|<|>|!=|={2,3}|~=)?\s*([^\s,]+)$z ^\d+(\.\d+)*$cCs||kS)Nr)vcprrrWszMatcher.cCs||kS)Nr)r.r/r0rrrr1XscCs||kp||kS)Nr)r.r/r0rrrr1YscCs||kp||kS)Nr)r.r/r0rrrr1ZscCs||kS)Nr)r.r/r0rrrr1[scCs||kS)Nr)r.r/r0rrrr1\scCs||kp||kS)Nr)r.r/r0rrrr1^scCs||kS)Nr)r.r/r0rrrr1_s)<>z<=z>=z==z===z~=z!=c CsJ|jdkrtd|j|_}|jj|}|snsz$Matcher.__init__..,zInvalid %r in %rz~=rz.*==!=z#'.*' not allowed for %r constraintsTF)r9r:) version_class ValueErrorrrdist_rematchgroupsnamelowerkeysplitcomp_reendswithnum_reappendtupler) rrmr@ZclistZ constraintsr/opZvnprefixrrrrbs:           zMatcher.__init__cCszt|tr|j|}x`|jD]V\}}}|jj|}t|trFt||}|sbd||jjf}t |||||sdSqWdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z%r not implemented for %sFT) isinstancerr<r _operatorsgetgetattrr(r r)rversionoperator constraintrLfmsgrrrr?s      z Matcher.matchcCs6d}t|jdkr2|jdddkr2|jdd}|S)Nrr=====)rVrW)lenr)rresultrrr exact_versions zMatcher.exact_versioncCs0t|t|ks|j|jkr,td||fdS)Nzcannot compare %s and %s)rrAr)rrrrrrszMatcher._check_compatiblecCs"|j||j|jko |j|jkS)N)rrCr)rrrrrr s zMatcher.__eq__cCs |j| S)N)r )rrrrrr!szMatcher.__ne__cCst|jt|jS)N)r&rCr)rrrrr'szMatcher.__hash__cCsd|jj|jfS)Nz%s(%r))r(r r)rrrrr)szMatcher.__repr__cCs|jS)N)r)rrrrr*szMatcher.__str__)r r rr<recompiler>rErGrNrr?r,rZrr r!r'r)r*rrrrr-Ns*    % r-zk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c Cs|j}tj|}|s"td||j}tdd|djdD}x(t|dkrn|ddkrn|dd}qHW|ds~d}n t|d}|dd}|d d }|d d }|d }|dkrf}n|dt|df}|dkrf}n|dt|df}|dkr f}n|dt|df}|dkr.f}nLg} x>|jdD]0} | j rZdt| f} nd| f} | j | q>Wt| }|s| r|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %scss|]}t|VqdS)N)int)r6r.rrr sz_pep_440_key..r.r az_finalrk)NN)NN)NNrk)rgrk)rh)ri)rj) rPEP440_VERSION_REr?r r@rIrDrXr]isdigitrH) rrJr@ZnumsZepochpreZpostdevZlocalrpartrrr _pep_440_keysT         rqc@s6eZdZdZddZedddddgZed d Zd S) raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCs<t|}tj|}|j}tdd|djdD|_|S)Ncss|]}t|VqdS)N)r])r6r.rrrr^sz*NormalizedVersion.parse..rr_)_normalized_keyrlr?r@rIrD_release_clause)rrrYrJr@rrrrs  zNormalizedVersion.parsergbr/rcrocstfddjDS)Nc3s |]}|r|djkVqdS)rN) PREREL_TAGS)r6t)rrrr^sz2NormalizedVersion.is_prerelease..)anyr)rr)rrr+szNormalizedVersion.is_prereleaseN) r r rrrsetrvr,r+rrrrrs cCs>t|}t|}||krdS|j|s*dSt|}||dkS)NTFr_)str startswithrX)xynrrr _match_prefix"s rc @sneZdZeZddddddddd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZdS)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)z~=r2r3z<=z>=z==z===z!=cCsV|rd|ko|jd}n|jd o,|jd}|rN|jjddd}|j|}||fS)N+rrrkrkrk)rrrDr<)rrQrSrLZ strip_localrrrr _adjust_local<s zNormalizedMatcher._adjust_localcCsD|j|||\}}||krdS|j}djdd|D}t|| S)NFr_cSsg|] }t|qSr)rz)r6irrrr7Osz/NormalizedMatcher._match_lt..)rrsjoinr)rrQrSrLrelease_clausepfxrrrrJs zNormalizedMatcher._match_ltcCsD|j|||\}}||krdS|j}djdd|D}t|| S)NFr_cSsg|] }t|qSr)rz)r6rrrrr7Wsz/NormalizedMatcher._match_gt..)rrsrr)rrQrSrLrrrrrrRs zNormalizedMatcher._match_gtcCs|j|||\}}||kS)N)r)rrQrSrLrrrrZszNormalizedMatcher._match_lecCs|j|||\}}||kS)N)r)rrQrSrLrrrr^szNormalizedMatcher._match_gecCs.|j|||\}}|s ||k}n t||}|S)N)rr)rrQrSrLrYrrrrbs   zNormalizedMatcher._match_eqcCst|t|kS)N)rz)rrQrSrLrrrrjsz"NormalizedMatcher._match_arbitrarycCs0|j|||\}}|s ||k}n t|| }|S)N)rr)rrQrSrLrYrrrrms   zNormalizedMatcher._match_necCsf|j|||\}}||krdS||kr*dS|j}t|dkrH|dd}djdd|D}t||S)NTFrr_cSsg|] }t|qSr)rz)r6rrrrr7sz7NormalizedMatcher._match_compatible..rk)rrsrXrr)rrQrSrLrrrrrrus  z#NormalizedMatcher._match_compatibleN)r r rrr<rNrrrrrrrrrrrrrr-s$z[.+-]$r4z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$z\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}r_z\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cCsZ|jj}xtD]\}}|j||}qW|s2d}tj|}|sJd}|}n|jdjd}dd|D}xt|dkr|j dqlWt|dkr||j d}n8dj dd|ddD||j d}|dd}dj d d|D}|j}|rxt D]\}}|j||}qW|s*|}nd |kr8d nd }|||}t |sVd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rr_cSsg|] }t|qSr)r])r6rrrrr7sz-_suggest_semantic_version..NcSsg|] }t|qSr)rz)r6rrrrr7scSsg|] }t|qSr)rz)r6rrrrr7sro-r)rrB _REPLACEMENTSsub_NUMERIC_PREFIXr?r@rDrXrHendr_SUFFIX_REPLACEMENTS is_semver)rrYZpatreplrJrLsuffixseprrr_suggest_semantic_versions:   ,   rcCsly t||Stk r YnX|j}xdBD]\}}|j||}q0Wtjdd|}tjdd|}tjdd|}tjdd|}tjdd|}|jdr|d d!}tjd"d|}tjd#d$|}tjd%d&|}tjd'd|}tjd(d)|}tjd*d)|}tjd+d |}tjd,d-|}tjd.d&|}tjd/d0|}tjd1d2|}y t|Wntk rfd!}YnX|S)CaSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. -alpharg-betartrrrur/-finalr4-pre-release.release-stablerr_ri .finalrjzpre$Zpre0zdev$Zdev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?z\1r.rNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$z\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1rrgrrtrrgrrtrur/rr4rr/rr4rr4rr4rr_rir_rr4rr4rjr4)rrrrrrrrrrrrrrr)rrr rBreplacer[rr{)rZrsZorigrrrr_suggest_normalized_versionsH      rz([a-z]+|\d+|[\.-])r/zfinal-@)rnZpreviewrruror4r_cCs~dd}g}xh||D]\}|jdrh|dkrJx|rH|ddkrH|jq.Wx|rf|d dkrf|jqLW|j|qWt|S) NcSsxg}xdtj|jD]R}tj||}|rd|ddkoBdknrT|jd}nd|}|j|qW|jd|S)N0r9*z*final) _VERSION_PARTrDrB_VERSION_REPLACErOzfillrH)rrYr0rrr get_partsIs    z_legacy_key..get_partsrz*finalrz*final-Z00000000rkrk)r{poprHrI)rrrYr0rrr _legacy_keyHs    rc@s eZdZddZeddZdS)rcCst|S)N)r)rrrrrrcszLegacyVersion.parsecCs:d}x0|jD]&}t|tr |jdr |dkr d}Pq W|S)NFrz*finalT)rrMrr{)rrYr|rrrr+fs zLegacyVersion.is_prereleaseN)r r rrr,r+rrrrrbsc@s4eZdZeZeejZded<ej dZ ddZ dS)rrz~=z^(\d+(\.\d+)*)cCs`||kr dS|jjt|}|s2tjd||dS|jd}d|krV|jddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrr_r) numeric_rer?rzloggerZwarningr@rsplitr)rrQrSrLrJrrrrrys zLegacyMatcher._match_compatibleN) r r rrr<dictr-rNr[r\rrrrrrrqs   zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs tj|S)N) _SEMVER_REr?)rrrrrsrc Csndd}t|}|st||j}dd|ddD\}}}||dd||dd}}|||f||fS) NcSs8|dkr|f}n$|ddjd}tdd|D}|S)Nrr_cSs"g|]}|jr|jdn|qS)r)rmr)r6r0rrrr7sz5_semantic_key..make_tuple..)rDrI)rZabsentrYrrrr make_tuples z!_semantic_key..make_tuplecSsg|] }t|qSr)r])r6rrrrr7sz!_semantic_key..r|r)rr r@) rrrJr@majorminorZpatchrnZbuildrrr _semantic_keys rc@s eZdZddZeddZdS)rcCst|S)N)r)rrrrrrszSemanticVersion.parsecCs|jdddkS)Nrrr)r)rrrrr+szSemanticVersion.is_prereleaseN)r r rrr,r+rrrrrsc@seZdZeZdS)r N)r r rrr<rrrrr sc@s6eZdZd ddZddZddZdd Zd d ZdS) VersionSchemeNcCs||_||_||_dS)N)rCmatcher suggester)rrCrrrrrrszVersionScheme.__init__c Cs2y|jj|d}Wntk r,d}YnX|S)NTF)rr<r )rrrYrrris_valid_versions   zVersionScheme.is_valid_versionc Cs0y|j|d}Wntk r*d}YnX|S)NTF)rr )rrrYrrris_valid_matchers   zVersionScheme.is_valid_matchercCs|jd|S)z: Used for processing some metadata fields zdummy_name (%s))r)rrrrris_valid_constraint_listsz&VersionScheme.is_valid_constraint_listcCs|jdkrd}n |j|}|S)N)r)rrrYrrrsuggests  zVersionScheme.suggest)N)r r rrrrrrrrrrrs  rcCs|S)Nr)rrrrrr1sr1) normalizedlegacyZsemanticrdefaultcCs|tkrtd|t|S)Nzunknown scheme name: %r)_SCHEMESr=)rArrrr s )(rZloggingr[compatr__all__Z getLoggerr rr=r objectrr-r\rlrqrrrrrrrrrrIrrrrrrrrrr rrr rrrr sz  1k =$ W             .r $  PK!*(*(#__pycache__/manifest.cpython-36.pycnu[3 Pf9@sdZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ ej eZejdejZejd ejejBZejdd ZGd ddeZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode) convert_pathManifestz\\w* z#.*?(?= )| (?=$)c@szeZdZdZdddZddZddZd d Zdd d ZddZ ddZ ddZ dddZ d ddZ d!ddZddZdS)"rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. NcCs>tjjtjj|ptj|_|jtj|_d|_t |_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfr r/usr/lib/python3.6/manifest.py__init__*szManifest.__init__cCsddlm}m}m}g|_}|j}|g}|j}|j}xv|r|}tj |} x\| D]T} tj j || } tj| } | j } || r|jt | qR|| rR||  rR|| qRWq8WdS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrr popappendrlistdirr joinst_moder)rrrrrrootstackrpushnamesnamefullnamermoderrrfindall9s"    zManifest.findallcCs4|j|jstjj|j|}|jjtjj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrrr rr raddr )ritemrrrr)Ts z Manifest.addcCsx|D]}|j|qWdS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r))ritemsr*rrradd_many^s zManifest.add_manyFcsffddtj}|rJt}x|D]}|tjj|q(W||O}ddtdd|DDS)z8 Return sorted files in directory order csJ|j|tjd||jkrFtjj|\}}|dks.add_dircSsg|]}tjj|qSr)rr r).0Z path_tuplerrr zsz#Manifest.sorted..css|]}tjj|VqdS)N)rr r1)r8r rrr {sz"Manifest.sorted..)rrrr dirnamesorted)rZwantdirsresultr3fr)r7rrr<gs  zManifest.sortedcCst|_g|_dS)zClear all collected files.N)rrr)rrrrclear}szManifest.clearcCs|j|\}}}}|dkrFx&|D]}|j|dds tjd|q Wn<|dkrnx|D]}|j|dd}qTWn|dkrx&|D]}|j|dds|tjd|q|Wn|d krx|D]}|j|dd}qWn|d krx|D] }|j||d stjd ||qWn|d kr&xz|D]}|j||d }q Wn\|dkrN|jd|d stjd|n4|dkrv|jd|d stjd|n td|dS)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludezglobal-includeFz3no files found matching %r anywhere in distributionzglobal-excludezrecursive-include)rz-no files found matching %r under directory %rzrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr/Zwarning_exclude_patternr)r directiveactionpatternsthedirZ dirpatternpatternfoundrrrprocess_directivesD           zManifest.process_directivec Cs|j}t|dkr,|ddkr,|jdd|d}d }}}|dkrxt|d kr`td |dd|dd D}n|dkrt|dkrtd|t|d}dd|d d D}n<|dkrt|d krtd|t|d}n td|||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rrr@rBglobal-includeglobal-excluderecursive-includerecursive-excluderCrDNrz$%r expects ...cSsg|] }t|qSr)r)r8wordrrrr9sz-Manifest._parse_directive..z*%r expects ...cSsg|] }t|qSr)r)r8rSrrrr9sz!%r expects a single zunknown action %r)r@rBrOrPrQrRrCrD)r@rBrOrP)rQrR)rCrD)r1leninsertrr)rrHZwordsrIrJrKZ dir_patternrrrrEs:           zManifest._parse_directiveTcCsTd}|j||||}|jdkr&|jx(|jD]}|j|r.|jj|d}q.W|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. FNT)_translate_patternrr'searchrr))rrLrAris_regexrM pattern_rer$rrrrFs    zManifest._include_patterncCsFd}|j||||}x,t|jD]}|j|r |jj|d}q W|S)atRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)rWlistrrXremove)rrLrArrYrMrZr>rrrrG)s   zManifest._exclude_patternc Cs|rt|trtj|S|Std kr:|jdjd\}}}|rj|j|}td krn|j|rd|j|snt nd}tj t j j |jd} |dk rftdkr|jd} |j|dt|  } n>|j|} | j|r| j|st | t|t| t|} t j} t jdkrd} tdkr4d| | j | d |f}n0|t|t|t|}d || | | ||f}n8|rtdkrd| |}nd || |t|df}tj|S)aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). rTrr6r-N\z\\^z.*z%s%s%s%s.*%s%sz%s%s%s)rTr)rTr)rTr)rTr)rTr) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionr(endswithr2escaperr rr rUr) rrLrArrYstartr6endrZr Z empty_patternZ prefix_rerrrrrW=sB             zManifest._translate_patterncCs8tj|}tj}tjdkrd}d|}tjd||}|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). r]z\\\\z\1[^%s]z((? s    PK!̒1yiyi#__pycache__/metadata.cpython-36.pycnu[3 Pf@sdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZejeZGd d d e ZGd dde ZGddde ZGddde ZdddgZdZ dZ!ej"dZ#ej"dZ$dGZ%dHZ&dIZ'dJZ(dKZ)dLZ*dMZ+e,Z-e-j.e%e-j.e&e-j.e(e-j.e*ej"d8Z/d9d:Z0d;d<Z1ddddd%ddd d!d"d#d+d,d$d&d'd-d/d0d5d1d2d*d)d(d.d3d4d6d7d=Z2dNZ3dOZ4dPZ5dQZ6dRZ7dSZ8dTZ9e:Z;ej"d>ZdDZ?dEZ@GdFdde:ZAdS)VzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REc@seZdZdZdS)MetadataMissingErrorzA required metadata is missingN)__name__ __module__ __qualname____doc__rr/usr/lib/python3.6/metadata.pyrsrc@seZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.N)rrrrrrrrr src@seZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.N)rrrrrrrrr$src@seZdZdZdS)MetadataInvalidErrorzA metadata value is invalidN)rrrrrrrrr(srMetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONzutf-8z1.1z \|z Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicenseSupported-Platform Classifier Download-URL ObsoletesProvidesRequires MaintainerMaintainer-emailObsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-ExternalPrivate-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extraz"extra\s*==\s*("([^"]+)"|'([^']+)')cCs<|dkr tS|dkrtS|dkr$tS|dkr0tSt|dS)Nz1.0z1.1z1.2z2.0) _241_FIELDS _314_FIELDS _345_FIELDS _426_FIELDSr)versionrrr_version2fieldlistgsr?c Csdd}g}x.|jD]"\}}|gddfkr.q|j|qWddddg}xt|D]l}|tkrld|krl|jd|tkrd|kr|jd|tkrd|kr|jd|tkrNd|krN|jdqNWt|d kr|d St|d krtd d|ko||t }d|ko ||t }d|ko||t }t |t |t |d krFtd | rl| rl| rlt |krlt S|rvdS|rdSdS) z5Detect the best version depending on the fields used.cSsx|D]}||krdSqWdS)NTFr)keysmarkersmarkerrrr _has_markerus z"_best_version.._has_markerUNKNOWNNz1.0z1.1z1.2z2.0rrzUnknown metadata setz(You used incompatible 1.1/1.2/2.0 fields)itemsappendr:remover;r<r=lenr _314_MARKERS _345_MARKERS _426_MARKERSintr) fieldsrCr@keyvalueZpossible_versionsZis_1_1Zis_1_2Zis_2_0rrr _best_versionssB        rP)metadata_versionnamer>platformZsupported_platformsummary descriptionkeywords home_pageauthor author_email maintainermaintainer_emaillicense classifier download_urlobsoletes_dist provides_dist requires_distsetup_requires_distrequires_pythonrequires_externalrequiresprovides obsoletes project_urlZprivate_versionZ obsoleted_by extensionZprovides_extraz[^A-Za-z0-9.]+FcCs0|r$tjd|}tjd|jdd}d||fS)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.- .z%s-%s) _FILESAFEsubreplace)rRr>Z for_filenamerrr_get_name_and_versions rpc@s eZdZdZd?ddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZd@ddZddZdd Zd!d"Zd#d$ZdAd%d&ZdBd'd(ZdCd)d*Zd+d,Zefd-d.ZdDd/d0ZdEd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!dS)FLegacyMetadataaaThe legacy metadata of a release. Supports versions 1.0, 1.1 and 1.2 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcCsz|||gjddkrtdi|_g|_d|_||_|dk rH|j|n.|dk r\|j|n|dk rv|j||j dS)Nz'path, fileobj and mapping are exclusive) count TypeError_fieldsZrequires_filesZ _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrwrrr__init__s   zLegacyMetadata.__init__cCst|j|jd<dS)NzMetadata-Version)rPrv)r|rrrr{sz#LegacyMetadata.set_metadata_versioncCs|jd||fdS)Nz%s: %s )write)r|r~rRrOrrr _write_field szLegacyMetadata._write_fieldcCs |j|S)N)get)r|rRrrr __getitem__szLegacyMetadata.__getitem__cCs |j||S)N)set)r|rRrOrrr __setitem__szLegacyMetadata.__setitem__c Cs8|j|}y |j|=Wntk r2t|YnXdS)N) _convert_namervKeyError)r|rR field_namerrr __delitem__s   zLegacyMetadata.__delitem__cCs||jkp|j||jkS)N)rvr)r|rRrrr __contains__s zLegacyMetadata.__contains__cCs(|tkr |S|jddj}tj||S)Nrj_) _ALL_FIELDSrolower _ATTR2FIELDr)r|rRrrrrszLegacyMetadata._convert_namecCs|tks|tkrgSdS)NrD) _LISTFIELDS_ELEMENTSFIELD)r|rRrrr_default_value%szLegacyMetadata._default_valuecCs&|jdkrtjd|Stjd|SdS)N1.01.1 )rr)rQ_LINE_PREFIX_PRE_1_2rn_LINE_PREFIX_1_2)r|rOrrr_remove_line_prefix*s  z"LegacyMetadata._remove_line_prefixcCs|tkr||St|dS)N)rAttributeError)r|rRrrr __getattr__0szLegacyMetadata.__getattr__FcCst|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.rr)rp)r|Zfilesaferrr get_fullname;szLegacyMetadata.get_fullnamecCs|j|}|tkS)z+return True if name is a valid metadata key)rr)r|rRrrris_fieldAs zLegacyMetadata.is_fieldcCs|j|}|tkS)N)rr)r|rRrrris_multi_fieldFs zLegacyMetadata.is_multi_fieldc Cs.tj|ddd}z|j|Wd|jXdS)z*Read the metadata values from a file path.rzutf-8)encodingN)codecsopenryclose)r|filepathfprrrrxJszLegacyMetadata.readcCst|}|d|jd<xxtD]p}||kr*q|tkrh|j|}|tkrZ|dk rZdd|D}|j||q||}|dk r|dkr|j||qW|jdS)z,Read the metadata values from a file object.zmetadata-versionzMetadata-VersionNcSsg|]}t|jdqS),)tuplesplit).0rOrrr _sz,LegacyMetadata.read_file..rD)rrvrrZget_all_LISTTUPLEFIELDSrr{)r|ZfileobmsgfieldvaluesrOrrrryRs  zLegacyMetadata.read_filec Cs0tj|ddd}z|j||Wd|jXdS)z&Write the metadata fields to filepath.wzutf-8)rN)rr write_filer)r|r skip_unknownrrrrrhszLegacyMetadata.writecCs|jxt|dD]}|j|}|r:|dgdgfkr:q|tkrX|j||dj|q|tkr|dkr|jd kr|jdd}n |jdd }|g}|t krd d |D}x|D]}|j|||qWqWd S)z0Write the PKG-INFO format data to a file object.zMetadata-VersionrDrr!1.01.1rz z |cSsg|]}dj|qS)r)join)rrOrrrrsz-LegacyMetadata.write_file..N)rr) r{r?rrrrrrQror)r|Z fileobjectrrrrOrrrrps$    zLegacyMetadata.write_filec sfdd}|snHt|dr>x<|jD]}||||q&Wnx|D]\}}|||qDW|r~x|jD]\}}|||qhWdS)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs"|tkr|rjj||dS)N)rrr)rNrO)r|rr_sets z#LegacyMetadata.update.._setr@N)hasattrr@rE)r|otherkwargsrkvr)r|rrzs  zLegacyMetadata.updatecCsn|j|}|tks|dkrPt|ttf rPt|trJdd|jdD}q~g}n.|tkr~t|ttf r~t|trz|g}ng}tj t j rB|d}t |j }|tkr|dk rx|D](}|j|jddstjd |||qWn`|tko|dk r|j|sBtjd |||n0|tkrB|dk rB|j|sBtjd ||||tkr`|d kr`|j|}||j|<dS) z"Control then set a metadata field.rcSsg|] }|jqSr)strip)rrrrrrsz&LegacyMetadata.set..rrN;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r!)rr isinstancelistrrrrloggerZ isEnabledForloggingZWARNINGr rw_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrrv)r|rRrOZ project_namerwrrrrrs@            zLegacyMetadata.setcCs|j|}||jkr*|tkr&|j|}|S|tkr@|j|}|S|tkr|j|}|dkr^gSg}x6|D].}|tkr|j|qh|j|d|dfqhW|S|tkr|j|}t |t r|j dS|j|S)zGet a metadata field.Nrrr) rrv_MISSINGrrrrrFrrrr)r|rRrrrOresvalrrrrs.          zLegacyMetadata.getc s |jgg}}xd D]}||kr|j|qW|rT|gkrTddj|}t|xdD]}||krZ|j|qZW|ddkr||fSt|jfd d }xdt|ftjft j ffD]F\}}x<|D]4} |j | d } | d k o||  r|jd | | fqWqW||fS)zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are providedrrzmissing required metadata: %sz, Home-pager$zMetadata-Versionz1.2cs*x$|D]}j|jddsdSqWdS)NrrFT)rr)rOr)rwrrare_valid_constraintss z3LegacyMetadata.check..are_valid_constraintsNzWrong value for '%s': %s)rr)rr$) r{rFrrr rwrrrrrr) r|strictmissingwarningsattrrrrMZ controllerrrOr)rwrchecks2         zLegacyMetadata.checkcCs|jdB}i}x,|D]$\}}| s.||jkr||||<qW|ddkrdK}x|D]F\}}| sn||jkrV|d&kr||||<qVd,d-||D||<qVWnF|dd.krdO}x2|D]*\}}| s||jkr||||<qW|S)PzReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). rQMetadata-VersionrRrr>rrTr rW Home-pagerXr$rY Author-emailr\r&rUr!rVr"rSr classifiersr(r^ Download-URLz1.2ra Requires-DistrcRequires-PythonrdRequires-Externalr` Provides-Distr_Obsoletes-Distrh Project-URLrZr-r[Maintainer-emailcSsg|]}dj|qS)r)r)rurrrrGsz)LegacyMetadata.todict..z1.1rfr+rer,rgr*rQrrRrr>rrTr rWrrXr$rYrr\r&rUr!rVr"rSrrr(r^r) rrrrrrrrrrrrrrarrcrrdrr`rr_rrhrrZr-r[r)rrrrrrrrrfr+rer,rgr*)rrr)r{rv)r|Z skip_missingZ mapping_1_0datarNrZ mapping_1_2Z mapping_1_1rrrtodictsP zLegacyMetadata.todictcCs<|ddkr(xdD]}||kr||=qW|d|7<dS)NzMetadata-Versionz1.1r*r,r+z Requires-Dist)r*r,r+r)r| requirementsrrrradd_requirementsUs    zLegacyMetadata.add_requirementscCstt|dS)NzMetadata-Version)rr?)r|rrrr@`szLegacyMetadata.keysccsx|jD] }|Vq WdS)N)r@)r|rNrrr__iter__cszLegacyMetadata.__iter__csfddjDS)Ncsg|] }|qSrr)rrN)r|rrrhsz)LegacyMetadata.values..)r@)r|r)r|rrgszLegacyMetadata.valuescsfddjDS)Ncsg|]}||fqSrr)rrN)r|rrrksz(LegacyMetadata.items..)r@)r|r)r|rrEjszLegacyMetadata.itemscCsd|jj|j|jfS)Nz <%s %s %s>) __class__rrRr>)r|rrr__repr__ms zLegacyMetadata.__repr__)NNNrr)F)F)F)N)F)F)"rrrrrr{rrrrrrrrrrrrrxryrrrzrrrrrrr@rrrErrrrrrqs>      ,  , ; rqz pydist.jsonz metadata.jsonc@seZdZdZejdZejdejZe Z ejdZ dZ de ZffdIdZd Zd ZeffedJfe dKfe dLfd ZdMZdNddZedOZdefZdefZdefdefeeedefeeeedefdPdQd Z[[dd ZdRd!d"Zd#d$Zed%d&Z ed'd(Z!e!j"d)d(Z!dSd*d+Z#ed,d-Z$ed.d/Z%e%j"d0d/Z%d1d2Z&d3d4Z'd5d6Z(d7d8Z)d9d:d;dZ*d?d@Z+dTdCdDZ,dEdFZ-dGdHZ.dS)Urz The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z .{1,2047}z2.0z distlib (%s)legacy)rRr>rTzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)rQrRr>rT_legacy_datarwNrrcCs0|||gjddkrtdd|_d|_||_|dk rzy|j||||_Wn*tk rvt||d|_|jYnXnd}|rt |d}|j }WdQRXn |r|j }|dkr|j |j d|_ndt |ts|jd}ytj||_|j|j|Wn0tk r*tt||d|_|jYnXdS)Nrsz'path, fileobj and mapping are exclusive)rrwrb)rQ generatorzutf-8)r~rw)rtrurrrw_validate_mappingrrqvalidaterrxMETADATA_VERSION GENERATORrr decodejsonloads ValueErrorr)r|r}r~rrwrfrrrrs<       zMetadata.__init__rRr>r\rVrTz Requires-DistzSetup-Requires-DistzProvides-Extrar( Download-URLMetadata-Version) run_requiresbuild_requires dev_requiresZ test_requires meta_requiresextrasmodules namespacesexportscommandsrZ source_urlrQc CsZtj|d}tj|d}||kr||\}}|jr^|dkrP|dkrHdn|}n |jj|}n|dkrjdn|}|d kr|jj||}nt}|}|jjd} | r |dkr| jd |}nR|dkr| jd } | r| j||}n.| jd } | s|jjd } | r | j||}||krV|}n:||kr4tj||}n"|jrJ|jj|}n |jj|}|S) N common_keys mapped_keysrrrrr extensionszpython.commandszpython.detailszpython.exports)rrrrr)object__getattribute__rrr) r|rNcommonmappedlkZmakerresultrOsentineldrrrrsF            zMetadata.__getattribute__cCsH||jkrD|j|\}}|p |j|krD|j|}|sDtd||fdS)Nz.'%s' is an invalid value for the '%s' property)SYNTAX_VALIDATORSrwmatchr)r|rNrOrwpattern exclusionsmrrr_validate_values  zMetadata._validate_valuecCs*|j||tj|d}tj|d}||kr||\}}|jrV|dkrJt||j|<nf|d krj||j|<nR|jjdi}|dkr||d <n2|dkr|jd i}|||<n|jd i}|||<nh||krtj|||nP|d krt|t r|j }|r|j }ng}|jr||j|<n ||j|<dS)Nrrrrrrrrzpython.commandszpython.detailszpython.exportsrV)rrrrr) r'rrrNotImplementedErrorr setdefault __setattr__rrrr)r|rNrOrrrrr!rrrr*s>               zMetadata.__setattr__cCst|j|jdS)NT)rprRr>)r|rrrname_and_version@szMetadata.name_and_versioncCsF|jr|jd}n|jjdg}d|j|jf}||krB|j||S)Nz Provides-Distrfz%s (%s))rrr)rRr>rF)r|rsrrrrfDs  zMetadata.providescCs |jr||jd<n ||jd<dS)Nz Provides-Distrf)rr)r|rOrrrrfOs c Cs|jr |}ng}t|pg|j}xl|D]d}d|kr@d|kr@d}n8d|krNd}n|jd|k}|rx|jd}|rxt||}|r&|j|dq&WxNd D]F}d|} | |kr|j| |jjd |g}|j|j|||d qW|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrebuilddevtestz:%s:z %s_requires)renv)r/r0r1) rr rrr extendrGrget_requirements) r|reqtsrr2rr!includerBrNerrrr4Vs0       zMetadata.get_requirementscCs|jr|jS|jS)N)r _from_legacyr)r|rrr dictionaryszMetadata.dictionarycCs|jr tnt|j|jSdS)N)rr(r rDEPENDENCY_KEYS)r|rrr dependenciesszMetadata.dependenciescCs|jr tn |jj|dS)N)rr(rrz)r|rOrrrr;sc Cs|jd|jkrtg}x0|jjD]"\}}||kr&||kr&|j|q&W|rfddj|}t|x"|jD]\}}|j|||qpWdS)NrQzMissing metadata items: %sz, ) rrrMANDATORY_KEYSrErFrrr') r|rrwrrNr%rrrrrrrszMetadata._validate_mappingcCsB|jr.|jjd\}}|s|r>tjd||n|j|j|jdS)NTz#Metadata: missing: %s, warnings: %s)rrrrrrrw)r|rrrrrrs  zMetadata.validatecCs(|jr|jjdSt|j|j}|SdS)NT)rrr r INDEX_KEYS)r|rrrrrs zMetadata.todictc Cs|jr|j st|j|jd}|jjd}x2dD]*}||kr2|dkrLd }n|}||||<q2W|jd g}|d gkrzg}||d <d}x2|D]*\}}||kr||rd||ig||<qW|j|d<i}i} |S)N)rQrTrRr>r\rTrUr]rr"rVrarrbrrerf)rRr>r\rTrUr]rarrbr)r?r@)rrAssertionErrorrrrrrf) r|rZlmdrnkkwr@okrXrZrrrr8s0     zMetadata._from_legacyrrr&r r!)rRr>r\rTrUrcCsdd}|jr|j stt}|j}x*|jjD]\}}||kr2||||<q2W||j|j}||j|j }|j rt |j |d<t ||d<t ||d<|S)NcSst}x|D]}|jd}|jd}|d}xb|D]Z}| rN| rN|j|q2d}|r^d|}|rx|rtd||f}n|}|jdj||fq2Wq W|S)Nr-r.rer>z extra == "%s"z (%s) and %sr)rraddr)Zentriesr5r7r-r2ZrlistrrBrrrprocess_entriess"      z,Metadata._to_legacy..process_entrieszProvides-Extraz Requires-DistzSetup-Requires-Dist) rrrArqLEGACY_MAPPINGrErrrrrsorted)r|rFrZnmdrBrDZr1Zr2rrr _to_legacys  zMetadata._to_legacyFTcCs||gjddkrtd|j|r`|jr4|j}n|j}|rP|j||dq|j||dn^|jrp|j}n|j}|rt j ||ddddn.t j |dd}t j ||ddddWdQRXdS) Nrz)Exactly one of path and fileobj is needed)rTrs)Z ensure_asciiindentZ sort_keysrzutf-8) rtr rrrIrrr8rrdumprr)r|r}r~rrZ legacy_mdr!r rrrrs&    zMetadata.writecCs|jr|jj|nt|jjdg}d}x"|D]}d|kr,d|kr,|}Pq,W|dkrhd|i}|jd|n t|dt|B}t||d<dS)Nrr.r-rer)rrrr)insertrrH)r|rralwaysentryZrsetrrrrs zMetadata.add_requirementscCs*|jpd}|jpd}d|jj|j||fS)Nz (no name)z no versionz<%s %s %s (%s)>)rRr>rrrQ)r|rRr>rrrr(s  zMetadata.__repr__)r)r)r)r)rrrw)NNNrr)rRr>r\rVrT)r N)r N)N)NN)NNFT)/rrrrrecompileZMETADATA_VERSION_MATCHERIZ NAME_MATCHERrZVERSION_MATCHERZSUMMARY_MATCHERrrrr<r=r:r" __slots__rrrrZ none_listdictZ none_dictrrr'r*propertyr+rfsetterr4r9r;rrrr8rGrIrrrrrrrrvsx    ,+ '   *   % ) rrrrr r!r"r#r$r%r&)rrrrr'r r!r"r#r$r%r&r(r)r*r+r,)r*r+r,r(r))rrrrr'r r!r"r#r$r%r-r.r&r(r)r/r0r1r2r3r4)r1r2r3r/r4r-r.r0)rrrrr'r r!r"r#r$r%r-r.r&r(r)r/r0r1r2r3r4r5r6r7r8r9)r5r9r6r7r8)r2r/r1)r3)r)rr(r*r,r+r/r1r2r4r0r'r7r9r8)r0)r")r$r-r r!)F)BrZ __future__rrZemailrrrrOr>rrcompatrrr rAr utilr r r>r rZ getLoggerrrrrrr__all__rrrPrrr:r;rIr<rJr=rKrrrzZEXTRA_REr?rPrrrrrrrrrrrmrprqZMETADATA_FILENAMEZWHEEL_METADATA_FILENAMErrrrr s             9   PK!#(__pycache__/markers.cpython-36.opt-1.pycnu[3 Pf@sddZddlZddlZddlZddlZddlmZmZddlm Z dgZ Gddde Z d d dZ dS) zEParser for the environment markers micro-language defined in PEP 345.N)python_implementation string_types)in_venv interpretc @seZdZdZddddddddddddd dd dd dd Zejd ejddejj ddde j e e ejejejed Zd*ddZddZddZd+ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)ZdS), Evaluatorz5 A limited evaluator for Python expressions. cCs||kS)N)xyrr/usr/lib/python3.6/markers.pyszEvaluator.cCs||kS)Nr)r r rrr r scCs||kS)Nr)r r rrr r scCs||kS)Nr)r r rrr r scCs||kS)Nr)r r rrr r scCs||kS)Nr)r r rrr r scCs| S)Nr)r rrr r scCs||kS)Nr)r r rrr r !scCs||kS)Nr)r r rrr r "s) eqgtZgteinltZltenotZnoteqZnotinz%s.%sN rr) Z sys_platformZpython_versionZpython_full_versionZos_nameZplatform_in_venvZplatform_releaseZplatform_versionZplatform_machineZplatform_python_implementationcCs|pi|_d|_dS)zu Initialise an instance. :param context: If specified, names are looked up in this mapping. N)contextsource)selfrrrr __init__3s zEvaluator.__init__cCs8d}d|j|||}||t|jkr4|d7}|S)zH Get the part of the source which is causing a problem. z%rz...)rlen)roffsetZ fragment_lensrrr get_fragment<s zEvaluator.get_fragmentcCst|d|dS)z@ Get a handler for the specified AST node type. zdo_%sN)getattr)r node_typerrr get_handlerFszEvaluator.get_handlercCst|trr||_ddi}|r$||d<ytj|f|}Wn:tk rp}z|j|j}td|WYdd}~XnX|jj j }|j |}|dkr|jdkrd}n |j|j }td||f||S)zf Evaluate a source string or node, using ``filename`` when displaying errors. modeevalfilenamezsyntax error %sNz(source not available)z don't know how to evaluate %r %s) isinstancerrastparse SyntaxErrorrr __class____name__lowerr col_offset)rnoder"kwargserrZhandlerrrr evaluateLs&       zEvaluator.evaluatecCsd|jj|jfS)Nz%s.%s)valueidattr)rr+rrr get_attr_keyfszEvaluator.get_attr_keycCsft|jtjsd}n|j|}||jkp0||jk}|sBtd|||jkrX|j|}n |j|}|S)NFzinvalid expression: %s)r#r/r$Namer2rallowed_valuesr&)rr+validkeyresultrrr do_attributejs     zEvaluator.do_attributecCsx|j|jd}|jjtjk}|jjtjk}|r4|s>|rt| rtx4|jddD]"}|j|}|rd|sn|rN| rNPqNW|S)Nrr)r.valuesopr'r$ZOrZAnd)rr+r7Zis_orZis_andnrrr do_boolopxs zEvaluator.do_boolopc sfdd}j}j|}d}xntjjD]\\}}||||jjj}|jkrft d|j|}j|||}|sP|}|}q2W|S)Ncs@d}t|tjr t|tjr d}|s<jj}td|dS)NTFzInvalid comparison: %s)r#r$ZStrrr*r&)lhsnoderhsnoder5r)r+rrr sanity_checks  z*Evaluator.do_compare..sanity_checkTzunsupported operation: %r) leftr.zipZopsZ comparatorsr'r(r) operatorsr&) rr+r?r=Zlhsr7r:r>Zrhsr)r+rr do_compares        zEvaluator.do_comparecCs |j|jS)N)r.Zbody)rr+rrr do_expressionszEvaluator.do_expressioncCsTd}|j|jkr"d}|j|j}n|j|jkr>d}|j|j}|sPtd|j|S)NFTzinvalid expression: %s)r0rr4r&)rr+r5r7rrr do_names   zEvaluator.do_namecCs|jS)N)r)rr+rrr do_strszEvaluator.do_str)N)N)r( __module__ __qualname____doc__rBsysplatform version_infoversionsplitosnamestrrreleasemachinerr4rrrr.r2r8r<rCrDrErFrrrr rs<       rcCst|j|jS)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping )rr.strip)ZmarkerZexecution_contextrrr rs )N)rIr$rOrJrKcompatrrutilr__all__objectrrrrrr s "PK!//1NN)__pycache__/locators.cpython-36.opt-1.pycnu[3 PfE@s@ddlZddlmZddlZddlZddlZddlZddlZy ddlZWne k rdddl ZYnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.dd l/m0Z0m1Z1dd l2m3Z3m4Z4ej5e6Z7ej8d Z9ej8d ej:Z;ej8d ZGdddeZ?Gddde@ZAGdddeAZBGdddeAZCGddde@ZDGdddeAZEGdddeAZFGdd d eAZGGd!d"d"eAZHGd#d$d$eAZIeIeGeEd%d&d'd(d)ZJeJjKZKej8d*ZLGd+d,d,e@ZMdS).N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape string_types build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)Metadata) cached_propertyparse_credentials ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.python.org/pypicCs |dkr t}t|dd}|jS)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. Ng@)timeout) DEFAULT_INDEXr list_packages)urlclientr*/usr/lib/python3.6/locators.pyget_all_distribution_names)s r,c@s$eZdZdZddZeZZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c Csd}xdD]}||kr ||}Pq W|dkr0dSt|}|jdkrpt|j|}t|drh|j||n|||<tj||||||S)Nlocationurireplace_header)r.r/)rschemerZ get_full_urlhasattrr1BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersZnewurlkeyZurlpartsr*r*r+r5=s   zRedirectHandler.http_error_302N)__name__ __module__ __qualname____doc__r5Zhttp_error_301Zhttp_error_303Zhttp_error_307r*r*r*r+r-4sr-c@seZdZdZd/Zd0Zd1Zd Zed2Zd3ddZ ddZ ddZ ddZ ddZ ddZee eZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd4d-d.Zd S)5LocatorzG A base class for locators - things that locate distributions. .tar.gz.tar.bz2.tar.zip.tgz.tbz.egg.exe.whl.pdfNdefaultcCs,i|_||_tt|_d|_tj|_dS)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher2rr-openermatcherr Queueerrors)r6r2r*r*r+__init__cs  zLocator.__init__c CsXg}xN|jjsRy|jjd}|j|Wn|jjk rDwYnX|jjqW|S)z8 Return any errors which have occurred. F)rQemptygetappendZEmpty task_done)r6resulter*r*r+ get_errorsvs  zLocator.get_errorscCs |jdS)z> Clear any errors which may have been logged. N)rY)r6r*r*r+ clear_errorsszLocator.clear_errorscCs|jjdS)N)rMclear)r6r*r*r+ clear_cacheszLocator.clear_cachecCs|jS)N)_scheme)r6r*r*r+ _get_schemeszLocator._get_schemecCs ||_dS)N)r])r6valuer*r*r+ _set_schemeszLocator._set_schemecCs tddS)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. z Please implement in the subclassN)NotImplementedError)r6namer*r*r+ _get_projects zLocator._get_projectcCs tddS)zJ Return all the distribution names known to this locator. z Please implement in the subclassN)ra)r6r*r*r+get_distribution_namesszLocator.get_distribution_namescCsL|jdkr|j|}n2||jkr,|j|}n|j|j|}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N)rMrcrZ)r6rbrWr*r*r+ get_projects      zLocator.get_projectcCsPt|}tj|j}d}|jd}|r6tt||j}|jdkd|j k|||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. Tz.whlhttpszpypi.python.org) r posixpathbasenamepathendswithr$r# wheel_tagsr2netloc)r6r(trhZ compatibleZis_wheelr*r*r+ score_urls  zLocator.score_urlcCsR|}|rN|j|}|j|}||kr(|}||kr@tjd||ntjd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rnloggerdebug)r6url1url2rWs1s2r*r*r+ prefer_urls   zLocator.prefer_urlcCs t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r6filename project_namer*r*r+rszLocator.split_filenamecCsdd}d}t|\}}}}} } | jjdr.same_projectNzegg=z %s: version hint in fragment: %rr/z.whlTr0z, cSs"g|]}djt|ddqS).N)joinlist).0vr*r*r+ sz8Locator.convert_url_to_download_info..)rbversionrvr(zpython-versionzinvalid path for wheel: %sz No match for project/version: %s)rbrrvr(zpython-versionz %s_digest)NNr)rlower startswithrorp HASHER_HASHmatchgroupsrjr#r$rkrbrrvrr|pyver Exceptionwarningdownloadable_extensionsrgrhlenr)r6r(rwrxrWr2rlriparamsqueryfragmalgodigestZorigpathwheelincluderXrvZextrmrbrrr*r*r+convert_url_to_download_infosf            z$Locator.convert_url_to_download_infocCs4d}x*dD]"}d|}||kr |||f}Pq W|S)z Get a digest from a dictionary by looking at keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. Nsha256md5z %s_digest)rrr*)r6inforWrr<r*r*r+ _get_digest)s  zLocator._get_digestc Cs|jd}|jd}||kr,||}|j}nt|||jd}|j}|j||_}|d}||d|<|j|dkr|j|j||_|dj|t j |||_ |||<dS)z Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. rbr)r2r(digestsurlsN) popmetadatarr2rr source_urlru setdefaultsetaddlocator) r6rWrrbrdistmdrr(r*r*r+_update_version_data9s   zLocator._update_version_dataFc Csd}t|}|dkr td|t|j}|j|j|_}tjd|t|j |j |j }t |dkr8g}|j } x|D]|} | d krqzyJ|j| stjd|| n,|s| | j r|j| ntjd| |j Wqztk rtjd || YqzXqzWt |d krt||jd }|r8tjd ||d} || }|r|jrN|j|_|jdij| t|_i} |jdi} x&|jD]}|| kr~| || |<q~W| |_d|_|S)a Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)r{rrz%s did not match %rz%skipping pre-release version %s of %szerror matching %s with %rr)r<zsorted list: %s)rrr)rrr!r2rO requirementrorptyper=rerbrZ version_classrZ is_prereleaserUrrsortedr<ZextrasrTr download_urlsr)r6r prereleasesrWrr2rOversionsZslistZvclskrdZsdr(r*r*r+locatePsT            zLocator.locate)rBrCrDrErFrG)rHrIrJ)rK)rJ)rL)F)r=r>r?r@source_extensionsbinary_extensionsexcluded_extensionsrkrrRrYrZr\r^r`propertyr2rcrdrernrurrrrrr*r*r*r+rASs.   FrAcs0eZdZdZfddZddZddZZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c s*tt|jf|||_t|dd|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. g@)r%N)superrrRbase_urlrr))r6r(kwargs) __class__r*r+rRszPyPIRPCLocator.__init__cCst|jjS)zJ Return all the distribution names known to this locator. )rr)r')r6r*r*r+rdsz%PyPIRPCLocator.get_distribution_namesc Csiid}|jj|d}x|D]}|jj||}|jj||}t|jd}|d|_|d|_|jd|_ |jdg|_ |jd|_ t |}|r|d } | d |_ |j| |_||_|||<xB|D]:} | d } |j| } |d j|tj| | |d | <qWqW|S) N)rrT)r2rbrlicensekeywordssummaryrr(rr)r)Zpackage_releasesZ release_urlsZ release_datarr2rbrrTrrrrrrrrrrr) r6rbrWrrrdatarrrr(rr*r*r+rcs0           zPyPIRPCLocator._get_project)r=r>r?r@rRrdrc __classcell__r*r*)rr+rs rcs0eZdZdZfddZddZddZZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c s tt|jf|t||_dS)N)rrrRrr)r6r(r)rr*r+rRszPyPIJSONLocator.__init__cCs tddS)zJ Return all the distribution names known to this locator. zNot available from this locatorN)ra)r6r*r*r+rdsz&PyPIJSONLocator.get_distribution_namescCsiid}t|jdt|}y|jj|}|jj}tj|}t |j d}|d}|d|_ |d|_ |j d|_|j dg|_|j d |_t|}||_|d } |||j <x`|d D]T} | d }|jj||j| |j|<|d j|j tj||j| |d |<qWx|d jD]\} } | |j kr:q"t |j d} |j | _ | | _ t| }||_||| <x\| D]T} | d }|jj||j| |j|<|d j| tj||j| |d |<qpWq"WWn@tk r}z"|jjt|tjd|WYdd}~XnX|S)N)rrz%s/json)r2rrbrrrrrr(rZreleaseszJSON fetch failed: %s) rrr rNopenreaddecodejsonloadsrr2rbrrTrrrrrrrrrrritemsrrQputrro exception)r6rbrWr(resprrrrrrrZinfosZomdodistrXr*r*r+rcsT               " zPyPIJSONLocator._get_project)r=r>r?r@rRrdrcrr*r*)rr+rs rc@s`eZdZdZejdejejBejBZ ejdejejBZ ddZ ejdejZ e ddZd S) Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)cCs4||_||_|_|jj|j}|r0|jd|_dS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr(_basesearchgroup)r6rr(rr*r*r+rRs  z Page.__init__z[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsdd}t}x|jj|jD]}|jd}|dpZ|dpZ|dpZ|dpZ|dpZ|d }|d pr|d pr|d }t|j|}t|}|jj d d|}|j ||fqWt |dddd}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs,t|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r(r2rlrirrrr*r*r+clean%s zPage.links..cleanr0Zrel1Zrel2Zrel3Zrel4Zrel5Zrel6rqrrZurl3cSsdt|jdS)Nz%%%2xr)ordr)rr*r*r+3szPage.links..cSs|dS)Nrr*)rmr*r*r+r7sT)r<reverse) r_hreffinditerr groupdictrrr _clean_resubrr)r6rrWrrrelr(r*r*r+linkss  z Page.linksN)r=r>r?r@recompileISXrrrRrrrr*r*r*r+rs rcseZdZdZejdddddZdfdd Zd d Zd d Z ddZ e j de j ZddZddZddZddZddZe j dZddZZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. cCstjttdjS)N)Zfileobj)gzipZGzipFilerrr)br*r*r+rEszSimpleScrapingLocator.cCs|S)Nr*)rr*r*r+rFs)ZdeflaterZnoneN c sftt|jf|t||_||_i|_t|_t j |_ t|_ d|_ ||_tj|_tj|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FN)rrrRrrr% _page_cacher_seenr rP _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplock)r6r(r%rr)rr*r+rRIs    zSimpleScrapingLocator.__init__cCsJg|_x>t|jD]0}tj|jd}|jd|j|jj|qWdS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsrangerrZThread_fetchZ setDaemonstartrU)r6irmr*r*r+_prepare_threadscs  z&SimpleScrapingLocator._prepare_threadscCs>x|jD]}|jjdqWx|jD] }|jq$Wg|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)rrrr|)r6rmr*r*r+ _wait_threadsps    z#SimpleScrapingLocator._wait_threadscCsiid}|jx||_||_t|jdt|}|jj|jj|j z&t j d||j j ||j jWd|jX|`WdQRX|S)N)rrz%s/z Queueing %s)rrWrwrrr rr[rrrorprrr|r)r6rbrWr(r*r*r+rc}s      z"SimpleScrapingLocator._get_projectz<\b(linux-(i\d86|x86_64|arm\w+)|win(32|-amd64)|macosx-?\d+)\bcCs |jj|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r6r(r*r*r+_is_platform_dependentsz,SimpleScrapingLocator._is_platform_dependentc CsT|j|rd}n|j||j}tjd|||rP|j|j|j|WdQRX|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s)rrrwrorprrrW)r6r(rr*r*r+_process_downloads z'SimpleScrapingLocator._process_downloadc Cst|\}}}}}}|j|j|j|jr2d}n~|jrL|j|j rLd}nd|j|js^d}nR|d krld}nD|dkrzd}n6|j|rd}n&|j ddd } | j d krd}nd }t j d |||||S)z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. Fhomepagedownloadhttprfftp:rrZ localhostTz#should_queue: %s (%s) from %s -> %s)rr)rrfr) rrjrrrrrrrsplitrrorp) r6linkZreferrerrr2rlri_rWhostr*r*r+ _should_queues*     z#SimpleScrapingLocator._should_queuecCsx|jj}zyz|r|j|}|dkr(wx\|jD]R\}}||jkr0|jj||j| r0|j|||r0tj d|||jj |q0WWn2t k r}z|j j t |WYdd}~XnXWd|jjX|sPqWdS)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)rrTget_pagerrrrrrorprrrQrrV)r6r(pagerrrXr*r*r+rs&     & zSimpleScrapingLocator._fetchcCsXt|\}}}}}}|dkr:tjjt|r:tt|d}||jkr`|j|}tj d||n|j ddd}d}||j krtj d||nt |d d id }zytj d ||j j||jd } tj d|| j} | jdd} tj| r| j} | j} | jd}|r"|j|}|| } d}tj| }|r@|jd}y| j|} Wn tk rn| jd} YnXt| | }||j| <Wntk r}z |jdkrtjd||WYdd}~Xnt k r}z2tjd|||j!|j j"|WdQRXWYdd}~Xn2t#k rB}ztjd||WYdd}~XnXWd||j|<X|S)a Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). filez index.htmlzReturning %s from cache: %srrrNzSkipping %s due to bad host %szAccept-encodingZidentity)r;z Fetching %s)r%z Fetched %sz Content-Typer0zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosriisdirrrrrrorprrrrNrr%rrTHTML_CONTENT_TYPErZgeturlrdecodersCHARSETrrr UnicodeErrorrrr9rrrrr)r6r(r2rlrirrWrr7rr;Z content_typeZ final_urlrencodingdecoderrrXr*r*r+rsZ              &$ zSimpleScrapingLocator.get_pagez]*>([^<]+)r?r@zlibZ decompressrrRrrrcrrrrrrrrrr rdrr*r*)rr+r;s"   ; rcs8eZdZdZfddZddZddZdd ZZS) DirectoryLocatorz? This class locates distributions in a directory tree. c sN|jdd|_tt|jf|tjj|}tjj|sDt d|||_ dS)a Initialise an instance. :param path: The root of the directory tree to search. :param kwargs: Passed to the superclass constructor, except for: * recursive - if True (the default), subdirectories are recursed into. If False, only the top-level directory is searched, recursiveTzNot a directory: %rN) rrrr rRrriabspathrrbase_dir)r6rir)rr*r+rR5s    zDirectoryLocator.__init__cCs |j|jS)z Should a filename be considered as a candidate for a distribution archive? As well as the filename, the directory which contains it is provided, though not used by the current implementation. )rjr)r6rvparentr*r*r+should_includeFszDirectoryLocator.should_includec Csiid}xtj|jD]v\}}}xb|D]Z}|j||r(tjj||}tddttjj|dddf}|j ||}|r(|j ||q(W|j sPqW|S)N)rrrr0) rwalkrrrir|rr rrrr) r6rbrWrootdirsfilesfnr(rr*r*r+rcNs     zDirectoryLocator._get_projectc Cst}xtj|jD]x\}}}xd|D]\}|j||r$tjj||}tddttjj |dddf}|j |d}|r$|j |dq$W|j sPqW|S)zJ Return all the distribution names known to this locator. rr0Nrb) rrrrrrir|rr rrrr)r6rWrrrrr(rr*r*r+rd^s    z'DirectoryLocator.get_distribution_names) r=r>r?r@rRrrcrdrr*r*)rr+r 0s  r c@s eZdZdZddZddZdS) JSONLocatora This locator uses special extended metadata (not available on PyPI) and is the basis of performant dependency resolution in distlib. Other locators require archive downloads before dependencies can be determined! As you might imagine, that can be slow. cCs tddS)zJ Return all the distribution names known to this locator. zNot available from this locatorN)ra)r6r*r*r+rdxsz"JSONLocator.get_distribution_namescCsiid}t|}|rx|jdgD]}|ddks$|ddkrBq$t|d|d|jd d |jd }|j}|d |_d |kr|d rd|d f|_|jdi|_|jdi|_|||j <|dj |j t j |d q$W|S)N)rrrZptypeZsdistZ pyversionsourcerbrrzPlaceholder for summary)rr2r(rrZ requirementsexportsr) rrTrr2rrrZ dependenciesrrrrr)r6rbrWrrrrr*r*r+rc~s&    "zJSONLocator._get_projectN)r=r>r?r@rdrcr*r*r*r+rqsrcs(eZdZdZfddZddZZS)DistPathLocatorz This locator finds installed distributions in a path. It can be useful for adding to an :class:`AggregatingLocator`. c stt|jf|||_dS)zs Initialise an instance. :param distpath: A :class:`DistributionPath` instance to search. N)rrrRdistpath)r6rr)rr*r+rRszDistPathLocator.__init__cCsP|jj|}|dkr iid}n,|j|d|jt|jgid|jtdgii}|S)N)rrrr)rZget_distributionrrr)r6rbrrWr*r*r+rcs  zDistPathLocator._get_project)r=r>r?r@rRrcrr*r*)rr+rs rcsReZdZdZfddZfddZddZeej j eZ dd Z d d Z Z S) AggregatingLocatorzI This class allows you to chain and/or merge a list of locators. cs*|jdd|_||_tt|jf|dS)a Initialise an instance. :param locators: The list of locators to search. :param kwargs: Passed to the superclass constructor, except for: * merge - if False (the default), the first successful search from any of the locators is returned. If True, the results from all locators are merged (this can be slow). mergeFN)rrlocatorsrrrR)r6rr)rr*r+rRs zAggregatingLocator.__init__cs*tt|jx|jD] }|jqWdS)N)rrr\r)r6r)rr*r+r\s zAggregatingLocator.clear_cachecCs ||_x|jD] }||_qWdS)N)r]rr2)r6r_rr*r*r+r`s zAggregatingLocator._set_schemec Csi}x|jD]}|j|}|r |jr|jdi}|jdi}|j||jd}|r|rx6|jD]*\}} ||kr||| O<qb| ||<qbW|jd} |r| r| j|q |jdkrd} n$d} x|D]}|jj|rd} PqW| r |}Pq W|S)NrrTF)rrerrTupdaterrOr) r6rbrWrrrrZdfrrZddfoundr*r*r+rcs8           zAggregatingLocator._get_projectc Cs@t}x4|jD]*}y||jO}Wqtk r6YqXqW|S)zJ Return all the distribution names known to this locator. )rrrdra)r6rWrr*r*r+rds  z)AggregatingLocator.get_distribution_names)r=r>r?r@rRr\r`rrAr2fgetrcrdrr*r*)rr+rs  ,rzhttps://pypi.python.org/simple/g@)r%legacy)r2z1(?P[\w-]+)\s*\(\s*(==\s*)?(?P[^)]+)\)$c@sLeZdZdZdddZddZddZd d Zd d Zd dZ dddZ dS)DependencyFinderz0 Locate dependencies for distributions. NcCs|pt|_t|jj|_dS)zf Initialise an instance, using the specified locator to locate distributions. N)default_locatorrr!r2)r6rr*r*r+rRs zDependencyFinder.__init__cCsvtjd||j}||j|<||j||jf<xD|jD]:}t|\}}tjd||||jj |t j ||fq4WdS)z Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. zadding distribution %szAdd to provided: %s, %s, %sN) rorpr< dists_by_namedistsrprovidesrprovidedrrr)r6rrbprr*r*r+add_distribution&s    z!DependencyFinder.add_distributioncCs|tjd||j}|j|=|j||jf=xN|jD]D}t|\}}tjd||||j|}|j ||f|s0|j|=q0WdS)z Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. zremoving distribution %sz Remove from provided: %s, %s, %sN) rorpr<r&r'rr(rr)remove)r6rrbr*rsr*r*r+remove_distribution5s    z$DependencyFinder.remove_distributionc CsBy|jj|}Wn,tk r<|jd}|jj|}YnX|S)z Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). r)r2rOr"r)r6reqtrOrbr*r*r+ get_matcherGs  zDependencyFinder.get_matcherc Csv|j|}|j}t}|j}||krrxL||D]@\}}y|j|}Wntk r\d}YnX|r.|j|Pq.W|S)z Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. F)r0r<rr)rr"r) r6r/rOrbrWr)rproviderrr*r*r+find_providersWs   zDependencyFinder.find_providersc Cs|j|}t}x,|D]$}|j|}|j|js|j|qW|r^|jd||t|fd}nD|j||j|=x"|D]}|jj|tj|qvW|j |d}|S)a Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. Z cantreplaceFT) reqtsrr0rrr frozensetr.rr+) r6r1otherproblemsZrlistZ unmatchedr-rOrWr*r*r+try_to_replaceos"         zDependencyFinder.try_to_replaceFcCsi|_i|_i|_i|_t|p g}d|krH|jd|tdddgO}t|trh|}}tj d|n4|j j ||d}}|dkrt d|tj d |d |_ t}t|g}t|g}x|r|j}|j} | |jkr|j|n"|j| } | |kr |j|| ||j|jB} |j} t} ||krbx2dD]*}d|}||kr4| t|d|O} q4W| | B| B}x>|D]4}|j|}|sNtj d||j j ||d}|dkr| r|j j |d d}|dkrtj d||jd|fn^|j|j}}||f|jkr|j||j||| krN||krN|j|tj d|jxZ|D]R}|j} | |jkr|jj|tj|n"|j| } | |krT|j|| |qTWqvWqWt|jj}x.|D]&}||k|_|jrtj d|jqWtj d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:z:test:z:build:z:dev:zpassed %s as requirement)rNzUnable to locate %rz located %sTtestbuilddevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %rZ unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)r8r9r:)r)r'r&r3rr, isinstancerrorprrrZ requestedrr<r+r7Z run_requiresZ meta_requiresZbuild_requiresgetattrr2rrZname_and_versionrvaluesZbuild_time_dependency)r6rZ meta_extrasrrrr6ZtodoZ install_distsrbr5ZireqtsZsreqtsZereqtsr<rXZ all_reqtsrZ providersr1nrr*r'r*r*r+finds                                zDependencyFinder.find)N)NF) r=r>r?r@rRr+r.r0r2r7r?r*r*r*r+r$s (r$)N)NriorrZloggingrrgrr ImportErrorZdummy_threadingr r0rcompatrrrrr r r r r rrr4rrrrZdatabaserrrrrutilrrrrrrrrr rr!r"rr#r$Z getLoggerr=rorrrrrr&r,r-objectrArrrrr rrrr%rZNAME_VERSION_REr$r*r*r*r+sZ   D ,    ;0E:vA&[ PK!D ' '"__pycache__/scripts.cpython-36.pycnu[3 Pfx;@sddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZejeZdjZejdZd Zd d ZGd d d eZdS))BytesION) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executablein_venva s^#!.*pythonw?[0-9.]*([ ].*)?$a|# -*- coding: utf-8 -*- if __name__ == '__main__': import sys, re def _resolve(module, func): __import__(module) mod = sys.modules[module] parts = func.split('.') result = getattr(mod, parts.pop(0)) for p in parts: result = getattr(result, p) return result try: sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) func = _resolve('%(module)s', '%(func)s') rc = func() # None interpreted as 0 except Exception as e: # only supporting Python >= 2.6 sys.stderr.write('%%s\n' %% e) rc = 1 sys.exit(rc) cCsZd|krV|jdrD|jdd\}}d|krV|jd rVd||f}n|jdsVd|}|S)N z /usr/bin/env r"z%s "%s"z"%s") startswithsplit) executableenvZ _executabler/usr/lib/python3.6/scripts.py_enquote_executableBs  rc@seZdZdZeZdZd%ddZddZe j j d rBd d Z d d Z d&ddZddZeZddZddZd'ddZddZeddZejddZejdksejd krejdkrdd Zd(d!d"Zd)d#d$ZdS)* ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFcCsz||_||_||_d|_d|_tjdkp:tjdko:tjdk|_t d|_ |pRt ||_ tjdkprtjdkortjdk|_ dS)NFposixjavaX.Ynt)rr) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr_fileop_is_nt)selfrrrdry_runZfileoprrr__init__[s   zScriptMaker.__init__cCs@|jddr<|jr|jd}n |jd}t} t| d} | jd|WdQRX| j } |||| }xd|D]Z} tj j |j | } |rrtj j | \}}|jdr|} d| } y|jj| |Wntk rntjdd | }tj j|r tj|tj| ||jj| |tjd ytj|Wntk rhYnXYnXnp|jr| jd | rd | |f} tj j| r|j rtjd | q|jj| ||jr|jj| g|j| qWdS)Nzutf-8pytwz __main__.pyz.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz %s.deletemez0Able to replace executable using .deleteme logic.z%s.%szSkipping existing file %s)rr(r!lineseprM _get_launcherrrZwritestrgetvaluer/r1rsplitextrr'Zwrite_binary_file Exceptionr:r;existsremoverenamedebugr?r r$set_executable_modeappend)r)namesrSZ script_bytes filenamesextZ use_launcherreZlauncherstreamZzfZzip_datar"outnameneZdfnamerrr _write_scriptsT            zScriptMaker._write_scriptc Csd}|r0|jdg}|r0ddj|}|jd}|jd||d}|j|jd}|j}t} d|jkrp| j|d|jkr| jd |t j d fd |jkr| jd |t j dd f|r|jddrd} nd} |j | |||| dS)NrAZinterpreter_argsz %sr zutf-8)r2rXz%s%srzX.Yz%s-%sr,Fpywra) r.r1rMrTr\r"r%r&addrJversionrw) r)r[rqr2rRargsrSscriptr"Z scriptnamesrrrrr _make_scripts(      zScriptMaker._make_scriptcCsd}tjj|jt|}tjj|jtjj|}|j rX|jj || rXt j d|dSyt |d}Wn t k r|js~d}YnLX|j}|st jd|j|dStj|jdd}|rd}|jdpd }|s|r|j|jj|||jr|jj|g|j|nt jd ||j|jjst|j\} } |jd |j| |} d |krbd } nd} tjj|} |j| g| |j || |r|jdS)NFznot copying %s (up-to-date)rbz"%s: %s is an empty file (skipping)s rFTrrAzcopying and adjusting %s -> %srspythonwrzra)!r!r/r1rr rr]rr'Znewerr:rmr6r9r*readliner;Zget_command_name FIRST_LINE_REmatchr0groupcloseZ copy_filer$rnroinforseekrTrwr7)r)r~rqZadjustrtfZ first_linerrRrQlinesrSrrrurrr _copy_scriptsR         zScriptMaker._copy_scriptcCs|jjS)N)r'r*)r)rrrr*JszScriptMaker.dry_runcCs ||j_dS)N)r'r*)r)valuerrrr*NsrcCsHtjddkrd}nd}d||f}tjddd}t|j|j}|S) NPZ64Z32z%s%s.exerdrr)structcalcsize__name__rsplitrfindbytes)r)Zkindbitsr"Zdistlib_packageresultrrrrfVs zScriptMaker._get_launchercCs6g}t|}|dkr"|j||n|j|||d|S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. N)r2)r rr)r) specificationr2rqr[rrrmakeds zScriptMaker.makecCs(g}x|D]}|j|j||q W|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r)Zspecificationsr2rqrrrr make_multiplews zScriptMaker.make_multiple)TFN)rAN)N)N)N)r __module__ __qualname____doc__SCRIPT_TEMPLATErWrr+r4rJrKrr=r@rTr\_DEFAULT_MANIFESTr^r`rwrrpropertyr*setterr!r"r#rfrrrrrrrRs,    82 4  r)iorZloggingr!rerrJcompatrrrZ resourcesrutilrr r r r Z getLoggerrr:striprcompilerrrobjectrrrrrs    PK!ҐCC __pycache__/index.cpython-36.pycnu[3 Pf]R @sddlZddlZddlZddlZddlZddlZyddlmZWn ek r`ddl mZYnXddl m Z ddl m Z mZmZmZmZmZddlmZmZmZejeZdZdZGd d d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)cached_propertyzip_dir ServerProxyzhttps://pypi.python.org/pypipypic@seZdZdZdZd*ddZddZdd Zd d Zd d Z ddZ ddZ d+ddZ d,ddZ d-ddZd.ddZddZd/ddZd0d d!Zd1d"d#Zd$d%Zd&d'Zd2d(d)ZdS)3 PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc Cs|pt|_|jt|j\}}}}}}|s<|s<|s<|d krJtd|jd|_d|_d|_d|_d|_ t t j dR}xJd D]B} y(t j| dg||d } | d kr| |_PWq|tk rYq|Xq|WWdQRXdS) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. httphttpszinvalid repository: %sNwgpggpg2z --version)stdoutstderrr)rr)rr) DEFAULT_INDEXurlread_configurationrrpassword_handler ssl_verifierrgpg_home rpc_proxyopenosdevnull subprocessZ check_callOSError) selfrschemenetlocpathZparamsZqueryZfragZsinksrcr)/usr/lib/python3.6/index.py__init__$s(   zPackageIndex.__init__cCs&ddlm}ddlm}|}||S)zs Get the distutils command for interacting with PyPI configurations. :return: the command. r) Distribution) PyPIRCCommand)Zdistutils.corer,Zdistutils.configr-)r#r,r-dr)r)r*_get_pypirc_commandBs  z PackageIndex._get_pypirc_commandcCsR|j}|j|_|j}|jd|_|jd|_|jdd|_|jd|j|_dS)z Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. usernamepasswordrealmr repositoryN)r/rr3Z _read_pypircgetr0r1r2)r#cZcfgr)r)r*rLs  zPackageIndex.read_configurationcCs$|j|j}|j|j|jdS)z Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. N)check_credentialsr/Z _store_pypircr0r1)r#r5r)r)r*save_configuration[szPackageIndex.save_configurationcCs\|jdks|jdkrtdt}t|j\}}}}}}|j|j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r0r1rrrrZ add_passwordr2rr)r#Zpm_r%r)r)r*r6gs zPackageIndex.check_credentialscCs\|j|j|j}d|d<|j|jg}|j|}d|d<|j|jg}|j|S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. Zverifyz:actionZsubmit)r6validatetodictencode_requestitems send_request)r#metadatar.requestZresponser)r)r*registerss  zPackageIndex.registercCsJx<|j}|sP|jdj}|j|tjd||fqW|jdS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. zutf-8z%s: %sN)readlinedecoderstripappendloggerdebugclose)r#namestreamZoutbufr'r)r)r*_readers  zPackageIndex._readercCs|jdddg}|dkr|j}|r.|jd|g|dk rF|jdddgtj}tjj|tjj|d }|jd d d |d ||gt j ddj|||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. z --status-fd2z--no-ttyNz --homedirz--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--outputz invoking: %s ) rrextendtempfileZmkdtemprr&joinbasenamerErF)r#filenamesigner sign_passwordkeystorecmdZtdZsfr)r)r*get_sign_commands zPackageIndex.get_sign_commandc Cstjtjd}|dk r tj|d<g}g}tj|f|}t|jd|j|fd}|jt|jd|j|fd}|j|dk r|jj ||jj |j |j |j |j ||fS)a Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. )rrNstdinr)targetargsr)r!PIPEPopenrrJrstartrrXwriterGwaitrP returncode) r#rVZ input_datakwargsrrpZt1Zt2r)r)r* run_commands$     zPackageIndex.run_commandc CsD|j||||\}}|j||jd\}}} |dkr@td||S)aR Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. zutf-8rz&sign command failed with error code %s)rWrcencoder) r#rRrSrTrUrVsig_filer(rrr)r)r* sign_files  zPackageIndex.sign_filesdistsourcecCs(|jtjj|s td||j|j}d} |rZ|jsJtj dn|j ||||} t |d} | j } WdQRXt j| j} t j| j} |jdd||| | ddtjj|| fg}| rt | d} | j }WdQRX|jd tjj| |ftjtjj| |j|j|}|j|S) a Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. z not found: %sNz)no signing program available - not signedrbZ file_upload1)z:actionZprotocol_versionfiletype pyversion md5_digest sha256_digestcontentZ gpg_signature)r6rr&existsrr9r:rrEZwarningrfrreadhashlibmd5 hexdigestZsha256updaterQrDshutilZrmtreedirnamer;r<r=)r#r>rRrSrTrkrlrUr.refZ file_datarmrnfilesZsig_datar?r)r)r* upload_files>       zPackageIndex.upload_filec Cs|jtjj|s td|tjj|d}tjj|sFtd||j|j|j }}t |j }d d|fd|fg}d||fg}|j ||} |j | S) a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r:action doc_uploadrHversionro)r{r|)r6rr&isdirrrPrpr9rHr}r getvaluer;r=) r#r>Zdoc_dirfnrHr}Zzip_datafieldsryr?r)r)r*upload_documentation)s        z!PackageIndex.upload_documentationcCsT|jdddg}|dkr|j}|r.|jd|g|jd||gtjddj||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. z --status-fdrKz--no-ttyNz --homedirz--verifyz invoking: %srM)rrrNrErFrP)r#signature_filename data_filenamerUrVr)r)r*get_verify_commandEszPackageIndex.get_verify_commandcCsH|jstd|j|||}|j|\}}}|dkr@td||dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailablerrz(verify command failed with error code %s)rr)rrrrc)r#rrrUrVr(rrr)r)r*verify_signature]szPackageIndex.verify_signaturecCsp|dkrd}tjdn6t|ttfr0|\}}nd}tt|}tjd|t|d}|jt |}z|j } d} d} d} d} d | krt | d } |r|| | | xP|j | }|sP| t |7} |j||r|j|| d7} |r|| | | qWWd|jXWdQRX| dkr4| | kr4td | | f|rl|j}||kr`td ||||ftjd |dS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrszDigest specified: %swbi rrzcontent-lengthzContent-Lengthz1retrieval incomplete: got only %d out of %d bytesz.%s digest mismatch for %s: expected %s, got %szDigest verified: %s)rErF isinstancelisttuplegetattrrrrr=rinfointrqlenr^rurGrrt)r#rdestfileZdigestZ reporthookZdigesterZhasherZdfpZsfpheadersZ blocksizesizerqZblocknumblockactualr)r)r* download_filevsV             zPackageIndex.download_filecCs:g}|jr|j|j|jr(|j|jt|}|j|S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrDrr r)r#ZreqZhandlersopenerr)r)r*r=s  zPackageIndex.send_requestcCsg}|j}xX|D]P\}}t|ttfs,|g}x2|D]*}|jd|d|jdd|jdfq2WqWx6|D].\}} } |jd|d|| fjdd| fqjW|jd|ddfdj|} d|} | tt| d} t |j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"zutf-8z8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrrNrdrPstrrrr)r#rrypartsrkvaluesvkeyrRvalueZbodyZctrr)r)r*r;s2     zPackageIndex.encode_requestcCs>t|trd|i}|jdkr,t|jdd|_|jj||p:dS)NrHg@)Ztimeoutand)rr rr rsearch)r#Ztermsoperatorr)r)r*rs   zPackageIndex.search)N)N)N)N)NNrgrhN)N)N)NN)N)__name__ __module__ __qualname____doc__rr+r/rr7r6r@rJrWrcrfrzrrrrr=r;rr)r)r)r*rs*      #  8   M+r)rrZloggingrrvr!rOZ threadingr ImportErrorZdummy_threadingrcompatrrrrr r utilr r r Z getLoggerrrErZ DEFAULT_REALMobjectrr)r)r)r*s    PK!'iQQ"__pycache__/version.cpython-36.pycnu[3 Pf\ @sZdZddlZddlZddlmZddddd d d d gZejeZGd d d e Z Gddde Z Gddde Z ejdZddZeZGddde ZddZGddde Zejddfejddfejddfejddfejd d!fejd"d!fejd#d$fejd%d&fejd'd(fejd)d*ff Zejd+dfejd,dfejd-d$fejd#d$fejd.dffZejd/Zd0d1Zd2d3Zejd4ejZd5d5d6d5d7ddd8Zd9d:ZGd;dde ZGdd?Z!d@dAZ"GdBd d e Z#GdCd d e Z$GdDdEdEe Z%e%eeee%eedFdGe%e"e$edHZ&e&dIe&dJ<dKd Z'dS)Lz~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesNormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemec@seZdZdZdS)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__rr/usr/lib/python3.6/version.pyr sc@sxeZdZddZddZddZddZd d Zd d Zd dZ ddZ ddZ ddZ ddZ ddZeddZdS)VersioncCs@|j|_}|j||_}t|ts,tt|dks=|<|>|!=|={2,3}|~=)?\s*([^\s,]+)$z ^\d+(\.\d+)*$cCs||kS)Nr)vcprrrWszMatcher.cCs||kS)Nr)r2r3r4rrrr5XscCs||kp||kS)Nr)r2r3r4rrrr5YscCs||kp||kS)Nr)r2r3r4rrrr5ZscCs||kS)Nr)r2r3r4rrrr5[scCs||kS)Nr)r2r3r4rrrr5\scCs||kp||kS)Nr)r2r3r4rrrr5^scCs||kS)Nr)r2r3r4rrrr5_s)<>z<=z>=z==z===z~=z!=c CsJ|jdkrtd|j|_}|jj|}|snsz$Matcher.__init__..,zInvalid %r in %rz~=rz.*==!=z#'.*' not allowed for %r constraintsTF)r=r>) version_class ValueErrorrrdist_rematchgroupsnamelowerkeysplitcomp_reendswithnum_reappendrr) rrmrDZclistZ constraintsr3opZvnprefixrrrrbs:           zMatcher.__init__cCszt|tr|j|}x`|jD]V\}}}|jj|}t|trFt||}|sbd||jjf}t |||||sdSqWdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z%r not implemented for %sFT) rrr@r _operatorsgetgetattrr,r r)rversionoperator constraintrOfmsgrrrrCs      z Matcher.matchcCs6d}t|jdkr2|jdddkr2|jdd}|S)Nrr=====)rXrY)rr)rresultrrr exact_versions zMatcher.exact_versioncCs0t|t|ks|j|jkr,td||fdS)Nzcannot compare %s and %s)r rEr!)rr"rrrr#szMatcher._check_compatiblecCs"|j||j|jko |j|jkS)N)r#rGr)rr"rrrr$s zMatcher.__eq__cCs |j| S)N)r$)rr"rrrr%szMatcher.__ne__cCst|jt|jS)N)r*rGr)rrrrr+szMatcher.__hash__cCsd|jj|jfS)Nz%s(%r))r,r r)rrrrr-szMatcher.__repr__cCs|jS)N)r)rrrrr.szMatcher.__str__)r r rr@recompilerBrIrKrPrrCr0r[r#r$r%r+r-r.rrrrr1Ns*    % r1zk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c Cs|j}tj|}|s"td||j}tdd|djdD}x(t|dkrn|ddkrn|dd}qHW|ds~d}n t|d}|dd}|d d }|d d }|d }|dkrf}n|dt|df}|dkrf}n|dt|df}|dkr f}n|dt|df}|dkr.f}nLg} x>|jdD]0} | j rZdt| f} nd| f} | j | q>Wt| }|s| r|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %scss|]}t|VqdS)N)int)r:r2rrr sz_pep_440_key..r.r az_finalrl)NN)NN)NNrl)rhrl)ri)rj)rk) rPEP440_VERSION_RErCr rDrrHrr^isdigitrL) rrMrDZnumsZepochpreZpostdevZlocalrpartrrr _pep_440_keysT         rrc@s6eZdZdZddZedddddgZed d Zd S) raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b cCs<t|}tj|}|j}tdd|djdD|_|S)Ncss|]}t|VqdS)N)r^)r:r2rrrr_sz*NormalizedVersion.parse..rr`)_normalized_keyrmrCrDrrH_release_clause)rrrZrMrDrrrrs  zNormalizedVersion.parserhbr3rcrpcstfddjDS)Nc3s |]}|r|djkVqdS)rN) PREREL_TAGS)r:t)rrrr_sz2NormalizedVersion.is_prerelease..)anyr)rr)rrr/szNormalizedVersion.is_prereleaseN) r r rrrsetrwr0r/rrrrrs cCs>t|}t|}||krdS|j|s*dSt|}||dkS)NTFr`)str startswithr)xynrrr _match_prefix"s rc @sneZdZeZddddddddd Zd d Zd d ZddZddZ ddZ ddZ ddZ ddZ ddZdS)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)z~=r6r7z<=z>=z==z===z!=cCsV|rd|ko|jd}n|jd o,|jd}|rN|jjddd}|j|}||fS)N+rrrlrlrl)rrrHr@)rrSrUrOZ strip_localrrrr _adjust_local<s zNormalizedMatcher._adjust_localcCsD|j|||\}}||krdS|j}djdd|D}t|| S)NFr`cSsg|] }t|qSr)r{)r:irrrr;Osz/NormalizedMatcher._match_lt..)rrtjoinr)rrSrUrOrelease_clausepfxrrrrJs zNormalizedMatcher._match_ltcCsD|j|||\}}||krdS|j}djdd|D}t|| S)NFr`cSsg|] }t|qSr)r{)r:rrrrr;Wsz/NormalizedMatcher._match_gt..)rrtrr)rrSrUrOrrrrrrRs zNormalizedMatcher._match_gtcCs|j|||\}}||kS)N)r)rrSrUrOrrrrZszNormalizedMatcher._match_lecCs|j|||\}}||kS)N)r)rrSrUrOrrrr^szNormalizedMatcher._match_gecCs.|j|||\}}|s ||k}n t||}|S)N)rr)rrSrUrOrZrrrrbs   zNormalizedMatcher._match_eqcCst|t|kS)N)r{)rrSrUrOrrrrjsz"NormalizedMatcher._match_arbitrarycCs0|j|||\}}|s ||k}n t|| }|S)N)rr)rrSrUrOrZrrrrms   zNormalizedMatcher._match_necCsf|j|||\}}||krdS||kr*dS|j}t|dkrH|dd}djdd|D}t||S)NTFrr`cSsg|] }t|qSr)r{)r:rrrrr;sz7NormalizedMatcher._match_compatible..rl)rrtrrr)rrSrUrOrrrrrrus  z#NormalizedMatcher._match_compatibleN)r r rrr@rPrrrrrrrrrrrrrr-s$z[.+-]$r8z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$z\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}r`z\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)cCsZ|jj}xtD]\}}|j||}qW|s2d}tj|}|sJd}|}n|jdjd}dd|D}xt|dkr|j dqlWt|dkr||j d}n8dj dd|ddD||j d}|dd}dj d d|D}|j}|rxt D]\}}|j||}qW|s*|}nd |kr8d nd }|||}t |sVd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rr`cSsg|] }t|qSr)r^)r:rrrrr;sz-_suggest_semantic_version..NcSsg|] }t|qSr)r{)r:rrrrr;scSsg|] }t|qSr)r{)r:rrrrr;srp-r)rrF _REPLACEMENTSsub_NUMERIC_PREFIXrCrDrHrrLendr_SUFFIX_REPLACEMENTS is_semver)rrZZpatreplrMrOsuffixseprrr_suggest_semantic_versions:   ,   rcCsly t||Stk r YnX|j}xdBD]\}}|j||}q0Wtjdd|}tjdd|}tjdd|}tjdd|}tjdd|}|jdr|d d!}tjd"d|}tjd#d$|}tjd%d&|}tjd'd|}tjd(d)|}tjd*d)|}tjd+d |}tjd,d-|}tjd.d&|}tjd/d0|}tjd1d2|}y t|Wntk rfd!}YnX|S)CaSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. -alpharh-betarurrrvr3-finalr8-pre-release.release-stablerr`rj .finalrkzpre$Zpre0zdev$Zdev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?z\1r2rNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$z\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1rrhrrurrhrrurvr3rr8rr3rr8rr8rr8rr`rjr`rr8rr8rkr8)rrrrrrrrrrrrrrr)rsr rFreplacer\rr|)rZrsZorigrrrr_suggest_normalized_versionsH      rz([a-z]+|\d+|[\.-])r3zfinal-@)roZpreviewrrvrpr8r`cCs~dd}g}xh||D]\}|jdrh|dkrJx|rH|ddkrH|jq.Wx|rf|d dkrf|jqLW|j|qWt|S) NcSsxg}xdtj|jD]R}tj||}|rd|ddkoBdknrT|jd}nd|}|j|qW|jd|S)N0r9*z*final) _VERSION_PARTrHrF_VERSION_REPLACErQzfillrL)rrZr4rrr get_partsIs    z_legacy_key..get_partsrz*finalrz*final-Z00000000rlrl)r|poprLr)rrrZr4rrr _legacy_keyHs    rc@s eZdZddZeddZdS)rcCst|S)N)r)rrrrrrcszLegacyVersion.parsecCs:d}x0|jD]&}t|tr |jdr |dkr d}Pq W|S)NFrz*finalT)rrrr|)rrZr}rrrr/fs zLegacyVersion.is_prereleaseN)r r rrr0r/rrrrrbsc@s4eZdZeZeejZded<ej dZ ddZ dS)rrz~=z^(\d+(\.\d+)*)cCs`||kr dS|jjt|}|s2tjd||dS|jd}d|krV|jddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrr`r) numeric_rerCr{loggerZwarningrDrsplitr)rrSrUrOrMrrrrrys zLegacyMatcher._match_compatibleN) r r rrr@dictr1rPr\r]rrrrrrrqs   zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$cCs tj|S)N) _SEMVER_RErC)rrrrrsrc Csndd}t|}|st||j}dd|ddD\}}}||dd||dd}}|||f||fS) NcSs8|dkr|f}n$|ddjd}tdd|D}|S)Nrr`cSs"g|]}|jr|jdn|qS)r)rnr)r:r4rrrr;sz5_semantic_key..make_tuple..)rHr)rZabsentrZrrrr make_tuples z!_semantic_key..make_tuplecSsg|] }t|qSr)r^)r:rrrrr;sz!_semantic_key..r|r)rr rD) rrrMrDmajorminorZpatchroZbuildrrr _semantic_keys rc@s eZdZddZeddZdS)rcCst|S)N)r)rrrrrrszSemanticVersion.parsecCs|jdddkS)Nrrr)r)rrrrr/szSemanticVersion.is_prereleaseN)r r rrr0r/rrrrrsc@seZdZeZdS)r N)r r rrr@rrrrr sc@s6eZdZd ddZddZddZdd Zd d ZdS) VersionSchemeNcCs||_||_||_dS)N)rGmatcher suggester)rrGrrrrrrszVersionScheme.__init__c Cs2y|jj|d}Wntk r,d}YnX|S)NTF)rr@r )rrrZrrris_valid_versions   zVersionScheme.is_valid_versionc Cs0y|j|d}Wntk r*d}YnX|S)NTF)rr )rrrZrrris_valid_matchers   zVersionScheme.is_valid_matchercCs|jd|S)z: Used for processing some metadata fields zdummy_name (%s))r)rrrrris_valid_constraint_listsz&VersionScheme.is_valid_constraint_listcCs|jdkrd}n |j|}|S)N)r)rrrZrrrsuggests  zVersionScheme.suggest)N)r r rrrrrrrrrrrs  rcCs|S)Nr)rrrrrr5sr5) normalizedlegacyZsemanticrdefaultcCs|tkrtd|t|S)Nzunknown scheme name: %r)_SCHEMESrA)rErrrr s )(rZloggingr\compatr__all__Z getLoggerr rrAr objectrr1r]rmrrrsrrrrrrrrIrrrrrrrrrr rrr rrrr sz  1k =$ W             .r $  PK!B||!__pycache__/compat.cpython-36.pycnu[3 Pfa@s ddlmZddlZddlZddlZy ddlZWnek rHdZYnXejddkr~ddlmZe fZ e Z ddl mZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#d d Zddl$Z$dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-er&dd l$m.Z.ddl/Z/ddl0Z0ddl1Z2ddl3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:da;ddZ<n ddl=mZe>fZ e>Z ddl=m?ZddlZddlZddlZddl@mZmZmZmZod?d@ZiYnXyddAlpmqZqWn"ek r ddAlrmqZqYnXejddBddkr,e3jsZsn ddDlpmsZsyddEl`mtZtWndek rddFl`muZuyddGlvmwZxWn ek rdedIdJZxYnXGdKdLdLeuZtYnXyddMlymzZzWn ek rdfdNdOZzYnXyddPl`m{Z{Wnek rzyddQl|m}Z~Wn"ek r4ddQlm}Z~YnXyddRlmZmZmZWnek rdYnXGdSdTdTeZ{YnXyddUlmZmZWnvek rejmdVejZdWdXZGdYdZdZeZdgd[d\ZGd]d^d^eZGd_d`d`eZGdadbdbeQZYnXdS)h)absolute_importN)StringIO)FileType)shutil)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypecCst|tr|jd}t|S)Nzutf-8) isinstanceunicodeencode_quote)sr/usr/lib/python3.6/compat.pyrs  r) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalsecCs<tdkrddl}|jdatj|}|r4|jddSd|fS)zJsplituser('user[:passwd]@host[:port]') --> 'user[:passwd]', 'host[:port]'.Nrz ^(.*)@(.*)$r) _userprogrecompilematchgroup)hostr*r,rrr splituser4s   r/) TextIOWrapper) rr r r/rrr r r) rr rrrrr r!r"r#)rrr) filterfalse)match_hostnameCertificateErrorc@s eZdZdS)r3N)__name__ __module__ __qualname__rrrrr3^sr3c Csg}|s dS|jd}|d|dd}}|jd}||krNtdt||sb|j|jkS|dkrv|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)splitcountr3reprlowerappend startswithr*escapereplacer+join IGNORECASEr,) ZdnhostnameZ max_wildcardsZpatspartsZleftmostZ remainderZ wildcardsfragZpatrrr_dnsname_matchbs(    rFcCs|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. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDZsubjectAltNameZDNSNZsubjectZ commonNamerz&hostname %r doesn't match either of %sz, zhostname %r doesn't match %rrz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrFr=lenr3rAmapr;)ZcertrCZdnsnamesZsankeyvaluesubrrrr2s.     r2)SimpleNamespacec@seZdZdZddZdS) ContainerzR A generic container for when multiple values need to be returned cKs|jj|dS)N)__dict__update)selfkwargsrrr__init__szContainer.__init__N)r4r5r6__doc__rTrrrrrOsrO)whichc s"dd}tjjr&||r"SdS|dkr>tjjdtj}|sFdS|jtj}tj dkrtj |krt|j dtj tjjddjtj}t fd d |Drg}q‡fd d |D}ng}t }xT|D]L}tjj|}||kr|j|x(|D] } tjj|| } || |r| SqWqWdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. cSs&tjj|o$tj||o$tjj| S)N)ospathexistsaccessisdir)fnmoderrr _access_checkszwhich.._access_checkNPATHZwin32rZPATHEXTc3s |]}jj|jVqdS)N)r<endswith).0ext)cmdrr szwhich..csg|] }|qSrr)rbrc)rdrr szwhich..)rWrXdirnameenvironrHdefpathr9pathsepsysplatformcurdirinsertanysetnormcaseaddrA) rdr]rXr^ZpathextfilesseendirZnormdirZthefilenamer)rdrrVs8            rV)ZipFile __enter__) ZipExtFilec@s$eZdZddZddZddZdS)rycCs|jj|jdS)N)rPrQ)rRbaserrrrTszZipExtFile.__init__cCs|S)Nr)rRrrrrxszZipExtFile.__enter__cGs |jdS)N)close)rRexc_inforrr__exit__szZipExtFile.__exit__N)r4r5r6rTrxr}rrrrrysryc@s$eZdZddZddZddZdS)rwcCs|S)Nr)rRrrrrx"szZipFile.__enter__cGs |jdS)N)r{)rRr|rrrr}%szZipFile.__exit__cOstj|f||}t|S)N) BaseZipFileopenry)rRargsrSrzrrrr)sz ZipFile.openN)r4r5r6rxr}rrrrrrw!srw)python_implementationcCs0dtjkrdStjdkrdStjjdr,dSdS)z6Return a string identifying the Python implementation.ZPyPyjavaZJythonZ IronPythonZCPython)rkversionrWrvr>rrrrr0s   r) sysconfig)CallablecCs t|tS)N)rr)objrrrcallableDsrmbcsstrictsurrogateescapecCs:t|tr|St|tr$|jttStdt|jdS)Nzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper4)filenamerrrfsencodeRs    rcCs:t|tr|St|tr$|jttStdt|jdS)Nzexpect bytes or str, not %s) rrrdecoderrrrr4)rrrrfsdecode[s    r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)cCsH|ddjjdd}|dks*|jdr.dS|d ks@|jdrDdS|S)z(Imitates get_normal_name in tokenizer.c.N _-zutf-8zutf-8-latin-1 iso-8859-1 iso-latin-1latin-1- iso-8859-1- iso-latin-1-)rrr)rrr)r<r@r>)orig_encencrrr_get_normal_namels rc sy jjWntk r$dYnXdd}d}fdd}fdd}|}|jtrpd|d d}d }|s||gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFzutf-8c s yStk rdSXdS)N) StopIterationr)readlinerr read_or_stopsz%detect_encoding..read_or_stopcsy|jd}Wn4tk rBd}dk r6dj|}t|YnXtj|}|sVdSt|d}y t|}Wn:tk rdkrd|}n dj|}t|YnXr|j dkr؈dkrd}n dj}t||d 7}|S) Nzutf-8z'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorrv)line line_stringmsgZmatchesencodingcodec) bom_foundrrr find_cookies6       z$detect_encoding..find_cookieTrz utf-8-sig)__self__rvAttributeErrorr>r)rrdefaultrrfirstsecondr)rrrrrws4   &     r)r?r()unescape)ChainMap)MutableMapping)recursive_repr...csfdd}|S)zm Decorator to make a repr function return fillvalue for a recursive call csLtfdd}td|_td|_td|_tdi|_|S)Nc sBt|tf}|krSj|z |}Wdj|X|S)N)id get_identrrdiscard)rRrKresult) fillvalue repr_running user_functionrrwrappers   z=_recursive_repr..decorating_function..wrapperr5rUr4__annotations__)rpgetattrr5rUr4r)rr)r)rrrdecorating_functions   z,_recursive_repr..decorating_functionr)rrr)rr_recursive_reprs rc@seZdZdZddZddZddZd'd d Zd d Zd dZ ddZ ddZ e ddZ eddZddZeZddZeddZddZdd Zd!d"Zd#d$Zd%d&ZdS)(ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. cGst|p ig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)rRrrrrrT szChainMap.__init__cCs t|dS)N)KeyError)rRrKrrr __missing__szChainMap.__missing__c Cs8x,|jD]"}y||Stk r(YqXqW|j|S)N)rrr)rRrKmappingrrr __getitem__s   zChainMap.__getitem__NcCs||kr||S|S)Nr)rRrKrrrrrHsz ChainMap.getcCsttj|jS)N)rIrpunionr)rRrrr__len__"szChainMap.__len__cCsttj|jS)N)iterrprr)rRrrr__iter__%szChainMap.__iter__cstfdd|jDS)Nc3s|]}|kVqdS)Nr)rbm)rKrrre)sz(ChainMap.__contains__..)ror)rRrKr)rKr __contains__(szChainMap.__contains__cCs t|jS)N)ror)rRrrr__bool__+szChainMap.__bool__cCsdj|djtt|jS)Nz{0.__class__.__name__}({1})z, )rrArJr;r)rRrrr__repr__.szChainMap.__repr__cGs|tj|f|S)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablerrrrr3szChainMap.fromkeyscCs$|j|jdjf|jddS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopy)rRrrrr8sz ChainMap.copycCs|jif|jS)z;New ChainMap with a new dict followed by all previous maps.)rr)rRrrr new_child>szChainMap.new_childcCs|j|jddS)zNew ChainMap from maps[1:].rN)rr)rRrrrparentsBszChainMap.parentscCs||jd|<dS)Nr)r)rRrKrLrrr __setitem__GszChainMap.__setitem__c Cs8y|jd|=Wn"tk r2tdj|YnXdS)Nrz(Key not found in the first mapping: {!r})rrr)rRrKrrr __delitem__JszChainMap.__delitem__c Cs0y|jdjStk r*tdYnXdS)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.N)rpopitemr)rRrrrrPszChainMap.popitemc Gs>y|jdj|f|Stk r8tdj|YnXdS)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rz(Key not found in the first mapping: {!r}N)rpoprr)rRrKrrrrrWsz ChainMap.popcCs|jdjdS)z'Clear maps[0], leaving maps[1:] intact.rN)rclear)rRrrrr^szChainMap.clear)N)r4r5r6rUrTrrrHrrrrrr classmethodrr__copy__rpropertyrrrrrrrrrrrs(    r)cache_from_sourcecCs0|jdst|dkrd}|r$d}nd}||S)Nz.pyTco)raAssertionError)rXdebug_overridesuffixrrrresr) OrderedDict)r)KeysView ValuesView ItemsViewc@seZdZdZddZejfddZejfddZdd Zd d Z d d Z d6ddZ ddZ ddZ ddZddZddZddZddZeZeZefdd Zd7d"d#Zd8d$d%Zd&d'Zd(d)Zed9d*d+Zd,d-Zd.d/Zd0d1Zd2d3Z d4d5Z!d!S):rz)Dictionary that remembers insertion orderc Osnt|dkrtdt|y |jWn6tk r\g|_}||dg|dd<i|_YnX|j||dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. rz$expected at most 1 arguments, got %dN)rIr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rRrkwdsrootrrrrTs    zOrderedDict.__init__cCsF||kr6|j}|d}|||g|d<|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rr)rRrKrLZ dict_setitemrlastrrrrs  zOrderedDict.__setitem__cCs0||||jj|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rr)rRrKZ dict_delitem link_prev link_nextrrrrs zOrderedDict.__delitem__ccs2|j}|d}x||k r,|dV|d}qWdS)zod.__iter__() <==> iter(od)rr(N)r)rRrcurrrrrrs   zOrderedDict.__iter__ccs2|j}|d}x||k r,|dV|d}qWdS)z#od.__reversed__() <==> reversed(od)rr(N)r)rRrrrrr __reversed__s   zOrderedDict.__reversed__c CshyDx|jjD]}|dd=qW|j}||dg|dd<|jjWntk rXYnXtj|dS)z.od.clear() -> None. Remove all items from od.N)r itervaluesrrrr)rRZnoderrrrrszOrderedDict.clearTcCs||s td|j}|r8|d}|d}||d<||d<n |d}|d}||d<||d<|d}|j|=tj||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrrr()rrrrr)rRrrlinkrrrKrLrrrrs   zOrderedDict.popitemcCst|S)zod.keys() -> list of keys in od)r)rRrrrkeysszOrderedDict.keyscsfddDS)z#od.values() -> list of values in odcsg|] }|qSrr)rbrK)rRrrrfsz&OrderedDict.values..r)rRr)rRrvaluesszOrderedDict.valuescsfddDS)z.od.items() -> list of (key, value) pairs in odcsg|]}||fqSrr)rbrK)rRrrrfsz%OrderedDict.items..r)rRr)rRritemsszOrderedDict.itemscCst|S)z0od.iterkeys() -> an iterator over the keys in od)r)rRrrriterkeysszOrderedDict.iterkeysccsx|D]}||VqWdS)z2od.itervalues -> an iterator over the values in odNr)rRkrrrrs zOrderedDict.itervaluesccs x|D]}|||fVqWdS)z=od.iteritems -> an iterator over the (key, value) items in odNr)rRrrrr iteritemss zOrderedDict.iteritemscOst|dkr tdt|fn |s,td|d}f}t|dkrL|d}t|trrx^|D]}||||<q\WnDt|drx8|jD]}||||<qWnx|D]\}}|||<qWx|jD]\}}|||<qWdS)aod.update(E, **F) -> None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v r(z8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rrrN)rIrrrhasattrrr)rrrRotherrKrLrrrrQs&      zOrderedDict.updatecCs0||kr||}||=|S||jkr,t||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr)rRrKrrrrrr!s zOrderedDict.popNcCs||kr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr)rRrKrrrr setdefault.szOrderedDict.setdefaultc Cs^|si}t|tf}||kr"dSd||<z&|s>d|jjfSd|jj|jfS||=XdS)zod.__repr__() <==> repr(od)z...rz%s()z%s(%r)N)r _get_identrr4r)rRZ _repr_runningZcall_keyrrrr5szOrderedDict.__repr__cs\fddD}tj}xttD]}|j|dq*W|rPj|f|fSj|ffS)z%Return state information for picklingcsg|]}||gqSrr)rbr)rRrrrfEsz*OrderedDict.__reduce__..N)varsrrrr)rRrZ inst_dictrr)rRr __reduce__Cs zOrderedDict.__reduce__cCs |j|S)z!od.copy() -> a shallow copy of od)r)rRrrrrMszOrderedDict.copycCs |}x|D] }|||<q W|S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r)rrrLdrKrrrrQs  zOrderedDict.fromkeyscCs6t|tr*t|t|ko(|j|jkStj||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrrIrr__eq__)rRrrrrr\s  zOrderedDict.__eq__cCs ||k S)Nr)rRrrrr__ne__eszOrderedDict.__ne__cCst|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)r)rRrrrviewkeysjszOrderedDict.viewkeyscCst|S)z an object providing a view on od's values)r)rRrrr viewvaluesnszOrderedDict.viewvaluescCst|S)zBod.viewitems() -> a set-like object providing a view on od's items)r)rRrrr viewitemsrszOrderedDict.viewitems)T)N)N)N)"r4r5r6rUrTrrrrrrrrrrrrrrQrobjectrrr rr rrrrrrrrrrrrrs:         r)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cCstj|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERr,rG)rrrrrr|s  rc@s"eZdZdZddZdddZdS)ConvertingDictz A converting dictionary wrapper.cCsJtj||}|jj|}||k rF|||<t|tttfkrF||_||_ |S)N) rr configuratorconvertrrConvertingListConvertingTupleparentrK)rRrKrLrrrrrs   zConvertingDict.__getitem__NcCsLtj|||}|jj|}||k rH|||<t|tttfkrH||_||_ |S)N) rrHrrrrrrrrK)rRrKrrLrrrrrHs  zConvertingDict.get)N)r4r5r6rUrrHrrrrrs rcCsDtj|||}|jj|}||k r@t|tttfkr@||_||_ |S)N) rrrrrrrrrrK)rRrKrrLrrrrrs  rc@s"eZdZdZddZd ddZdS) rzA converting list wrapper.cCsJtj||}|jj|}||k rF|||<t|tttfkrF||_||_ |S)N) rrrrrrrrrrK)rRrKrLrrrrrs   zConvertingList.__getitem__rcCs<tj||}|jj|}||k r8t|tttfkr8||_|S)N) rrrrrrrrr)rRidxrLrrrrrs   zConvertingList.popN)r)r4r5r6rUrrrrrrrs rc@seZdZdZddZdS)rzA converting tuple wrapper.cCsBtj||}|jj|}||k r>t|tttfkr>||_||_ |S)N) tuplerrrrrrrrrK)rRrKrLrrrrrs   zConvertingTuple.__getitem__N)r4r5r6rUrrrrrrsrc@seZdZdZejdZejdZejdZejdZ ejdZ ddd Z e e Zd d Zd d ZddZddZddZddZddZdS)rzQ The configurator base class which defines some useful defaults. z%^(?P[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)rcZcfgcCst||_||j_dS)N)rconfigr)rRr"rrrrTs zBaseConfigurator.__init__c Cs|jd}|jd}y`|j|}xP|D]H}|d|7}yt||}Wq&tk rl|j|t||}Yq&Xq&W|Stk rtjdd\}}td||f}|||_ |_ |YnXdS)zl Resolve strings to objects using standard import and attribute syntax. r7rrNzCannot resolve %r: %s) r9rimporterrr ImportErrorrkr|rG __cause__ __traceback__) rRrrvZusedfoundrEetbvrrrresolves"      zBaseConfigurator.resolvecCs |j|S)z*Default converter for the ext:// protocol.)r+)rRrLrrrr szBaseConfigurator.ext_convertc Cs|}|jj|}|dkr&td|n||jd}|j|jd}x|r|jj|}|rp||jd}nd|jj|}|r|jd}|jj|s||}n2yt |}||}Wnt k r||}YnX|r||jd}qJtd||fqJW|S)z*Default converter for the cfg:// protocol.NzUnable to convert %rrzUnable to convert %r at %r) WORD_PATTERNr,rGendr"groups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNintr)rRrLrestrr rnrrrr!s2       zBaseConfigurator.cfg_convertcCst|t r&t|tr&t|}||_nt|t rLt|trLt|}||_n|t|t rrt|trrt|}||_nVt|tr|j j |}|r|j }|d}|j j |d}|r|d}t||}||}|S)z Convert values to an appropriate type. dicts, lists and tuples are replaced by their converting alternatives. Strings are checked to see if they have a conversion format and are converted if they do. prefixNr)rrrrrrrr string_typesCONVERT_PATTERNr, groupdictvalue_convertersrHr)rRrLrr r5Z converterrrrrr)s*     zBaseConfigurator.convertcsrjd}t|s|j|}jdd}tfddD}|f|}|rnx |jD]\}}t|||qVW|S)z1Configure an object with a user-supplied factory.z()r7Ncs g|]}t|r||fqSr)r)rbr)r"rrrfLsz5BaseConfigurator.configure_custom..)rrr+rrsetattr)rRr"rZpropsrSrrvrLr)r"rconfigure_customEs    z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)rrr)rRrLrrras_tupleSs zBaseConfigurator.as_tupleN)r4r5r6rUr*r+r7r,r/r0r1r9 staticmethod __import__r#rTr+r r!rr;r<rrrrrs      "r)r)rr)r)N)N)Z __future__rrWr*rkZsslr$ version_inforZ basestringr6rrtypesrZ file_typeZ __builtin__builtinsZ ConfigParserZ configparserZ _backportrrr r r r Zurllibr rrrrrrrZurllib2rrrrrr r!r"r#r$ZhttplibZ xmlrpclibZQueueZqueuer%ZhtmlentitydefsZ raw_input itertoolsr&filterr'r1r)r/iostrr0Z urllib.parseZurllib.requestZ urllib.errorZ http.clientZclientZrequestZ xmlrpc.clientZ html.parserZ html.entitiesZentitiesinputr2r3rGrFrNrOrrVF_OKX_OKZzipfilerwr~rryZBaseZipExtFilerlrrr NameError collectionsrrrrgetfilesystemencodingrrtokenizercodecsrrr+rrZhtmlr?ZcgirrrreprlibrrZimprrZthreadrr Z dummy_threadZ_abcollrrrrZlogging.configrrIrrrrrrrrrrrs&      $,      ,0        2+A              [   b w  PK!^N*N**__pycache__/resources.cpython-36.opt-1.pycnu[3 Pf*@sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZejeZdaGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZedee jeiZyFy ddl Z!Wne"k r$ddl#Z!YnXeee!j$<eee!j%<[!Wne"e&fk rXYnXddZ'iZ(ddZ)e j*e+dZ,ddZ-dS))unicode_literalsN)DistlibException)cached_propertyget_cache_basepath_to_cache_dirCachecs.eZdZdfdd ZddZddZZS) ResourceCacheNcs0|dkrtjjttd}tt|j|dS)Nzresource-cache)ospathjoinrstrsuperr __init__)selfbase) __class__/usr/lib/python3.6/resources.pyrszResourceCache.__init__cCsdS)z Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Tr)rresourcer rrris_stale#s zResourceCache.is_stalec Cs|jj|\}}|dkr|}n~tjj|j|j||}tjj|}tjj|sXtj |tjj |sjd}n |j ||}|rt |d}|j |jWdQRX|S)z Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTwb)finderget_cache_infor r r rZ prefix_to_dirdirnameisdirmakedirsexistsropenwritebytes)rrprefixr resultrZstalefrrrget.s      zResourceCache.get)N)__name__ __module__ __qualname__rrr$ __classcell__rr)rrr s r c@seZdZddZdS) ResourceBasecCs||_||_dS)N)rname)rrr*rrrrIszResourceBase.__init__N)r%r&r'rrrrrr)Hsr)c@s@eZdZdZdZddZeddZeddZed d Z d S) Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. FcCs |jj|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_stream)rrrr as_streamVszResource.as_streamcCstdkrtatj|S)N)cacher r$)rrrr file_path_szResource.file_pathcCs |jj|S)N)r get_bytes)rrrrr fszResource.bytescCs |jj|S)N)rget_size)rrrrsizejsz Resource.sizeN) r%r&r'__doc__ is_containerr-rr/r r2rrrrr+Ns   r+c@seZdZdZeddZdS)ResourceContainerTcCs |jj|S)N)r get_resources)rrrr resourcesrszResourceContainer.resourcesN)r%r&r'r4rr7rrrrr5osr5c@seZdZdZejjdrdZnd ZddZdd Z d d Z d d Z ddZ ddZ ddZddZddZddZddZeejjZddZdS)!ResourceFinderz4 Resource finder for file system resources. java.pyc.pyo.classcCs.||_t|dd|_tjjt|dd|_dS)N __loader____file__)modulegetattrloaderr r rr)rr@rrrrszResourceFinder.__init__cCs tjj|S)N)r r realpath)rr rrr _adjust_pathszResourceFinder._adjust_pathcCsBt|trd}nd}|j|}|jd|jtjj|}|j|S)N//r) isinstancer splitinsertrr r r rD)r resource_nameseppartsr"rrr _make_paths   zResourceFinder._make_pathcCs tjj|S)N)r r r)rr rrr_findszResourceFinder._findcCs d|jfS)N)r )rrrrrrszResourceFinder.get_cache_infocCsD|j|}|j|sd}n&|j|r0t||}n t||}||_|S)N)rMrN _is_directoryr5r+r )rrJr r"rrrfinds     zResourceFinder.findcCs t|jdS)Nrb)rr )rrrrrr,szResourceFinder.get_streamc Cs t|jd }|jSQRXdS)NrQ)rr read)rrr#rrrr0szResourceFinder.get_bytescCstjj|jS)N)r r getsize)rrrrrr1szResourceFinder.get_sizecs*fddtfddtj|jDS)Ncs|dko|jj S)N __pycache__)endswithskipped_extensions)r#)rrrallowedsz-ResourceFinder.get_resources..allowedcsg|]}|r|qSrr).0r#)rWrr sz0ResourceFinder.get_resources..)setr listdirr )rrr)rWrrr6s zResourceFinder.get_resourcescCs |j|jS)N)rOr )rrrrrr4szResourceFinder.is_containerccs|j|}|dk r|g}xn|r|jd}|V|jr|j}xH|jD]>}|sP|}ndj||g}|j|}|jrz|j|qB|VqBWqWdS)NrrF)rPpopr4r*r7r append)rrJrZtodoZrnamer*new_nameZchildrrriterators      zResourceFinder.iteratorN)r:r;r<)r:r;)r%r&r'r3sysplatform startswithrVrrDrMrNrrPr,r0r1r6r4 staticmethodr r rrOr_rrrrr8ws"    r8cs`eZdZdZfddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ Z S)ZipResourceFinderz6 Resource finder for resources in .zip files. csZtt|j||jj}dt||_t|jdr>|jj|_n t j ||_t |j|_ dS)Nr_files) rrdrrBarchivelen prefix_lenhasattrre zipimport_zip_directory_cachesortedindex)rr@rf)rrrrs   zZipResourceFinder.__init__cCs|S)Nr)rr rrrrDszZipResourceFinder._adjust_pathc Cs||jd}||jkrd}nX|r:|dtjkr:|tj}tj|j|}y|j|j|}Wntk rtd}YnX|stj d||j j ntj d||j j |S)NTrFz_find failed: %r %rz_find worked: %r %r) rhrer rKbisectrmrb IndexErrorloggerdebugrBr!)rr r"irrrrNs   zZipResourceFinder._findcCs&|jj}|jdt|d}||fS)Nr)rBrfr rg)rrr!r rrrrsz ZipResourceFinder.get_cache_infocCs|jj|jS)N)rBget_datar )rrrrrr0szZipResourceFinder.get_bytescCstj|j|S)N)ioBytesIOr0)rrrrrr,szZipResourceFinder.get_streamcCs|j|jd}|j|dS)N)r rhre)rrr rrrr1szZipResourceFinder.get_sizecCs|j|jd}|r,|dtjkr,|tj7}t|}t}tj|j|}xV|t|jkr|j|j|sjP|j||d}|j |j tjdd|d7}qJW|S)Nrrrn) r rhr rKrgrZrormrbaddrH)rrr Zplenr"rssrrrr6s  zZipResourceFinder.get_resourcesc Csj||jd}|r*|dtjkr*|tj7}tj|j|}y|j|j|}Wntk rdd}YnX|S)NrFrn)rhr rKrormrbrp)rr rsr"rrrrOs  zZipResourceFinder._is_directory)r%r&r'r3rrDrNrr0r,r1r6rOr(rr)rrrds rdcCs|tt|<dS)N)_finder_registrytype)rB finder_makerrrrregister_finder0sr}cCs|tkrt|}nv|tjkr$t|tj|}t|dd}|dkrJtdt|dd}tjt|}|dkrxtd|||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packager=zUnable to locate finder for %r) _finder_cacher`modules __import__rArrzr$r{)packager"r@r rBr|rrrr6s      rZ __dummy__cCsRd}tj|tjj|}tjt|}|rNt}tj j |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. Nr?) pkgutilZ get_importerr`path_importer_cacher$rzr{ _dummy_moduler r r r>r=)r r"rBrr@rrrfinder_for_pathRs  r).Z __future__rroruZloggingr rZshutilr`typesrjr?rutilrrrrZ getLoggerr%rqr.r objectr)r+r5r8rdr{ zipimporterrz_frozen_importlib_externalZ_fi ImportError_frozen_importlibSourceFileLoader FileFinderAttributeErrorr}rr ModuleTyper rrrrrrsH   ,!ZN    PK!_.mWW%__pycache__/util.cpython-36.opt-1.pycnu[3 Pfi@s>ddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZy ddlZWnek rdZYnXddlZddlZddlZddlZddlZy ddlZWnek rddlZYnXddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/e j0e1Z2dZ3e j4e3Z5dZ6d e6d Z7e6d Z8d Z9d e9de8de3d e9de8dZ:dZ;de:de;de:dZde6de>de<dZ?e j4e?Z@de9de8d ZAe j4eAZBdd ZCd!d"ZDd#d$ZEd%d&ZFdd'd(ZGd)d*ZHd+d,ZId-d.ZJejKd/d0ZLejKd1d2ZMejKdd4d5ZNGd6d7d7eOZPd8d9ZQGd:d;d;eOZRdd?d?eOZTe j4d@e jUZVdAdBZWddCdDZXdEdFZYdGdHZZdIdJZ[dKdLZ\dMdNZ]e j4dOe j^Z_e j4dPZ`ddQdRZae j4dSZbdTdUZcdVdWZddXdYZedZZfd[d\Zgd]d^ZhGd_d`d`eOZiGdadbdbeOZjGdcddddeOZkdZlddmdnZmdodpZndZoGdwdxdxeOZpe j4dyZqe j4dzZre j4d{Zsd|d}Zd~dZter\ddlmuZvmwZwmxZxGddde$jyZyGdddevZuGdddeue'Zzej{ddZ|e|dkrGddde$j}Z}erGddde$j~Z~Gddde%jZerGddde%jZGddde%jZddZGdddeOZGdddeZGdddeZGddde(ZGdddeOZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquotez\s*,\s*z (\w|[.-])+z(\*|:(\*|\w+):|)z\*?z([<>=!~]=)|[<>](z)?\s*(z)(z)\s*(z))*z(from\s+(?P.*))z \(\s*(?P|z)\s*\)|(?Pz\s*)z)*z \[\s*(?Pz)?\s*\]z(?Pz \s*)?(\s*z)?$z(?Pz )\s*(?Pc sddd}tj|}|r|j}|d}|dp8|d}|dsHd}nd}|dj}|snd}d}|d}nL|dd krd |}tj|} fd d | D}d |djdd |Df}|dsd} ntj|d} t ||| |||d}|S)NcSs|j}|d|dfS)NopZvn) groupdict)mdr!/usr/lib/python3.6/util.pyget_constraintYsz)parse_requirement..get_constraintZdnZc1Zc2Zdirefrz<>!=z~=csg|] }|qSr!r!).0r)r#r!r" qsz%parse_requirement..z%s (%s)z, cSsg|] }d|qS)z%s %sr!)r%Zconr!r!r"r&rsZex)nameZ constraintsextrasZ requirementsourceurl) REQUIREMENT_REmatchrstripRELOP_IDENT_REfinditerjoinCOMMA_REsplitr) sresultrr r'Zconsr*ZconstrZrsiteratorr(r!)r#r"parse_requirementWs4      r6cCsdd}i}x|D]\}}}tjj||}xt|D]t}tjj||} x`t| D]T} ||| } |dkrt|j| dqP||| } |jtjjdjd} | d| || <qPWq4WqW|S)z%Find destinations for resources filescSs6|jtjjd}|jtjjd}|t|djdS)N/)replaceospathseplenlstrip)baser:r!r!r" get_rel_pathsz)get_resources_dests..get_rel_pathNr7)r9r:r0rpopr8r;rstrip)Zresources_rootZrulesr?Z destinationsr>suffixdestprefixZabs_baseZabs_globZabs_pathZ resource_fileZrel_pathZrel_destr!r!r"get_resources_dests|s  rEcCs(ttdrd}ntjttdtjk}|S)NZ real_prefixT base_prefix)hasattrsysrDgetattr)r4r!r!r"in_venvs rJcCs$tjjtj}t|ts t|}|S)N)r9r:normcaserH executable isinstancerr)r4r!r!r"get_executables  rNcCsT|}xJt|}|}| r |r |}|r|dj}||kr:P|rd|||f}qW|S)Nrz %c: %s %s)r lower)promptZ allowed_charsZ error_promptdefaultpr3cr!r!r"proceeds  rTcCs<t|tr|j}i}x |D]}||kr||||<qW|S)N)rMrr2)r keysr4keyr!r!r"extract_by_keys  rWcCsntjddkrtjd|}|j}t|}yftj|}|ddd}xF|jD]:\}}x0|jD]$\}}d||f}t |} | ||<qdWqRW|St k r|j ddYnXdd } t j } y| | |Wn<t jk r|jtj|}t|}| | |YnXi}xT| jD]H} i|| <}x4| j| D]&\} }d| |f}t |} | || <q:WqW|S) Nrzutf-8 extensionszpython.exportsexportsz%s = %scSs$t|dr|j|n |j|dS)N read_file)rGr[Zreadfp)cpstreamr!r!r" read_streams  z!read_exports..read_stream)rH version_infocodecs getreaderreadr jsonloaditemsget_export_entry Exceptionseekr ConfigParserZMissingSectionHeaderErrorclosetextwrapdedentZsections)r]dataZjdatar4groupZentrieskvr3entryr^r\rVr'valuer!r!r" read_exportss@     rscCstjddkrtjd|}tj}x||jD]p\}}|j|x\|jD]P}|j dkr`|j }nd|j |j f}|j rd|dj |j f}|j ||j|qJWq.W|j|dS)NrrXzutf-8z%s:%sz%s [%s]z, )rHr_r` getwriterrrireZ add_sectionvaluesrBrDflagsr0setr'write)rZr]r\rorprqr3r!r!r" write_exportss  ryc cs$tj}z |VWdtj|XdS)N)tempfilemkdtemprrmtree)Ztdr!r!r"tempdir s r}c cs.tj}ztj|dVWdtj|XdS)N)r9getcwdchdir)r cwdr!r!r"rs   rc cs.tj}ztj|dVWdtj|XdS)N)socketZgetdefaulttimeoutZsetdefaulttimeout)ZsecondsZctor!r!r"socket_timeouts   rc@seZdZddZdddZdS)cached_propertycCs ||_dS)N)func)selfrr!r!r"__init__)szcached_property.__init__NcCs,|dkr |S|j|}tj||jj||S)N)robject __setattr____name__)robjclsrrr!r!r"__get__.s  zcached_property.__get__)N)r __module__ __qualname__rrr!r!r!r"r(srcCstjdkr|S|s|S|ddkr.td||ddkrFtd||jd}xtj|krj|jtjqRW|svtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put 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. r7rzpath '%s' cannot be absoluterzpath '%s' cannot end with '/')r9r; ValueErrorr2curdirremover:r0)pathnamepathsr!r!r" convert_path6s       rc@seZdZd$ddZddZddZdd Zd%d d Zd&ddZddZ ddZ ddZ ddZ ddZ d'ddZddZddZd d!Zd"d#Zd S)( FileOperatorFcCs||_t|_|jdS)N)dry_runrwensured _init_record)rrr!r!r"rRszFileOperator.__init__cCsd|_t|_t|_dS)NF)recordrw files_written dirs_created)rr!r!r"rWszFileOperator._init_recordcCs|jr|jj|dS)N)rradd)rr:r!r!r"record_as_written\szFileOperator.record_as_writtencCsHtjj|s tdtjj|tjj|s0dStj|jtj|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)r9r:existsrabspathstatst_mtime)rr)targetr!r!r"newer`s  zFileOperator.newerTcCs|jtjj|tjd|||jsd}|rftjj|rDd|}n"tjj|rftjj | rfd|}|rvt |dt j |||j |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirr9r:dirnameloggerinforislinkrisfilerrZcopyfiler)rZinfileoutfilecheckmsgr!r!r" copy_filets    zFileOperator.copy_fileNc Cst|jtjj|tjd|||jsf|dkr:t|d}ntj|d|d}zt j ||Wd|j X|j |dS)NzCopying stream %s to %swbw)encoding) rr9r:rrrropenr`rZ copyfileobjrjr)rZinstreamrrZ outstreamr!r!r" copy_streams  zFileOperator.copy_streamc CsF|jtjj||js8t|d}|j|WdQRX|j|dS)Nr)rr9r:rrrrxr)rr:rmfr!r!r"write_binary_files  zFileOperator.write_binary_filec CsL|jtjj||js>t|d}|j|j|WdQRX|j|dS)Nr) rr9r:rrrrxencoder)rr:rmrrr!r!r"write_text_files  zFileOperator.write_text_filecCsrtjdkstjdkrntjdkrnxN|D]F}|jrszFileOperator.cCs~tjj|}||jkrztjj| rz|jj|tjj|\}}|j|tj d||j shtj ||j rz|j j|dS)Nz Creating %s)r9r:rrrrr2rrrrmkdirrr)rr:r rr!r!r"rs    zFileOperator.ensure_dircCsht|| }tjd|||jsZ|s0|j||rJ|s:d}n|t|d}tj|||d|j||S)NzByte-compiling %s to %sT) r rrrrr< py_compilecompiler)rr:optimizeforcerDZdpathZdiagpathr!r!r" byte_compiles  zFileOperator.byte_compilecCstjj|rtjj|r`tjj| r`tjd||jsBtj ||j r||j kr|j j |nPtjj|rrd}nd}tjd|||jstj ||j r||j kr|j j |dS)NzRemoving directory tree at %slinkfilezRemoving %s %s)r9r:risdirrrdebugrrr|rrrr)rr:r3r!r!r"ensure_removeds"       zFileOperator.ensure_removedcCsHd}x>|sBtjj|r&tj|tj}Ptjj|}||kr)r'rDrBrv)rr!r!r"__repr__!s zExportEntry.__repr__cCsDt|tsd}n0|j|jko>|j|jko>|j|jko>|j|jk}|S)NF)rMrr'rDrBrv)rotherr4r!r!r"__eq__%s     zExportEntry.__eq__N) rrrrrrrrrr__hash__r!r!r!r"rs   rz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P\w+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cstj|}|s0d}d|ks"d|krtd|n|j}|d}|d}|jd}|dkrf|d}}n"|dkrztd||jd\}}|d } | dkrd|ksd|krtd|g} nd d | jd D} t|||| }|S) N[]zInvalid specification '%s'r'callable:rrrvcSsg|] }|jqSr!)r-)r%rr!r!r"r&Qsz$get_export_entry..,)ENTRY_REsearchrrcountr2r) Z specificationrr4r r'r:ZcolonsrDrBrvr!r!r"rf7s2    rfc Cs|dkr d}tjdkr.dtjkr.tjjd}n tjjd}tjj|rftj|tj}|st j d|n|jdd\}}d|kr.|}n|jdd\}}|||fS)N@rr)r2)ZnetlocZusernameZpasswordrDr!r!r"parse_credentialssrcCstjd}tj||S)N)r9umask)r4r!r!r"get_process_umasks  rcCs2d}d}x$t|D]\}}t|tsd}PqW|S)NTF) enumeraterMr)seqr4ir3r!r!r"is_string_sequences rz3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|jdd}tj|}|r@|jd}|d|j}|rt|t|dkrtjtj |d|}|r|j }|d|||dd|f}|dkrt j|}|r|jd|jd|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\brX) rr8PYTHON_VERSIONrrnstartr<rer,escapeendPROJECT_NAME_AND_VERSION)filenameZ project_namer4Zpyverrnr!r!r"split_filenames"   rz-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCs:tj|}|std||j}|djj|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'r'Zver)NAME_VERSION_REr,rrr-rO)rRrr r!r!r"parse_name_and_versions  rcCst}t|pg}t|pg}d|kr8|jd||O}x|D]x}|dkrV|j|q>|jdr|dd}||krtjd|||kr|j|q>||krtjd||j|q>W|S)N*rrzundeclared extra: %s)rwrr startswithrr)Z requestedZ availabler4rZunwantedr!r!r" get_extrass&        rcCsi}yNt|}|j}|jd}|jds8tjd|ntjd|}tj |}Wn0t k r}ztj d||WYdd}~XnX|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %szutf-8z&Failed to get external data for %s: %s) r rgetrrrr`rarcrdrg exception)r*r4ZrespZheadersZctreaderer!r!r"_get_external_datas   rz'https://www.red-dove.com/pypi/projects/cCs*d|dj|f}tt|}t|}|S)Nz%s/%s/project.jsonr)upperr _external_data_base_urlr)r'r*r4r!r!r"get_project_datas rcCs(d|dj||f}tt|}t|S)Nz%s/%s/package-%s.jsonr)rr rr)r'versionr*r!r!r"get_package_datas r c@s(eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsPtjj|stj|tj|jd@dkr6tjd|tjjtjj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) r9r:rrrrrrrnormpathr>)rr>r!r!r"r"s    zCache.__init__cCst|S)zN Converts a resource prefix to a directory name in the cache. )r)rrDr!r!r" prefix_to_dir0szCache.prefix_to_dirc Csg}xtj|jD]r}tjj|j|}y>tjj|s@tjj|rLtj|ntjj|rbt j |Wqt k r|j |YqXqW|S)z" Clear the cache. ) r9rr>r:r0rrrrrr|rgappend)rZ not_removedfnr!r!r"clear6s  z Cache.clearN)rrr__doc__rr$r'r!r!r!r"r!sr!c@s:eZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dS)N) _subscribers)rr!r!r"rKszEventMixin.__init__TcCsD|j}||krt|g||<n"||}|r6|j|n |j|dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)r*rr% appendleft)revent subscriberr%subsZsqr!r!r"rNs  zEventMixin.addcCs,|j}||krtd|||j|dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)r*rr)rr,r-r.r!r!r"rbs zEventMixin.removecCst|jj|fS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. )iterr*r)rr,r!r!r"get_subscribersnszEventMixin.get_subscribersc Ospg}xT|j|D]F}y||f||}Wn"tk rJtjdd}YnX|j|qWtjd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)r0rgrrr%r)rr,argskwargsr4r-rrr!r!r"publishus    zEventMixin.publishN)T) rrrr(rrrr0r3r!r!r!r"r)Gs   r)c@s^eZdZddZddZdddZdd Zd d Zd d ZddZ e ddZ e ddZ dS) SequencercCsi|_i|_t|_dS)N)_preds_succsrw_nodes)rr!r!r"rszSequencer.__init__cCs|jj|dS)N)r7r)rnoder!r!r"add_nodeszSequencer.add_nodeFcCs||jkr|jj||rx&t|jj|fD]}|j||q.Wx&t|jj|fD]}|j||qVWx&t|jjD]\}}|sz|j|=qzWx&t|jjD]\}}|s|j|=qWdS)N)r7rrwr5rr6rre)rr8ZedgesrRr3rorpr!r!r" remove_nodes   zSequencer.remove_nodecCs0|jj|tj||jj|tj|dS)N)r5 setdefaultrwrr6)rpredsuccr!r!r"rsz Sequencer.addcCs|y|j|}|j|}Wn tk r8td|YnXy|j||j|Wn$tk rvtd||fYnXdS)Nz%r not a successor of anythingz%r not a successor of %r)r5r6KeyErrorrr)rr<r=predsZsuccsr!r!r"rs  zSequencer.removecCs||jkp||jkp||jkS)N)r5r6r7)rstepr!r!r"is_stepszSequencer.is_stepcCs|j|std|g}g}t}|j|xd|r|jd}||krd||kr|j||j|q0|j||j||jj|f}|j |q0Wt |S)Nz Unknown: %rr) rArrwr%r@rrr5rextendreversed)rfinalr4Ztodoseenr@r?r!r!r" get_stepss"        zSequencer.get_stepscsVdggiig|jfddxD]}|kr:|q:WS)Nrc sd|<d|<dd7<j|y |}Wntk rVg}YnXxR|D]J}|kr|t|||<q^|kr^t|||<q^W||krg}x j}|j|||krPqWt|}j|dS)Nrr)r%rgminr@tuple)r8Z successorsZ successorZconnected_componentZ component)graphindex index_counterlowlinksr4stack strongconnectr!r"rNs.       z3Sequencer.strong_connections..strongconnect)r6)rr8r!)rIrJrKrLr4rMrNr"strong_connectionss"  zSequencer.strong_connectionscCsrdg}x8|jD].}|j|}x|D]}|jd||fq"WqWx|jD]}|jd|qHW|jddj|S)Nz digraph G {z %s -> %s;z %s;} )r5r%r7r0)rr4r=r?r<r8r!r!r"dot s     z Sequencer.dotN)F) rrrrr9r:rrrArFpropertyrOrRr!r!r!r"r4s   3r4.tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc sffdd}tjjtd}|dkr|jdr>d}nH|jdrRd}d }n4|jdrfd }d }n |jdrzd}d}n td|z|dkrt|d}|r|j}xD|D] }||qWn.tj ||}|r|j }x|D] }||qW|dkr6t j ddkr6x.|j D]"} t| jts| jjd| _qWdd} | |_|jWd|r`|jXdS)NcsTt|ts|jd}tjjtjj|}|j sD|tjkrPt d|dS)Nzutf-8zpath outside destination: %r) rMrdecoder9r:rr0rr;r)r:rR)dest_dirplenr!r" check_paths   zunarchive..check_path.zip.whlzip.tar.gz.tgzZtgzzr:gz.tar.bz2.tbzZtbzzr:bz2z.tarZtarrzUnknown format for %rrrXzutf-8cSsBy tj||Stjk r<}ztt|WYdd}~XnXdS)z:Run tarfile.tar_fillter, but raise the expected ValueErrorN)tarfileZ tar_filterZ FilterErrorrstr)memberr:excr!r!r"extraction_filterPs z$unarchive..extraction_filter)r_r`)rbrc)rdre)r9r:rr<rrrZnamelistrfrZgetnamesrHr_Z getmembersrMr'rr[rjZ extractallrj) Zarchive_filenamer\formatrr^archivernamesr'Ztarinforjr!)r\r]r" unarchivesL           rnc Cstj}t|}t|db}xZtj|D]L\}}}x@|D]8}tjj||}||d} tjj| |} |j|| q8Wq(WWdQRX|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOr<rr9walkr:r0rx) Z directoryr4ZdlenZzfrootrrr'ZfullZrelrCr!r!r"zip_dir`s   rsr$KMGTPc@sreZdZdZdddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressZUNKNOWNrdcCs(||_|_||_d|_d|_d|_dS)NrF)rGcurmaxstartedelapseddone)rZminvalZmaxvalr!r!r"rws  zProgress.__init__cCs0||_tj}|jdkr ||_n ||j|_dS)N)r{timer}r~)rZcurvalZnowr!r!r"updates  zProgress.updatecCs|j|j|dS)N)rr{)rZincrr!r!r" incrementszProgress.incrementcCs|j|j|S)N)rrG)rr!r!r"r s zProgress.startcCs |jdk r|j|jd|_dS)NT)r|rr)rr!r!r"stops  z Progress.stopcCs|jdkr|jS|jS)N)r|unknown)rr!r!r"maximumszProgress.maximumcCsD|jr d}n4|jdkrd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rr|r{rG)rr4rpr!r!r" percentages zProgress.percentagecCs:|dkr|jdks|j|jkr$d}ntjdtj|}|S)Nrz??:??:??z%H:%M:%S)r|r{rGrZstrftimeZgmtime)rZdurationr4r!r!r"format_durationszProgress.format_durationcCs|jrd}|j}n^d}|jdkr&d}nJ|jdks<|j|jkrBd}n.t|j|j}||j|j}|d|j}d||j|fS)NZDonezETA rrz%s: %sr)rr~r|r{rGfloatr)rrDtr!r!r"ETAs z Progress.ETAcCsN|jdkrd}n|j|j|j}xtD]}|dkr6P|d}q(Wd||fS)Nrgig@@z%d %sB/s)r~r{rGUNITS)rr4Zunitr!r!r"speeds   zProgress.speedN)rrz)rrrrrrrr rrSrrrrrr!r!r!r"ryts     ryz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<tj|rd}t||tj|r4d}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrr_CHECK_MISMATCH_SET_iglob) path_globrr!r!r"rs    rc cstj|d}t|dkr\|\}}}x|jdD](}x"tdj|||fD] }|VqHWq.Wnd|kr~xt|D] }|VqnWn|jdd\}}|dkrd}|dkrd}n|jd}|jd}xFtj|D]8\}}} tj j |}x ttj j||D] } | VqWqWdS) Nrrr$z**rrr7\) RICH_GLOBr2r<rr0 std_iglobr=r9rqr:r#) rZrich_path_globrDrwrBitemr:Zradicaldirrr&r!r!r"rs(       r) HTTPSHandlermatch_hostnameCertificateErrorc@seZdZdZdZddZdS)HTTPSConnectionNTc CsPtj|j|jf|j}t|ddr0||_|jtt dsp|j rHt j }nt j }t j ||j|j|t j|j d|_nxt jt j}|jt jO_|jr|j|j|ji}|j rt j |_|j|j dtt ddr|j|d<|j |f||_|j o|jrLy$t|jj|jtjd|jWn0tk rJ|jjtj|jjYnXdS) NZ _tunnel_hostF SSLContext) cert_reqsZ ssl_versionca_certs)ZcafileZHAS_SNIZserver_hostnamezHost verified: %s) rZcreate_connectionhostporttimeoutrIsockZ_tunnelrGsslrZ CERT_REQUIREDZ CERT_NONEZ wrap_socketZkey_fileZ cert_fileZPROTOCOL_SSLv23rZoptionsZ OP_NO_SSLv2Zload_cert_chainZ verify_modeZload_verify_locations check_domainrZ getpeercertrrrZshutdownZ SHUT_RDWRrj)rrrcontextr2r!r!r"connect s>      zHTTPSConnection.connect)rrrrrrr!r!r!r"rsrc@s&eZdZd ddZddZddZdS) rTcCstj|||_||_dS)N)BaseHTTPSHandlerrrr)rrrr!r!r"r0s zHTTPSHandler.__init__cOs$t||}|jr |j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr)rr1r2r4r!r!r" _conn_maker5s zHTTPSHandler._conn_makercCsVy|j|j|Stk rP}z&dt|jkr>td|jnWYdd}~XnXdS)Nzcertificate verify failedz*Unable to verify server certificate for %s)Zdo_openrrrgreasonrr)rreqrr!r!r" https_openEs zHTTPSHandler.https_openN)T)rrrrrrr!r!r!r"r/s rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrr!r!r" http_openYszHTTPSOnlyHandler.http_openN)rrrrr!r!r!r"rXsrc@seZdZdddZdS)HTTPr$NcKs&|dkr d}|j|j||f|dS)Nr)_setup_connection_class)rrrr2r!r!r"resz HTTP.__init__)r$N)rrrrr!r!r!r"rdsrc@seZdZdddZdS)HTTPSr$NcKs&|dkr d}|j|j||f|dS)Nr)rr)rrrr2r!r!r"rmszHTTPS.__init__)r$N)rrrrr!r!r!r"rlsrc@seZdZdddZddZdS) TransportrcCs||_tjj||dS)N)rrrr)rr use_datetimer!r!r"rtszTransport.__init__cCsb|j|\}}}tdkr(t||jd}n6|j s>||jdkrT||_|tj|f|_|jd}|S)Nrr)rrr)rr) get_host_info _ver_inforr _connection_extra_headersrZHTTPConnection)rrhehZx509r4r!r!r"make_connectionxs zTransport.make_connectionN)r)rrrrrr!r!r!r"rss rc@seZdZdddZddZdS) SafeTransportrcCs||_tjj||dS)N)rrrr)rrrr!r!r"rszSafeTransport.__init__cCsz|j|\}}}|si}|j|d<tdkr:t|df|}n<|j sP||jdkrl||_|tj|df|f|_|jd}|S)Nrrrrr)rr)rrrrrrrr)rrrrr2r4r!r!r"rs    zSafeTransport.make_connectionN)r)rrrrrr!r!r!r"rs rc@seZdZddZdS) ServerProxyc Kst|jdd|_}|dk r^t|\}}|jdd}|dkr@t}nt}|||d|d<}||_tjj ||f|dS)NrrrZhttps)r transport) r@rrrrrrrrr) rZurir2rscheme_rZtclsrr!r!r"rs  zServerProxy.__init__N)rrrrr!r!r!r"rsrcKs.tjddkr|d7}nd|d<t||f|S)NrrXbr$newline)rHr_r)r&rr2r!r!r" _csv_opens rc@s4eZdZedededdZddZddZd S) CSVBaser"rQ)Z delimiterZ quotecharZlineterminatorcCs|S)Nr!)rr!r!r" __enter__szCSVBase.__enter__cGs|jjdS)N)r]rj)rrr!r!r"__exit__szCSVBase.__exit__N)rrrrgdefaultsrrr!r!r!r"rs  rc@s(eZdZddZddZddZeZdS) CSVReadercKs\d|kr4|d}tjddkr,tjd|}||_nt|dd|_tj|jf|j|_dS)Nr]rrXzutf-8r:r) rHr_r`rar]rcsvrr)rr2r]r!r!r"rszCSVReader.__init__cCs|S)Nr!)rr!r!r"__iter__szCSVReader.__iter__cCsJt|j}tjddkrFx,t|D] \}}t|ts"|jd||<q"W|S)NrrXzutf-8)nextrrHr_rrMrr[)rr4rrr!r!r"rs   zCSVReader.nextN)rrrrrr__next__r!r!r!r"rs rc@seZdZddZddZdS) CSVWritercKs$t|d|_tj|jf|j|_dS)Nr)rr]rwriterr)rr&r2r!r!r"rs zCSVWriter.__init__cCsRtjddkrBg}x*|D]"}t|tr0|jd}|j|qW|}|jj|dS)NrrXzutf-8)rHr_rMrrr%rwriterow)rrowrrr!r!r"rs   zCSVWriter.writerowN)rrrrrr!r!r!r"rsrcsHeZdZeejZded<d fdd ZddZdd Zd d Z Z S) Configurator inc_convertZincNcs"tt|j||ptj|_dS)N)superrrr9r~r>)rconfigr>) __class__r!r"rszConfigurator.__init__c sfddjd}t|s*j|}jdd}jdf}|r\tfdd|D}fddD}t|}|||}|rx$|jD]\}} t||| qW|S) Ncszt|ttfr*t|fdd|D}nLt|trld|krHj|}qvi}x(|D]}||||<qRWn j|}|S)Ncsg|] }|qSr!r!)r%r)convertr!r"r&szBConfigurator.configure_custom..convert..z())rMrrHtypedictconfigure_customr)or4ro)rrr!r"rs    z.Configurator.configure_custom..convertz()rz[]csg|] }|qSr!r!)r%r)rr!r"r&sz1Configurator.configure_custom..cs$g|]}t|r||fqSr!)r)r%ro)rrr!r"r&s)r@rrrHrresetattr) rrrSZpropsr1rer2r4rrpr!)rrrr"rs     zConfigurator.configure_customcCs4|j|}t|tr0d|kr0|j||j|<}|S)Nz())rrMrr)rrVr4r!r!r" __getitem__s zConfigurator.__getitem__c CsFtjj|stjj|j|}tj|ddd}tj|}WdQRX|S)z*Default converter for the inc:// protocol.rzutf-8)rN) r9r:isabsr0r>r`rrcrd)rrrrr4r!r!r"rs  zConfigurator.inc_convert)N) rrrrrZvalue_convertersrrrr __classcell__r!r!)rr"rs  rc@s&eZdZd ddZddZddZdS) SubprocessMixinFNcCs||_||_dS)N)verboseprogress)rrrr!r!r"r+szSubprocessMixin.__init__cCsn|j}|j}xT|j}|sP|dk r0|||q|sBtjjdntjj|jdtjjqW|jdS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nrzutf-8) rrreadlinerHstderrrxr[flushrj)rr]rrrr3r!r!r"r/s zSubprocessMixin.readercKstj|ftjtjd|}tj|j|jdfd}|jtj|j|jdfd}|j|j |j |j |j dk r|j ddn|j rt jjd|S)N)stdoutrr)rr1rzdone.mainzdone. ) subprocessPopenPIPE threadingZThreadrrr rwaitr0rrrHrx)rcmdr2rRZt1Zt2r!r!r" run_commandDs   zSubprocessMixin.run_command)FN)rrrrrrr!r!r!r"r*s rcCstjdd|jS)z,Normalize a python package name a la PEP 503z[-_.]+r)r subrO)r'r!r!r"normalize_nameUsr)NN)r)N)N)rTrUrVrWrXrYrZ)NT)r$rtrurvrwrx)rr)r` collectionsr contextlibrZglobrrrorcZloggingr9rr rrr ImportErrorrrHrfrzrkrZdummy_threadingrr$rcompatrrr r r r r rrrrrrrrrrrrZ getLoggerrrCOMMArr1ZIDENTZ EXTRA_IDENTZVERSPECZRELOPZBARE_CONSTRAINTSZ DIRECT_REFZ CONSTRAINTSZ EXTRA_LISTZEXTRASZ REQUIREMENTr+Z RELOP_IDENTr.r6rErJrNrTrWrsrycontextmanagerr}rrrrrrrrVERBOSErrfrrrrrrIr rrrrrrrrr r!r)r4ZARCHIVE_EXTENSIONSrnrsrryrrrrrrrrrrr_rrrrrrrrrrrrrr!r!r!r"s      X   ,   %   /  7  )     ,H  C]    *)  :+PK!Lmaa __pycache__/wheel.cpython-36.pycnu[3 Pf˘@sddlmZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd l,m-Z-m.Z.e j/e0Z1da2e3ed r4d Z4n*ej5j6d rHdZ4nej5dkrZdZ4ndZ4ej7dZ8e8sdej9ddZ8de8Z:e4e8Z;ej"j<j=ddj=ddZ>ej7dZ?e?re?j6dre?j=ddZ?nddZ@e@Z?[@ejAdejBejCBZDejAdejBejCBZEejAdZFejAd ZGd!ZHd"ZIe jJd#kr>d$d%ZKnd&d%ZKGd'd(d(eLZMeMZNGd)d*d*eLZOd+d,ZPePZQ[Pd/d-d.ZRdS)0)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir)NormalizedVersionUnsupportedVersionErrorZpypy_version_infoZppjavaZjyZcliZipcppy_version_nodotz%s%spy-_.SOABIzcpython-cCsRdtg}tjdr|jdtjdr0|jdtjddkrH|jdd j|S) NrPy_DEBUGd WITH_PYMALLOCmZPy_UNICODE_SIZEu) VER_SUFFIXrget_config_varappendjoin)partsr//usr/lib/python3.6/wheel.py _derive_abi;s     r1zz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/cCs|S)Nr/)or/r/r0]sr4cCs|jtjdS)Nr2)replaceossep)r3r/r/r0r4_sc@s6eZdZddZddZddZd dd Zd d ZdS) MountercCsi|_i|_dS)N) impure_wheelslibs)selfr/r/r0__init__cszMounter.__init__cCs||j|<|jj|dS)N)r9r:update)r;pathname extensionsr/r/r0addgs z Mounter.addcCs4|jj|}x"|D]\}}||jkr|j|=qWdS)N)r9popr:)r;r>r?kvr/r/r0removeks  zMounter.removeNcCs||jkr|}nd}|S)N)r:)r;fullnamepathresultr/r/r0 find_moduleqs zMounter.find_modulecCsj|tjkrtj|}nP||jkr,td|tj||j|}||_|jdd}t|dkrf|d|_ |S)Nzunable to find extension for %sr!rr) sysmodulesr: ImportErrorimpZ load_dynamic __loader__rsplitlen __package__)r;rErGr.r/r/r0 load_modulexs       zMounter.load_module)N)__name__ __module__ __qualname__r<r@rDrHrQr/r/r/r0r8bs  r8c@seZdZdZd2ZdZd3ddZedd Zed d Z ed d Z e ddZ ddZ e ddZddZd4ddZddZddZddZd5ddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd6d*d+Zd,d-Zd.d/Zd7d0d1ZdS)8Wheelz@ Class to build and install from Wheel files (PEP 427). rZsha256NFcCs8||_||_d|_tg|_dg|_dg|_tj|_ |dkrRd|_ d|_ |j |_ ntj|}|r|jd}|d|_ |djd d |_ |d |_|j |_ ntjj|\}}tj|}|std ||rtjj||_ ||_ |jd}|d|_ |d|_ |d |_|d jd|_|djd|_|djd|_dS)zB Initialise an instance using a (valid) filename. r)noneanyNZdummyz0.1ZnmZvnr rZbnzInvalid name or filename: %rrr!Zbiar)signZ should_verifybuildverPYVERpyverabiarchr6getcwddirnamenameversionfilenameZ _filenameNAME_VERSION_REmatch groupdictr5rFsplit FILENAME_RErabspath)r;rcrYverifyr&infor`r/r/r0r<sB            zWheel.__init__cCs^|jrd|j}nd}dj|j}dj|j}dj|j}|jjdd}d|j|||||fS)zJ Build and return a filename from the various components. rr)r!r z%s-%s%s-%s-%s-%s.whl)rZr-r\r]r^rbr5ra)r;rZr\r]r^rbr/r/r0rcs     zWheel.filenamecCstjj|j|j}tjj|S)N)r6rFr-r`rcisfile)r;rFr/r/r0existssz Wheel.existsccs@x:|jD]0}x*|jD] }x|jD]}|||fVq WqWqWdS)N)r\r]r^)r;r\r]r^r/r/r0tagss   z Wheel.tagscCstjj|j|j}d|j|jf}d|}tjd}t |d}|j |}|dj dd}t dd |D}|d krzd } nt } y8tj|| } |j| } || } t| d } WdQRXWn tk rtd | YnXWdQRX| S)Nz%s-%sz %s.dist-infozutf-8rz Wheel-Versionr!rcSsg|] }t|qSr/)int).0ir/r/r0 sz"Wheel.metadata..ZMETADATA)Zfileobjz$Invalid wheel, because %s is missing)rr)r6rFr-r`rcrarbcodecs getreaderrget_wheel_metadatargtupler posixpathopenr KeyError ValueError)r;r>name_verinfo_dirwrapperzfwheel_metadatawv file_versionfnmetadata_filenamebfwfrGr/r/r0metadatas(     zWheel.metadatac CsXd|j|jf}d|}tj|d}|j|}tjd|}t|}WdQRXt|S)Nz%s-%sz %s.dist-infoWHEELzutf-8) rarbrxr-ryrtrurdict)r;rr|r}rrrmessager/r/r0rvs  zWheel.get_wheel_metadatac Cs6tjj|j|j}t|d}|j|}WdQRX|S)Nro)r6rFr-r`rcrrv)r;r>rrGr/r/r0rks z Wheel.infoc Cstj|}|r||j}|d|||d}}d|jkrBt}nt}tj|}|rfd|jd }nd}||}||}nT|jd}|jd} |dks|| krd} n|||dd krd } nd} t| |}|S) Nspythonw r  rrs ) SHEBANG_REreendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) r;datar&rZshebangZdata_after_shebangZshebang_pythonargsZcrZlfZtermr/r/r0process_shebangs,       zWheel.process_shebangc Csh|dkr|j}ytt|}Wn tk r<td|YnX||j}tj|jdj d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64Zurlsafe_b64encoderstripdecode)r;rrhasherrGr/r/r0get_hashs zWheel.get_hashc Csbt|}ttjj||}|j|ddf|jt|}x|D]}|j|qBWWdQRXdS)Nr)) listto_posixr6rFrelpathr,sortrZwriterow)r;recordsZ record_pathbasepwriterrowr/r/r0 write_record's  zWheel.write_recordc Csg}|\}}tt|j}xX|D]P\}} t| d} | j} WdQRXd|j| } tjj| } |j || | fqWtjj |d} |j || |t tjj |d}|j || fdS)Nrbz%s=%sRECORD) rrrryreadrr6rFgetsizer,r-rr)r;rklibdir archive_pathsrdistinfor}raprfrrsizer/r/r0 write_records0s   zWheel.write_recordsc CsJt|dtj2}x*|D]"\}}tjd|||j||qWWdQRXdS)NwzWrote %s to %s in wheel)rzipfileZ ZIP_DEFLATEDloggerdebugwrite)r;r>rrrrr/r/r0 build_zip@szWheel.build_zipc!s|dkr i}ttfddd%d}|dkrFd}tg}tg}tg}nd}tg}d g}d g}|jd ||_|jd ||_|jd ||_ |} d|j |j f} d| } d| } g} xd&D]}|krq|}t j j|rxt j|D]\}}}x|D]}tt j j||}t j j||}tt j j| ||}| j||f|dkr|jd rt|d}|j}WdQRX|j|}t|d}|j|WdQRXqWqWqW| }d}xt j|D]\}}}||kr"x@t|D]4\}}t|}|jdrt j j||}||=PqW|s"tdxP|D]H}t|jd'r@q(t j j||}tt j j||}| j||fq(WqWt j|}xJ|D]B}|d(krtt j j||}tt j j| |}| j||fqWd|p|jd td!|g}x*|jD] \}}}|jd"|||fqWt j j|d}t|d#}|jd$j|WdQRXtt j j| d}| j||f|j || f| | t j j|j!|j"} |j#| | | S))z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Ncs|kS)Nr/)r3)pathsr/r0r4NszWheel.build..purelibplatlibrZfalsetruerVrWr\r]r^z%s-%sz%s.dataz %s.dist-inforheadersscriptsz.exerwbz .dist-infoz(.dist-info directory expected, not found.pyc.pyor INSTALLERSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %sz Tag: %s-%s-%sr )rr)rrr)rr)rrrr)$rr IMPVERABIARCHr[getr\r]r^rarbr6rFisdirwalkr r-rrr,endswithryrrr enumerateAssertionErrorlistdir wheel_versionrrnrr`rcr)!r;rrnrZlibkeyZis_pureZ default_pyverZ default_abiZ default_archrr|data_dirr}rkeyrFrootdirsfilesrrrprrrrrrdnrr\r]r^r>r/)rr0buildFs      "         z Wheel.buildcBIKs`|j}|jd}|jdd}tjj|j|j}d|j|jf}d|} d|} t j| t } t j| d} t j| d} t j d }t |d }|j| }||}t|}Wd QRX|d jd d}tdd|D}||jkr|r||j||ddkr|d}n|d}i}|j| <}t|d&}x|D]}|d}|||<q.WWd QRXWd QRXt j| d}t j| d}t j| dd}t|d}d|_tj }g} tj}!|!|_d |_zy^x|jD]}"|"j}#t|#tr|#}$n |#jd }$|$j drq||$}|dr0t!|"j"|dkr0t#d|$|dr|djdd\}%}&|j|#}|j$}'Wd QRX|j%|'|%\}(})|)|&krt#d|#|r|$j&||frt'j(d |$q|$j&|o|$j d! }*|$j&|r|$jd"d\}(}+},tjj||+t)|,}-n$|$| | fkrqtjj|t)|$}-|*s|j|#}|j*||-Wd QRX| j+|-| r|drt|-d#4}|j$}'|j%|'|%\}(}.|.|)krt#d$|-Wd QRX|rx|-j d%rxy|j,|-}/| j+|/Wn$t-k rt'j.d&dd'YnXnttjj/t)|#}0tjj|!|0}1|j|#}|j*||1Wd QRXtjj|-\}2}0|2|_|j0|0}3|j1|3| j2|3qW|rt'j(d(d }4n~d }5|j3d }|d)kr~t j| d*}6y|j|6}t4|}7Wd QRXi}5xxd|=s |>r|jdd}?tjj;|?s.tW|>rd,di}Ax8|>j=D],\}9};d8|9|;f}@|j0|@|A}3|j1|3qWtjj|| }t>|}4t?|}|d=|d=||d9<|4j@||}|r| j+||4jA| |d:||4St-k r@t'jBd;|jCYnXWd tDjE|!XWd QRXd S)=a Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. warnerlib_onlyFz%s-%sz%s.dataz %s.dist-inforrzutf-8roNz Wheel-Versionr!rcSsg|] }t|qSr/)rp)rqrrr/r/r0rssz!Wheel.install..zRoot-Is-Purelibrrr)streamrr)r)dry_runTz /RECORD.jwsrzsize mismatch for %s=zdigest mismatch for %szlib_only: skipping %sz.exer2rzdigest mismatch on write for %sz.pyzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txtconsoleguiz %s_scriptszwrap_%sz%s:%sz %szAUnable to read legacy script metadata, so cannot generate scriptsr?zpython.commandsz8Unable to read JSON metadata, so cannot generate scriptsZ wrap_consoleZwrap_guizValid script path not specifiedz%s = %slibprefixzinstallation failed.)rr)Frrr6rFr-r`rcrarbrxrrtrurryrrgrwrrrrecordrIdont_write_bytecodetempfileZmkdtempZ source_dirZ target_dirinfolist isinstancer rrstr file_sizerrr startswithrrrZ copy_streamr,Z byte_compile ExceptionZwarningbasenameZmakeZset_executable_modeextendrkrvaluesrsuffixflagsjsonloadrr{itemsr rZwrite_shared_locationsZwrite_installed_filesZ exceptionZrollbackshutilZrmtree)Br;rZmakerkwargsrrrr>r|rr} metadata_namewheel_metadata_name record_namer~rbwfrrrrrrrreaderrrZdata_pfxZinfo_pfxZ script_pfxZfileopZbcZoutfilesworkdirzinfoarcname u_arcnamekindvaluerr rZ is_scriptwhererZoutfileZ newdigestZpycrZworknamer filenamesZdistZcommandsZepZepdatarrBr$rCsZconsole_scriptsZ gui_scriptsZ script_dirZscriptZoptionsr/r/r0installsB            "                                          z Wheel.installcCs4tdkr0tjjttdtjdd}t|atS)Nz dylib-cache) cacher6rFr-rrrIrbr)r;rr/r/r0_get_dylib_caches zWheel._get_dylib_cachecCsltjj|j|j}d|j|jf}d|}tj|d}tj d}g}t |d}y|j |}||} t j | } |j} | j|} tjj| j| } tjj| stj| x| jD]\}}tjj| t|}tjj|sd}n6tj|j}tjj|}|j|}tj|j}||k}|r(|j|| |j||fqWWdQRXWntk r\YnXWdQRX|S)Nz%s-%sz %s.dist-infoZ EXTENSIONSzutf-8roT)r6rFr-r`rcrarbrxrtrurryrrrZ prefix_to_dirrrmakedirsrrrmstatst_mtimedatetimeZ fromtimestampZgetinfoZ date_timeextractr,rz)r;r>r|r}rr~rGrrrr?rrZ cache_baserardestrZ file_timerkZ wheel_timer/r/r0_get_extensionss>              zWheel._get_extensionscCst|S)zM Determine if a wheel is compatible with the running system. ) is_compatible)r;r/r/r0rszWheel.is_compatiblecCsdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr/)r;r/r/r0 is_mountableszWheel.is_mountablecCstjjtjj|j|j}|js2d|}t||jsJd|}t||t jkrbt j d|nN|rtt jj |nt jj d||j}|rtt jkrt jj ttj||dS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)r6rFrir-r`rcrrrrIrrr,insertr_hook meta_pathr@)r;r,r>msgr?r/r/r0mounts"   z Wheel.mountcCsrtjjtjj|j|j}|tjkr2tjd|nr/r/r0unmounts     z Wheel.unmountc'Cstjj|j|j}d|j|jf}d|}d|}tj|t}tj|d}tj|d}t j d}t |d} | j |} || } t | } WdQRX| djd d } td d | D}i}| j |:}t|d $}x|D]}|d}|||<qWWdQRXWdQRXx| jD]}|j}t|tr*|}n |jd}d|krJtd||jdrZq||}|drt|j|dkrtd||d r|d jdd \}}| j |}|j}WdQRX|j||\}}||krtd|qWWdQRXdS)Nz%s-%sz%s.dataz %s.dist-inforrzutf-8roz Wheel-Versionr!rcSsg|] }t|qSr/)rp)rqrrr/r/r0rssz Wheel.verify..)rrz..zinvalid entry in wheel: %rz /RECORD.jwsrzsize mismatch for %srzdigest mismatch for %s)r6rFr-r`rcrarbrxrrtrurryrrgrwrrrr rrrrrrr)r;r>r|rr}rrrr~rrrrrrrrrrrrrrrrrr rr/r/r0rjsT                z Wheel.verifycKsdd}dd}tjj|j|j}d|j|jf}d|}tj|d} t} t |d} i} xt| j D]h} | j}t |t r|}n |j d }|| krqjd |krtd || j| | tjj| t|}|| |<qjWWd QRX|| |\}}|| f|}|r|| |\}}|r(||kr(||||d krRtjd d| d\}}tj|n*tjj|sltd|tjj||j}t| j}tjj| |}||f}|j|| ||j|||d krtj||Wd QRX|S)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. cSsHd}}d|tf}||kr$d|}||kr@||}t|dj}||fS)Nz%s/%sz %s/PKG-INFO)rF)rr rb)path_mapr}rbrFrr/r/r0 get_version1s  z!Wheel.update..get_versionc Ssd}y|t|}|jd}|dkr*d|}nTdd||ddjdD}|dd7<d|d|djd d |Df}Wn tk rtjd |YnX|rt|d }||_|j t  }|j ||d tjd||dS)Nrrz%s+1cSsg|] }t|qSr/)rp)rqr r/r/r0rsCsz8Wheel.update..update_version..rr!z%s+%scss|]}t|VqdS)N)r)rqrrr/r/r0 Fsz7Wheel.update..update_version..z0Cannot update non-compliant (PEP-440) version %r)rF)rFlegacyzVersion updated from %r to %rr) rrrgr-rrrr rbrrr)rbrFupdatedrCrrr.Zmdr"r/r/r0update_version;s(       z$Wheel.update..update_versionz%s-%sz %s.dist-inforrozutf-8z..zinvalid entry in wheel: %rNz.whlz wheel-update-)rrdirzNot a directory: %r)r6rFr-r`rcrarbrxrrrrr rrrrrZmkstempcloserrrrrrZcopyfile)r;ZmodifierZdest_dirrr r$r>r|r}rrrrrrrrFZoriginal_versionr ZmodifiedZcurrent_versionfdnewpathrrrkr/r/r0r= sX                z Wheel.update)rr)NFF)N)NN)F)N)rRrSrT__doc__rrr<propertyrcrmrnrrrvrkrrrrrrr rrrrrrrjr=r/r/r/r0rUs4 )        he "  6rUcCstg}td}x6ttjddddD]}|jdj|t|gq&Wg}x6tjD]*\}}}|j drT|j|j dddqTW|j t dkr|j dt |jdg}tg}tjdkrtjd t}|r|j\} }}} t|}| g} | dkr| jd | dkr| jd| dkr*| jd| dkr>| jd| dkrR| jdxL|dkrx2| D]*} d| ||| f} | tkrd|j| qdW|d8}qTWx<|D]4}x,|D]$} |jdjt|df|| fqWqWxXt|D]L\}}|jdjt|fddf|dkr|jdjt|dfddfqWxXt|D]L\}}|jdjd|fddf|dkrB|jdjd|dfddfqBWt|S)zG Return (pyver, abi, arch) tuples compatible with this Python. rrr)z.abir!rrVdarwinz(\w+)_(\d+)_(\d+)_(\w+)$i386ppcZfatx86_64Zfat3ppc64Zfat64intelZ universalz %s_%s_%s_%srWrrr)r,r-)r,r-r.)r/r.)r,r.)r,r.r0r-r/)r*rangerI version_infor,r-rrLZ get_suffixesrrgrrrrplatformrererrp IMP_PREFIXrset)ZversionsmajorminorZabisrr rGZarchesr&rar^Zmatchesrer r]rrrbr/r/r0compatible_tagss`                    * $ $r9cCs^t|tst|}d}|dkr"t}x6|D].\}}}||jkr(||jkr(||jkr(d}Pq(W|S)NFT)rrUCOMPATIBLE_TAGSr\r]r^)ZwheelrnrGZverr]r^r/r/r0rs r)N)SZ __future__rrrtrZdistutils.utilZ distutilsZemailrrrLrZloggingr6rxr4rrIrrr)rrcompatrrr r r Zdatabaser rr rutilrrrrrrrrrrbrrZ getLoggerrRrrhasattrr5r3rr+r*r2r[r get_platformr5rrr1compile IGNORECASEVERBOSErhrdrrrrr7robjectr8rrUr9r:rr/r/r/r0s   ,          #>PK!kxx#__pycache__/locators.cpython-36.pycnu[3 PfE@s@ddlZddlmZddlZddlZddlZddlZddlZy ddlZWne k rdddl ZYnXddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlm Z m!Z!m"Z"ddl#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.dd l/m0Z0m1Z1dd l2m3Z3m4Z4ej5e6Z7ej8d Z9ej8d ej:Z;ej8d ZGdddeZ?Gddde@ZAGdddeAZBGdddeAZCGddde@ZDGdddeAZEGdddeAZFGdd d eAZGGd!d"d"eAZHGd#d$d$eAZIeIeGeEd%d&d'd(d)ZJeJjKZKej8d*ZLGd+d,d,e@ZMdS).N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape string_types build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)Metadata) cached_propertyparse_credentials ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.python.org/pypicCs |dkr t}t|dd}|jS)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. Ng@)timeout) DEFAULT_INDEXr list_packages)urlclientr*/usr/lib/python3.6/locators.pyget_all_distribution_names)s r,c@s$eZdZdZddZeZZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c Csd}xdD]}||kr ||}Pq W|dkr0dSt|}|jdkrpt|j|}t|drh|j||n|||<tj||||||S)Nlocationurireplace_header)r.r/)rschemerZ get_full_urlhasattrr1BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersZnewurlkeyZurlpartsr*r*r+r5=s   zRedirectHandler.http_error_302N)__name__ __module__ __qualname____doc__r5Zhttp_error_301Zhttp_error_303Zhttp_error_307r*r*r*r+r-4sr-c@seZdZdZd/Zd0Zd1Zd Zed2Zd3ddZ ddZ ddZ ddZ ddZ ddZee eZddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd4d-d.Zd S)5LocatorzG A base class for locators - things that locate distributions. .tar.gz.tar.bz2.tar.zip.tgz.tbz.egg.exe.whl.pdfNdefaultcCs,i|_||_tt|_d|_tj|_dS)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher2rr-openermatcherr Queueerrors)r6r2r*r*r+__init__cs  zLocator.__init__c CsXg}xN|jjsRy|jjd}|j|Wn|jjk rDwYnX|jjqW|S)z8 Return any errors which have occurred. F)rQemptygetappendZEmpty task_done)r6resulter*r*r+ get_errorsvs  zLocator.get_errorscCs |jdS)z> Clear any errors which may have been logged. N)rY)r6r*r*r+ clear_errorsszLocator.clear_errorscCs|jjdS)N)rMclear)r6r*r*r+ clear_cacheszLocator.clear_cachecCs|jS)N)_scheme)r6r*r*r+ _get_schemeszLocator._get_schemecCs ||_dS)N)r])r6valuer*r*r+ _set_schemeszLocator._set_schemecCs tddS)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. z Please implement in the subclassN)NotImplementedError)r6namer*r*r+ _get_projects zLocator._get_projectcCs tddS)zJ Return all the distribution names known to this locator. z Please implement in the subclassN)ra)r6r*r*r+get_distribution_namesszLocator.get_distribution_namescCsL|jdkr|j|}n2||jkr,|j|}n|j|j|}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. N)rMrcrZ)r6rbrWr*r*r+ get_projects      zLocator.get_projectcCsPt|}tj|j}d}|jd}|r6tt||j}|jdkd|j k|||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. Tz.whlhttpszpypi.python.org) r posixpathbasenamepathendswithr$r# wheel_tagsr2netloc)r6r(trhZ compatibleZis_wheelr*r*r+ score_urls  zLocator.score_urlcCsR|}|rN|j|}|j|}||kr(|}||kr@tjd||ntjd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rnloggerdebug)r6url1url2rWs1s2r*r*r+ prefer_urls   zLocator.prefer_urlcCs t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r6filename project_namer*r*r+rszLocator.split_filenamecCsdd}d}t|\}}}}} } | jjdr.same_projectNzegg=z %s: version hint in fragment: %rr/z.whlTr0z, cSs"g|]}djt|ddqS).N)joinlist).0vr*r*r+ sz8Locator.convert_url_to_download_info..)rbversionrvr(zpython-versionzinvalid path for wheel: %sz No match for project/version: %s)rbrrvr(zpython-versionz %s_digest)NNr)rlower startswithrorp HASHER_HASHmatchgroupsrjr#r$rkrbrrvrr|pyver Exceptionwarningdownloadable_extensionsrgrhlenr)r6r(rwrxrWr2rlriparamsqueryfragmalgodigestZorigpathwheelincluderXrvZextrmrbrrr*r*r+convert_url_to_download_infosf            z$Locator.convert_url_to_download_infocCs4d}x*dD]"}d|}||kr |||f}Pq W|S)z Get a digest from a dictionary by looking at keys of the form 'algo_digest'. Returns a 2-tuple (algo, digest) if found, else None. Currently looks only for SHA256, then MD5. Nsha256md5z %s_digest)rrr*)r6inforWrr<r*r*r+ _get_digest)s  zLocator._get_digestc Cs|jd}|jd}||kr,||}|j}nt|||jd}|j}|j||_}|d}||d|<|j|dkr|j|j||_|dj|t j |||_ |||<dS)z Update a result dictionary (the final result from _get_project) with a dictionary for a specific version, which typically holds information gleaned from a filename or URL for an archive for the distribution. rbr)r2r(digestsurlsN) popmetadatarr2rr source_urlru setdefaultsetaddlocator) r6rWrrbrdistmdrr(r*r*r+_update_version_data9s   zLocator._update_version_dataFc Csd}t|}|dkr td|t|j}|j|j|_}tjd|t|j |j |j }t |dkr8g}|j } x|D]|} | d krqzyJ|j| stjd|| n,|s| | j r|j| ntjd| |j Wqztk rtjd || YqzXqzWt |d krt||jd }|r8tjd ||d} || }|r|jrN|j|_|jdij| t|_i} |jdi} x&|jD]}|| kr~| || |<q~W| |_d|_|S)a Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)r{rrz%s did not match %rz%skipping pre-release version %s of %szerror matching %s with %rr)r<zsorted list: %s)rrr)rrr!r2rO requirementrorptyper=rerbrZ version_classrZ is_prereleaserUrrsortedr<ZextrasrTr download_urlsr)r6r prereleasesrWrr2rOversionsZslistZvclskrdZsdr(r*r*r+locatePsT            zLocator.locate)rBrCrDrErFrG)rHrIrJ)rK)rJ)rL)F)r=r>r?r@source_extensionsbinary_extensionsexcluded_extensionsrkrrRrYrZr\r^r`propertyr2rcrdrernrurrrrrr*r*r*r+rASs.   FrAcs0eZdZdZfddZddZddZZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c s*tt|jf|||_t|dd|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. g@)r%N)superrrRbase_urlrr))r6r(kwargs) __class__r*r+rRszPyPIRPCLocator.__init__cCst|jjS)zJ Return all the distribution names known to this locator. )rr)r')r6r*r*r+rdsz%PyPIRPCLocator.get_distribution_namesc Csiid}|jj|d}x|D]}|jj||}|jj||}t|jd}|d|_|d|_|jd|_ |jdg|_ |jd|_ t |}|r|d } | d |_ |j| |_||_|||<xB|D]:} | d } |j| } |d j|tj| | |d | <qWqW|S) N)rrT)r2rbrlicensekeywordssummaryrr(rr)r)Zpackage_releasesZ release_urlsZ release_datarr2rbrrTrrrrrrrrrrr) r6rbrWrrrdatarrrr(rr*r*r+rcs0           zPyPIRPCLocator._get_project)r=r>r?r@rRrdrc __classcell__r*r*)rr+rs rcs0eZdZdZfddZddZddZZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c s tt|jf|t||_dS)N)rrrRrr)r6r(r)rr*r+rRszPyPIJSONLocator.__init__cCs tddS)zJ Return all the distribution names known to this locator. zNot available from this locatorN)ra)r6r*r*r+rdsz&PyPIJSONLocator.get_distribution_namescCsiid}t|jdt|}y|jj|}|jj}tj|}t |j d}|d}|d|_ |d|_ |j d|_|j dg|_|j d |_t|}||_|d } |||j <x`|d D]T} | d }|jj||j| |j|<|d j|j tj||j| |d |<qWx|d jD]\} } | |j kr:q"t |j d} |j | _ | | _ t| }||_||| <x\| D]T} | d }|jj||j| |j|<|d j| tj||j| |d |<qpWq"WWn@tk r}z"|jjt|tjd|WYdd}~XnX|S)N)rrz%s/json)r2rrbrrrrrr(rZreleaseszJSON fetch failed: %s) rrr rNopenreaddecodejsonloadsrr2rbrrTrrrrrrrrrrritemsrrQputrro exception)r6rbrWr(resprrrrrrrZinfosZomdodistrXr*r*r+rcsT               " zPyPIJSONLocator._get_project)r=r>r?r@rRrdrcrr*r*)rr+rs rc@s`eZdZdZejdejejBejBZ ejdejejBZ ddZ ejdejZ e ddZd S) Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)cCs4||_||_|_|jj|j}|r0|jd|_dS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr(_basesearchgroup)r6rr(rr*r*r+rRs  z Page.__init__z[^a-z0-9$&+,/:;=?@.#%_\\|-]cCsdd}t}x|jj|jD]}|jd}|dpZ|dpZ|dpZ|dpZ|dpZ|d }|d pr|d pr|d }t|j|}t|}|jj d d|}|j ||fqWt |dddd}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. cSs,t|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r(r2rlrirrrr*r*r+clean%s zPage.links..cleanr0Zrel1Zrel2Zrel3Zrel4Zrel5Zrel6rqrrZurl3cSsdt|jdS)Nz%%%2xr)ordr)rr*r*r+3szPage.links..cSs|dS)Nrr*)rmr*r*r+r7sT)r<reverse) r_hreffinditerr groupdictrrr _clean_resubrr)r6rrWrrrelr(r*r*r+linkss  z Page.linksN)r=r>r?r@recompileISXrrrRrrrr*r*r*r+rs rcseZdZdZejdddddZdfdd Zd d Zd d Z ddZ e j de j ZddZddZddZddZddZe j dZddZZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. cCstjttdjS)N)Zfileobj)gzipZGzipFilerrr)br*r*r+rEszSimpleScrapingLocator.cCs|S)Nr*)rr*r*r+rFs)ZdeflaterZnoneN c sftt|jf|t||_||_i|_t|_t j |_ t|_ d|_ ||_tj|_tj|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FN)rrrRrrr% _page_cacher_seenr rP _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplock)r6r(r%rr)rr*r+rRIs    zSimpleScrapingLocator.__init__cCsJg|_x>t|jD]0}tj|jd}|jd|j|jj|qWdS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsrangerrZThread_fetchZ setDaemonstartrU)r6irmr*r*r+_prepare_threadscs  z&SimpleScrapingLocator._prepare_threadscCs>x|jD]}|jjdqWx|jD] }|jq$Wg|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)rrrr|)r6rmr*r*r+ _wait_threadsps    z#SimpleScrapingLocator._wait_threadscCsiid}|jx||_||_t|jdt|}|jj|jj|j z&t j d||j j ||j jWd|jX|`WdQRX|S)N)rrz%s/z Queueing %s)rrWrwrrr rr[rrrorprrr|r)r6rbrWr(r*r*r+rc}s      z"SimpleScrapingLocator._get_projectz<\b(linux-(i\d86|x86_64|arm\w+)|win(32|-amd64)|macosx-?\d+)\bcCs |jj|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r6r(r*r*r+_is_platform_dependentsz,SimpleScrapingLocator._is_platform_dependentc CsT|j|rd}n|j||j}tjd|||rP|j|j|j|WdQRX|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s)rrrwrorprrrW)r6r(rr*r*r+_process_downloads z'SimpleScrapingLocator._process_downloadc Cst|\}}}}}}|j|j|j|jr2d}n~|jrL|j|j rLd}nd|j|js^d}nR|d krld}nD|dkrzd}n6|j|rd}n&|j ddd } | j d krd}nd }t j d |||||S)z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. Fhomepagedownloadhttprfftp:rrZ localhostTz#should_queue: %s (%s) from %s -> %s)rr)rrfr) rrjrrrrrrrsplitrrorp) r6linkZreferrerrr2rlri_rWhostr*r*r+ _should_queues*     z#SimpleScrapingLocator._should_queuecCsx|jj}zyz|r|j|}|dkr(wx\|jD]R\}}||jkr0|jj||j| r0|j|||r0tj d|||jj |q0WWn2t k r}z|j j t |WYdd}~XnXWd|jjX|sPqWdS)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. NzQueueing %s from %s)rrTget_pagerrrrrrorprrrQrrV)r6r(pagerrrXr*r*r+rs&     & zSimpleScrapingLocator._fetchcCsXt|\}}}}}}|dkr:tjjt|r:tt|d}||jkr`|j|}tj d||n|j ddd}d}||j krtj d||nt |d d id }zytj d ||j j||jd } tj d|| j} | jdd} tj| r| j} | j} | jd}|r"|j|}|| } d}tj| }|r@|jd}y| j|} Wn tk rn| jd} YnXt| | }||j| <Wntk r}z |jdkrtjd||WYdd}~Xnt k r}z2tjd|||j!|j j"|WdQRXWYdd}~Xn2t#k rB}ztjd||WYdd}~XnXWd||j|<X|S)a Get the HTML for an URL, possibly from an in-memory cache. XXX TODO Note: this cache is never actually cleared. It's assumed that the data won't get stale over the lifetime of a locator instance (not necessarily true for the default_locator). filez index.htmlzReturning %s from cache: %srrrNzSkipping %s due to bad host %szAccept-encodingZidentity)r;z Fetching %s)r%z Fetched %sz Content-Typer0zContent-Encodingzutf-8zlatin-1izFetch failed: %s: %s)$rosriisdirrrrrrorprrrrNrr%rrTHTML_CONTENT_TYPErZgeturlrdecodersCHARSETrrr UnicodeErrorrrr9rrrrr)r6r(r2rlrirrWrr7rr;Z content_typeZ final_urlrencodingdecoderrrXr*r*r+rsZ              &$ zSimpleScrapingLocator.get_pagez]*>([^<]+)r?r@zlibZ decompressrrRrrrcrrrrrrrrrr rdrr*r*)rr+r;s"   ; rcs8eZdZdZfddZddZddZdd ZZS) DirectoryLocatorz? This class locates distributions in a directory tree. c sN|jdd|_tt|jf|tjj|}tjj|sDt d|||_ dS)a Initialise an instance. :param path: The root of the directory tree to search. :param kwargs: Passed to the superclass constructor, except for: * recursive - if True (the default), subdirectories are recursed into. If False, only the top-level directory is searched, recursiveTzNot a directory: %rN) rrrr rRrriabspathrrbase_dir)r6rir)rr*r+rR5s    zDirectoryLocator.__init__cCs |j|jS)z Should a filename be considered as a candidate for a distribution archive? As well as the filename, the directory which contains it is provided, though not used by the current implementation. )rjr)r6rvparentr*r*r+should_includeFszDirectoryLocator.should_includec Csiid}xtj|jD]v\}}}xb|D]Z}|j||r(tjj||}tddttjj|dddf}|j ||}|r(|j ||q(W|j sPqW|S)N)rrrr0) rwalkrrrir|rr rrrr) r6rbrWrootdirsfilesfnr(rr*r*r+rcNs     zDirectoryLocator._get_projectc Cst}xtj|jD]x\}}}xd|D]\}|j||r$tjj||}tddttjj |dddf}|j |d}|r$|j |dq$W|j sPqW|S)zJ Return all the distribution names known to this locator. rr0Nrb) rrrrrrir|rr rrrr)r6rWrrrrr(rr*r*r+rd^s    z'DirectoryLocator.get_distribution_names) r=r>r?r@rRrrcrdrr*r*)rr+r 0s  r c@s eZdZdZddZddZdS) JSONLocatora This locator uses special extended metadata (not available on PyPI) and is the basis of performant dependency resolution in distlib. Other locators require archive downloads before dependencies can be determined! As you might imagine, that can be slow. cCs tddS)zJ Return all the distribution names known to this locator. zNot available from this locatorN)ra)r6r*r*r+rdxsz"JSONLocator.get_distribution_namescCsiid}t|}|rx|jdgD]}|ddks$|ddkrBq$t|d|d|jd d |jd }|j}|d |_d |kr|d rd|d f|_|jdi|_|jdi|_|||j <|dj |j t j |d q$W|S)N)rrrZptypeZsdistZ pyversionsourcerbrrzPlaceholder for summary)rr2r(rrZ requirementsexportsr) rrTrr2rrrZ dependenciesrrrrr)r6rbrWrrrrr*r*r+rc~s&    "zJSONLocator._get_projectN)r=r>r?r@rdrcr*r*r*r+rqsrcs(eZdZdZfddZddZZS)DistPathLocatorz This locator finds installed distributions in a path. It can be useful for adding to an :class:`AggregatingLocator`. c s*tt|jf|t|ts t||_dS)zs Initialise an instance. :param distpath: A :class:`DistributionPath` instance to search. N)rrrR isinstancerAssertionErrordistpath)r6rr)rr*r+rRszDistPathLocator.__init__cCsP|jj|}|dkr iid}n,|j|d|jt|jgid|jtdgii}|S)N)rrrr)rZget_distributionrrr)r6rbrrWr*r*r+rcs  zDistPathLocator._get_project)r=r>r?r@rRrcrr*r*)rr+rs rcsReZdZdZfddZfddZddZeej j eZ dd Z d d Z Z S) AggregatingLocatorzI This class allows you to chain and/or merge a list of locators. cs*|jdd|_||_tt|jf|dS)a Initialise an instance. :param locators: The list of locators to search. :param kwargs: Passed to the superclass constructor, except for: * merge - if False (the default), the first successful search from any of the locators is returned. If True, the results from all locators are merged (this can be slow). mergeFN)rr locatorsrrrR)r6r!r)rr*r+rRs zAggregatingLocator.__init__cs*tt|jx|jD] }|jqWdS)N)rrr\r!)r6r)rr*r+r\s zAggregatingLocator.clear_cachecCs ||_x|jD] }||_qWdS)N)r]r!r2)r6r_rr*r*r+r`s zAggregatingLocator._set_schemec Csi}x|jD]}|j|}|r |jr|jdi}|jdi}|j||jd}|r|rx6|jD]*\}} ||kr||| O<qb| ||<qbW|jd} |r| r| j|q |jdkrd} n$d} x|D]}|jj|rd} PqW| r |}Pq W|S)NrrTF)r!rer rTupdaterrOr) r6rbrWrrrrZdfrrZddfoundr*r*r+rcs8           zAggregatingLocator._get_projectc Cs@t}x4|jD]*}y||jO}Wqtk r6YqXqW|S)zJ Return all the distribution names known to this locator. )rr!rdra)r6rWrr*r*r+rds  z)AggregatingLocator.get_distribution_names)r=r>r?r@rRr\r`rrAr2fgetrcrdrr*r*)rr+rs  ,rzhttps://pypi.python.org/simple/g@)r%legacy)r2z1(?P[\w-]+)\s*\(\s*(==\s*)?(?P[^)]+)\)$c@sLeZdZdZdddZddZddZd d Zd d Zd dZ dddZ dS)DependencyFinderz0 Locate dependencies for distributions. NcCs|pt|_t|jj|_dS)zf Initialise an instance, using the specified locator to locate distributions. N)default_locatorrr!r2)r6rr*r*r+rRs zDependencyFinder.__init__cCsvtjd||j}||j|<||j||jf<xD|jD]:}t|\}}tjd||||jj |t j ||fq4WdS)z Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. zadding distribution %szAdd to provided: %s, %s, %sN) rorpr< dists_by_namedistsrprovidesrprovidedrrr)r6rrbprr*r*r+add_distribution&s    z!DependencyFinder.add_distributioncCs|tjd||j}|j|=|j||jf=xN|jD]D}t|\}}tjd||||j|}|j ||f|s0|j|=q0WdS)z Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. zremoving distribution %sz Remove from provided: %s, %s, %sN) rorpr<r(r)rr*rr+remove)r6rrbr,rsr*r*r+remove_distribution5s    z$DependencyFinder.remove_distributionc CsBy|jj|}Wn,tk r<|jd}|jj|}YnX|S)z Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). r)r2rOr"r)r6reqtrOrbr*r*r+ get_matcherGs  zDependencyFinder.get_matcherc Csv|j|}|j}t}|j}||krrxL||D]@\}}y|j|}Wntk r\d}YnX|r.|j|Pq.W|S)z Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. F)r2r<rr+rr"r) r6r1rOrbrWr+rproviderrr*r*r+find_providersWs   zDependencyFinder.find_providersc Cs|j|}t}x,|D]$}|j|}|j|js|j|qW|r^|jd||t|fd}nD|j||j|=x"|D]}|jj|tj|qvW|j |d}|S)a Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. Z cantreplaceFT) reqtsrr2rrr frozensetr0rr-) r6r3otherproblemsZrlistZ unmatchedr/rOrWr*r*r+try_to_replaceos"         zDependencyFinder.try_to_replaceFcCsi|_i|_i|_i|_t|p g}d|krH|jd|tdddgO}t|trh|}}tj d|n4|j j ||d}}|dkrt d|tj d |d |_ t}t|g}t|g}x|r|j}|j} | |jkr|j|n"|j| } | |kr |j|| ||j|jB} |j} t} ||krbx2dD]*}d|}||kr4| t|d|O} q4W| | B| B}x>|D]4}|j|}|sNtj d||j j ||d}|dkr| r|j j |d d}|dkrtj d||jd|fn^|j|j}}||f|jkr|j||j||| krN||krN|j|tj d|jxZ|D]R}|j} | |jkr|jj|tj|n"|j| } | |krT|j|| |qTWqvWqWt|jj}x.|D]&}||k|_|jrtj d|jqWtj d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:z:test:z:build:z:dev:zpassed %s as requirement)rNzUnable to locate %rz located %sTtestbuilddevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %rZ unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)r:r;r<)r+r)r(r5rr.rrrorprrrZ requestedrr<r-r9Z run_requiresZ meta_requiresZbuild_requiresgetattrr4rrZname_and_versionrvaluesZbuild_time_dependency)r6rZ meta_extrasrrrr8ZtodoZ install_distsrbr7ZireqtsZsreqtsZereqtsr<rXZ all_reqtsrZ providersr3nrr,r)r*r*r+finds                                zDependencyFinder.find)N)NF) r=r>r?r@rRr-r0r2r4r9r@r*r*r*r+r&s (r&)N)NriorrZloggingrrgrr ImportErrorZdummy_threadingr r0rcompatrrrrr r r r r rrr4rrrrZdatabaserrrrrutilrrrrrrrrr rr!r"rr#r$Z getLoggerr=rorrrrrr&r,r-objectrArrrrr rrrr'rZNAME_VERSION_REr&r*r*r*r+sZ   D ,    ;0E:vA&[ PK!֮֮__pycache__/util.cpython-36.pycnu[3 Pfi@s>ddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZy ddlZWnek rdZYnXddlZddlZddlZddlZddlZy ddlZWnek rddlZYnXddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/e j0e1Z2dZ3e j4e3Z5dZ6d e6d Z7e6d Z8d Z9d e9de8de3d e9de8dZ:dZ;de:de;de:dZde6de>de<dZ?e j4e?Z@de9de8d ZAe j4eAZBdd ZCd!d"ZDd#d$ZEd%d&ZFdd'd(ZGd)d*ZHd+d,ZId-d.ZJejKd/d0ZLejKd1d2ZMejKdd4d5ZNGd6d7d7eOZPd8d9ZQGd:d;d;eOZRdd?d?eOZTe j4d@e jUZVdAdBZWddCdDZXdEdFZYdGdHZZdIdJZ[dKdLZ\dMdNZ]e j4dOe j^Z_e j4dPZ`ddQdRZae j4dSZbdTdUZcdVdWZddXdYZedZZfd[d\Zgd]d^ZhGd_d`d`eOZiGdadbdbeOZjGdcddddeOZkdZlddmdnZmdodpZndZoGdwdxdxeOZpe j4dyZqe j4dzZre j4d{Zsd|d}Zd~dZter\ddlmuZvmwZwmxZxGddde$jyZyGdddevZuGdddeue'Zzej{ddZ|e|dkrGddde$j}Z}erGddde$j~Z~Gddde%jZerGddde%jZGddde%jZddZGdddeOZGdddeZGdddeZGddde(ZGdddeOZddZdS)N)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquotez\s*,\s*z (\w|[.-])+z(\*|:(\*|\w+):|)z\*?z([<>=!~]=)|[<>](z)?\s*(z)(z)\s*(z))*z(from\s+(?P.*))z \(\s*(?P|z)\s*\)|(?Pz\s*)z)*z \[\s*(?Pz)?\s*\]z(?Pz \s*)?(\s*z)?$z(?Pz )\s*(?Pc sddd}tj|}|r|j}|d}|dp8|d}|dsHd}nd}|dj}|snd}d}|d}nL|dd krd |}tj|} fd d | D}d |djdd |Df}|dsd} ntj|d} t ||| |||d}|S)NcSs|j}|d|dfS)NopZvn) groupdict)mdr!/usr/lib/python3.6/util.pyget_constraintYsz)parse_requirement..get_constraintZdnZc1Zc2Zdirefrz<>!=z~=csg|] }|qSr!r!).0r)r#r!r" qsz%parse_requirement..z%s (%s)z, cSsg|] }d|qS)z%s %sr!)r%Zconr!r!r"r&rsZex)nameZ constraintsextrasZ requirementsourceurl) REQUIREMENT_REmatchrstripRELOP_IDENT_REfinditerjoinCOMMA_REsplitr) sresultrr r'Zconsr*ZconstrZrsiteratorr(r!)r#r"parse_requirementWs4      r6cCsdd}i}x|D]\}}}tjj||}xt|D]t}tjj||} x`t| D]T} ||| } |dkrt|j| dqP||| } |jtjjdjd} | d| || <qPWq4WqW|S)z%Find destinations for resources filescSsD|jtjjd}|jtjjd}|j|s.t|t|djdS)N/)replaceospathsep startswithAssertionErrorlenlstrip)baser:r!r!r" get_rel_pathsz)get_resources_dests..get_rel_pathNr7)r9r:r0rpopr8r;rstrip)Zresources_rootZrulesrAZ destinationsr@suffixdestprefixZabs_baseZabs_globZabs_pathZ resource_fileZrel_pathZrel_destr!r!r"get_resources_dests|s  rGcCs(ttdrd}ntjttdtjk}|S)NZ real_prefixT base_prefix)hasattrsysrFgetattr)r4r!r!r"in_venvs rLcCs$tjjtj}t|ts t|}|S)N)r9r:normcaserJ executable isinstancerr)r4r!r!r"get_executables  rPcCsT|}xJt|}|}| r |r |}|r|dj}||kr:P|rd|||f}qW|S)Nrz %c: %s %s)r lower)promptZ allowed_charsZ error_promptdefaultpr3cr!r!r"proceeds  rVcCs<t|tr|j}i}x |D]}||kr||||<qW|S)N)rOrr2)r keysr4keyr!r!r"extract_by_keys  rYcCstjddkrtjd|}|j}t|}yrtj|}|ddd}xR|jD]F\}}x<|jD]0\}}d||f}t |} | dk st | ||<qdWqRW|St k r|j ddYnXdd } t j} y| | |Wn<t jk r|jtj|}t|}| | |YnXi}xb| jD]V} i|| <}xB| j| D]4\} }d| |f}t |} | dk spt | || <qFWq*W|S) Nrzutf-8 extensionszpython.exportsexportsz%s = %scSs$t|dr|j|n |j|dS)N read_file)rIr]Zreadfp)cpstreamr!r!r" read_streams  z!read_exports..read_stream)rJ version_infocodecs getreaderreadr jsonloaditemsget_export_entryr= Exceptionseekr ConfigParserZMissingSectionHeaderErrorclosetextwrapdedentZsections)r_dataZjdatar4groupZentrieskvr3entryr`r^rXr'valuer!r!r" read_exportssD      rucCstjddkrtjd|}tj}x||jD]p\}}|j|x\|jD]P}|j dkr`|j }nd|j |j f}|j rd|dj |j f}|j ||j|qJWq.W|j|dS)NrrZzutf-8z%s:%sz%s [%s]z, )rJrarb getwriterrrkrgZ add_sectionvaluesrDrFflagsr0setr'write)r\r_r^rqrrrsr3r!r!r" write_exportss  r{c cs$tj}z |VWdtj|XdS)N)tempfilemkdtemprrmtree)Ztdr!r!r"tempdir s rc cs.tj}ztj|dVWdtj|XdS)N)r9getcwdchdir)r cwdr!r!r"rs   rc cs.tj}ztj|dVWdtj|XdS)N)socketZgetdefaulttimeoutZsetdefaulttimeout)ZsecondsZctor!r!r"socket_timeouts   rc@seZdZddZdddZdS)cached_propertycCs ||_dS)N)func)selfrr!r!r"__init__)szcached_property.__init__NcCs,|dkr |S|j|}tj||jj||S)N)robject __setattr____name__)robjclsrtr!r!r"__get__.s  zcached_property.__get__)N)r __module__ __qualname__rrr!r!r!r"r(srcCstjdkr|S|s|S|ddkr.td||ddkrFtd||jd}xtj|krj|jtjqRW|svtjStjj|S)aReturn 'pathname' as a name that will work on the native filesystem. The path is split on '/' and put 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. r7rzpath '%s' cannot be absoluterzpath '%s' cannot end with '/')r9r; ValueErrorr2curdirremover:r0)pathnamepathsr!r!r" convert_path6s       rc@seZdZd$ddZddZddZdd Zd%d d Zd&ddZddZ ddZ ddZ ddZ ddZ d'ddZddZddZd d!Zd"d#Zd S)( FileOperatorFcCs||_t|_|jdS)N)dry_runryensured _init_record)rrr!r!r"rRszFileOperator.__init__cCsd|_t|_t|_dS)NF)recordry files_written dirs_created)rr!r!r"rWszFileOperator._init_recordcCs|jr|jj|dS)N)rradd)rr:r!r!r"record_as_written\szFileOperator.record_as_writtencCsHtjj|s tdtjj|tjj|s0dStj|jtj|jkS)aTell if the target is newer than the source. Returns true if 'source' exists and is more recently modified than 'target', or if 'source' exists and 'target' doesn't. Returns false if both exist and 'target' is the same age or younger than 'source'. Raise PackagingFileError if 'source' does not exist. Note that this test is not very accurate: files created in the same second will have the same "age". zfile '%r' does not existT)r9r:existsrabspathstatst_mtime)rr)targetr!r!r"newer`s  zFileOperator.newerTcCs|jtjj|tjd|||jsd}|rftjj|rDd|}n"tjj|rftjj | rfd|}|rvt |dt j |||j |dS)z8Copy a file respecting dry-run and force flags. zCopying %s to %sNz%s is a symlinkz%s is a non-regular filez which would be overwritten) ensure_dirr9r:dirnameloggerinforislinkrisfilerrZcopyfiler)rZinfileoutfilecheckmsgr!r!r" copy_filets    zFileOperator.copy_fileNc Cstjj| st|jtjj|tjd|||jsx|dkrLt |d}nt j |d|d}zt j ||Wd|j X|j|dS)NzCopying stream %s to %swbw)encoding)r9r:isdirr=rrrrropenrbrZ copyfileobjrlr)rZinstreamrrZ outstreamr!r!r" copy_streams  zFileOperator.copy_streamc CsF|jtjj||js8t|d}|j|WdQRX|j|dS)Nr)rr9r:rrrrzr)rr:rofr!r!r"write_binary_files  zFileOperator.write_binary_filec CsL|jtjj||js>t|d}|j|j|WdQRX|j|dS)Nr) rr9r:rrrrzencoder)rr:rorrr!r!r"write_text_files  zFileOperator.write_text_filecCsrtjdkstjdkrntjdkrnxN|D]F}|jrszFileOperator.cCs~tjj|}||jkrztjj| rz|jj|tjj|\}}|j|tj d||j shtj ||j rz|j j|dS)Nz Creating %s)r9r:rrrrr2rrrrmkdirrr)rr:r rr!r!r"rs    zFileOperator.ensure_dircCsvt|| }tjd|||jsh|s0|j||rX|s:d}n|j|sHt|t|d}tj |||d|j ||S)NzByte-compiling %s to %sT) r rrrrr<r=r> py_compilecompiler)rr:optimizeforcerFZdpathZdiagpathr!r!r" byte_compiles  zFileOperator.byte_compilecCstjj|rtjj|r`tjj| r`tjd||jsBtj ||j r||j kr|j j |nPtjj|rrd}nd}tjd|||jstj ||j r||j kr|j j |dS)NzRemoving directory tree at %slinkfilezRemoving %s %s)r9r:rrrrdebugrrr~rrrr)rr:r3r!r!r"ensure_removeds"       zFileOperator.ensure_removedcCsHd}x>|sBtjj|r&tj|tj}Ptjj|}||kr)r'rFrDrx)rr!r!r"__repr__!s zExportEntry.__repr__cCsDt|tsd}n0|j|jko>|j|jko>|j|jko>|j|jk}|S)NF)rOrr'rFrDrx)rotherr4r!r!r"__eq__%s     zExportEntry.__eq__N) rrrrrrtrrr__hash__r!r!r!r"rs   rz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P\w+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? c Cstj|}|s0d}d|ks"d|krtd|n|j}|d}|d}|jd}|dkrf|d}}n"|dkrztd||jd\}}|d } | dkrd|ksd|krtd|g} nd d | jd D} t|||| }|S) N[]zInvalid specification '%s'r'callable:rrrxcSsg|] }|jqSr!)r-)r%rr!r!r"r&Qsz$get_export_entry..,)ENTRY_REsearchrrcountr2r) Z specificationrr4r r'r:ZcolonsrFrDrxr!r!r"rh7s2    rhc Cs|dkr d}tjdkr.dtjkr.tjjd}n tjjd}tjj|rftj|tj}|st j d|n|jdd\}}d|kr.|}n|jdd\}}|||fS)N@rr)r2)ZnetlocZusernameZpasswordrFr!r!r"parse_credentialssrcCstjd}tj||S)N)r9umask)r4r!r!r"get_process_umasks  rcCs>d}d}x$t|D]\}}t|tsd}PqW|dk s:t|S)NTF) enumeraterOrr=)seqr4ir3r!r!r"is_string_sequences  rz3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)cCsd}d}t|jdd}tj|}|r@|jd}|d|j}|rt|t|dkrtjtj |d|}|r|j }|d|||dd|f}|dkrt j|}|r|jd|jd|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None N -rz\brZ) rr8PYTHON_VERSIONrrpstartr>rer,escapeendPROJECT_NAME_AND_VERSION)filenameZ project_namer4Zpyverrnr!r!r"split_filenames"   rz-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$cCs:tj|}|std||j}|djj|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'r'Zver)NAME_VERSION_REr,rrr-rQ)rTrr r!r!r"parse_name_and_versions  rcCst}t|pg}t|pg}d|kr8|jd||O}x|D]x}|dkrV|j|q>|jdr|dd}||krtjd|||kr|j|q>||krtjd||j|q>W|S)N*r rzundeclared extra: %s)ryrrr<rr)Z requestedZ availabler4rZunwantedr!r!r" get_extrass&        rcCsi}yNt|}|j}|jd}|jds8tjd|ntjd|}tj |}Wn0t k r}ztj d||WYdd}~XnX|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %szutf-8z&Failed to get external data for %s: %s) r rgetr<rrrbrcrerfri exception)r*r4ZrespZheadersZctreaderer!r!r"_get_external_datas   rz'https://www.red-dove.com/pypi/projects/cCs*d|dj|f}tt|}t|}|S)Nz%s/%s/project.jsonr)upperr _external_data_base_urlr)r'r*r4r!r!r"get_project_datas r cCs(d|dj||f}tt|}t|S)Nz%s/%s/package-%s.jsonr)rr rr)r'versionr*r!r!r"get_package_datas r"c@s(eZdZdZddZddZddZdS) Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cCsPtjj|stj|tj|jd@dkr6tjd|tjjtjj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) r9r:rrrrrrrnormpathr@)rr@r!r!r"r"s    zCache.__init__cCst|S)zN Converts a resource prefix to a directory name in the cache. )r)rrFr!r!r" prefix_to_dir0szCache.prefix_to_dirc Csg}xtj|jD]r}tjj|j|}y>tjj|s@tjj|rLtj|ntjj|rbt j |Wqt k r|j |YqXqW|S)z" Clear the cache. ) r9rr@r:r0rrrrrr~riappend)rZ not_removedfnr!r!r"clear6s  z Cache.clearN)rrr__doc__rr&r)r!r!r!r"r#sr#c@s:eZdZdZddZdddZddZd d Zd d Zd S) EventMixinz1 A very simple publish/subscribe system. cCs i|_dS)N) _subscribers)rr!r!r"rKszEventMixin.__init__TcCsD|j}||krt|g||<n"||}|r6|j|n |j|dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)r,rr' appendleft)revent subscriberr'subsZsqr!r!r"rNs  zEventMixin.addcCs,|j}||krtd|||j|dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)r,rr)rr.r/r0r!r!r"rbs zEventMixin.removecCst|jj|fS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. )iterr,r)rr.r!r!r"get_subscribersnszEventMixin.get_subscribersc Ospg}xT|j|D]F}y||f||}Wn"tk rJtjdd}YnX|j|qWtjd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)r2rirrr'r)rr.argskwargsr4r/rtr!r!r"publishus    zEventMixin.publishN)T) rrrr*rrrr2r5r!r!r!r"r+Gs   r+c@s^eZdZddZddZdddZdd Zd d Zd d ZddZ e ddZ e ddZ dS) SequencercCsi|_i|_t|_dS)N)_preds_succsry_nodes)rr!r!r"rszSequencer.__init__cCs|jj|dS)N)r9r)rnoder!r!r"add_nodeszSequencer.add_nodeFcCs||jkr|jj||rx&t|jj|fD]}|j||q.Wx&t|jj|fD]}|j||qVWx&t|jjD]\}}|sz|j|=qzWx&t|jjD]\}}|s|j|=qWdS)N)r9rryr7rr8rrg)rr:ZedgesrTr3rqrrr!r!r" remove_nodes   zSequencer.remove_nodecCs<||ks t|jj|tj||jj|tj|dS)N)r=r7 setdefaultryrr8)rpredsuccr!r!r"rs z Sequencer.addcCs||ks ty|j|}|j|}Wn tk rDtd|YnXy|j||j|Wn$tk rtd||fYnXdS)Nz%r not a successor of anythingz%r not a successor of %r)r=r7r8KeyErrorrr)rr>r?predsZsuccsr!r!r"rs   zSequencer.removecCs||jkp||jkp||jkS)N)r7r8r9)rstepr!r!r"is_stepszSequencer.is_stepcCs|j|std|g}g}t}|j|xd|r|jd}||krd||kr|j||j|q0|j||j||jj|f}|j |q0Wt |S)Nz Unknown: %rr) rCrryr'rBrrr7rextendreversed)rfinalr4ZtodoseenrBrAr!r!r" get_stepss"        zSequencer.get_stepscsVdggiig|jfddxD]}|kr:|q:WS)Nrc sd|<d|<dd7<j|y |}Wntk rVg}YnXxR|D]J}|kr|t|||<q^|kr^t|||<q^W||krg}x j}|j|||krPqWt|}j|dS)Nrr)r'riminrBtuple)r:Z successorsZ successorZconnected_componentZ component)graphindex index_counterlowlinksr4stack strongconnectr!r"rPs.       z3Sequencer.strong_connections..strongconnect)r8)rr:r!)rKrLrMrNr4rOrPr"strong_connectionss"  zSequencer.strong_connectionscCsrdg}x8|jD].}|j|}x|D]}|jd||fq"WqWx|jD]}|jd|qHW|jddj|S)Nz digraph G {z %s -> %s;z %s;} )r7r'r9r0)rr4r?rAr>r:r!r!r"dot s     z Sequencer.dotN)F) rrrrr;r<rrrCrHpropertyrQrTr!r!r!r"r6s   3r6.tar.gz.tar.bz2.tar.zip.tgz.tbz.whlTc sffdd}tjjtd}|dkr|jdr>d}nH|jdrRd}d }n4|jdrfd }d }n |jdrzd}d}n td|z|dkrt|d}|r|j}xD|D] }||qWn.tj ||}|r|j }x|D] }||qW|dkr6t j ddkr6x.|j D]"} t| jts| jjd| _qWdd} | |_|jWd|r`|jXdS)NcsTt|ts|jd}tjjtjj|}|j sD|tjkrPt d|dS)Nzutf-8zpath outside destination: %r) rOrdecoder9r:rr0r<r;r)r:rT)dest_dirplenr!r" check_paths   zunarchive..check_path.zip.whlzip.tar.gz.tgzZtgzzr:gz.tar.bz2.tbzZtbzzr:bz2z.tarZtarrzUnknown format for %rrrZzutf-8cSsBy tj||Stjk r<}ztt|WYdd}~XnXdS)z:Run tarfile.tar_fillter, but raise the expected ValueErrorN)tarfileZ tar_filterZ FilterErrorrstr)memberr:excr!r!r"extraction_filterPs z$unarchive..extraction_filter)rarb)rdre)rfrg)r9r:rr>rrrZnamelistrhrZgetnamesrJraZ getmembersrOr'rr]rlZ extractallrl) Zarchive_filenamer^formatrr`archivernamesr'Ztarinforlr!)r^r_r" unarchivesL           rpc Cstj}t|}t|db}xZtj|D]L\}}}x@|D]8}tjj||}||d} tjj| |} |j|| q8Wq(WWdQRX|S)z*zip a directory tree into a BytesIO objectrN) ioBytesIOr>rr9walkr:r0rz) Z directoryr4ZdlenZzfrootrrr'ZfullZrelrEr!r!r"zip_dir`s   rur$KMGTPc@sreZdZdZdddZddZdd Zd d Zd d Ze ddZ e ddZ ddZ e ddZ e ddZdS)ProgressZUNKNOWNrdcCs<|dks||kst||_|_||_d|_d|_d|_dS)NrF)r=rIcurmaxstartedelapseddone)rZminvalZmaxvalr!r!r"rws  zProgress.__init__cCsV|j|kst|jdks&||jks&t||_tj}|jdkrF||_n ||j|_dS)N)rIr=r~r}timerr)rZcurvalZnowr!r!r"updates zProgress.updatecCs |dks t|j|j|dS)Nr)r=rr})rZincrr!r!r" increments zProgress.incrementcCs|j|j|S)N)rrI)rr!r!r"r s zProgress.startcCs |jdk r|j|jd|_dS)NT)r~rr)rr!r!r"stops  z Progress.stopcCs|jdkr|jS|jS)N)r~unknown)rr!r!r"maximumszProgress.maximumcCsD|jr d}n4|jdkrd}n$d|j|j|j|j}d|}|S)Nz100 %z ?? %gY@z%3d %%)rr~r}rI)rr4rrr!r!r" percentages zProgress.percentagecCs:|dkr|jdks|j|jkr$d}ntjdtj|}|S)Nrz??:??:??z%H:%M:%S)r~r}rIrZstrftimeZgmtime)rZdurationr4r!r!r"format_durationszProgress.format_durationcCs|jrd}|j}n^d}|jdkr&d}nJ|jdks<|j|jkrBd}n.t|j|j}||j|j}|d|j}d||j|fS)NZDonezETA rrz%s: %sr)rrr~r}rIfloatr)rrFtr!r!r"ETAs z Progress.ETAcCsN|jdkrd}n|j|j|j}xtD]}|dkr6P|d}q(Wd||fS)Nrgig@@z%d %sB/s)rr}rIUNITS)rr4Zunitr!r!r"speeds   zProgress.speedN)rr|)rrrrrrrr rrUrrrrrr!r!r!r"r{ts     r{z \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$cCs<tj|rd}t||tj|r4d}t||t|S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrr_CHECK_MISMATCH_SET_iglob) path_globrr!r!r"rs    rc cstj|d}t|dkrpt|dks,t||\}}}x|jdD](}x"tdj|||fD] }|Vq\WqBWnd|krxt|D] }|VqWn|jdd\}}|dkrd}|dkrd}n|jd}|jd }xHtj |D]:\}}} tj j |}x"ttj j||D] } | VqWqWdS) NrrZrr$z**rrr7\) RICH_GLOBr2r>r=rr0 std_iglobr?r9rsr:r%) rZrich_path_globrFryrDitemr:Zradicaldirrr(r!r!r"rs*       r) HTTPSHandlermatch_hostnameCertificateErrorc@seZdZdZdZddZdS)HTTPSConnectionNTc CsPtj|j|jf|j}t|ddr0||_|jtt dsp|j rHt j }nt j }t j ||j|j|t j|j d|_nxt jt j}|jt jO_|jr|j|j|ji}|j rt j |_|j|j dtt ddr|j|d<|j |f||_|j o|jrLy$t|jj|jtjd|jWn0tk rJ|jjtj|jjYnXdS) NZ _tunnel_hostF SSLContext) cert_reqsZ ssl_versionca_certs)ZcafileZHAS_SNIZserver_hostnamezHost verified: %s) rZcreate_connectionhostporttimeoutrKsockZ_tunnelrIsslrZ CERT_REQUIREDZ CERT_NONEZ wrap_socketZkey_fileZ cert_fileZPROTOCOL_SSLv23rZoptionsZ OP_NO_SSLv2Zload_cert_chainZ verify_modeZload_verify_locations check_domainrZ getpeercertrrrZshutdownZ SHUT_RDWRrl)rrrcontextr4r!r!r"connect s>      zHTTPSConnection.connect)rrrrrrr!r!r!r"rsrc@s&eZdZd ddZddZddZdS) rTcCstj|||_||_dS)N)BaseHTTPSHandlerrrr)rrrr!r!r"r0s zHTTPSHandler.__init__cOs$t||}|jr |j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr)rr3r4r4r!r!r" _conn_maker5s zHTTPSHandler._conn_makercCsVy|j|j|Stk rP}z&dt|jkr>td|jnWYdd}~XnXdS)Nzcertificate verify failedz*Unable to verify server certificate for %s)Zdo_openrrrireasonrr)rreqrr!r!r" https_openEs zHTTPSHandler.https_openN)T)rrrrrrr!r!r!r"r/s rc@seZdZddZdS)HTTPSOnlyHandlercCstd|dS)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrr!r!r" http_openYszHTTPSOnlyHandler.http_openN)rrrrr!r!r!r"rXsrc@seZdZdddZdS)HTTPr$NcKs&|dkr d}|j|j||f|dS)Nr)_setup_connection_class)rrrr4r!r!r"resz HTTP.__init__)r$N)rrrrr!r!r!r"rdsrc@seZdZdddZdS)HTTPSr$NcKs&|dkr d}|j|j||f|dS)Nr)rr)rrrr4r!r!r"rmszHTTPS.__init__)r$N)rrrrr!r!r!r"rlsrc@seZdZdddZddZdS) TransportrcCs||_tjj||dS)N)rrrr)rr use_datetimer!r!r"rtszTransport.__init__cCsb|j|\}}}tdkr(t||jd}n6|j s>||jdkrT||_|tj|f|_|jd}|S)Nrr)rrr)rr) get_host_info _ver_inforr _connection_extra_headersrZHTTPConnection)rrhehZx509r4r!r!r"make_connectionxs zTransport.make_connectionN)r)rrrrrr!r!r!r"rss rc@seZdZdddZddZdS) SafeTransportrcCs||_tjj||dS)N)rrrr)rrrr!r!r"rszSafeTransport.__init__cCsz|j|\}}}|si}|j|d<tdkr:t|df|}n<|j sP||jdkrl||_|tj|df|f|_|jd}|S)Nrrrrr)rr)rrrrrrrr)rrrrr4r4r!r!r"rs    zSafeTransport.make_connectionN)r)rrrrrr!r!r!r"rs rc@seZdZddZdS) ServerProxyc Kst|jdd|_}|dk r^t|\}}|jdd}|dkr@t}nt}|||d|d<}||_tjj ||f|dS)NrrrZhttps)r transport) rBrrrrrrrrr) rZurir4rscheme_rZtclsrr!r!r"rs  zServerProxy.__init__N)rrrrr!r!r!r"rsrcKs.tjddkr|d7}nd|d<t||f|S)NrrZbr$newline)rJrar)r(rr4r!r!r" _csv_opens rc@s4eZdZedededdZddZddZd S) CSVBaser"rS)Z delimiterZ quotecharZlineterminatorcCs|S)Nr!)rr!r!r" __enter__szCSVBase.__enter__cGs|jjdS)N)r_rl)rrr!r!r"__exit__szCSVBase.__exit__N)rrrridefaultsrrr!r!r!r"rs  rc@s(eZdZddZddZddZeZdS) CSVReadercKs\d|kr4|d}tjddkr,tjd|}||_nt|dd|_tj|jf|j|_dS)Nr_rrZzutf-8r:r) rJrarbrcr_rcsvrr)rr4r_r!r!r"rszCSVReader.__init__cCs|S)Nr!)rr!r!r"__iter__szCSVReader.__iter__cCsJt|j}tjddkrFx,t|D] \}}t|ts"|jd||<q"W|S)NrrZzutf-8)nextrrJrarrOrr])rr4rrr!r!r"rs   zCSVReader.nextN)rrrrrr__next__r!r!r!r"rs rc@seZdZddZddZdS) CSVWritercKs$t|d|_tj|jf|j|_dS)Nr)rr_rwriterr)rr(r4r!r!r"rs zCSVWriter.__init__cCsRtjddkrBg}x*|D]"}t|tr0|jd}|j|qW|}|jj|dS)NrrZzutf-8)rJrarOrrr'rwriterow)rrowrrr!r!r"rs   zCSVWriter.writerowN)rrrrrr!r!r!r"rsrcsHeZdZeejZded<d fdd ZddZdd Zd d Z Z S) Configurator inc_convertZincNcs"tt|j||ptj|_dS)N)superrrr9rr@)rconfigr@) __class__r!r"rszConfigurator.__init__c sfddjd}t|s*j|}jdd}jdf}|r\tfdd|D}fddD}t|}|||}|rx$|jD]\}} t||| qW|S) Ncszt|ttfr*t|fdd|D}nLt|trld|krHj|}qvi}x(|D]}||||<qRWn j|}|S)Ncsg|] }|qSr!r!)r%r)convertr!r"r&szBConfigurator.configure_custom..convert..z())rOrrJtypedictconfigure_customr)or4rq)rrr!r"rs    z.Configurator.configure_custom..convertz()rz[]csg|] }|qSr!r!)r%r)rr!r"r&sz1Configurator.configure_custom..cs$g|]}t|r||fqSr!)r)r%rq)rrr!r"r&s)rBrrrJrrgsetattr) rrrUZpropsr3rgr4r4rrrr!)rrrr"rs     zConfigurator.configure_customcCs4|j|}t|tr0d|kr0|j||j|<}|S)Nz())rrOrr)rrXr4r!r!r" __getitem__s zConfigurator.__getitem__c CsFtjj|stjj|j|}tj|ddd}tj|}WdQRX|S)z*Default converter for the inc:// protocol.rzutf-8)rN) r9r:isabsr0r@rbrrerf)rrtrr4r!r!r"rs  zConfigurator.inc_convert)N) rrrrrZvalue_convertersrrrr __classcell__r!r!)rr"rs  rc@s&eZdZd ddZddZddZdS) SubprocessMixinFNcCs||_||_dS)N)verboseprogress)rrrr!r!r"r+szSubprocessMixin.__init__cCsn|j}|j}xT|j}|sP|dk r0|||q|sBtjjdntjj|jdtjjqW|jdS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. Nrzutf-8) rrreadlinerJstderrrzr]flushrl)rr_rrrr3r!r!r"r/s zSubprocessMixin.readercKstj|ftjtjd|}tj|j|jdfd}|jtj|j|jdfd}|j|j |j |j |j dk r|j ddn|j rt jjd|S)N)stdoutrr)rr3rzdone.mainzdone. ) subprocessPopenPIPE threadingZThreadrrr rwaitr0rrrJrz)rcmdr4rTZt1Zt2r!r!r" run_commandDs   zSubprocessMixin.run_command)FN)rrrrrrr!r!r!r"r*s rcCstjdd|jS)z,Normalize a python package name a la PEP 503z[-_.]+r )r subrQ)r'r!r!r"normalize_nameUsr)NN)r)N)N)rVrWrXrYrZr[r\)NT)r$rvrwrxryrz)rr)rb collectionsr contextlibrZglobrrrqreZloggingr9rr rrr ImportErrorrrJrhr|rmrZdummy_threadingrr$rcompatrrr r r r r rrrrrrrrrrrrZ getLoggerrrCOMMArr1ZIDENTZ EXTRA_IDENTZVERSPECZRELOPZBARE_CONSTRAINTSZ DIRECT_REFZ CONSTRAINTSZ EXTRA_LISTZEXTRASZ REQUIREMENTr+Z RELOP_IDENTr.r6rGrLrPrVrYrur{contextmanagerrrrrrrrrrVERBOSErrhrrrrrrIrr rrrrrrr r"r#r+r6ZARCHIVE_EXTENSIONSrprurr{rrrrrrrrrrrarrrrrrrrrrrrrr!r!r!r"s      X   ,   %   /  7  )     ,H  C]    *)  :+PK!B`NN)__pycache__/database.cpython-36.opt-1.pycnu[3 Pf@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZdd lmZmZmZmZmZmZmZd d d d dgZ ej!e"Z#dZ$dZ%deddde$dfZ&dZ'Gddde(Z)Gddde(Z*Gdd d e(Z+Gdd d e+Z,Gdd d e,Z-Gdd d e,Z.e-Z/e.Z0Gddde(Z1d)d!d"Z2d#d$Z3d%d&Z4d'd(Z5dS)*zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.jsonZ INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc@s(eZdZdZddZddZddZdS) _CachezL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generated)selfr!/usr/lib/python3.6/database.py__init__0sz_Cache.__init__cCs|jj|jjd|_dS)zC Clear the cache, setting it to its initial state. FN)rclearrr)r r!r!r"r$8s  z _Cache.clearcCs2|j|jkr.||j|j<|jj|jgj|dS)z` Add a distribution to the cache. :param dist: The distribution to add. N)rr setdefaultkeyappend)r distr!r!r"add@s  z _Cache.addN)__name__ __module__ __qualname____doc__r#r$r)r!r!r!r"r,src@seZdZdZdddZddZdd ZeeeZd d Z d d Z ddZ e ddZ ddZddZdddZddZdddZdS)rzU Represents a set of distributions installed on a path (typically sys.path). NFcCsD|dkrtj}||_d|_||_t|_t|_d|_td|_ dS)a Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. NTdefault) sysr _include_dist _include_eggr_cache _cache_egg_cache_enabledr_scheme)r rZ include_eggr!r!r"r#Ns zDistributionPath.__init__cCs|jS)N)r4)r r!r!r"_get_cache_enabledbsz#DistributionPath._get_cache_enabledcCs ||_dS)N)r4)r valuer!r!r"_set_cache_enabledesz#DistributionPath._set_cache_enabledcCs|jj|jjdS)z, Clears the internal cache. N)r2r$r3)r r!r!r" clear_cachejs zDistributionPath.clear_cachec csTt}xF|jD]:}tj|}|dkr*q|jd}| s|j rDqt|j}x|D]}|j|}| sV|j|krvqV|jo|jt rt t g}x*|D] }t j ||} |j| } | rPqWqVtj| j} t| dd} WdQRXtjd|j|j|jt|j| |dVqV|jrV|jd rVtjd|j|j|jt|j|VqVWqWdS) zD Yield .dist-info and/or .egg(-info) distributions. Nlegacy)fileobjschemezFound %s)metadataenv .egg-info.egg)r@rA)setrrfinder_for_pathfindZ is_containersortedr0endswith DISTINFO_EXTr r posixpathjoin contextlibclosing as_streamr loggerdebugr)new_dist_classr1old_dist_class) r seenrfinderrZrsetentryZpossible_filenamesZmetadata_filenameZ metadata_pathZpydiststreamr>r!r!r"_yield_distributionsrs@            z%DistributionPath._yield_distributionscCst|jj }|jo|jj }|s"|rpx4|jD](}t|trH|jj|q,|jj|q,W|rdd|j_|rpd|j_dS)zk Scan the path for distributions and populate the cache with those that are found. TN)r2rr1r3rV isinstancerr))r Zgen_distZgen_eggr(r!r!r"_generate_caches  z DistributionPath._generate_cachecCs|jdd}dj||gtS)ao The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: string-_)replacerIrG)clsrversionr!r!r"distinfo_dirnames z!DistributionPath.distinfo_dirnameccsj|js x^|jD] }|VqWnF|jx|jjjD] }|Vq6W|jrfx|jjjD] }|VqXWdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r4rVrXr2rvaluesr1r3)r r(r!r!r"get_distributionss   z"DistributionPath.get_distributionscCsd}|j}|js6xj|jD]}|j|kr|}PqWnH|j||jjkr\|jj|d}n"|jr~||jjkr~|jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr4rVr&rXr2rr1r3)r rresultr(r!r!r"get_distributions   z!DistributionPath.get_distributionc csd}|dk rJy|jjd||f}Wn$tk rHtd||fYnXxd|jD]X}|j}xL|D]D}t|\}}|dkr||kr|VPqd||krd|j|rd|VPqdWqTWdS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string Nz%s (%s)zinvalid name or version: %r, %r)r5matcher ValueErrorrr`providesrmatch) r rr]rdr(providedpp_namep_verr!r!r"provides_distributions$  z&DistributionPath.provides_distributioncCs(|j|}|dkrtd||j|S)z5 Return the path to a resource file. Nzno distribution named %r found)rc LookupErrorget_resource_path)r r relative_pathr(r!r!r" get_file_paths  zDistributionPath.get_file_pathccs`xZ|jD]N}|j}||kr ||}|dk r@||krX||Vq x|jD] }|VqJWq WdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)r`exportsr_)r categoryrr(rSdvr!r!r"get_exported_entries"s z%DistributionPath.get_exported_entries)NF)N)N)r*r+r,r-r#r6r8propertyZ cache_enabledr9rVrX classmethodr^r`rcrlrprur!r!r!r"rJs  *  $ c@seZdZdZdZdZddZeddZeZ eddZ ed d Z d d Z ed dZ eddZeddZeddZeddZddZddZddZddZdS) rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. FcCsL||_|j|_|jj|_|j|_d|_d|_d|_d|_t |_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) r>rrar&r]ZlocatordigestextrascontextrBZ download_urlsZdigests)r r>r!r!r"r#Gs zDistribution.__init__cCs|jjS)zH The source archive download URL for this distribution. )r> source_url)r r!r!r"r{XszDistribution.source_urlcCsd|j|jfS)zX A utility property which displays the name and version in parentheses. z%s (%s))rr])r r!r!r"name_and_versionaszDistribution.name_and_versioncCs.|jj}d|j|jf}||kr*|j||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. z%s (%s))r>rfrr]r')r Zplistsr!r!r"rfhs  zDistribution.providescCs8|j}tjd|jt||}t|j||j|jdS)Nz%Getting requirements from metadata %r)ryr?) r>rMrNZtodictgetattrrBZget_requirementsryrz)r Zreq_attrmdZreqtsr!r!r"_get_requirementsts   zDistribution._get_requirementscCs |jdS)N run_requires)r)r r!r!r"r{szDistribution.run_requirescCs |jdS)N meta_requires)r)r r!r!r"rszDistribution.meta_requirescCs |jdS)Nbuild_requires)r)r r!r!r"rszDistribution.build_requirescCs |jdS)N test_requires)r)r r!r!r"rszDistribution.test_requirescCs |jdS)N dev_requires)r)r r!r!r"rszDistribution.dev_requiresc Cst|}t|jj}y|j|j}Wn6tk rZtjd||j d}|j|}YnX|j }d}xJ|j D]@}t |\}} ||krqny|j | }PWqntk rYqnXqnW|S)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. z+could not read version %r - using name onlyrF)r rr>r=rd requirementrrMwarningsplitr&rfrrg) r reqrSr=rdrrbrirjrkr!r!r"matches_requirements*       z Distribution.matches_requirementcCs(|jrd|j}nd}d|j|j|fS)zC Return a textual representation of this instance, z [%s]r:z)r{rr])r suffixr!r!r"__repr__s zDistribution.__repr__cCs>t|t|k rd}n$|j|jko8|j|jko8|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typerr]r{)r otherrbr!r!r"__eq__s    zDistribution.__eq__cCst|jt|jt|jS)zH Compute hash in a way which matches the equality test. )hashrr]r{)r r!r!r"__hash__szDistribution.__hash__N)r*r+r,r-Zbuild_time_dependency requestedr#rvr{Z download_urlr|rfrrrrrrrrrrr!r!r!r"r5s$        " cs0eZdZdZdZdfdd ZdddZZS) rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncs tt|j|||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr#r dist_path)r r>rr?) __class__r!r"r#s z"BaseInstalledDistribution.__init__cCsd|dkr|j}|dkr"tj}d}ntt|}d|j}||j}tj|jdjd}d||fS)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str Nr:z%s==asciiz%s%s) hasherhashlibmd5r~rxbase64Zurlsafe_b64encoderstripdecode)r datarprefixrxr!r!r"get_hashs   z"BaseInstalledDistribution.get_hash)N)N)r*r+r,r-rr#r __classcell__r!r!)rr"rscseZdZdZdZd'fdd ZddZdd Zd d Ze d d Z ddZ ddZ ddZ ddZd(ddZddZe ddZd)ddZdd Zd!d"Zd#d$Zd%d&ZejZZS)*ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). Zsha256Ncs0tj||_}|dkr(ddl}|j|rN|jrN||jjkrN|jj|j}nt|dkr|j t }|dkrr|j t }|dkr|j d}|dkrt dt |ft j|j}t|dd}WdQRXtt|j||||r|jr|jj|y|j d}Wn&tk r ddl}|jYnX|dk |_dS)NrZMETADATAzno %s found in %sr;)r<r=r)rrCrRpdbZ set_tracer4r2rr>rDr r rerJrKrLr rrr#r)AttributeErrorr)r rr>r?rRrrSrU)rr!r"r#s4      zInstalledDistribution.__init__cCsd|j|j|jfS)Nz#)rr]r)r r!r!r"r2szInstalledDistribution.__repr__cCsd|j|jfS)Nz%s %s)rr])r r!r!r"__str__6szInstalledDistribution.__str__c Csg}|jd}tj|j`}t|dJ}xB|D]:}ddtt|dD}||\}}} |j||| fq0WWdQRXWdQRX|S)a" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). r)rUcSsg|]}dqS)Nr!).0ir!r!r" Hsz6InstalledDistribution._get_records..N)get_distinfo_resourcerJrKrLrrangelenr') r resultsrSrUZ record_readerrowmissingrchecksumsizer!r!r" _get_records9s   (z"InstalledDistribution._get_recordscCsi}|jt}|r|j}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )rEXPORTS_FILENAMEr)r rbrSr!r!r"rqPs  zInstalledDistribution.exportsc Cs8i}|jt}|r4tj|j}t|}WdQRX|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. N)rrrJrKrLr)r rbrSrUr!r!r"r^s  z"InstalledDistribution.read_exportsc Cs.|jt}t|d}t||WdQRXdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_fileropenr)r rqZrffr!r!r"rms  z#InstalledDistribution.write_exportscCsh|jd}tj|j:}t|d$}x|D]\}}||kr,|Sq,WWdQRXWdQRXtd|dS)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. r)rUNz3no resource file with relative path %r is installed)rrJrKrLrKeyError)r rorSrUZresources_readerZrelativeZ destinationr!r!r"rnxs  z'InstalledDistribution.get_resource_pathccsx|jD] }|Vq WdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r rbr!r!r"list_installed_filessz*InstalledDistribution.list_installed_filesFc Cs,tjj|d}tjj|j}|j|}tjj|d}|jd}tjd||rRdSt|}x|D]}tjj |s||j d rd} } n4dtjj |} t |d} |j | j} WdQRX|j|s|r|j|rtjj||}|j|| | fqbW|j|rtjj||}|j|ddfWdQRX|S) z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. r:rz creating %sN.pyc.pyoz%drb)rr)osrrIdirname startswithrrMinforisdirrFgetsizerrreadrelpathZwriterow) r pathsrdry_runbaseZbase_under_prefix record_pathwriterr hash_valuerfpr!r!r"write_installed_filess.         z+InstalledDistribution.write_installed_filesc Csg}tjj|j}|jd}x|jD]\}}}tjj|sLtjj||}||krVq(tjj|sv|j|dddfq(tjj |r(t tjj |}|r||kr|j|d||fq(|r(d|kr|j ddd}nd }t |d 2} |j| j|} | |kr |j|d || fWd QRXq(W|S) a Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rexistsTFr=rrNrr)rrrrrisabsrIrr'isfilestrrrrrr) r mismatchesrrrrrZ actual_sizerrZ actual_hashr!r!r"check_installed_filess.         z+InstalledDistribution.check_installed_filesc Csi}tjj|jd}tjj|rtj|ddd}|jj}WdQRXx@|D]8}|jdd\}}|dkr~|j |gj |qN|||<qNW|S) a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rrSzutf-8)encodingNrr namespace) rrrIrcodecsrr splitlinesrr%r')r rb shared_pathrlinesliner&r7r!r!r"shared_locationss   z&InstalledDistribution.shared_locationsc Cstjj|jd}tjd||r$dSg}x6dD].}||}tjj||r.|jd ||fq.Wx"|jd fD]}|jd |qnWtj |d d d}|j dj|WdQRX|S)aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rz creating %sNrlibheadersscriptsrz%s=%srz namespace=%srzutf-8)r )rrrrr) rrrIrMrrr'getrrwrite) r rrrrr&rnsrr!r!r"write_shared_locationss   z,InstalledDistribution.write_shared_locationscCsF|tkrtd||jftj|j}|dkr.set_name_and_version) rrr4r3r>rr] _get_metadatar)rrr#)r rr?rr>)rr!r"r#Ws   zEggInfoDistribution.__init__c s2d}ddfdd}|jdrtjj|rdtjj|dd}t|dd }tjj|dd }||}n`tj|}t|j d j d }t|dd }y|j d} | j d}Wnt k rd}YnXnX|jdrtjj|rtjj|d }||}tjj|d}t|dd }n t d||r.|j ||S)NcSsg}|j}x|D]}|j}|jdr6tjd|Pt|}|sPtjd|q|jr`tjd|jst|j|j qdj dd|jD}|jd|j |fqW|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedz, css|]}d|VqdS)z%s%sNr!)rcr!r!r" szQEggInfoDistribution._get_metadata..parse_requires_data..z%s (%s)) rstriprrMrr ryZ constraintsr'rrI)rreqsrrrSZconsr!r!r"parse_requires_dataos&    z>EggInfoDistribution._get_metadata..parse_requires_datacsHg}y*tj|dd}|j}WdQRXWntk rBYnX|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rSzutf-8N)rrrIOError)req_pathrr)rr!r"parse_requires_pathsz>EggInfoDistribution._get_metadata..parse_requires_pathz.eggzEGG-INFOzPKG-INFOr;)rr=z requires.txtzEGG-INFO/PKG-INFOutf8)r<r=zEGG-INFO/requires.txtzutf-8z .egg-infoz,path must end with .egg-info or .egg, got %r)rFrrrrIr zipimport zipimporterrget_datarrrZadd_requirements) r rrequiresr meta_pathr>rZzipfr<rr!)rr"rls:           z!EggInfoDistribution._get_metadatacCsd|j|j|jfS)Nz!)rr]r)r r!r!r"rszEggInfoDistribution.__repr__cCsd|j|jfS)Nz%s %s)rr])r r!r!r"rszEggInfoDistribution.__str__cCsdg}tjj|jd}tjj|r`x>|jD]2\}}}||kr>q*tjj|s*|j|dddfq*W|S)a Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. zinstalled-files.txtrTF)rrrIrrr')r rrrrZr!r!r"rs   z)EggInfoDistribution.check_installed_filesc Csdd}dd}tjj|jd}g}tjj|rtj|ddd|}xt|D]l}|j}tjjtjj|j|}tjj|stj d ||j d rqHtjj |sH|j |||||fqHWWd QRX|j |d d f|S)z Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) c Ss0t|d}z |j}Wd|jXtj|jS)Nr)rrcloserrZ hexdigest)rrZcontentr!r!r"_md5s    z6EggInfoDistribution.list_installed_files.._md5cSs tj|jS)N)rstatst_size)rr!r!r"_sizesz7EggInfoDistribution.list_installed_files.._sizezinstalled-files.txtrSzutf-8)rzNon-existent file: %s.pyc.pyoN)rr) rrrIrrrrnormpathrMrrFrr')r rrrrbrrrir!r!r"rs"      &z(EggInfoDistribution.list_installed_filesFc cstjj|jd}d}tj|dddd}x\|D]T}|j}|dkrFd}q,|s,tjjtjj|j|}|j|jr,|rz|Vq,|Vq,WWdQRXdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths zinstalled-files.txtTrSzutf-8)rz./FN)rrrIrrrrr)r Zabsoluterskiprrrir!r!r"rs   z'EggInfoDistribution.list_distinfo_filescCst|to|j|jkS)N)rWrr)r rr!r!r"rs zEggInfoDistribution.__eq__)N)F)r*r+r,r-rrr#rrrrrrrrrrr!r!)rr"rNsK& c@s^eZdZdZddZddZdddZd d Zd d ZdddZ dddZ ddZ ddZ dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dS)N)adjacency_list reverse_listr)r r!r!r"r#.szDependencyGraph.__init__cCsg|j|<g|j|<dS)zAdd the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` N)rr)r distributionr!r!r"add_distribution3s z DependencyGraph.add_distributionNcCs6|j|j||f||j|kr2|j|j|dS)aAdd an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` N)rr'r)r xylabelr!r!r"add_edge=s zDependencyGraph.add_edgecCs&tjd|||jj|gj|dS)a Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` z %s missing %rN)rMrNrr%r')r rrr!r!r" add_missingLszDependencyGraph.add_missingcCsd|j|jfS)Nz%s %s)rr])r r(r!r!r" _repr_distWszDependencyGraph._repr_distrcCs|j|g}xv|j|D]h\}}|j|}|dk r>d||f}|jd|t||j||d}|jd}|j|ddqWdj|S)zPrints only a subgraphNz%s [%s]z rr)rrr'r repr_noderextendrI)r r(leveloutputrr Z suboutputZsubsr!r!r"rZs    zDependencyGraph.repr_nodeTcCsg}|jdx||jjD]n\}}t|dkr>| r>|j|xH|D]@\}}|dk rn|jd|j|j|fqD|jd|j|jfqDWqW| rt|dkr|jd|jd|jdx&|D]}|jd |j|jd qW|jd |jd dS) a9Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` zdigraph dependencies { rNz"%s" -> "%s" [label="%s"] z "%s" -> "%s" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rz} )rritemsrr'r)r rZskip_disconnectedZ disconnectedr(adjsrr r!r!r"to_dotgs&        zDependencyGraph.to_dotcsg}i}x&|jjD]\}}|dd||<qWxgx4t|jddD]\}}|sLj|||=qLWsrPx*|jD]\}}fdd|D||<q|WtjdddD|jq2W|t|jfS)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. Ncs g|]\}}|kr||fqSr!r!)rrsrS) to_remover!r"rsz4DependencyGraph.topological_sort..zMoving to result: %scSsg|]}d|j|jfqS)z%s (%s))rr])rrsr!r!r"rs)rrlistr'rMrNrkeys)r rbZalistkrtr!)rr"topological_sorts$  z DependencyGraph.topological_sortcCs6g}x&|jjD]\}}|j|j|qWdj|S)zRepresentation of the graphr)rrr'rrI)r rr(rr!r!r"rszDependencyGraph.__repr__)N)r)T) r*r+r,r-r#r r rrrrrrr!r!r!r"rs   rr.cCsft|}t}i}xX|D]P}|j|x@|jD]6}t|\}}tjd||||j|gj||fq.WqWx|D]}|j |j B|j B|j B}x|D]} y|j | } Wn6tk rtjd| | jd}|j |} YnX| j}d} ||krJxV||D]J\}} y| j|} Wntk r,d} YnX| r|j|| | d} PqW| s|j|| qWqrW|S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %sz+could not read version %r - using name onlyrFT)rrr rfrrMrNr%r'rrrrrdrrrr&rgr r)distsr=graphrhr(rirr]rrrdZmatchedZproviderrgr!r!r" make_graphsD         rcCs~||krtd|jt|}|g}|j|}x@|rn|j}|j|x$|j|D]}||krR|j|qRWq0W|jd|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested z1given distribution %r is not a member of the listr)rrrrpopr')rr(rZdeptodorsZsuccr!r!r"get_dependent_distss    r!cCsv||krtd|jt|}g}|j|}xD|rp|jd}|j|x$|j|D]}||krT|j|qTWq.W|S)zRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested z1given distribution %r is not a member of the listr)rrrrrr')rr(rrr rsZpredr!r!r"get_required_distss    r"cKs4|jdd}tf|}||_||_|p(d|_t|S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summary)rr rr]r#r)rr]kwargsr#rr!r!r" make_dists    r%)r.)6r-Z __future__rrrrJrZloggingrrHr/rr:rrcompatrr]rrr>r r r utilr r rrrrr__all__Z getLoggerr*rMrZCOMMANDS_FILENAMErrGrrrrrrrrOrPrrr!r"r%r!r!r!r"sV  $  l7GM 6PK!B`NN#__pycache__/database.cpython-36.pycnu[3 Pf@sdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZdd lmZmZmZmZmZmZmZd d d d dgZ ej!e"Z#dZ$dZ%deddde$dfZ&dZ'Gddde(Z)Gddde(Z*Gdd d e(Z+Gdd d e+Z,Gdd d e,Z-Gdd d e,Z.e-Z/e.Z0Gddde(Z1d)d!d"Z2d#d$Z3d%d&Z4d'd(Z5dS)*zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.jsonZ INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc@s(eZdZdZddZddZddZdS) _CachezL A simple cache mapping names and .dist-info paths to distributions cCsi|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generated)selfr!/usr/lib/python3.6/database.py__init__0sz_Cache.__init__cCs|jj|jjd|_dS)zC Clear the cache, setting it to its initial state. FN)rclearrr)r r!r!r"r$8s  z _Cache.clearcCs2|j|jkr.||j|j<|jj|jgj|dS)z` Add a distribution to the cache. :param dist: The distribution to add. N)rr setdefaultkeyappend)r distr!r!r"add@s  z _Cache.addN)__name__ __module__ __qualname____doc__r#r$r)r!r!r!r"r,src@seZdZdZdddZddZdd ZeeeZd d Z d d Z ddZ e ddZ ddZddZdddZddZdddZdS)rzU Represents a set of distributions installed on a path (typically sys.path). NFcCsD|dkrtj}||_d|_||_t|_t|_d|_td|_ dS)a Create an instance from a path, optionally including legacy (distutils/ setuptools/distribute) distributions. :param path: The path to use, as a list of directories. If not specified, sys.path is used. :param include_egg: If True, this instance will look for and return legacy distributions as well as those based on PEP 376. NTdefault) sysr _include_dist _include_eggr_cache _cache_egg_cache_enabledr_scheme)r rZ include_eggr!r!r"r#Ns zDistributionPath.__init__cCs|jS)N)r4)r r!r!r"_get_cache_enabledbsz#DistributionPath._get_cache_enabledcCs ||_dS)N)r4)r valuer!r!r"_set_cache_enabledesz#DistributionPath._set_cache_enabledcCs|jj|jjdS)z, Clears the internal cache. N)r2r$r3)r r!r!r" clear_cachejs zDistributionPath.clear_cachec csTt}xF|jD]:}tj|}|dkr*q|jd}| s|j rDqt|j}x|D]}|j|}| sV|j|krvqV|jo|jt rt t g}x*|D] }t j ||} |j| } | rPqWqVtj| j} t| dd} WdQRXtjd|j|j|jt|j| |dVqV|jrV|jd rVtjd|j|j|jt|j|VqVWqWdS) zD Yield .dist-info and/or .egg(-info) distributions. Nlegacy)fileobjschemezFound %s)metadataenv .egg-info.egg)r@rA)setrrfinder_for_pathfindZ is_containersortedr0endswith DISTINFO_EXTr r posixpathjoin contextlibclosing as_streamr loggerdebugr)new_dist_classr1old_dist_class) r seenrfinderrZrsetentryZpossible_filenamesZmetadata_filenameZ metadata_pathZpydiststreamr>r!r!r"_yield_distributionsrs@            z%DistributionPath._yield_distributionscCst|jj }|jo|jj }|s"|rpx4|jD](}t|trH|jj|q,|jj|q,W|rdd|j_|rpd|j_dS)zk Scan the path for distributions and populate the cache with those that are found. TN)r2rr1r3rV isinstancerr))r Zgen_distZgen_eggr(r!r!r"_generate_caches  z DistributionPath._generate_cachecCs|jdd}dj||gtS)ao The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: string-_)replacerIrG)clsrversionr!r!r"distinfo_dirnames z!DistributionPath.distinfo_dirnameccsj|js x^|jD] }|VqWnF|jx|jjjD] }|Vq6W|jrfx|jjjD] }|VqXWdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r4rVrXr2rvaluesr1r3)r r(r!r!r"get_distributionss   z"DistributionPath.get_distributionscCsd}|j}|js6xj|jD]}|j|kr|}PqWnH|j||jjkr\|jj|d}n"|jr~||jjkr~|jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr4rVr&rXr2rr1r3)r rresultr(r!r!r"get_distributions   z!DistributionPath.get_distributionc csd}|dk rJy|jjd||f}Wn$tk rHtd||fYnXxd|jD]X}|j}xL|D]D}t|\}}|dkr||kr|VPqd||krd|j|rd|VPqdWqTWdS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string Nz%s (%s)zinvalid name or version: %r, %r)r5matcher ValueErrorrr`providesrmatch) r rr]rdr(providedpp_namep_verr!r!r"provides_distributions$  z&DistributionPath.provides_distributioncCs(|j|}|dkrtd||j|S)z5 Return the path to a resource file. Nzno distribution named %r found)rc LookupErrorget_resource_path)r r relative_pathr(r!r!r" get_file_paths  zDistributionPath.get_file_pathccs`xZ|jD]N}|j}||kr ||}|dk r@||krX||Vq x|jD] }|VqJWq WdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)r`exportsr_)r categoryrr(rSdvr!r!r"get_exported_entries"s z%DistributionPath.get_exported_entries)NF)N)N)r*r+r,r-r#r6r8propertyZ cache_enabledr9rVrX classmethodr^r`rcrlrprur!r!r!r"rJs  *  $ c@seZdZdZdZdZddZeddZeZ eddZ ed d Z d d Z ed dZ eddZeddZeddZeddZddZddZddZddZdS) rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. FcCsL||_|j|_|jj|_|j|_d|_d|_d|_d|_t |_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) r>rrar&r]ZlocatordigestextrascontextrBZ download_urlsZdigests)r r>r!r!r"r#Gs zDistribution.__init__cCs|jjS)zH The source archive download URL for this distribution. )r> source_url)r r!r!r"r{XszDistribution.source_urlcCsd|j|jfS)zX A utility property which displays the name and version in parentheses. z%s (%s))rr])r r!r!r"name_and_versionaszDistribution.name_and_versioncCs.|jj}d|j|jf}||kr*|j||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. z%s (%s))r>rfrr]r')r Zplistsr!r!r"rfhs  zDistribution.providescCs8|j}tjd|jt||}t|j||j|jdS)Nz%Getting requirements from metadata %r)ryr?) r>rMrNZtodictgetattrrBZget_requirementsryrz)r Zreq_attrmdZreqtsr!r!r"_get_requirementsts   zDistribution._get_requirementscCs |jdS)N run_requires)r)r r!r!r"r{szDistribution.run_requirescCs |jdS)N meta_requires)r)r r!r!r"rszDistribution.meta_requirescCs |jdS)Nbuild_requires)r)r r!r!r"rszDistribution.build_requirescCs |jdS)N test_requires)r)r r!r!r"rszDistribution.test_requirescCs |jdS)N dev_requires)r)r r!r!r"rszDistribution.dev_requiresc Cst|}t|jj}y|j|j}Wn6tk rZtjd||j d}|j|}YnX|j }d}xJ|j D]@}t |\}} ||krqny|j | }PWqntk rYqnXqnW|S)z Say if this instance matches (fulfills) a requirement. :param req: The requirement to match. :rtype req: str :return: True if it matches, else False. z+could not read version %r - using name onlyrF)r rr>r=rd requirementrrMwarningsplitr&rfrrg) r reqrSr=rdrrbrirjrkr!r!r"matches_requirements*       z Distribution.matches_requirementcCs(|jrd|j}nd}d|j|j|fS)zC Return a textual representation of this instance, z [%s]r:z)r{rr])r suffixr!r!r"__repr__s zDistribution.__repr__cCs>t|t|k rd}n$|j|jko8|j|jko8|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typerr]r{)r otherrbr!r!r"__eq__s    zDistribution.__eq__cCst|jt|jt|jS)zH Compute hash in a way which matches the equality test. )hashrr]r{)r r!r!r"__hash__szDistribution.__hash__N)r*r+r,r-Zbuild_time_dependency requestedr#rvr{Z download_urlr|rfrrrrrrrrrrr!r!r!r"r5s$        " cs0eZdZdZdZdfdd ZdddZZS) rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncs tt|j|||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr#r dist_path)r r>rr?) __class__r!r"r#s z"BaseInstalledDistribution.__init__cCsd|dkr|j}|dkr"tj}d}ntt|}d|j}||j}tj|jdjd}d||fS)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str Nr:z%s==asciiz%s%s) hasherhashlibmd5r~rxbase64Zurlsafe_b64encoderstripdecode)r datarprefixrxr!r!r"get_hashs   z"BaseInstalledDistribution.get_hash)N)N)r*r+r,r-rr#r __classcell__r!r!)rr"rscseZdZdZdZd'fdd ZddZdd Zd d Ze d d Z ddZ ddZ ddZ ddZd(ddZddZe ddZd)ddZdd Zd!d"Zd#d$Zd%d&ZejZZS)*ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). Zsha256Ncs0tj||_}|dkr(ddl}|j|rN|jrN||jjkrN|jj|j}nt|dkr|j t }|dkrr|j t }|dkr|j d}|dkrt dt |ft j|j}t|dd}WdQRXtt|j||||r|jr|jj|y|j d}Wn&tk r ddl}|jYnX|dk |_dS)NrZMETADATAzno %s found in %sr;)r<r=r)rrCrRpdbZ set_tracer4r2rr>rDr r rerJrKrLr rrr#r)AttributeErrorr)r rr>r?rRrrSrU)rr!r"r#s4      zInstalledDistribution.__init__cCsd|j|j|jfS)Nz#)rr]r)r r!r!r"r2szInstalledDistribution.__repr__cCsd|j|jfS)Nz%s %s)rr])r r!r!r"__str__6szInstalledDistribution.__str__c Csg}|jd}tj|j`}t|dJ}xB|D]:}ddtt|dD}||\}}} |j||| fq0WWdQRXWdQRX|S)a" Get the list of installed files for the distribution :return: A list of tuples of path, hash and size. Note that hash and size might be ``None`` for some entries. The path is exactly as stored in the file (which is as in PEP 376). r)rUcSsg|]}dqS)Nr!).0ir!r!r" Hsz6InstalledDistribution._get_records..N)get_distinfo_resourcerJrKrLrrangelenr') r resultsrSrUZ record_readerrowmissingrchecksumsizer!r!r" _get_records9s   (z"InstalledDistribution._get_recordscCsi}|jt}|r|j}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )rEXPORTS_FILENAMEr)r rbrSr!r!r"rqPs  zInstalledDistribution.exportsc Cs8i}|jt}|r4tj|j}t|}WdQRX|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. N)rrrJrKrLr)r rbrSrUr!r!r"r^s  z"InstalledDistribution.read_exportsc Cs.|jt}t|d}t||WdQRXdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_fileropenr)r rqZrffr!r!r"rms  z#InstalledDistribution.write_exportscCsh|jd}tj|j:}t|d$}x|D]\}}||kr,|Sq,WWdQRXWdQRXtd|dS)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. r)rUNz3no resource file with relative path %r is installed)rrJrKrLrKeyError)r rorSrUZresources_readerZrelativeZ destinationr!r!r"rnxs  z'InstalledDistribution.get_resource_pathccsx|jD] }|Vq WdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r rbr!r!r"list_installed_filessz*InstalledDistribution.list_installed_filesFc Cs,tjj|d}tjj|j}|j|}tjj|d}|jd}tjd||rRdSt|}x|D]}tjj |s||j d rd} } n4dtjj |} t |d} |j | j} WdQRX|j|s|r|j|rtjj||}|j|| | fqbW|j|rtjj||}|j|ddfWdQRX|S) z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. r:rz creating %sN.pyc.pyoz%drb)rr)osrrIdirname startswithrrMinforisdirrFgetsizerrreadrelpathZwriterow) r pathsrdry_runbaseZbase_under_prefix record_pathwriterr hash_valuerfpr!r!r"write_installed_filess.         z+InstalledDistribution.write_installed_filesc Csg}tjj|j}|jd}x|jD]\}}}tjj|sLtjj||}||krVq(tjj|sv|j|dddfq(tjj |r(t tjj |}|r||kr|j|d||fq(|r(d|kr|j ddd}nd }t |d 2} |j| j|} | |kr |j|d || fWd QRXq(W|S) a Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rexistsTFr=rrNrr)rrrrrisabsrIrr'isfilestrrrrrr) r mismatchesrrrrrZ actual_sizerrZ actual_hashr!r!r"check_installed_filess.         z+InstalledDistribution.check_installed_filesc Csi}tjj|jd}tjj|rtj|ddd}|jj}WdQRXx@|D]8}|jdd\}}|dkr~|j |gj |qN|||<qNW|S) a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rrSzutf-8)encodingNrr namespace) rrrIrcodecsrr splitlinesrr%r')r rb shared_pathrlinesliner&r7r!r!r"shared_locationss   z&InstalledDistribution.shared_locationsc Cstjj|jd}tjd||r$dSg}x6dD].}||}tjj||r.|jd ||fq.Wx"|jd fD]}|jd |qnWtj |d d d}|j dj|WdQRX|S)aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rz creating %sNrlibheadersscriptsrz%s=%srz namespace=%srzutf-8)r )rrrrr) rrrIrMrrr'getrrwrite) r rrrrr&rnsrr!r!r"write_shared_locationss   z,InstalledDistribution.write_shared_locationscCsF|tkrtd||jftj|j}|dkr.set_name_and_version) rrr4r3r>rr] _get_metadatar)rrr#)r rr?rr>)rr!r"r#Ws   zEggInfoDistribution.__init__c s2d}ddfdd}|jdrtjj|rdtjj|dd}t|dd }tjj|dd }||}n`tj|}t|j d j d }t|dd }y|j d} | j d}Wnt k rd}YnXnX|jdrtjj|rtjj|d }||}tjj|d}t|dd }n t d||r.|j ||S)NcSsg}|j}x|D]}|j}|jdr6tjd|Pt|}|sPtjd|q|jr`tjd|jst|j|j qdj dd|jD}|jd|j |fqW|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedz, css|]}d|VqdS)z%s%sNr!)rcr!r!r" szQEggInfoDistribution._get_metadata..parse_requires_data..z%s (%s)) rstriprrMrr ryZ constraintsr'rrI)rreqsrrrSZconsr!r!r"parse_requires_dataos&    z>EggInfoDistribution._get_metadata..parse_requires_datacsHg}y*tj|dd}|j}WdQRXWntk rBYnX|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rSzutf-8N)rrrIOError)req_pathrr)rr!r"parse_requires_pathsz>EggInfoDistribution._get_metadata..parse_requires_pathz.eggzEGG-INFOzPKG-INFOr;)rr=z requires.txtzEGG-INFO/PKG-INFOutf8)r<r=zEGG-INFO/requires.txtzutf-8z .egg-infoz,path must end with .egg-info or .egg, got %r)rFrrrrIr zipimport zipimporterrget_datarrrZadd_requirements) r rrequiresr meta_pathr>rZzipfr<rr!)rr"rls:           z!EggInfoDistribution._get_metadatacCsd|j|j|jfS)Nz!)rr]r)r r!r!r"rszEggInfoDistribution.__repr__cCsd|j|jfS)Nz%s %s)rr])r r!r!r"rszEggInfoDistribution.__str__cCsdg}tjj|jd}tjj|r`x>|jD]2\}}}||kr>q*tjj|s*|j|dddfq*W|S)a Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. zinstalled-files.txtrTF)rrrIrrr')r rrrrZr!r!r"rs   z)EggInfoDistribution.check_installed_filesc Csdd}dd}tjj|jd}g}tjj|rtj|ddd|}xt|D]l}|j}tjjtjj|j|}tjj|stj d ||j d rqHtjj |sH|j |||||fqHWWd QRX|j |d d f|S)z Iterates over the ``installed-files.txt`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: a list of (path, hash, size) c Ss0t|d}z |j}Wd|jXtj|jS)Nr)rrcloserrZ hexdigest)rrZcontentr!r!r"_md5s    z6EggInfoDistribution.list_installed_files.._md5cSs tj|jS)N)rstatst_size)rr!r!r"_sizesz7EggInfoDistribution.list_installed_files.._sizezinstalled-files.txtrSzutf-8)rzNon-existent file: %s.pyc.pyoN)rr) rrrIrrrrnormpathrMrrFrr')r rrrrbrrrir!r!r"rs"      &z(EggInfoDistribution.list_installed_filesFc cstjj|jd}d}tj|dddd}x\|D]T}|j}|dkrFd}q,|s,tjjtjj|j|}|j|jr,|rz|Vq,|Vq,WWdQRXdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths zinstalled-files.txtTrSzutf-8)rz./FN)rrrIrrrrr)r Zabsoluterskiprrrir!r!r"rs   z'EggInfoDistribution.list_distinfo_filescCst|to|j|jkS)N)rWrr)r rr!r!r"rs zEggInfoDistribution.__eq__)N)F)r*r+r,r-rrr#rrrrrrrrrrr!r!)rr"rNsK& c@s^eZdZdZddZddZdddZd d Zd d ZdddZ dddZ ddZ ddZ dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. cCsi|_i|_i|_dS)N)adjacency_list reverse_listr)r r!r!r"r#.szDependencyGraph.__init__cCsg|j|<g|j|<dS)zAdd the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` N)rr)r distributionr!r!r"add_distribution3s z DependencyGraph.add_distributionNcCs6|j|j||f||j|kr2|j|j|dS)aAdd an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` N)rr'r)r xylabelr!r!r"add_edge=s zDependencyGraph.add_edgecCs&tjd|||jj|gj|dS)a Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` z %s missing %rN)rMrNrr%r')r rrr!r!r" add_missingLszDependencyGraph.add_missingcCsd|j|jfS)Nz%s %s)rr])r r(r!r!r" _repr_distWszDependencyGraph._repr_distrcCs|j|g}xv|j|D]h\}}|j|}|dk r>d||f}|jd|t||j||d}|jd}|j|ddqWdj|S)zPrints only a subgraphNz%s [%s]z rr)rrr'r repr_noderextendrI)r r(leveloutputrr Z suboutputZsubsr!r!r"rZs    zDependencyGraph.repr_nodeTcCsg}|jdx||jjD]n\}}t|dkr>| r>|j|xH|D]@\}}|dk rn|jd|j|j|fqD|jd|j|jfqDWqW| rt|dkr|jd|jd|jdx&|D]}|jd |j|jd qW|jd |jd dS) a9Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` zdigraph dependencies { rNz"%s" -> "%s" [label="%s"] z "%s" -> "%s" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rz} )rritemsrr'r)r rZskip_disconnectedZ disconnectedr(adjsrr r!r!r"to_dotgs&        zDependencyGraph.to_dotcsg}i}x&|jjD]\}}|dd||<qWxgx4t|jddD]\}}|sLj|||=qLWsrPx*|jD]\}}fdd|D||<q|WtjdddD|jq2W|t|jfS)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. Ncs g|]\}}|kr||fqSr!r!)rrsrS) to_remover!r"rsz4DependencyGraph.topological_sort..zMoving to result: %scSsg|]}d|j|jfqS)z%s (%s))rr])rrsr!r!r"rs)rrlistr'rMrNrkeys)r rbZalistkrtr!)rr"topological_sorts$  z DependencyGraph.topological_sortcCs6g}x&|jjD]\}}|j|j|qWdj|S)zRepresentation of the graphr)rrr'rrI)r rr(rr!r!r"rszDependencyGraph.__repr__)N)r)T) r*r+r,r-r#r r rrrrrrr!r!r!r"rs   rr.cCsft|}t}i}xX|D]P}|j|x@|jD]6}t|\}}tjd||||j|gj||fq.WqWx|D]}|j |j B|j B|j B}x|D]} y|j | } Wn6tk rtjd| | jd}|j |} YnX| j}d} ||krJxV||D]J\}} y| j|} Wntk r,d} YnX| r|j|| | d} PqW| s|j|| qWqrW|S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %sz+could not read version %r - using name onlyrFT)rrr rfrrMrNr%r'rrrrrdrrrr&rgr r)distsr=graphrhr(rirr]rrrdZmatchedZproviderrgr!r!r" make_graphsD         rcCs~||krtd|jt|}|g}|j|}x@|rn|j}|j|x$|j|D]}||krR|j|qRWq0W|jd|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested z1given distribution %r is not a member of the listr)rrrrpopr')rr(rZdeptodorsZsuccr!r!r"get_dependent_distss    r!cCsv||krtd|jt|}g}|j|}xD|rp|jd}|j|x$|j|D]}||krT|j|qTWq.W|S)zRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested z1given distribution %r is not a member of the listr)rrrrrr')rr(rrr rsZpredr!r!r"get_required_distss    r"cKs4|jdd}tf|}||_||_|p(d|_t|S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summary)rr rr]r#r)rr]kwargsr#rr!r!r" make_dists    r%)r.)6r-Z __future__rrrrJrZloggingrrHr/rr:rrcompatrr]rrr>r r r utilr r rrrrr__all__Z getLoggerr*rMrZCOMMANDS_FILENAMErrGrrrrrrrrOrPrrr!r"r%r!r!r!r"sV  $  l7GM 6PK!^N*N*$__pycache__/resources.cpython-36.pycnu[3 Pf*@sddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl m Z ddl mZmZmZmZejeZdaGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZedee jeiZyFy ddl Z!Wne"k r$ddl#Z!YnXeee!j$<eee!j%<[!Wne"e&fk rXYnXddZ'iZ(ddZ)e j*e+dZ,ddZ-dS))unicode_literalsN)DistlibException)cached_propertyget_cache_basepath_to_cache_dirCachecs.eZdZdfdd ZddZddZZS) ResourceCacheNcs0|dkrtjjttd}tt|j|dS)Nzresource-cache)ospathjoinrstrsuperr __init__)selfbase) __class__/usr/lib/python3.6/resources.pyrszResourceCache.__init__cCsdS)z Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Tr)rresourcer rrris_stale#s zResourceCache.is_stalec Cs|jj|\}}|dkr|}n~tjj|j|j||}tjj|}tjj|sXtj |tjj |sjd}n |j ||}|rt |d}|j |jWdQRX|S)z Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTwb)finderget_cache_infor r r rZ prefix_to_dirdirnameisdirmakedirsexistsropenwritebytes)rrprefixr resultrZstalefrrrget.s      zResourceCache.get)N)__name__ __module__ __qualname__rrr$ __classcell__rr)rrr s r c@seZdZddZdS) ResourceBasecCs||_||_dS)N)rname)rrr*rrrrIszResourceBase.__init__N)r%r&r'rrrrrr)Hsr)c@s@eZdZdZdZddZeddZeddZed d Z d S) Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. FcCs |jj|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_stream)rrrr as_streamVszResource.as_streamcCstdkrtatj|S)N)cacher r$)rrrr file_path_szResource.file_pathcCs |jj|S)N)r get_bytes)rrrrr fszResource.bytescCs |jj|S)N)rget_size)rrrrsizejsz Resource.sizeN) r%r&r'__doc__ is_containerr-rr/r r2rrrrr+Ns   r+c@seZdZdZeddZdS)ResourceContainerTcCs |jj|S)N)r get_resources)rrrr resourcesrszResourceContainer.resourcesN)r%r&r'r4rr7rrrrr5osr5c@seZdZdZejjdrdZnd ZddZdd Z d d Z d d Z ddZ ddZ ddZddZddZddZddZeejjZddZdS)!ResourceFinderz4 Resource finder for file system resources. java.pyc.pyo.classcCs.||_t|dd|_tjjt|dd|_dS)N __loader____file__)modulegetattrloaderr r rr)rr@rrrrszResourceFinder.__init__cCs tjj|S)N)r r realpath)rr rrr _adjust_pathszResourceFinder._adjust_pathcCsBt|trd}nd}|j|}|jd|jtjj|}|j|S)N//r) isinstancer splitinsertrr r r rD)r resource_nameseppartsr"rrr _make_paths   zResourceFinder._make_pathcCs tjj|S)N)r r r)rr rrr_findszResourceFinder._findcCs d|jfS)N)r )rrrrrrszResourceFinder.get_cache_infocCsD|j|}|j|sd}n&|j|r0t||}n t||}||_|S)N)rMrN _is_directoryr5r+r )rrJr r"rrrfinds     zResourceFinder.findcCs t|jdS)Nrb)rr )rrrrrr,szResourceFinder.get_streamc Cs t|jd }|jSQRXdS)NrQ)rr read)rrr#rrrr0szResourceFinder.get_bytescCstjj|jS)N)r r getsize)rrrrrr1szResourceFinder.get_sizecs*fddtfddtj|jDS)Ncs|dko|jj S)N __pycache__)endswithskipped_extensions)r#)rrrallowedsz-ResourceFinder.get_resources..allowedcsg|]}|r|qSrr).0r#)rWrr sz0ResourceFinder.get_resources..)setr listdirr )rrr)rWrrr6s zResourceFinder.get_resourcescCs |j|jS)N)rOr )rrrrrr4szResourceFinder.is_containerccs|j|}|dk r|g}xn|r|jd}|V|jr|j}xH|jD]>}|sP|}ndj||g}|j|}|jrz|j|qB|VqBWqWdS)NrrF)rPpopr4r*r7r append)rrJrZtodoZrnamer*new_nameZchildrrriterators      zResourceFinder.iteratorN)r:r;r<)r:r;)r%r&r'r3sysplatform startswithrVrrDrMrNrrPr,r0r1r6r4 staticmethodr r rrOr_rrrrr8ws"    r8cs`eZdZdZfddZddZddZdd Zd d Zd d Z ddZ ddZ ddZ Z S)ZipResourceFinderz6 Resource finder for resources in .zip files. csZtt|j||jj}dt||_t|jdr>|jj|_n t j ||_t |j|_ dS)Nr_files) rrdrrBarchivelen prefix_lenhasattrre zipimport_zip_directory_cachesortedindex)rr@rf)rrrrs   zZipResourceFinder.__init__cCs|S)Nr)rr rrrrDszZipResourceFinder._adjust_pathc Cs||jd}||jkrd}nX|r:|dtjkr:|tj}tj|j|}y|j|j|}Wntk rtd}YnX|stj d||j j ntj d||j j |S)NTrFz_find failed: %r %rz_find worked: %r %r) rhrer rKbisectrmrb IndexErrorloggerdebugrBr!)rr r"irrrrNs   zZipResourceFinder._findcCs&|jj}|jdt|d}||fS)Nr)rBrfr rg)rrr!r rrrrsz ZipResourceFinder.get_cache_infocCs|jj|jS)N)rBget_datar )rrrrrr0szZipResourceFinder.get_bytescCstj|j|S)N)ioBytesIOr0)rrrrrr,szZipResourceFinder.get_streamcCs|j|jd}|j|dS)N)r rhre)rrr rrrr1szZipResourceFinder.get_sizecCs|j|jd}|r,|dtjkr,|tj7}t|}t}tj|j|}xV|t|jkr|j|j|sjP|j||d}|j |j tjdd|d7}qJW|S)Nrrrn) r rhr rKrgrZrormrbaddrH)rrr Zplenr"rssrrrr6s  zZipResourceFinder.get_resourcesc Csj||jd}|r*|dtjkr*|tj7}tj|j|}y|j|j|}Wntk rdd}YnX|S)NrFrn)rhr rKrormrbrp)rr rsr"rrrrOs  zZipResourceFinder._is_directory)r%r&r'r3rrDrNrr0r,r1r6rOr(rr)rrrds rdcCs|tt|<dS)N)_finder_registrytype)rB finder_makerrrrregister_finder0sr}cCs|tkrt|}nv|tjkr$t|tj|}t|dd}|dkrJtdt|dd}tjt|}|dkrxtd|||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packager=zUnable to locate finder for %r) _finder_cacher`modules __import__rArrzr$r{)packager"r@r rBr|rrrr6s      rZ __dummy__cCsRd}tj|tjj|}tjt|}|rNt}tj j |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. Nr?) pkgutilZ get_importerr`path_importer_cacher$rzr{ _dummy_moduler r r r>r=)r r"rBrr@rrrfinder_for_pathRs  r).Z __future__rroruZloggingr rZshutilr`typesrjr?rutilrrrrZ getLoggerr%rqr.r objectr)r+r5r8rdr{ zipimporterrz_frozen_importlib_externalZ_fi ImportError_frozen_importlibSourceFileLoader FileFinderAttributeErrorr}rr ModuleTyper rrrrrrsH   ,!ZN    PK!|#__pycache__/__init__.cpython-36.pycnu[3 PfE @snddlZdZGdddeZyddlmZWn&ek rRGdddejZYnXejeZ e j edS)Nz0.2.4c@s eZdZdS)DistlibExceptionN)__name__ __module__ __qualname__rr/usr/lib/python3.6/__init__.pyr sr) NullHandlerc@s$eZdZddZddZddZdS)rcCsdS)Nr)selfrecordrrrhandleszNullHandler.handlecCsdS)Nr)r r rrremitszNullHandler.emitcCs d|_dS)N)lock)r rrr createLockszNullHandler.createLockN)rrrr r rrrrrrsr) Zlogging __version__ Exceptionrr ImportErrorZHandlerZ getLoggerrZloggerZ addHandlerrrrrs PK!|)__pycache__/__init__.cpython-36.opt-1.pycnu[3 PfE @snddlZdZGdddeZyddlmZWn&ek rRGdddejZYnXejeZ e j edS)Nz0.2.4c@s eZdZdS)DistlibExceptionN)__name__ __module__ __qualname__rr/usr/lib/python3.6/__init__.pyr sr) NullHandlerc@s$eZdZddZddZddZdS)rcCsdS)Nr)selfrecordrrrhandleszNullHandler.handlecCsdS)Nr)r r rrremitszNullHandler.emitcCs d|_dS)N)lock)r rrr createLockszNullHandler.createLockN)rrrr r rrrrrrsr) Zlogging __version__ Exceptionrr ImportErrorZHandlerZ getLoggerrZloggerZ addHandlerrrrrs PK!hQ2i2i)__pycache__/metadata.cpython-36.opt-1.pycnu[3 Pf@sdZddlmZddlZddlmZddlZddlZddlZddl m Z m Z ddl m Z mZmZddlmZdd lmZmZdd lmZmZejeZGd d d e ZGd dde ZGddde ZGddde ZdddgZdZ dZ!ej"dZ#ej"dZ$dGZ%dHZ&dIZ'dJZ(dKZ)dLZ*dMZ+e,Z-e-j.e%e-j.e&e-j.e(e-j.e*ej"d8Z/d9d:Z0d;d<Z1ddddd%ddd d!d"d#d+d,d$d&d'd-d/d0d5d1d2d*d)d(d.d3d4d6d7d=Z2dNZ3dOZ4dPZ5dQZ6dRZ7dSZ8dTZ9e:Z;ej"d>ZdDZ?dEZ@GdFdde:ZAdS)VzImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REc@seZdZdZdS)MetadataMissingErrorzA required metadata is missingN)__name__ __module__ __qualname____doc__rr/usr/lib/python3.6/metadata.pyrsrc@seZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.N)rrrrrrrrr src@seZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.N)rrrrrrrrr$src@seZdZdZdS)MetadataInvalidErrorzA metadata value is invalidN)rrrrrrrrr(srMetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONzutf-8z1.1z \|z Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicenseSupported-Platform Classifier Download-URL ObsoletesProvidesRequires MaintainerMaintainer-emailObsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-ExternalPrivate-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extraz"extra\s*==\s*("([^"]+)"|'([^']+)')cCs<|dkr tS|dkrtS|dkr$tS|dkr0tSt|dS)Nz1.0z1.1z1.2z2.0) _241_FIELDS _314_FIELDS _345_FIELDS _426_FIELDSr)versionrrr_version2fieldlistgsr?c Csdd}g}x.|jD]"\}}|gddfkr.q|j|qWddddg}xt|D]l}|tkrld|krl|jd|tkrd|kr|jd|tkrd|kr|jd|tkrNd|krN|jdqNWt|d kr|d St|d krtd d|ko||t }d|ko ||t }d|ko||t }t |t |t |d krFtd | rl| rl| rlt |krlt S|rvdS|rdSdS) z5Detect the best version depending on the fields used.cSsx|D]}||krdSqWdS)NTFr)keysmarkersmarkerrrr _has_markerus z"_best_version.._has_markerUNKNOWNNz1.0z1.1z1.2z2.0rrzUnknown metadata setz(You used incompatible 1.1/1.2/2.0 fields)itemsappendr:remover;r<r=lenr _314_MARKERS _345_MARKERS _426_MARKERSintr) fieldsrCr@keyvalueZpossible_versionsZis_1_1Zis_1_2Zis_2_0rrr _best_versionssB        rP)metadata_versionnamer>platformZsupported_platformsummary descriptionkeywords home_pageauthor author_email maintainermaintainer_emaillicense classifier download_urlobsoletes_dist provides_dist requires_distsetup_requires_distrequires_pythonrequires_externalrequiresprovides obsoletes project_urlZprivate_versionZ obsoleted_by extensionZprovides_extraz[^A-Za-z0-9.]+FcCs0|r$tjd|}tjd|jdd}d||fS)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.- .z%s-%s) _FILESAFEsubreplace)rRr>Z for_filenamerrr_get_name_and_versions rpc@s eZdZdZd?ddZddZdd Zd d Zd d ZddZ ddZ ddZ ddZ ddZ ddZd@ddZddZdd Zd!d"Zd#d$ZdAd%d&ZdBd'd(ZdCd)d*Zd+d,Zefd-d.ZdDd/d0ZdEd1d2Zd3d4Zd5d6Zd7d8Zd9d:Zd;d<Z d=d>Z!dS)FLegacyMetadataaaThe legacy metadata of a release. Supports versions 1.0, 1.1 and 1.2 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcCsz|||gjddkrtdi|_g|_d|_||_|dk rH|j|n.|dk r\|j|n|dk rv|j||j dS)Nz'path, fileobj and mapping are exclusive) count TypeError_fieldsZrequires_filesZ _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrwrrr__init__s   zLegacyMetadata.__init__cCst|j|jd<dS)NzMetadata-Version)rPrv)r|rrrr{sz#LegacyMetadata.set_metadata_versioncCs|jd||fdS)Nz%s: %s )write)r|r~rRrOrrr _write_field szLegacyMetadata._write_fieldcCs |j|S)N)get)r|rRrrr __getitem__szLegacyMetadata.__getitem__cCs |j||S)N)set)r|rRrOrrr __setitem__szLegacyMetadata.__setitem__c Cs8|j|}y |j|=Wntk r2t|YnXdS)N) _convert_namervKeyError)r|rR field_namerrr __delitem__s   zLegacyMetadata.__delitem__cCs||jkp|j||jkS)N)rvr)r|rRrrr __contains__s zLegacyMetadata.__contains__cCs(|tkr |S|jddj}tj||S)Nrj_) _ALL_FIELDSrolower _ATTR2FIELDr)r|rRrrrrszLegacyMetadata._convert_namecCs|tks|tkrgSdS)NrD) _LISTFIELDS_ELEMENTSFIELD)r|rRrrr_default_value%szLegacyMetadata._default_valuecCs&|jdkrtjd|Stjd|SdS)N1.01.1 )rr)rQ_LINE_PREFIX_PRE_1_2rn_LINE_PREFIX_1_2)r|rOrrr_remove_line_prefix*s  z"LegacyMetadata._remove_line_prefixcCs|tkr||St|dS)N)rAttributeError)r|rRrrr __getattr__0szLegacyMetadata.__getattr__FcCst|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.rr)rp)r|Zfilesaferrr get_fullname;szLegacyMetadata.get_fullnamecCs|j|}|tkS)z+return True if name is a valid metadata key)rr)r|rRrrris_fieldAs zLegacyMetadata.is_fieldcCs|j|}|tkS)N)rr)r|rRrrris_multi_fieldFs zLegacyMetadata.is_multi_fieldc Cs.tj|ddd}z|j|Wd|jXdS)z*Read the metadata values from a file path.rzutf-8)encodingN)codecsopenryclose)r|filepathfprrrrxJszLegacyMetadata.readcCst|}|d|jd<xxtD]p}||kr*q|tkrh|j|}|tkrZ|dk rZdd|D}|j||q||}|dk r|dkr|j||qW|jdS)z,Read the metadata values from a file object.zmetadata-versionzMetadata-VersionNcSsg|]}t|jdqS),)tuplesplit).0rOrrr _sz,LegacyMetadata.read_file..rD)rrvrrZget_all_LISTTUPLEFIELDSrr{)r|ZfileobmsgfieldvaluesrOrrrryRs  zLegacyMetadata.read_filec Cs0tj|ddd}z|j||Wd|jXdS)z&Write the metadata fields to filepath.wzutf-8)rN)rr write_filer)r|r skip_unknownrrrrrhszLegacyMetadata.writecCs|jxt|dD]}|j|}|r:|dgdgfkr:q|tkrX|j||dj|q|tkr|dkr|jd kr|jdd}n |jdd }|g}|t krd d |D}x|D]}|j|||qWqWd S)z0Write the PKG-INFO format data to a file object.zMetadata-VersionrDrr!1.01.1rz z |cSsg|]}dj|qS)r)join)rrOrrrrsz-LegacyMetadata.write_file..N)rr) r{r?rrrrrrQror)r|Z fileobjectrrrrOrrrrps$    zLegacyMetadata.write_filec sfdd}|snHt|dr>x<|jD]}||||q&Wnx|D]\}}|||qDW|r~x|jD]\}}|||qhWdS)aSet metadata values from the given iterable `other` and kwargs. Behavior is like `dict.update`: If `other` has a ``keys`` method, they are looped over and ``self[key]`` is assigned ``other[key]``. Else, ``other`` is an iterable of ``(key, value)`` iterables. Keys that don't match a metadata field or that have an empty value are dropped. cs"|tkr|rjj||dS)N)rrr)rNrO)r|rr_sets z#LegacyMetadata.update.._setr@N)hasattrr@rE)r|otherkwargsrkvr)r|rrzs  zLegacyMetadata.updatecCsn|j|}|tks|dkrPt|ttf rPt|trJdd|jdD}q~g}n.|tkr~t|ttf r~t|trz|g}ng}tj t j rB|d}t |j }|tkr|dk rx|D](}|j|jddstjd |||qWn`|tko|dk r|j|sBtjd |||n0|tkrB|dk rB|j|sBtjd ||||tkr`|d kr`|j|}||j|<dS) z"Control then set a metadata field.rcSsg|] }|jqSr)strip)rrrrrrsz&LegacyMetadata.set..rrN;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r!)rr isinstancelistrrrrloggerZ isEnabledForloggingZWARNINGr rw_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrrv)r|rRrOZ project_namerwrrrrrs@            zLegacyMetadata.setcCs|j|}||jkr*|tkr&|j|}|S|tkr@|j|}|S|tkr|j|}|dkr^gSg}x6|D].}|tkr|j|qh|j|d|dfqhW|S|tkr|j|}t |t r|j dS|j|S)zGet a metadata field.Nrrr) rrv_MISSINGrrrrrFrrrr)r|rRrrrOresvalrrrrs.          zLegacyMetadata.getc s |jgg}}xd D]}||kr|j|qW|rT|gkrTddj|}t|xdD]}||krZ|j|qZW|ddkr||fSt|jfd d }xdt|ftjft j ffD]F\}}x<|D]4} |j | d } | d k o||  r|jd | | fqWqW||fS)zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are providedrrzmissing required metadata: %sz, Home-pager$zMetadata-Versionz1.2cs*x$|D]}j|jddsdSqWdS)NrrFT)rr)rOr)rwrrare_valid_constraintss z3LegacyMetadata.check..are_valid_constraintsNzWrong value for '%s': %s)rr)rr$) r{rFrrr rwrrrrrr) r|strictmissingwarningsattrrrrMZ controllerrrOr)rwrchecks2         zLegacyMetadata.checkcCs|jdB}i}x,|D]$\}}| s.||jkr||||<qW|ddkrdK}x|D]F\}}| sn||jkrV|d&kr||||<qVd,d-||D||<qVWnF|dd.krdO}x2|D]*\}}| s||jkr||||<qW|S)PzReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). rQMetadata-VersionrRrr>rrTr rW Home-pagerXr$rY Author-emailr\r&rUr!rVr"rSr classifiersr(r^ Download-URLz1.2ra Requires-DistrcRequires-PythonrdRequires-Externalr` Provides-Distr_Obsoletes-Distrh Project-URLrZr-r[Maintainer-emailcSsg|]}dj|qS)r)r)rurrrrGsz)LegacyMetadata.todict..z1.1rfr+rer,rgr*rQrrRrr>rrTr rWrrXr$rYrr\r&rUr!rVr"rSrrr(r^r) rrrrrrrrrrrrrrarrcrrdrr`rr_rrhrrZr-r[r)rrrrrrrrrfr+rer,rgr*)rrr)r{rv)r|Z skip_missingZ mapping_1_0datarNrZ mapping_1_2Z mapping_1_1rrrtodictsP zLegacyMetadata.todictcCs<|ddkr(xdD]}||kr||=qW|d|7<dS)NzMetadata-Versionz1.1r*r,r+z Requires-Dist)r*r,r+r)r| requirementsrrrradd_requirementsUs    zLegacyMetadata.add_requirementscCstt|dS)NzMetadata-Version)rr?)r|rrrr@`szLegacyMetadata.keysccsx|jD] }|Vq WdS)N)r@)r|rNrrr__iter__cszLegacyMetadata.__iter__csfddjDS)Ncsg|] }|qSrr)rrN)r|rrrhsz)LegacyMetadata.values..)r@)r|r)r|rrgszLegacyMetadata.valuescsfddjDS)Ncsg|]}||fqSrr)rrN)r|rrrksz(LegacyMetadata.items..)r@)r|r)r|rrEjszLegacyMetadata.itemscCsd|jj|j|jfS)Nz <%s %s %s>) __class__rrRr>)r|rrr__repr__ms zLegacyMetadata.__repr__)NNNrr)F)F)F)N)F)F)"rrrrrr{rrrrrrrrrrrrrxryrrrzrrrrrrr@rrrErrrrrrqs>      ,  , ; rqz pydist.jsonz metadata.jsonc@seZdZdZejdZejdejZe Z ejdZ dZ de ZffdIdZd Zd ZeffedJfe dKfe dLfd ZdMZdNddZedOZdefZdefZdefdefeeedefeeeedefdPdQd Z[[dd ZdRd!d"Zd#d$Zed%d&Z ed'd(Z!e!j"d)d(Z!dSd*d+Z#ed,d-Z$ed.d/Z%e%j"d0d/Z%d1d2Z&d3d4Z'd5d6Z(d7d8Z)d9d:d;dZ*d?d@Z+dTdCdDZ,dEdFZ-dGdHZ.dS)Urz The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z .{1,2047}z2.0z distlib (%s)legacy)rRr>rTzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)rQrRr>rT_legacy_datarwNrrcCs0|||gjddkrtdd|_d|_||_|dk rzy|j||||_Wn*tk rvt||d|_|jYnXnd}|rt |d}|j }WdQRXn |r|j }|dkr|j |j d|_ndt |ts|jd}ytj||_|j|j|Wn0tk r*tt||d|_|jYnXdS)Nrsz'path, fileobj and mapping are exclusive)rrwrb)rQ generatorzutf-8)r~rw)rtrurrrw_validate_mappingrrqvalidaterrxMETADATA_VERSION GENERATORrr decodejsonloads ValueErrorr)r|r}r~rrwrfrrrrs<       zMetadata.__init__rRr>r\rVrTz Requires-DistzSetup-Requires-DistzProvides-Extrar( Download-URLMetadata-Version) run_requiresbuild_requires dev_requiresZ test_requires meta_requiresextrasmodules namespacesexportscommandsrZ source_urlrQc CsZtj|d}tj|d}||kr||\}}|jr^|dkrP|dkrHdn|}n |jj|}n|dkrjdn|}|d kr|jj||}nt}|}|jjd} | r |dkr| jd |}nR|dkr| jd } | r| j||}n.| jd } | s|jjd } | r | j||}||krV|}n:||kr4tj||}n"|jrJ|jj|}n |jj|}|S) N common_keys mapped_keysrrrrr extensionszpython.commandszpython.detailszpython.exports)rrrrr)object__getattribute__rrr) r|rNcommonmappedlkZmakerresultrOsentineldrrrrsF            zMetadata.__getattribute__cCsH||jkrD|j|\}}|p |j|krD|j|}|sDtd||fdS)Nz.'%s' is an invalid value for the '%s' property)SYNTAX_VALIDATORSrwmatchr)r|rNrOrwpattern exclusionsmrrr_validate_values  zMetadata._validate_valuecCs*|j||tj|d}tj|d}||kr||\}}|jrV|dkrJt||j|<nf|d krj||j|<nR|jjdi}|dkr||d <n2|dkr|jd i}|||<n|jd i}|||<nh||krtj|||nP|d krt|t r|j }|r|j }ng}|jr||j|<n ||j|<dS)Nrrrrrrrrzpython.commandszpython.detailszpython.exportsrV)rrrrr) r'rrrNotImplementedErrorr setdefault __setattr__rrrr)r|rNrOrrrrr!rrrr*s>               zMetadata.__setattr__cCst|j|jdS)NT)rprRr>)r|rrrname_and_version@szMetadata.name_and_versioncCsF|jr|jd}n|jjdg}d|j|jf}||krB|j||S)Nz Provides-Distrfz%s (%s))rrr)rRr>rF)r|rsrrrrfDs  zMetadata.providescCs |jr||jd<n ||jd<dS)Nz Provides-Distrf)rr)r|rOrrrrfOs c Cs|jr |}ng}t|pg|j}xl|D]d}d|kr@d|kr@d}n8d|krNd}n|jd|k}|rx|jd}|rxt||}|r&|j|dq&WxNd D]F}d|} | |kr|j| |jjd |g}|j|j|||d qW|S) a Base method to get dependencies, given a set of extras to satisfy and an optional environment context. :param reqts: A list of sometimes-wanted dependencies, perhaps dependent on extras and environment. :param extras: A list of optional components being requested. :param env: An optional environment for marker evaluation. extra environmentTrebuilddevtestz:%s:z %s_requires)renv)r/r0r1) rr rrr extendrGrget_requirements) r|reqtsrr2rr!includerBrNerrrr4Vs0       zMetadata.get_requirementscCs|jr|jS|jS)N)r _from_legacyr)r|rrr dictionaryszMetadata.dictionarycCs|jr tnt|j|jSdS)N)rr(r rDEPENDENCY_KEYS)r|rrr dependenciesszMetadata.dependenciescCs|jr tn |jj|dS)N)rr(rrz)r|rOrrrr;sc Cs|jd|jkrtg}x0|jjD]"\}}||kr&||kr&|j|q&W|rfddj|}t|x"|jD]\}}|j|||qpWdS)NrQzMissing metadata items: %sz, ) rrrMANDATORY_KEYSrErFrrr') r|rrwrrNr%rrrrrrrszMetadata._validate_mappingcCsB|jr.|jjd\}}|s|r>tjd||n|j|j|jdS)NTz#Metadata: missing: %s, warnings: %s)rrrrrrrw)r|rrrrrrs  zMetadata.validatecCs(|jr|jjdSt|j|j}|SdS)NT)rrr r INDEX_KEYS)r|rrrrrs zMetadata.todictc Cs|j|jd}|jjd}x2dD]*}||kr |dkr:d }n|}||||<q W|jd g}|d gkrhg}||d <d}x2|D]*\}}||krz||rzd||ig||<qzW|j|d<i}i} |S)N)rQrTrRr>r\rTrUr]rr"rVrarrbrrerf)rRr>r\rTrUr]rarrbr)r?r@)rrrrrrf) r|rZlmdrnkkwr@okrXrZrrrr8s.     zMetadata._from_legacyrrr&r r!)rRr>r\rTrUrcCsdd}t}|j}x*|jjD]\}}||kr ||||<q W||j|j}||j|j}|jrtt |j|d<t ||d<t ||d<|S)NcSst}x|D]}|jd}|jd}|d}xb|D]Z}| rN| rN|j|q2d}|r^d|}|rx|rtd||f}n|}|jdj||fq2Wq W|S)Nr-r.rer>z extra == "%s"z (%s) and %sr)rraddr)Zentriesr5r7r-r2ZrlistrrBrrrprocess_entriess"      z,Metadata._to_legacy..process_entrieszProvides-Extraz Requires-DistzSetup-Requires-Dist) rqrLEGACY_MAPPINGrErrrrrsorted)r|rErZnmdrArCZr1Zr2rrr _to_legacys  zMetadata._to_legacyFTcCs||gjddkrtd|j|r`|jr4|j}n|j}|rP|j||dq|j||dn^|jrp|j}n|j}|rt j ||ddddn.t j |dd}t j ||ddddWdQRXdS) Nrz)Exactly one of path and fileobj is needed)rTrs)Z ensure_asciiindentZ sort_keysrzutf-8) rtr rrrHrrr8rrdumprr)r|r}r~rrZ legacy_mdr!r rrrrs&    zMetadata.writecCs|jr|jj|nt|jjdg}d}x"|D]}d|kr,d|kr,|}Pq,W|dkrhd|i}|jd|n t|dt|B}t||d<dS)Nrr.r-rer)rrrr)insertrrG)r|rralwaysentryZrsetrrrrs zMetadata.add_requirementscCs*|jpd}|jpd}d|jj|j||fS)Nz (no name)z no versionz<%s %s %s (%s)>)rRr>rrrQ)r|rRr>rrrr(s  zMetadata.__repr__)r)r)r)r)rrrw)NNNrr)rRr>r\rVrT)r N)r N)N)NN)NNFT)/rrrrrecompileZMETADATA_VERSION_MATCHERIZ NAME_MATCHERrZVERSION_MATCHERZSUMMARY_MATCHERrrrr<r=r:r" __slots__rrrrZ none_listdictZ none_dictrrr'r*propertyr+rfsetterr4r9r;rrrr8rFrHrrrrrrrrvsx    ,+ '   *   % ) rrrrr r!r"r#r$r%r&)rrrrr'r r!r"r#r$r%r&r(r)r*r+r,)r*r+r,r(r))rrrrr'r r!r"r#r$r%r-r.r&r(r)r/r0r1r2r3r4)r1r2r3r/r4r-r.r0)rrrrr'r r!r"r#r$r%r-r.r&r(r)r/r0r1r2r3r4r5r6r7r8r9)r5r9r6r7r8)r2r/r1)r3)r)rr(r*r,r+r/r1r2r4r0r'r7r9r8)r0)r")r$r-r r!)F)BrZ __future__rrZemailrrrrNr>rrcompatrrr rAr utilr r r>r rZ getLoggerrrrrrr__all__rrrOrrr:r;rIr<rJr=rKrrrzZEXTRA_REr?rPrrrrrrrrrrrmrprqZMETADATA_FILENAMEZWHEEL_METADATA_FILENAMErrrrr s             9   PK!Ku{aFF"__pycache__/markers.cpython-36.pycnu[3 Pf@sddZddlZddlZddlZddlZddlmZmZddlm Z dgZ Gddde Z d d dZ dS) zEParser for the environment markers micro-language defined in PEP 345.N)python_implementation string_types)in_venv interpretc @seZdZdZddddddddddddd dd dd dd Zejd ejddejj ddde j e e ejejejed Zd*ddZddZddZd+ddZddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)ZdS), Evaluatorz5 A limited evaluator for Python expressions. cCs||kS)N)xyrr/usr/lib/python3.6/markers.pyszEvaluator.cCs||kS)Nr)r r rrr r scCs||kS)Nr)r r rrr r scCs||kS)Nr)r r rrr r scCs||kS)Nr)r r rrr r scCs||kS)Nr)r r rrr r scCs| S)Nr)r rrr r scCs||kS)Nr)r r rrr r !scCs||kS)Nr)r r rrr r "s) eqgtZgteinltZltenotZnoteqZnotinz%s.%sN rr) Z sys_platformZpython_versionZpython_full_versionZos_nameZplatform_in_venvZplatform_releaseZplatform_versionZplatform_machineZplatform_python_implementationcCs|pi|_d|_dS)zu Initialise an instance. :param context: If specified, names are looked up in this mapping. N)contextsource)selfrrrr __init__3s zEvaluator.__init__cCs8d}d|j|||}||t|jkr4|d7}|S)zH Get the part of the source which is causing a problem. z%rz...)rlen)roffsetZ fragment_lensrrr get_fragment<s zEvaluator.get_fragmentcCst|d|dS)z@ Get a handler for the specified AST node type. zdo_%sN)getattr)r node_typerrr get_handlerFszEvaluator.get_handlercCst|trr||_ddi}|r$||d<ytj|f|}Wn:tk rp}z|j|j}td|WYdd}~XnX|jj j }|j |}|dkr|jdkrd}n |j|j }td||f||S)zf Evaluate a source string or node, using ``filename`` when displaying errors. modeevalfilenamezsyntax error %sNz(source not available)z don't know how to evaluate %r %s) isinstancerrastparse SyntaxErrorrr __class____name__lowerr col_offset)rnoder"kwargserrZhandlerrrr evaluateLs&       zEvaluator.evaluatecCs&t|tjstdd|jj|jfS)Nzattribute node expectedz%s.%s)r#r$Z AttributeAssertionErrorvalueidattr)rr+rrr get_attr_keyfszEvaluator.get_attr_keycCsft|jtjsd}n|j|}||jkp0||jk}|sBtd|||jkrX|j|}n |j|}|S)NFzinvalid expression: %s)r#r0r$Namer3rallowed_valuesr&)rr+validkeyresultrrr do_attributejs     zEvaluator.do_attributecCs|j|jd}|jjtjk}|jjtjk}|s8|s8t|r@|sJ|r| rx4|jddD]"}|j|}|rp|sz|rZ| rZPqZW|S)Nrr)r.valuesopr'r$ZOrZAndr/)rr+r8Zis_orZis_andnrrr do_boolopxs  zEvaluator.do_boolopc sfdd}j}j|}d}xntjjD]\\}}||||jjj}|jkrft d|j|}j|||}|sP|}|}q2W|S)Ncs@d}t|tjr t|tjr d}|s<jj}td|dS)NTFzInvalid comparison: %s)r#r$ZStrrr*r&)lhsnoderhsnoder6r)r+rrr sanity_checks  z*Evaluator.do_compare..sanity_checkTzunsupported operation: %r) leftr.zipZopsZ comparatorsr'r(r) operatorsr&) rr+r@r>Zlhsr8r;r?Zrhsr)r+rr do_compares        zEvaluator.do_comparecCs |j|jS)N)r.Zbody)rr+rrr do_expressionszEvaluator.do_expressioncCsTd}|j|jkr"d}|j|j}n|j|jkr>d}|j|j}|sPtd|j|S)NFTzinvalid expression: %s)r1rr5r&)rr+r6r8rrr do_names   zEvaluator.do_namecCs|jS)N)r)rr+rrr do_strszEvaluator.do_str)N)N)r( __module__ __qualname____doc__rCsysplatform version_infoversionsplitosnamestrrreleasemachinerr5rrrr.r3r9r=rDrErFrGrrrr rs<       rcCst|j|jS)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping )rr.strip)ZmarkerZexecution_contextrrr rs )N)rJr$rPrKrLcompatrrutilr__all__objectrrrrrr s "PK!ҐCC&__pycache__/index.cpython-36.opt-1.pycnu[3 Pf]R @sddlZddlZddlZddlZddlZddlZyddlmZWn ek r`ddl mZYnXddl m Z ddl m Z mZmZmZmZmZddlmZmZmZejeZdZdZGd d d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)cached_propertyzip_dir ServerProxyzhttps://pypi.python.org/pypipypic@seZdZdZdZd*ddZddZdd Zd d Zd d Z ddZ ddZ d+ddZ d,ddZ d-ddZd.ddZddZd/ddZd0d d!Zd1d"d#Zd$d%Zd&d'Zd2d(d)ZdS)3 PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc Cs|pt|_|jt|j\}}}}}}|s<|s<|s<|d krJtd|jd|_d|_d|_d|_d|_ t t j dR}xJd D]B} y(t j| dg||d } | d kr| |_PWq|tk rYq|Xq|WWdQRXdS) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. httphttpszinvalid repository: %sNwgpggpg2z --version)stdoutstderrr)rr)rr) DEFAULT_INDEXurlread_configurationrrpassword_handler ssl_verifierrgpg_home rpc_proxyopenosdevnull subprocessZ check_callOSError) selfrschemenetlocpathZparamsZqueryZfragZsinksrcr)/usr/lib/python3.6/index.py__init__$s(   zPackageIndex.__init__cCs&ddlm}ddlm}|}||S)zs Get the distutils command for interacting with PyPI configurations. :return: the command. r) Distribution) PyPIRCCommand)Zdistutils.corer,Zdistutils.configr-)r#r,r-dr)r)r*_get_pypirc_commandBs  z PackageIndex._get_pypirc_commandcCsR|j}|j|_|j}|jd|_|jd|_|jdd|_|jd|j|_dS)z Read the PyPI access configuration as supported by distutils, getting PyPI to do the actual work. This populates ``username``, ``password``, ``realm`` and ``url`` attributes from the configuration. usernamepasswordrealmr repositoryN)r/rr3Z _read_pypircgetr0r1r2)r#cZcfgr)r)r*rLs  zPackageIndex.read_configurationcCs$|j|j}|j|j|jdS)z Save the PyPI access configuration. You must have set ``username`` and ``password`` attributes before calling this method. Again, distutils is used to do the actual work. N)check_credentialsr/Z _store_pypircr0r1)r#r5r)r)r*save_configuration[szPackageIndex.save_configurationcCs\|jdks|jdkrtdt}t|j\}}}}}}|j|j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r0r1rrrrZ add_passwordr2rr)r#Zpm_r%r)r)r*r6gs zPackageIndex.check_credentialscCs\|j|j|j}d|d<|j|jg}|j|}d|d<|j|jg}|j|S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. Zverifyz:actionZsubmit)r6validatetodictencode_requestitems send_request)r#metadatar.requestZresponser)r)r*registerss  zPackageIndex.registercCsJx<|j}|sP|jdj}|j|tjd||fqW|jdS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. zutf-8z%s: %sN)readlinedecoderstripappendloggerdebugclose)r#namestreamZoutbufr'r)r)r*_readers  zPackageIndex._readercCs|jdddg}|dkr|j}|r.|jd|g|dk rF|jdddgtj}tjj|tjj|d }|jd d d |d ||gt j ddj|||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. z --status-fd2z--no-ttyNz --homedirz--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--outputz invoking: %s ) rrextendtempfileZmkdtemprr&joinbasenamerErF)r#filenamesigner sign_passwordkeystorecmdZtdZsfr)r)r*get_sign_commands zPackageIndex.get_sign_commandc Cstjtjd}|dk r tj|d<g}g}tj|f|}t|jd|j|fd}|jt|jd|j|fd}|j|dk r|jj ||jj |j |j |j |j ||fS)a Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. )rrNstdinr)targetargsr)r!PIPEPopenrrJrstartrrXwriterGwaitrP returncode) r#rVZ input_datakwargsrrpZt1Zt2r)r)r* run_commands$     zPackageIndex.run_commandc CsD|j||||\}}|j||jd\}}} |dkr@td||S)aR Sign a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The absolute pathname of the file where the signature is stored. zutf-8rz&sign command failed with error code %s)rWrcencoder) r#rRrSrTrUrVsig_filer(rrr)r)r* sign_files  zPackageIndex.sign_filesdistsourcecCs(|jtjj|s td||j|j}d} |rZ|jsJtj dn|j ||||} t |d} | j } WdQRXt j| j} t j| j} |jdd||| | ddtjj|| fg}| rt | d} | j }WdQRX|jd tjj| |ftjtjj| |j|j|}|j|S) a Upload a release file to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the file to be uploaded. :param filename: The pathname of the file to be uploaded. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param filetype: The type of the file being uploaded. This is the distutils command which produced that file, e.g. ``sdist`` or ``bdist_wheel``. :param pyversion: The version of Python which the release relates to. For code compatible with any Python, this would be ``source``, otherwise it would be e.g. ``3.2``. :param keystore: The path to a directory which contains the keys used in signing. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The HTTP response received from PyPI upon submission of the request. z not found: %sNz)no signing program available - not signedrbZ file_upload1)z:actionZprotocol_versionfiletype pyversion md5_digest sha256_digestcontentZ gpg_signature)r6rr&existsrr9r:rrEZwarningrfrreadhashlibmd5 hexdigestZsha256updaterQrDshutilZrmtreedirnamer;r<r=)r#r>rRrSrTrkrlrUr.refZ file_datarmrnfilesZsig_datar?r)r)r* upload_files>       zPackageIndex.upload_filec Cs|jtjj|s td|tjj|d}tjj|sFtd||j|j|j }}t |j }d d|fd|fg}d||fg}|j ||} |j | S) a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r:action doc_uploadrHversionro)r{r|)r6rr&isdirrrPrpr9rHr}r getvaluer;r=) r#r>Zdoc_dirfnrHr}Zzip_datafieldsryr?r)r)r*upload_documentation)s        z!PackageIndex.upload_documentationcCsT|jdddg}|dkr|j}|r.|jd|g|jd||gtjddj||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. z --status-fdrKz--no-ttyNz --homedirz--verifyz invoking: %srM)rrrNrErFrP)r#signature_filename data_filenamerUrVr)r)r*get_verify_commandEszPackageIndex.get_verify_commandcCsH|jstd|j|||}|j|\}}}|dkr@td||dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailablerrz(verify command failed with error code %s)rr)rrrrc)r#rrrUrVr(rrr)r)r*verify_signature]szPackageIndex.verify_signaturecCsp|dkrd}tjdn6t|ttfr0|\}}nd}tt|}tjd|t|d}|jt |}z|j } d} d} d} d} d | krt | d } |r|| | | xP|j | }|sP| t |7} |j||r|j|| d7} |r|| | | qWWd|jXWdQRX| dkr4| | kr4td | | f|rl|j}||kr`td ||||ftjd |dS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrszDigest specified: %swbi rrzcontent-lengthzContent-Lengthz1retrieval incomplete: got only %d out of %d bytesz.%s digest mismatch for %s: expected %s, got %szDigest verified: %s)rErF isinstancelisttuplegetattrrrrr=rinfointrqlenr^rurGrrt)r#rdestfileZdigestZ reporthookZdigesterZhasherZdfpZsfpheadersZ blocksizesizerqZblocknumblockactualr)r)r* download_filevsV             zPackageIndex.download_filecCs:g}|jr|j|j|jr(|j|jt|}|j|S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrDrr r)r#ZreqZhandlersopenerr)r)r*r=s  zPackageIndex.send_requestcCsg}|j}xX|D]P\}}t|ttfs,|g}x2|D]*}|jd|d|jdd|jdfq2WqWx6|D].\}} } |jd|d|| fjdd| fqjW|jd|ddfdj|} d|} | tt| d} t |j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"zutf-8z8Content-Disposition: form-data; name="%s"; filename="%s"s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrrNrdrPstrrrr)r#rrypartsrkvaluesvkeyrRvalueZbodyZctrr)r)r*r;s2     zPackageIndex.encode_requestcCs>t|trd|i}|jdkr,t|jdd|_|jj||p:dS)NrHg@)Ztimeoutand)rr rr rsearch)r#Ztermsoperatorr)r)r*rs   zPackageIndex.search)N)N)N)N)NNrgrhN)N)N)NN)N)__name__ __module__ __qualname____doc__rr+r/rr7r6r@rJrWrcrfrzrrrrr=r;rr)r)r)r*rs*      #  8   M+r)rrZloggingrrvr!rOZ threadingr ImportErrorZdummy_threadingrcompatrrrrr r utilr r r Z getLoggerrrErZ DEFAULT_REALMobjectrr)r)r)r*s    PK!o|7a7a&__pycache__/wheel.cpython-36.opt-1.pycnu[3 Pf˘@sddlmZddlZddlZddlZddlZddlmZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd l,m-Z-m.Z.e j/e0Z1da2e3ed r4d Z4n*ej5j6d rHdZ4nej5dkrZdZ4ndZ4ej7dZ8e8sdej9ddZ8de8Z:e4e8Z;ej"j<j=ddj=ddZ>ej7dZ?e?re?j6dre?j=ddZ?nddZ@e@Z?[@ejAdejBejCBZDejAdejBejCBZEejAdZFejAd ZGd!ZHd"ZIe jJd#kr>d$d%ZKnd&d%ZKGd'd(d(eLZMeMZNGd)d*d*eLZOd+d,ZPePZQ[Pd/d-d.ZRdS)0)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir)NormalizedVersionUnsupportedVersionErrorZpypy_version_infoZppjavaZjyZcliZipcppy_version_nodotz%s%spy-_.SOABIzcpython-cCsRdtg}tjdr|jdtjdr0|jdtjddkrH|jdd j|S) NrPy_DEBUGd WITH_PYMALLOCmZPy_UNICODE_SIZEu) VER_SUFFIXrget_config_varappendjoin)partsr//usr/lib/python3.6/wheel.py _derive_abi;s     r1zz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/cCs|S)Nr/)or/r/r0]sr4cCs|jtjdS)Nr2)replaceossep)r3r/r/r0r4_sc@s6eZdZddZddZddZd dd Zd d ZdS) MountercCsi|_i|_dS)N) impure_wheelslibs)selfr/r/r0__init__cszMounter.__init__cCs||j|<|jj|dS)N)r9r:update)r;pathname extensionsr/r/r0addgs z Mounter.addcCs4|jj|}x"|D]\}}||jkr|j|=qWdS)N)r9popr:)r;r>r?kvr/r/r0removeks  zMounter.removeNcCs||jkr|}nd}|S)N)r:)r;fullnamepathresultr/r/r0 find_moduleqs zMounter.find_modulecCsj|tjkrtj|}nP||jkr,td|tj||j|}||_|jdd}t|dkrf|d|_ |S)Nzunable to find extension for %sr!rr) sysmodulesr: ImportErrorimpZ load_dynamic __loader__rsplitlen __package__)r;rErGr.r/r/r0 load_modulexs       zMounter.load_module)N)__name__ __module__ __qualname__r<r@rDrHrQr/r/r/r0r8bs  r8c@seZdZdZd2ZdZd3ddZedd Zed d Z ed d Z e ddZ ddZ e ddZddZd4ddZddZddZddZd5ddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd6d*d+Zd,d-Zd.d/Zd7d0d1ZdS)8Wheelz@ Class to build and install from Wheel files (PEP 427). rZsha256NFcCs8||_||_d|_tg|_dg|_dg|_tj|_ |dkrRd|_ d|_ |j |_ ntj|}|r|jd}|d|_ |djd d |_ |d |_|j |_ ntjj|\}}tj|}|std ||rtjj||_ ||_ |jd}|d|_ |d|_ |d |_|d jd|_|djd|_|djd|_dS)zB Initialise an instance using a (valid) filename. r)noneanyNZdummyz0.1ZnmZvnr rZbnzInvalid name or filename: %rrr!Zbiar)signZ should_verifybuildverPYVERpyverabiarchr6getcwddirnamenameversionfilenameZ _filenameNAME_VERSION_REmatch groupdictr5rFsplit FILENAME_RErabspath)r;rcrYverifyr&infor`r/r/r0r<sB            zWheel.__init__cCs^|jrd|j}nd}dj|j}dj|j}dj|j}|jjdd}d|j|||||fS)zJ Build and return a filename from the various components. rr)r!r z%s-%s%s-%s-%s-%s.whl)rZr-r\r]r^rbr5ra)r;rZr\r]r^rbr/r/r0rcs     zWheel.filenamecCstjj|j|j}tjj|S)N)r6rFr-r`rcisfile)r;rFr/r/r0existssz Wheel.existsccs@x:|jD]0}x*|jD] }x|jD]}|||fVq WqWqWdS)N)r\r]r^)r;r\r]r^r/r/r0tagss   z Wheel.tagscCstjj|j|j}d|j|jf}d|}tjd}t |d}|j |}|dj dd}t dd |D}|d krzd } nt } y8tj|| } |j| } || } t| d } WdQRXWn tk rtd | YnXWdQRX| S)Nz%s-%sz %s.dist-infozutf-8rz Wheel-Versionr!rcSsg|] }t|qSr/)int).0ir/r/r0 sz"Wheel.metadata..ZMETADATA)Zfileobjz$Invalid wheel, because %s is missing)rr)r6rFr-r`rcrarbcodecs getreaderrget_wheel_metadatargtupler posixpathopenr KeyError ValueError)r;r>name_verinfo_dirwrapperzfwheel_metadatawv file_versionfnmetadata_filenamebfwfrGr/r/r0metadatas(     zWheel.metadatac CsXd|j|jf}d|}tj|d}|j|}tjd|}t|}WdQRXt|S)Nz%s-%sz %s.dist-infoWHEELzutf-8) rarbrxr-ryrtrurdict)r;rr|r}rrrmessager/r/r0rvs  zWheel.get_wheel_metadatac Cs6tjj|j|j}t|d}|j|}WdQRX|S)Nro)r6rFr-r`rcrrv)r;r>rrGr/r/r0rks z Wheel.infoc Cstj|}|r||j}|d|||d}}d|jkrBt}nt}tj|}|rfd|jd }nd}||}||}nT|jd}|jd} |dks|| krd} n|||dd krd } nd} t| |}|S) Nspythonw r  rrs ) SHEBANG_REreendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) r;datar&rZshebangZdata_after_shebangZshebang_pythonargsZcrZlfZtermr/r/r0process_shebangs,       zWheel.process_shebangc Csh|dkr|j}ytt|}Wn tk r<td|YnX||j}tj|jdj d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64Zurlsafe_b64encoderstripdecode)r;rrhasherrGr/r/r0get_hashs zWheel.get_hashc Csbt|}ttjj||}|j|ddf|jt|}x|D]}|j|qBWWdQRXdS)Nr)) listto_posixr6rFrelpathr,sortrZwriterow)r;recordsZ record_pathbasepwriterrowr/r/r0 write_record's  zWheel.write_recordc Csg}|\}}tt|j}xX|D]P\}} t| d} | j} WdQRXd|j| } tjj| } |j || | fqWtjj |d} |j || |t tjj |d}|j || fdS)Nrbz%s=%sRECORD) rrrryreadrr6rFgetsizer,r-rr)r;rklibdir archive_pathsrdistinfor}raprfrrsizer/r/r0 write_records0s   zWheel.write_recordsc CsJt|dtj2}x*|D]"\}}tjd|||j||qWWdQRXdS)NwzWrote %s to %s in wheel)rzipfileZ ZIP_DEFLATEDloggerdebugwrite)r;r>rrrrr/r/r0 build_zip@szWheel.build_zipc!s|dkr i}ttfddd$d}|dkrFd}tg}tg}tg}nd}tg}d g}d g}|jd ||_|jd ||_|jd ||_ |} d|j |j f} d| } d| } g} xd%D]}|krq|}t j j|rxt j|D]\}}}x|D]}tt j j||}t j j||}tt j j| ||}| j||f|dkr|jd rt|d}|j}WdQRX|j|}t|d}|j|WdQRXqWqWqW| }d}xt j|D]\}}}||krx@t|D]4\}}t|}|jdrt j j||}||=PqWxP|D]H}t|jd&r2qt j j||}tt j j||}| j||fqWqWt j|}xJ|D]B}|d'kr|tt j j||}tt j j| |}| j||fq|Wd|p|jdtd |g}x*|jD] \}}}|jd!|||fqWt j j|d}t|d"}|jd#j|WdQRXtt j j| d}| j||f|j|| f| | t j j|j |j!} |j"| | | S)(z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Ncs|kS)Nr/)r3)pathsr/r0r4NszWheel.build..purelibplatlibrZfalsetruerVrWr\r]r^z%s-%sz%s.dataz %s.dist-inforheadersscriptsz.exerwbz .dist-info.pyc.pyor INSTALLERSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %sz Tag: %s-%s-%sr )rr)rrr)rr)rrrr)#rr IMPVERABIARCHr[getr\r]r^rarbr6rFisdirwalkr r-rrr,endswithryrrr enumeratelistdir wheel_versionrrnrr`rcr)!r;rrnrZlibkeyZis_pureZ default_pyverZ default_abiZ default_archrr|data_dirr}rkeyrFrootdirsfilesrrrprrrrrrdnrr\r]r^r>r/)rr0buildFs      "         z Wheel.buildcBIKs`|j}|jd}|jdd}tjj|j|j}d|j|jf}d|} d|} t j| t } t j| d} t j| d} t j d }t |d }|j| }||}t|}Wd QRX|d jd d}tdd|D}||jkr|r||j||ddkr|d}n|d}i}|j| <}t|d&}x|D]}|d}|||<q.WWd QRXWd QRXt j| d}t j| d}t j| dd}t|d}d|_tj }g} tj}!|!|_d |_zy^x|jD]}"|"j}#t|#tr|#}$n |#jd }$|$j drq||$}|dr0t!|"j"|dkr0t#d|$|dr|djdd\}%}&|j|#}|j$}'Wd QRX|j%|'|%\}(})|)|&krt#d|#|r|$j&||frt'j(d |$q|$j&|o|$j d! }*|$j&|r|$jd"d\}(}+},tjj||+t)|,}-n$|$| | fkrqtjj|t)|$}-|*s|j|#}|j*||-Wd QRX| j+|-| r|drt|-d#4}|j$}'|j%|'|%\}(}.|.|)krt#d$|-Wd QRX|rx|-j d%rxy|j,|-}/| j+|/Wn$t-k rt'j.d&dd'YnXnttjj/t)|#}0tjj|!|0}1|j|#}|j*||1Wd QRXtjj|-\}2}0|2|_|j0|0}3|j1|3| j2|3qW|rt'j(d(d }4n~d }5|j3d }|d)kr~t j| d*}6y|j|6}t4|}7Wd QRXi}5xxd|=s |>r|jdd}?tjj;|?s.tW|>rd,di}Ax8|>j=D],\}9};d8|9|;f}@|j0|@|A}3|j1|3qWtjj|| }t>|}4t?|}|d=|d=||d9<|4j@||}|r| j+||4jA| |d:||4St-k r@t'jBd;|jCYnXWd tDjE|!XWd QRXd S)=a Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. warnerlib_onlyFz%s-%sz%s.dataz %s.dist-inforrzutf-8roNz Wheel-Versionr!rcSsg|] }t|qSr/)rp)rqrrr/r/r0rssz!Wheel.install..zRoot-Is-Purelibrrr)streamrr)r)dry_runTz /RECORD.jwsrzsize mismatch for %s=zdigest mismatch for %szlib_only: skipping %sz.exer2rzdigest mismatch on write for %sz.pyzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txtconsoleguiz %s_scriptszwrap_%sz%s:%sz %szAUnable to read legacy script metadata, so cannot generate scriptsr?zpython.commandsz8Unable to read JSON metadata, so cannot generate scriptsZ wrap_consoleZwrap_guizValid script path not specifiedz%s = %slibprefixzinstallation failed.)rr)Frrr6rFr-r`rcrarbrxrrtrurryrrgrwrrrrecordrIdont_write_bytecodetempfileZmkdtempZ source_dirZ target_dirinfolist isinstancer rrstr file_sizerrr startswithrrrZ copy_streamr,Z byte_compile ExceptionZwarningbasenameZmakeZset_executable_modeextendrkrvaluesrsuffixflagsjsonloadrr{itemsr rZwrite_shared_locationsZwrite_installed_filesZ exceptionZrollbackshutilZrmtree)Br;rZmakerkwargsrrrr>r|rr} metadata_namewheel_metadata_name record_namer~rbwfrrrrrrrreaderrrZdata_pfxZinfo_pfxZ script_pfxZfileopZbcZoutfilesworkdirzinfoarcname u_arcnamekindvaluerr rZ is_scriptwhererZoutfileZ newdigestZpycrZworknamer filenamesZdistZcommandsZepZepdatarrBr$rCsZconsole_scriptsZ gui_scriptsZ script_dirZscriptZoptionsr/r/r0installsB            "                                          z Wheel.installcCs4tdkr0tjjttdtjdd}t|atS)Nz dylib-cache) cacher6rFr-rrrIrbr)r;rr/r/r0_get_dylib_caches zWheel._get_dylib_cachecCsltjj|j|j}d|j|jf}d|}tj|d}tj d}g}t |d}y|j |}||} t j | } |j} | j|} tjj| j| } tjj| stj| x| jD]\}}tjj| t|}tjj|sd}n6tj|j}tjj|}|j|}tj|j}||k}|r(|j|| |j||fqWWdQRXWntk r\YnXWdQRX|S)Nz%s-%sz %s.dist-infoZ EXTENSIONSzutf-8roT)r6rFr-r`rcrarbrxrtrurryrrrZ prefix_to_dirrrmakedirsrrrmstatst_mtimedatetimeZ fromtimestampZgetinfoZ date_timeextractr,rz)r;r>r|r}rr~rGrrrr?r rZ cache_baserardestrZ file_timerkZ wheel_timer/r/r0_get_extensionss>              zWheel._get_extensionscCst|S)zM Determine if a wheel is compatible with the running system. ) is_compatible)r;r/r/r0rszWheel.is_compatiblecCsdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr/)r;r/r/r0 is_mountableszWheel.is_mountablecCstjjtjj|j|j}|js2d|}t||jsJd|}t||t jkrbt j d|nN|rtt jj |nt jj d||j}|rtt jkrt jj ttj||dS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)r6rFrir-r`rcrrrrIrrr,insertr_hook meta_pathr@)r;r,r>msgr?r/r/r0mounts"   z Wheel.mountcCsrtjjtjj|j|j}|tjkr2tjd|nr/r/r0unmounts     z Wheel.unmountc'Cstjj|j|j}d|j|jf}d|}d|}tj|t}tj|d}tj|d}t j d}t |d} | j |} || } t | } WdQRX| djd d } td d | D}i}| j |:}t|d $}x|D]}|d}|||<qWWdQRXWdQRXx| jD]}|j}t|tr*|}n |jd}d|krJtd||jdrZq||}|drt|j|dkrtd||d r|d jdd \}}| j |}|j}WdQRX|j||\}}||krtd|qWWdQRXdS)Nz%s-%sz%s.dataz %s.dist-inforrzutf-8roz Wheel-Versionr!rcSsg|] }t|qSr/)rp)rqrrr/r/r0rssz Wheel.verify..)rrz..zinvalid entry in wheel: %rz /RECORD.jwsrzsize mismatch for %srzdigest mismatch for %s)r6rFr-r`rcrarbrxrrtrurryrrgrwrrrr rrrrrrr)r;r>r|rr}rrrr~rrrrrrrrrrrrrrrrrr rr/r/r0rjsT                z Wheel.verifycKsdd}dd}tjj|j|j}d|j|jf}d|}tj|d} t} t |d} i} xt| j D]h} | j}t |t r|}n |j d }|| krqjd |krtd || j| | tjj| t|}|| |<qjWWd QRX|| |\}}|| f|}|r|| |\}}|r(||kr(||||d krRtjd d| d\}}tj|n*tjj|sltd|tjj||j}t| j}tjj| |}||f}|j|| ||j|||d krtj||Wd QRX|S)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. cSsHd}}d|tf}||kr$d|}||kr@||}t|dj}||fS)Nz%s/%sz %s/PKG-INFO)rF)rr rb)path_mapr}rbrFrr/r/r0 get_version1s  z!Wheel.update..get_versionc Ssd}y|t|}|jd}|dkr*d|}nTdd||ddjdD}|dd7<d|d|djd d |Df}Wn tk rtjd |YnX|rt|d }||_|j t  }|j ||d tjd||dS)Nrrz%s+1cSsg|] }t|qSr/)rp)rqr r/r/r0rsCsz8Wheel.update..update_version..rr!z%s+%scss|]}t|VqdS)N)r)rqrrr/r/r0 Fsz7Wheel.update..update_version..z0Cannot update non-compliant (PEP-440) version %r)rF)rFlegacyzVersion updated from %r to %rr) rrrgr-rrrr rbrrr)rbrFupdatedrCrrr.Zmdr!r/r/r0update_version;s(       z$Wheel.update..update_versionz%s-%sz %s.dist-inforrozutf-8z..zinvalid entry in wheel: %rNz.whlz wheel-update-)rrdirzNot a directory: %r)r6rFr-r`rcrarbrxrrrrr rrrrrZmkstempcloserrrrrrZcopyfile)r;ZmodifierZdest_dirrrr#r>r|r}rrrrrrrrFZoriginal_versionr ZmodifiedZcurrent_versionfdnewpathrrrkr/r/r0r= sX                z Wheel.update)rr)NFF)N)NN)F)N)rRrSrT__doc__rrr<propertyrcrmrnrrrvrkrrrrrrr rrrrrrrjr=r/r/r/r0rUs4 )        he "  6rUcCstg}td}x6ttjddddD]}|jdj|t|gq&Wg}x6tjD]*\}}}|j drT|j|j dddqTW|j t dkr|j dt |jdg}tg}tjdkrtjd t}|r|j\} }}} t|}| g} | dkr| jd | dkr| jd| dkr*| jd| dkr>| jd| dkrR| jdxL|dkrx2| D]*} d| ||| f} | tkrd|j| qdW|d8}qTWx<|D]4}x,|D]$} |jdjt|df|| fqWqWxXt|D]L\}}|jdjt|fddf|dkr|jdjt|dfddfqWxXt|D]L\}}|jdjd|fddf|dkrB|jdjd|dfddfqBWt|S)zG Return (pyver, abi, arch) tuples compatible with this Python. rrr)z.abir!rrVdarwinz(\w+)_(\d+)_(\d+)_(\w+)$i386ppcZfatx86_64Zfat3ppc64Zfat64intelZ universalz %s_%s_%s_%srWrrr)r+r,)r+r,r-)r.r-)r+r-)r+r-r/r,r.)r*rangerI version_infor,r-rrLZ get_suffixesrrgrrrrplatformrererrp IMP_PREFIXrset)ZversionsmajorminorZabisrr rGZarchesr&rar^Zmatchesrer r]rrrbr/r/r0compatible_tagss`                    * $ $r8cCs^t|tst|}d}|dkr"t}x6|D].\}}}||jkr(||jkr(||jkr(d}Pq(W|S)NFT)rrUCOMPATIBLE_TAGSr\r]r^)ZwheelrnrGZverr]r^r/r/r0rs r)N)SZ __future__rrrtrZdistutils.utilZ distutilsZemailrrrLrZloggingr6rxr3rrIrrr)rrcompatrrr r r Zdatabaser rr rutilrrrrrrrrrrbrrZ getLoggerrRrr hasattrr4r2rr+r*r1r[r get_platformr5rrr1compile IGNORECASEVERBOSErhrdrrrrr7robjectr8rrUr8r9rr/r/r/r0s   ,          #>PK!-VM>M>._backport/__pycache__/sysconfig.cpython-36.pycnu[3 PfKi@sdZddlZddlZddlZddlZddlmZmZy ddlZWne k r\ddl ZYnXdddddd d d d d dg Z ddZ ej rejje ej Zn e ejZejdkrdedEdjkre ejjeeZejdkodedFdjkr e ejjeeeZejdkr@dedGdjkr@e ejjeeeZddZeZdaddZejZejdZddZejjdZ ejdd Z!e de d!Z"ejj#ej$Z%ejj#ej&Z'da(dZ)d"d#Z*d$d%Z+d&d'Z,d(d)Z-d*d+Z.d,d-Z/dHd.d/Z0d0dZ1d1d2Z2d3d4Z3dId5dZ4d6dZ5d7d Z6d8d Z7e.dd9fd:d Z8e.dd9fd;dZ9dd ZdBdCZ?e@dDkre?dS)Jz-Access to Python's configuration information.N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hc Cs"yt|Stk r|SXdS)N)rOSError)pathr/usr/lib/python3.6/sysconfig.py_safe_realpath"srntZpcbuildz\pc\v z\pcbuild\amd64cCs.x(dD] }tjjtjjtd|rdSqWdS)N Setup.dist Setup.localModulesTF)rr)osrisfilejoin _PROJECT_BASE)fnrrris_python_build:s r Fc Cstsddlm}tjddd}||}|jd}|s>td|j}tj |WdQRXt rx(dD] }tj |d d tj |d d qfWdadS)N)finder.rz sysconfig.cfgzsysconfig.cfg exists posix_prefix posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T)r%r&) _cfg_readZ resourcesr"__name__rsplitfindAssertionErrorZ as_stream_SCHEMESZreadfp _PYTHON_BUILDset)r"Zbackport_packageZ_finderZ_cfgfilesschemerrr_ensure_cfg_readDs     r3z \{([^{]*?)\}cst|jdr|jd}nt}|j}xD|D]<}|dkr>q0x,|D]$\}}|j||rZqD|j|||qDWq0W|jdxX|jD]L}t|j|fdd}x,|j|D]\}}|j||t j ||qWqWdS)Nglobalscs$|jd}|kr|S|jdS)Nr$r)group)matchobjname) variablesrr _replaceros z"_expand_globals.._replacer) r3Z has_sectionitemstuplesectionsZ has_optionr0Zremove_sectiondict _VAR_REPLsub)configr4r<ZsectionZoptionvaluer9r)r8r_expand_globalsYs$      rBr!csfdd}tj||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. cs8|jd}|kr|S|tjkr.tj|S|jdS)Nr$r)r5renviron)r6r7) local_varsrrr9s    z_subst_vars.._replacer)r>r?)rrEr9r)rEr _subst_varss rFcCs4|j}x&|jD]\}}||kr$q|||<qWdS)N)keysr:) target_dict other_dict target_keyskeyrArrr _extend_dicts rLcCsdi}|dkri}t|txBtj|D]4\}}tjdkrFtjj|}tjjt ||||<q(W|S)Nposixr)rMr) rLrr.r:rr7r expandusernormpathrF)r2varsresrKrArrr _expand_varss   rRcsfdd}tj||S)Ncs$|jd}|kr|S|jdS)Nr$r)r5)r6r7)rPrrr9s zformat_value.._replacer)r>r?)rArPr9r)rPr format_values rScCstjdkrdStjS)NrMr%)rr7rrrr_get_default_schemes rTcCstjjdd}dd}tjdkrBtjjdp.d}|r8|S||dStjdkr|td }|r||r`|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjjtjj|S)N)rrrNr)argsrrrjoinusersz_getuserbase..joinuserrAPPDATA~PythondarwinPYTHONFRAMEWORKLibraryz%d.%dr!z.local)rrDgetr7sysplatformr version_info)env_baserWbase frameworkrrr _getuserbases"    recCs"tjd}tjd}tjd}|dkr*i}i}i}tj|ddd}|j}WdQRXx|D]} | jds\| jd krxq\|j| } | r\| jd d \} } | j} | j d d } d | kr| || <q\y t | } Wn$t k r| j d d || <Yq\X| || <q\Wt |j }d}xt|dkrxt|D]}||}|j|pJ|j|} | dk r| jd } d}| |kr|t|| }n| |krd}nx| tjkrtj| }n`| |kr|jdr|dd|krd }n$d| |krd}nt|d| }n d || <}|r|| jd}|d| j||}d |krF|||<n~y t |}Wn"t k rt|j||<Yn X|||<|j||jdr|dd|kr|dd}||kr|||<n|||<|j|q(WqWx.|jD]"\}} t| tr| j||<qW|j||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. z"([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_]*)}Nzutf-8surrogateescape)encodingerrors#r$r!z$$$CFLAGSLDFLAGSCPPFLAGSrTFPY_rC)rlrmrn)recompilecodecsopen readlines startswithstripmatchr5replaceint ValueErrorlistrGlenr;searchstrrrDendstartremover: isinstanceupdate)filenamerP _variable_rx _findvar1_rx _findvar2_rxdonenotdoneflineslinemnvtmpvr8renamed_variablesr7rAfounditemafterkrrr_parse_makefiles                             rcCsDtrtjjtdSttdr,dttjf}nd}tjjt d|dS)z Return the path of the Makefile.Makefileabiflagsz config-%s%sr@stdlib) r/rrrrhasattrr__PY_VERSION_SHORTrr)config_dir_namerrrrMs  cCst}yt||WnJtk r^}z.d|}t|drF|d|j}t|WYdd}~XnXt}y"t|}t||WdQRXWnJtk r}z.d|}t|dr|d|j}t|WYdd}~XnXtr|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N BLDSHAREDLDSHARED) rrIOErrorrrrrsrr/)rPmakefileemsgconfig_hrrrr _init_posixXs&   rcCsVtd|d<td|d<td|d<d|d<d |d <t|d <tjjttj|d <d S)z+Initialize the module as appropriate for NTrLIBDEST platstdlib BINLIBDESTr' INCLUDEPYz.pydSOz.exeEXEVERSIONBINDIRN)r_PY_VERSION_SHORT_NO_DOTrrdirnamerr_ executable)rPrrr_init_non_posixts   rc Cs|dkr i}tjd}tjd}xx|j}|s0P|j|}|rz|jdd\}}y t|}Wntk rnYnX|||<q"|j|}|r"d||jd<q"W|S)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_]+) [*]/ r$r!r)rprqreadlinerwr5ryrz)fprP define_rxundef_rxrrrrrrrrs(      cCs:tr$tjdkrtjjtd}q,t}ntd}tjj|dS)zReturn the path of pyconfig.h.rPCr(z pyconfig.h)r/rr7rrrr)inc_dirrrrrs  cCstttjS)z,Return a tuple containing the schemes names.)r;sortedr.r<rrrrr scCs tjdS)z*Return a tuple containing the paths names.r%)r.Zoptionsrrrrr sTcCs&t|rt||Sttj|SdS)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. N)r3rRr=r.r:)r2rPexpandrrrr s cCst||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r7r2rPrrrrrscGstdkriattd<ttd<ttd<ttd<tdtdtd<ttd <ttd <ttd <ytjtd <Wntk rd td <YnXt j d#krt tt j dkrt ttj dkrttd<dtkrttd<nttdtd<tot j dkr\t}y t j}Wntk rd}YnXt jjtd r\||kr\t jj|td}t jj|td<tjdkrt jd}t|jdd}|dkrx:d$D]2}t|}tjdd|}tjdd|}|t|<qWndt jkrt jd}x8d%D]0}t|}tjdd|}|d|}|t|<qWtjdd } tjd | } | dk r| j d!} t jj!| sx,d&D]$}t|}tjd"d|}|t|<q^W|rg} x|D]} | j"tj| qW| StSdS)'ayWith no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS 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. Nprefix exec_prefix py_versionpy_version_shortrr!py_version_nodotrcplatbase projectbaserrjros2rMz2.6userbasesrcdirr[r#rrm BASECFLAGSrl PY_CFLAGSrz -arch\s+\w+\s z-isysroot [^ ]*Z ARCHFLAGSz-isysroot\s+(\S+)r$z-isysroot\s+\S+(\s|$))rr)rmrrlrr)rmrrlrr)rmrrlrr)# _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrrr_rAttributeErrorrr7rrversionrerr/getcwdrrisabsrrOr`unamerysplitrpr?rDr^r}r5existsappend)rVrccwdrZkernel_versionZ major_versionrKflagsZarchrlrZsdkvalsr7rrrrs                    cCs tj|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rr^)r7rrrrRscCs`tjdkrnd}tjj|}|d:kr(tjStjjd|}tj|t||j}|dkr\dS|dkrhdStjStjd ksttd  rtjStj \}}}}}|jj d d }|j d d}|j d d}|dddkrd||fS|dddkr(|ddkrRd}dt |dd|ddf}n*|dddkrFd||fS|dddkrfd|||fS|ddd krd }t j d!} | j|} | rR| j}n|ddd"krRt} | jd#} | } y td$}Wntk rYnJXzt jd%|j} Wd|jX| dk r4d&j| jdjd&dd} | s>| } | rR| }d'}| d&d(krd)tjd*d jkrd+}tjd*}t jd,|}ttt|}t|dkr|d}n^|d;krd+}nN|d|d=krd1}n.|d>krd3}n|d?krd4}ntd5|fn<|d-kr2tjd@krRd/}n |dAkrRtjdBkrNd2}nd.}d9|||fS)CaReturn 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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit (r$)amd64z win-amd64itaniumzwin-ia64rMr/rjr_-Nlinuxz%s-%ssunosr5solarisz%d.%srCr!irixaixz%s-%s.%scygwinz[\d.]+r[MACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)r#Zmacosxz10.4.z-archrlZfatz -arch\s+(\S+)i386ppcx86_64ZintelZfat3ppc64Zfat64Z universalz%Don't know machine value for archs=%r PowerPCPower_Macintoshz%s-%s-%s)rr)rr)rrr)rr)rrrrl)rrl) rr7r_rr,r`r|lowerrrrxryrprqrwr5rr^rsrr}readcloserrrvfindallr;rr0rzmaxsize)rijlookosnamehostreleasermachinerel_rerZcfgvarsZmacverZ macreleaserZcflagsZarchsrrrr [s     $                    cCstS)N)rrrrrr scCsJxDtt|jD]0\}\}}|dkr2td|td||fqWdS)Nrz%s: z %s = "%s") enumeraterr:print)titledataindexrKrArrr _print_dicts rcCsRtdttdttdtttdtttdtdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"Paths VariablesN)rr r rTrr rrrrr_mains r__main__iii)N)N)A__doc__rrrrpr_Zos.pathrrZ configparser ImportErrorZ ConfigParser__all__rrrrrrr7rrr r/r)r3ZRawConfigParserr.rqr>rBrrrrrrOrrrrr _USER_BASErFrLrRrSrTrerrrrrrr r r rrrr r rrr*rrrrs   " #   v     # PK!ۨO/_backport/__pycache__/misc.cpython-36.opt-1.pycnu[3 Pf@sdZddlZddlZdddgZyddlmZWnek rLd ddZYnXyeZWn(ek r~dd l m Z d dZYnXy ej Z Wne k rd dZ YnXdS) z/Backports for individual classes and functions.Ncache_from_sourcecallablefsencode)rFcCs|rdp d}||S)Nco)Zpy_filedebugZextrr/usr/lib/python3.6/misc.pyrs )CallablecCs t|tS)N) isinstancer )objrrr rscCs<t|tr|St|tr&|jtjStdt|jdS)Nzexpect bytes or str, not %s) r bytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenamerrr r"s   )F) __doc__osr__all__Zimpr ImportErrorr NameError collectionsr rAttributeErrorrrrr s    PK!T3)_backport/__pycache__/misc.cpython-36.pycnu[3 Pf@sdZddlZddlZdddgZyddlmZWnek rLd ddZYnXyeZWn(ek r~dd l m Z d dZYnXy ej Z Wne k rd dZ YnXdS) z/Backports for individual classes and functions.Ncache_from_sourcecallablefsencode)rTcCs|rdp d}||S)Nco)Zpy_filedebugZextrr/usr/lib/python3.6/misc.pyrs )CallablecCs t|tS)N) isinstancer )objrrr rscCs<t|tr|St|tr&|jtjStdt|jdS)Nzexpect bytes or str, not %s) r bytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenamerrr r"s   )T) __doc__osr__all__Zimpr ImportErrorr NameError collectionsr rAttributeErrorrrrr s    PK!A-_backport/__pycache__/__init__.cpython-36.pycnu[3 Pf@sdZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__rr/usr/lib/python3.6/__init__.pysPK!A3_backport/__pycache__/__init__.cpython-36.opt-1.pycnu[3 Pf@sdZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__rr/usr/lib/python3.6/__init__.pysPK!k_n>>4_backport/__pycache__/sysconfig.cpython-36.opt-1.pycnu[3 PfKi@sdZddlZddlZddlZddlZddlmZmZy ddlZWne k r\ddl ZYnXdddddd d d d d dg Z ddZ ej rejje ej Zn e ejZejdkrdedEdjkre ejjeeZejdkodedFdjkr e ejjeeeZejdkr@dedGdjkr@e ejjeeeZddZeZdaddZejZejdZddZejjdZ ejdd Z!e de d!Z"ejj#ej$Z%ejj#ej&Z'da(dZ)d"d#Z*d$d%Z+d&d'Z,d(d)Z-d*d+Z.d,d-Z/dHd.d/Z0d0dZ1d1d2Z2d3d4Z3dId5dZ4d6dZ5d7d Z6d8d Z7e.dd9fd:d Z8e.dd9fd;dZ9dd ZdBdCZ?e@dDkre?dS)Jz-Access to Python's configuration information.N)pardirrealpathget_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hc Cs"yt|Stk r|SXdS)N)rOSError)pathr/usr/lib/python3.6/sysconfig.py_safe_realpath"srntZpcbuildz\pc\v z\pcbuild\amd64cCs.x(dD] }tjjtjjtd|rdSqWdS)N Setup.dist Setup.localModulesTF)rr)osrisfilejoin _PROJECT_BASE)fnrrris_python_build:s r Fc Cstsddlm}tjddd}||}|jd}|j}tj|WdQRXt r~x(dD] }tj |d d tj |d d qZWd adS)N)finder.rz sysconfig.cfg posix_prefix posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T)r%r&) _cfg_readZ resourcesr"__name__rsplitfindZ as_stream_SCHEMESZreadfp _PYTHON_BUILDset)r"Zbackport_packageZ_finderZ_cfgfilesschemerrr_ensure_cfg_readDs    r2z \{([^{]*?)\}cst|jdr|jd}nt}|j}xD|D]<}|dkr>q0x,|D]$\}}|j||rZqD|j|||qDWq0W|jdxX|jD]L}t|j|fdd}x,|j|D]\}}|j||t j ||qWqWdS)Nglobalscs$|jd}|kr|S|jdS)Nr$r)group)matchobjname) variablesrr _replaceros z"_expand_globals.._replacer) r2Z has_sectionitemstuplesectionsZ has_optionr/Zremove_sectiondict _VAR_REPLsub)configr3r;ZsectionZoptionvaluer8r)r7r_expand_globalsYs$      rAr!csfdd}tj||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. cs8|jd}|kr|S|tjkr.tj|S|jdS)Nr$r)r4renviron)r5r6) local_varsrrr8s    z_subst_vars.._replacer)r=r>)rrDr8r)rDr _subst_varss rEcCs4|j}x&|jD]\}}||kr$q|||<qWdS)N)keysr9) target_dict other_dict target_keyskeyr@rrr _extend_dicts rKcCsdi}|dkri}t|txBtj|D]4\}}tjdkrFtjj|}tjjt ||||<q(W|S)Nposixr)rLr) rKrr-r9rr6r expandusernormpathrE)r1varsresrJr@rrr _expand_varss   rQcsfdd}tj||S)Ncs$|jd}|kr|S|jdS)Nr$r)r4)r5r6)rOrrr8s zformat_value.._replacer)r=r>)r@rOr8r)rOr format_values rRcCstjdkrdStjS)NrLr%)rr6rrrr_get_default_schemes rScCstjjdd}dd}tjdkrBtjjdp.d}|r8|S||dStjdkr|td }|r||r`|S|dd |d tjdd S|r|S|dd SdS)NPYTHONUSERBASEcWstjjtjj|S)N)rrrMr)argsrrrjoinusersz_getuserbase..joinuserrAPPDATA~PythondarwinPYTHONFRAMEWORKLibraryz%d.%dr!z.local)rrCgetr6sysplatformr version_info)env_baserVbase frameworkrrr _getuserbases"    rdcCs"tjd}tjd}tjd}|dkr*i}i}i}tj|ddd}|j}WdQRXx|D]} | jds\| jd krxq\|j| } | r\| jd d \} } | j} | j d d } d | kr| || <q\y t | } Wn$t k r| j d d || <Yq\X| || <q\Wt |j }d}xt|dkrxt|D]}||}|j|pJ|j|} | dk r| jd } d}| |kr|t|| }n| |krd}nx| tjkrtj| }n`| |kr|jdr|dd|krd }n$d| |krd}nt|d| }n d || <}|r|| jd}|d| j||}d |krF|||<n~y t |}Wn"t k rt|j||<Yn X|||<|j||jdr|dd|kr|dd}||kr|||<n|||<|j|q(WqWx.|jD]"\}} t| tr| j||<qW|j||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. z"([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_]*)}Nzutf-8surrogateescape)encodingerrors#r$r!z$$$CFLAGSLDFLAGSCPPFLAGSrTFPY_rB)rkrlrm)recompilecodecsopen readlines startswithstripmatchr4replaceint ValueErrorlistrFlenr:searchstrrrCendstartremover9 isinstanceupdate)filenamerO _variable_rx _findvar1_rx _findvar2_rxdonenotdoneflineslinemnvtmpvr7renamed_variablesr6r@founditemafterkrrr_parse_makefiles                             rcCsDtrtjjtdSttdr,dttjf}nd}tjjt d|dS)z Return the path of the Makefile.Makefileabiflagsz config-%s%sr?stdlib) r.rrrrhasattrr^_PY_VERSION_SHORTrr)config_dir_namerrrrMs  cCst}yt||WnJtk r^}z.d|}t|drF|d|j}t|WYdd}~XnXt}y"t|}t||WdQRXWnJtk r}z.d|}t|dr|d|j}t|WYdd}~XnXtr|d|d<dS)z7Initialize the module as appropriate for POSIX systems.z.invalid Python installation: unable to open %sstrerrorz (%s)N BLDSHAREDLDSHARED) rrIOErrorrrrrrrr.)rOmakefileemsgconfig_hrrrr _init_posixXs&   rcCsVtd|d<td|d<td|d<d|d<d |d <t|d <tjjttj|d <d S)z+Initialize the module as appropriate for NTrLIBDEST platstdlib BINLIBDESTr' INCLUDEPYz.pydSOz.exeEXEVERSIONBINDIRN)r_PY_VERSION_SHORT_NO_DOTrrdirnamerr^ executable)rOrrr_init_non_posixts   rc Cs|dkr i}tjd}tjd}xx|j}|s0P|j|}|rz|jdd\}}y t|}Wntk rnYnX|||<q"|j|}|r"d||jd<q"W|S)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_]+) [*]/ r$r!r)rorpreadlinervr4rxry)fprO define_rxundef_rxrrrrrrrrs(      cCs:tr$tjdkrtjjtd}q,t}ntd}tjj|dS)zReturn the path of pyconfig.h.rPCr(z pyconfig.h)r.rr6rrrr)inc_dirrrrrs  cCstttjS)z,Return a tuple containing the schemes names.)r:sortedr-r;rrrrr scCs tjdS)z*Return a tuple containing the paths names.r%)r-Zoptionsrrrrr sTcCs&t|rt||Sttj|SdS)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. N)r2rQr<r-r9)r1rOexpandrrrr s cCst||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )r6r1rOrrrrrscGstdkriattd<ttd<ttd<ttd<tdtdtd<ttd <ttd <ttd <ytjtd <Wntk rd td <YnXt j d#krt tt j dkrt ttj dkrttd<dtkrttd<nttdtd<tot j dkr\t}y t j}Wntk rd}YnXt jjtd r\||kr\t jj|td}t jj|td<tjdkrt jd}t|jdd}|dkrx:d$D]2}t|}tjdd|}tjdd|}|t|<qWndt jkrt jd}x8d%D]0}t|}tjdd|}|d|}|t|<qWtjdd } tjd | } | dk r| j d!} t jj!| sx,d&D]$}t|}tjd"d|}|t|<q^W|rg} x|D]} | j"tj| qW| StSdS)'ayWith no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS 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. Nprefix exec_prefix py_versionpy_version_shortrr!py_version_nodotrbplatbase projectbaserriros2rLz2.6userbasesrcdirrZr#rrl BASECFLAGSrk PY_CFLAGSrz -arch\s+\w+\s z-isysroot [^ ]*Z ARCHFLAGSz-isysroot\s+(\S+)r$z-isysroot\s+\S+(\s|$))rr)rlrrkrr)rlrrkrr)rlrrkrr)# _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrrr^rAttributeErrorrr6rrversionrdrr.getcwdrrisabsrrNr_unamerxsplitror>rCr]r|r4existsappend)rUrbcwdrZkernel_versionZ major_versionrJflagsZarchrkrZsdkvalsr6rrrrs                    cCs tj|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rr])r6rrrrRscCs`tjdkrnd}tjj|}|d:kr(tjStjjd|}tj|t||j}|dkr\dS|dkrhdStjStjd ksttd  rtjStj \}}}}}|jj d d }|j d d}|j d d}|dddkrd||fS|dddkr(|ddkrRd}dt |dd|ddf}n*|dddkrFd||fS|dddkrfd|||fS|ddd krd }t j d!} | j|} | rR| j}n|ddd"krRt} | jd#} | } y td$}Wntk rYnJXzt jd%|j} Wd|jX| dk r4d&j| jdjd&dd} | s>| } | rR| }d'}| d&d(krd)tjd*d jkrd+}tjd*}t jd,|}ttt|}t|dkr|d}n^|d;krd+}nN|d|d=krd1}n.|d>krd3}n|d?krd4}ntd5|fn<|d-kr2tjd@krRd/}n |dAkrRtjdBkrNd2}nd.}d9|||fS)CaReturn 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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit (r$)amd64z win-amd64itaniumzwin-ia64rLr/rir_-Nlinuxz%s-%ssunosr5solarisz%d.%srBr!irixaixz%s-%s.%scygwinz[\d.]+rZMACOSX_DEPLOYMENT_TARGETz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)r#Zmacosxz10.4.z-archrkZfatz -arch\s+(\S+)i386ppcx86_64ZintelZfat3ppc64Zfat64Z universalz%Don't know machine value for archs=%r PowerPCPower_Macintoshz%s-%s-%s)rr)rr)rrr)rr)rrrrl)rrl) rr6r^rr,r_r{lowerrrrwrxrorprvr4rr]rrrr|readcloserrrufindallr:rr/rymaxsize)rijlookosnamehostreleasermachinerel_rerZcfgvarsZmacverZ macreleaserZcflagsZarchsrrrr [s     $                    cCstS)N)rrrrrr scCsJxDtt|jD]0\}\}}|dkr2td|td||fqWdS)Nrz%s: z %s = "%s") enumeraterr9print)titledataindexrJr@rrr _print_dicts rcCsRtdttdttdtttdtttdtdS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"Paths VariablesN)rr r rSrr rrrrr_mains r__main__iii)N)N)A__doc__rqrror^Zos.pathrrZ configparser ImportErrorZ ConfigParser__all__rrrrrrr6rrr r.r)r2ZRawConfigParserr-rpr=rArrrrrrNrrrrr _USER_BASErErKrQrRrSrdrrrrrrr r r rrrr r rrr*rrrrs   " #   v     # PK!BB$__pycache__/manifest.cpython-311.pycnu[ ^i9dZddlZddlZddlZddlZddlZddlmZddlm Z ddl m Z dgZ ej eZejdejZejd ejejzZejdd ZGd deZdS) zu Class representing the list of files in a distribution. Equivalent to distutils.filelist, but fixes some problems. N)DistlibException)fsdecode convert_pathManifestz\\w* z#.*?(?= )| (?=$)cpeZdZdZddZdZdZdZddZd Z d Z d Z dd Z ddZ ddZdZdS)rz~A list of files built by on exploring the filesystem and filtered by applying various patterns to what we find there. Nctjtj|ptj|_|jtjz|_d|_t|_ dS)zd Initialise an instance. :param base: The base directory to explore under. N) ospathabspathnormpathgetcwdbasesepprefixallfilessetfiles)selfrs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/manifest.py__init__zManifest.__init__*sZ GOOBG$4$4T5HRY[[$I$IJJ i"&(  UU cddlm}m}m}gx|_}|j}|g}|j}|j}|r|}tj |} | D]} tj || } tj| } | j } || r#|t| k|| r|| s || |dSdS)zmFind all files under the base and set ``allfiles`` to the absolute pathnames of files found. r)S_ISREGS_ISDIRS_ISLNKN)statrrrrrpopappendr listdirr joinst_moder)rrrrrrootstackr pushnamesnamefullnamermodes rfindallzManifest.findall9s  3222222222#%% yi| #355DJt$$E # #7<<d33wx((|74==#OOHX$6$67777WT]]#774==#DNNN # # # # #rc||js%tj|j|}|jtj|dS)zz Add a file to the manifest. :param item: The pathname to add. This can be relative to the base. N) startswithrr r r#rraddr)ritems rr/z Manifest.addTs[ t{++ 17<< 400D rw''--.....rc:|D]}||dS)z Add a list of files to the manifest. :param items: The pathnames to add. These can be relative to the base. N)r/)ritemsr0s radd_manyzManifest.add_many^s.   D HHTNNNN  rFcfdtj}|rAt}|D]+}|tj|,||z}dt d|DDS)z8 Return sorted files in directory order c||td||jkr6tj|\}}|dvsJ||dSdS)Nzadd_dir added %s)/)r/loggerdebugrr r split)dirsdparent_add_dirrs rr?z Manifest.sorted..add_dirlsy HHQKKK LL+Q / / /DI~~GMM!,, Y....f%%%%%~rc4g|]}tjj|S)r r r#).0 path_tuples r z#Manifest.sorted..zs3@@@j j)@@@rc3TK|]#}tj|V$dSN)r r r:)rBr s r z"Manifest.sorted..{s0>>trw}}T**>>>>>>r)rrr r dirnamesorted)rwantdirsresultr;fr?s` @rrIzManifest.sortedgs  & & & & & &TZ  55D 2 2bgooa001111 dNF@@>>v>>>>>@@@ @rc:t|_g|_dS)zClear all collected files.N)rrr)rs rclearzManifest.clear}sUU  rc||\}}}}|dkr9|D]4}||dstd|5dS|dkr|D]}||d}dS|dkr9|D]4}||dstd|5dS|d kr|D]}||d}dS|d kr:|D]5}||| std ||6dS|d kr|D]}||| }dS|dkr6|d| std|dSdS|dkr6|d| std|dSdSt d|z)av Process a directive which either adds some files from ``allfiles`` to ``files``, or removes some files from ``files``. :param directive: The directive to process. This should be in a format compatible with distutils ``MANIFEST.in`` files: http://docs.python.org/distutils/sourcedist.html#commands includeT)anchorzno files found matching %rexcludeglobal-includeFz3no files found matching %r anywhere in distributionglobal-excluderecursive-include)rz-no files found matching %r under directory %rrecursive-excludegraftNz no directories found matching %rprunez4no previously-included directories found matching %rzinvalid action %r)_parse_directive_include_patternr8warning_exclude_patternr)r directiveactionpatternsthedir dirpatternpatternfounds rprocess_directivezManifest.process_directives04/D/DY/O/O,&* Y  # J J,,WT,BBJNN#?III J Jy # D D--gd-CC D D ' ' '# H H,,WU,CCHNN$>?FHHH H H ' ' '# E E--ge-DD E E* * *# J J,,WV,DDJNN$89@&JJJ J J * * *# F F--gf-EE F Fw  ((j(AA +A)+++++ + +w  ((j(AA : -.8::::: : : ##f,.. .rc||}t|dkr |ddvr|dd|d}dx}x}}|dvr:t|dkrtd|zd |ddD}n|d vrOt|d krtd |zt |d}d |ddD}nQ|dvr;t|dkrtd|zt |d}ntd|z||||fS)z Validate a directive. :param directive: The directive to validate. :return: A tuple of action, patterns, thedir, dir_patterns rr)rPrRrSrTrUrVrWrXrPN)rPrRrSrTr z$%r expects ...c,g|]}t|SrArrBwords rrDz-Manifest._parse_directive.. AAAt T**AAAr)rUrVz*%r expects ...c,g|]}t|SrArrgs rrDz-Manifest._parse_directive..rir)rWrXz!%r expects a single zunknown action %r)r:leninsertrr)rr]wordsr^r_r` dir_patterns rrYzManifest._parse_directives !! u::??uQx0B B B LLI & & &q*...6K : : :5zzA~~&:VCEEEBAuQRRyAAAHH A A A5zzA~~&@6IKKK"%(++FAAuQRRyAAAHH ) ) )5zzQ&7&@BBB'uQx00KK##6#?@@ @x44rTcd}|||||}|j||jD]3}||r|j|d}4|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. FNT)_translate_patternrr,searchrr/)rrbrQris_regexrc pattern_rer)s rrZzManifest._include_patterns8,,WffhOO  = LLNNNM  D  &&  t$$$ rcd}|||||}t|jD]3}||r|j|d}4|S)atRemove 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. This API is public to allow e.g. exclusion of SCM subdirs, e.g. when packaging source distributions FT)rqlistrrrremove)rrbrQrrsrcrtrLs rr\zManifest._exclude_pattern)sr,,WffhOO dj!!  A  ##  !!!$$$ rc |r+t|trtj|S|Stdkr,|dd\}}}|rM||}tdkr,||r||sJnd}tj tj |j d} |OtdkrA|d} ||dt|  } nu||} | |r| |sJ| t|t| t|z } tj} tjdkrd} tdkr!d| z| | d|zfz}nw|t|t|t|z }|| | | d||}n3|r1tdkr d| z|z}n|| |t|d}tj|S) aTranslate a shell-like wildcard pattern to a compiled regular expression. Return the compiled regex. If 'is_regex' true, then 'pattern' is directly compiled to a regex (if it's a string) or just returned as-is (assumes it's a regex object). )rjr r>r6N\z\\^z.*) isinstancestrrecompile_PYTHON_VERSION _glob_to_re partitionr.endswithescaper r r#rrlr) rrbrQrrsstartr>endrtr empty_pattern prefix_rers rrqzManifest._translate_pattern=s  '3'' z'*** V # # ,,S11;;C@@ME1c  ))'22J''!,,U33P 8K8KC8P8PPPPJydi4455  &(( $ 0 0 4 4  ,,V445Is=7I7I6I5IJ  ,,V44  ++E22Ny7I7I#7N7NNNN%c%jj#i..3s882K&KL &Cv~~&(( 4Z#((I48:4E4G+H+HH (E C OOc#hh4N(NO 27%yy###2<*ccC  T"f,,!$tj!8JJ.3eTT:c%jjkk;R;R!SJz*%%%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). ryz\\\\z\1[^%s]z((?>Cs"V17JGG rrF)F)TNF)__name__ __module__ __qualname____doc__rr,r/r3rIrNrdrYrZr\rqrrArrrr%s    ###6///@@@@, I.I.I.^-5-5-5^=A"'''''R=A"'(?C$)5&5&5&5&nr)rrloggingr r}sysr6rcompatrutilr__all__ getLoggerrr8r~M_COLLAPSE_PATTERNS_COMMENTED_LINE version_inforobjectrrArrrs    ,  8 $ $BJz2400"*124"$;??"2A2&dddddvdddddrPK!`Rnn#__pycache__/markers.cpython-311.pycnu[ ^i}dZddlZddlZddlZddlZddlmZddlmZm Z ddl m Z dgZ ejdZd Zd ZGd d eZd ZeZ[eZddZdS)zG Parser for the environment markers micro-language defined in PEP 508. N) string_types)in_venv parse_marker)NormalizedVersion interpretz<((\d+(\.\d+)*\w*)|\'(\d+(\.\d+)*\w*)\'|\"(\d+(\.\d+)*\w*)\")cHt|tr|sdS|ddvS)NFr'") isinstancer)os /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/markers.py _is_literalrs. a & &au Q45=cg}t|D]<}|t|d=t |S)Nr)_VERSION_PATTERNfinditerappendNVgroupsset)sresultms r _get_versionsr!sY F  & &q ) ))) bA''(((( v;;rc NeZdZdZdddddddd d d d d d ZdZdS) Evaluatorz; This class is used to evaluate marker expessions. c||kSNxys r zEvaluator.- 16rc||kSrrr s r r#zEvaluator..s AFrc||kp||kSrrr s r r#zEvaluator./s16?QUrc||kSrrr s r r#zEvaluator.0r$rc||kSrrr s r r#zEvaluator.1 1q5rc||kp||kSrrr s r r#zEvaluator.2AFOa!erc||kSrrr s r r#zEvaluator.3r)rc||kp||kSrrr s r r#zEvaluator.4r+rc |o|Srrr s r r#zEvaluator.5s AG!rc |p|Srrr s r r#zEvaluator.6s 16rc ||vSrrr s r r#zEvaluator.7s 16rc ||vSrrr s r r#zEvaluator.8s qzr) =====~=!=<<=>>=andorinnot inct|tr6|ddvr |dd}nF||vrtd|z||}n&t|tsJ|d}||jvrt d|z|d}|d }t |dr-t |d rtd |d |d ||||}|||}|d ks|d kr#|d vrt|}t|}n(|d kr"|dvrt|}t|}|j|||}|S)z Evaluate a marker expression returned by the :func:`parse_requirement` function in the specified context. rr rzunknown variable: %sopzop not implemented: %slhsrhszinvalid comparison:  python_version)r6r7r8r9r3r2r5r4)r<r=) r r SyntaxErrordict operationsNotImplementedErrorrevaluaterr) selfexprcontextrr@elhserhsrArBs r rIzEvaluator.evaluate;s dL ) ) 3Aw%adw&&%&.format_full_version^sQ $ DJJJ C  7?? tAwT[!1!11 1Grimplementation0) implementation_nameimplementation_versionos_nameplatform_machineplatform_python_implementationplatform_releaseplatform_systemplatform_versionplatform_in_venvpython_full_versionrD sys_platform)hasattrsysrar^nameosplatformmachinepython_implementationreleasesystemr[rrD)r`rfrers r default_contextry]ss$%%!!4!4S5G5O!P!P!05!$  3"87$,..*2*H*J*J$,..#?,,$,.. NN'688"133BQB7   F MrcJ t|\}}n'#t$r}td|d|d}~wwxYw|r!|ddkrtd|d|tt}|r||t ||S)z Interpret a marker and return a result depending on environment. :param marker: The marker to interpret. :type marker: str :param execution_context: The context used for name lookup. :type execution_context: mapping z#Unable to interpret marker syntax: z: Nr#z$unexpected trailing data in marker: )r ExceptionrErFDEFAULT_CONTEXTupdate evaluatorrI)markerexecution_contextrKresterLs r rrsU!&)) dd UUUkQRQRSTTTU YQ3k&&&RVRVWXXX?##G*()))   dG , ,,s 949r)rRrsrerqrtcompatrutilrrr^rr__all__compilerrrobjectrryr}rrrrr rs  '''''''',,,,,, -2:]^^  44444444l>"/## IKK ------rPK!1h$__pycache__/__init__.cpython-311.pycnu[ ^iEddlZdZGddeZ ddlmZn#e$rGddejZYnwxYwejeZ e edS)Nz0.3.3ceZdZdS)DistlibExceptionN)__name__ __module__ __qualname__/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/__init__.pyrr sDr r) NullHandlerc eZdZdZdZdZdS)r cdSNrselfrecords r handlezNullHandler.handler cdSrrrs r emitzNullHandler.emitrr cd|_dSr)lock)rs r createLockzNullHandler.createLocks $diiir N)rrrrrrrr r r r s+&&&$$$.....r r ) logging __version__ Exceptionrr ImportErrorHandler getLoggerrlogger addHandlerrr r r!s      y   /#######////////go//////  8 $ $++-- s 88PK!/sg!__pycache__/wheel.cpython-311.pycnu[ ^iddlmZddlZddlZddlZddlmZddlZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZddlZddlZddlmZmZddlmZmZmZmZmZddlmZddlmZmZm Z m!Z!dd l"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,dd l-m.Z.m/Z/e j0e1Z2da3e4ed rd Z5n-ej67d rdZ5nej6dkrdZ5ndZ5ej8dZ9e9sdej:ddzZ9de9zZ;e5e9zZ<e,=dd=ddZ>ej8dZ?e?rEe?7dr0e?=dd@ddZ?ndZAeAZ?[Ae jBde jCe jDzZEe jBde jCe jDzZFe jBdZGe jBdZHd ZId!ZJe jKd"krd#ZLnd$ZLGd%d&eMZNeNZOGd'd(eMZPd)ZQd*ZReRZS[Rd,d+ZTdS)-)unicode_literalsN)message_from_file) __version__DistlibException) sysconfigZipFilefsdecode text_typefilter)InstalledDistribution)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME) FileOperator convert_path CSVReader CSVWriterCachecached_propertyget_cache_base read_exportstempdir get_platform)NormalizedVersionUnsupportedVersionErrorpypy_version_infoppjavajycliipcppy_version_nodotz%s%spy-_.SOABIzcpython-c<dtg}tjdr|dtjdr|dtjddkr|dd |S) Nr$Py_DEBUGd WITH_PYMALLOCmPy_UNICODE_SIZEu) VER_SUFFIXrget_config_varappendjoin)partss /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/wheel.py _derive_abir;<sz"  #J / /  LL     #O 4 4  LL     #$5 6 6! ; ; LL   wwu~~zz (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))? -(?P\w+\d+(\.\w+\d+)*) -(?P\w+) -(?P\w+(\.\w+)*) \.whl$ z7 (?P[^-]+) -(?P\d+[^-]*) (-(?P\d+[^-]*))?$ s \s*#![^\r\n]*s^(\s*#!("[^"]+"|\S+))\s+(.*)$s#!pythons #!pythonw/c|SNos r:rC^sr<cB|tjdS)Nr=)replaceosseprAs r:rCrC`s263//r<c.eZdZdZdZdZddZdZdS)Mounterc"i|_i|_dSr?) impure_wheelslibsselfs r:__init__zMounter.__init__ds r<cN||j|<|j|dSr?)rKrLupdate)rNpathname extensionss r:addz Mounter.addhs+'18$ $$$$$r<cl|j|}|D]\}}||jvr|j|=dSr?)rKpoprL)rNrRrSkvs r:removezMounter.removelsJ'++H55  ! !DAqDI~~IaL ! !r<Nc"||jvr|}nd}|Sr?)rL)rNfullnamepathresults r: find_modulezMounter.find_modulers ty FFF r<c8|tjvrtj|}nx||jvrtd|zt j||j|}||_|dd}t|dkr |d|_ |S)Nzunable to find extension for %sr*rr) sysmodulesrL ImportErrorimp load_dynamic __loader__rsplitlen __package__)rNr[r]r9s r: load_modulezMounter.load_moduleys s{ " "[*FFty((!"Ch"NOOO%h (0CDDF $F OOC++E5zzA~~%*1X" r<r?)__name__ __module__ __qualname__rOrTrYr^rir@r<r:rIrIcsd%%%!!!      r<rIceZdZdZdZdZddZedZedZ ed Z e d Z d Z e d Zd ZddZdZdZdZddZdZdZdZdZdZdZd dZdZdZddZdS)!Wheelz@ Class to build and install from Wheel files (PEP 427). )rrsha256NFc||_||_d|_tg|_dg|_dg|_tj|_ |d|_ d|_ |j |_ dSt|}|r^|d}|d|_ |dd d |_ |d |_|j |_ dStj|\}}t(|}|st+d |z|r$tj||_ ||_ |d}|d|_ |d|_ |d |_|d d|_|dd|_|dd|_dS)zB Initialise an instance using a (valid) filename. r4noneanyNdummyz0.1nmvnr)r(bnzInvalid name or filename: %rr'r*biar)sign should_verifybuildverPYVERpyverabiarchrFgetcwddirnamenameversionfilename _filenameNAME_VERSION_REmatch groupdictrEr\split FILENAME_RErabspath)rNrryverifyr0infors r:rOzWheel.__init__s # W 8G y{{  DI DL!]DNNN%%h//A 2{{2 J #Dz11#s;; $T  !%$&GMM($;$;!%%h//F*,:z"Wheel.metadata..!5!5!5Q#a&&!5!5!5r<)fileobjz8Invalid wheel, because metadata is missing: looked in %sz, )rFr\r8rrrrcodecs getreaderr get_wheel_metadatartuplerr posixpathopenrKeyError ValueError)rNrRname_verinfo_dirwrapperzfwheel_metadatawv file_versionfnsr]fnmetadata_filenamebfwfs r:metadatazWheel.metadatas\7<< dm<<"iii6!H,"7++ Xs # # Kr!44R88N066sA>>B !5!5"!5!5!566L +,DECF  (1x(D(D%!233"r$WR[[!)"!5!5!5!"! """"""""""""""""""""""""  D K "9;?99S>>"JKKK K+ K K K K K K K K K K K K K K K0 sg%AE8*D4/D( D4E8 D4(D, ,D4/D, 0D43E84 E>E8E*E88E<?E<c(|jd|j}d|z}tj|d}||5}t jd|}t|}dddn #1swxYwYt|S)Nr(rWHEELr) rrrr8rrrrdict)rNrrrrrrmessages r:rzWheel.get_wheel_metadatas"iii6!H,%N8W== WW& ' ' ,2*!'**2..B'++G , , , , , , , , , , , , , , ,G}}s-A::A>A>ctj|j|j}t |d5}||}dddn #1swxYwY|S)Nr)rFr\r8rrr r)rNrRrr]s r:rz Wheel.infos7<< dm<< Xs # # 1r,,R00F 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 sAA!$A!ct|}|r|}|d|||d}}d|vrt}nt }t |}|rd|dz}nd}||z}||z}n\|d}|d} |dks|| krd} n|||dzd krd } nd} t | z|z}|S) Nspythonw r<  rr&s ) SHEBANG_RErendlowerSHEBANG_PYTHONWSHEBANG_PYTHONSHEBANG_DETAIL_REgroupsfind) rNdatar0rshebangdata_after_shebangshebang_pythonargscrlfterms r:process_shebangzWheel.process_shebangs#   T " "  0%%''C*.tt*d344j'GW]]__,,!0!/!''00A ahhjjn,$t+G//DD5!!B5!!BAvvb26 ?g--"DD D!D(4/D r<c8||j} tt|}n #t$rt d|zwxYw||}t j|d d}||fS)NzUnsupported hash algorithm: %r=ascii) hash_kindgetattrhashlibAttributeErrorrdigestbase64urlsafe_b64encoderstripdecode)rNrrhasherr]s r:get_hashzWheel.get_hash%s  I QWi00FF Q Q Q"#Ci#OPP P Q$$&&)&1188>>EEgNN&  s!>c4t|}ttj||}||ddft |5}|D]}|| ddddS#1swxYwYdS)Nr4)listto_posixrFr\relpathr7rwriterow)rNrecords record_pathbasepwriterrows r: write_recordzWheel.write_record0sw-- RW__[$77 8 82r{### { # # %v % %$$$$ % % % % % % % % % % % % % % % % % % %s$B  BBcdg}|\}}tt|j}|D]\}} t| d5} | } dddn #1swxYwYd|| z} t j| } | || | ft j |d} | || |tt j |d}| || fdS)Nrbz%s=%sRECORD) rrrrreadrrFr\getsizer7r8rr)rNrlibdir archive_pathsrdistinforraprfrrsizes r: write_recordszWheel.write_records8sO!($.11" / /EBa !vvxx               t}}T222F7??1%%D NNB- . . . . GLL8 , , '1f--- bgll8X66 7 7b!W%%%%%sAA !A ct|dtj5}|D]7\}}td|||||8 ddddS#1swxYwYdS)NwzWrote %s to %s in wheel)r zipfile ZIP_DEFLATEDloggerdebugwrite)rNrRrrrrs r: build_zipzWheel.build_zipHs XsG$8 9 9 R&  A 62>>>B                   s;A%%A),A)c  |i}ttfddd}|dkrd}tg}tg}tg}nd}t g}dg}d g}|d ||_|d ||_|d ||_ |} |j d |j } d| z} d| z} g} dD]}|vr|}tj |r_tj|D]I\}}}|D]>}t!tj ||}tj ||}t'tj | ||}| ||f|dkr|dst-|d5}|}dddn #1swxYwY||}t-|d5}||dddn #1swxYwY@K| }d}tj|D]\}}}||krjt5|D]N\}}t!|}|dr%tj ||}||=nO|s Jd|D]}t!|dr%tj ||}t'tj ||}| ||ftj|}|D]w}|dvrqt!tj ||}t'tj | |}| ||fxd|p|jzdt:zd|zg}|jD]$\}}}|d|d |d |%tj |d}t-|d5}|d|dddn #1swxYwYt'tj | d}| ||fd } t?| | !} | || f| | tj |j!|j"}!|#|!| |!S)"z Build a wheel from files in specified paths, and use any specified tags when determining the name of the wheel. Nc |vSr?r@)rBpathss r:rCzWheel.build..Vs qEzr<)purelibplatlibrrfalsetruerqrrr}r~rr(%s.datar)rheadersscriptsr .exerwb .dist-infoz(.dist-info directory expected, not found)z.pycz.pyo)r INSTALLERSHAREDrzWheel-Version: %d.%dzGenerator: distlib %szRoot-Is-Purelib: %szTag: rr cV|d}|d}d|vr|dz }||fS)Nrr=r i')count)trns r:sorterzWheel.build..sorters71B Ar!!U r7Nr<)key)$rr IMPVERABIARCHr|getr}r~rrrrFr\isdirwalkr r8rrr7endswithrrrr enumeratelistdir wheel_versionrrsortedrrrr)"rNrrr libkeyis_pure default_pyver default_abi default_archrrdata_dirrrrr\rootdirsfilesrrrprrrrrdnrr}r~rrrRs" ` r:buildz Wheel.buildNs' <Df11113IJJKKAN Y  G#HM%K 6LLG"GM!(K!7LXXg}55 88E;//HHV\22 v"iii6x'!H, 2 . .C%:Dw}}T"" .)+ . .%D$# . .$RW\\$%;%;<<W__Q55%bgll8S"&E&EFF%,,b!W555)++AJJv4F4F+!%a0!'(vvxx000000000000000#'#7#7#=#=D!%a.! ! ............... .!# . . D$t||'t__EAr!"B{{<00#%7<<b#9#9 G KK!KKKx . .B<<(()9::GLLr**bgooa6677$$b!W----  . 8$$ . .BCCCRW\\(B7788bgll8R8899$$b!W--- #m&It7I J #k 1 !G +  !%  H H E3  ! ! !UUUCCC"F G G G G GLL7 + + !S\\ /Q GGDIIn-- . . . / / / / / / / / / / / / / / / bgll8W55 6 6b!W%%%     }&999  Hh/GGG7<< dm<< x///s6"H H H 3I I I )R<<SSc,|dS)zl Determine whether an archive entry should be skipped when verifying or installing. )r=z /RECORD.jws)r)rNarcnames r: skip_entryzWheel.skip_entrys 4555r<c |j}|d}|dd}|dd}tj|j|j}|jd|j} d| z} d| z} tj| t} tj| d} tj| d }tj d }t|d 5}|| 5}||}t|}d d d n #1swxYwY|d dd}t#d|D}||jkr|r||j||ddkr |d}n|d}i}||5}t'|5}|D]}|d}|||< d d d n #1swxYwYd d d n #1swxYwYtj| d}tj| d}tj| dd}t)|}d|_t,j } g}!t1j}"|"|_d |_ |D]}#|#j}$t;|$t<r|$}%n|$d }%| |%rM||%}|dr0tC|#j"|dkrtGd|%z|dr|ddd\}&}'||$5}|$}(d d d n #1swxYwY|%|(|&\})}*|*|'krtGd|$z|r4|%&||frtN(d|%\|%&|o|%)d  }+|%&|rN|%d!d\})},}-tj||,tU|-}.n5|%| |fvrtj|tU|%}.|+su||$5}|+||.d d d n #1swxYwYtjd"kr tj,|.|#j-d#z d$z|!.|.|sv|drnt|.d%5}|$}(|%|(|&\})}/|/|*krtGd&|.z d d d n #1swxYwY| rq|.)d'r\ |/|.|(}0|!.|0h#t`$r tN1d)d*YwxYwtj2tU|$}1tj|"|1}2||$5}|+||2d d d n #1swxYwYtj|.\}3}1|3|_|3|1}4|4|4|!5|4|rtN(d+d }5n[d }6|j6d }|d,krtj| d-}7 ||75}to|}8d d d n #1swxYwYi}6d.D]t}9d/|9z}:|:|8vriix|6d0|9z<};|8|:8D]D}<||6d9i}?|>s|?r|dd}@tj>|@std:|@|_|>@D]6\}:}<|:d;|<}A|3|A}4|4|47|?rPd||5tjF|"cd d d S#t`$r0tNGd?|HwxYw#tjF|"wxYw#1swxYwYd S)@a~ Install a wheel to the specified paths. If kwarg ``warner`` is specified, it should be a callable, which will be called with two tuples indicating the wheel version of this software and the wheel version in the file, if there is a discrepancy in the versions. This can be used to issue any warnings to raise any exceptions. If kwarg ``lib_only`` is True, only the purelib/platlib files are installed, and the headers, scripts, data and dist-info metadata are not written. If kwarg ``bytecode_hashed_invalidation`` is True, written bytecode will try to use file-hash based invalidation (PEP-552) on supported interpreter versions (CPython 2.7+). The return value is a :class:`InstalledDistribution` instance unless ``options.lib_only`` is True, in which case the return value is ``None``. warnerlib_onlyFbytecode_hashed_invalidationr(rrrrrrNrr*rc,g|]}t|Sr@rrs r:rz!Wheel.install..rr<zRoot-Is-Purelibrrrstreamrr4r )dry_runTr&size mismatch for %s=digest mismatch for %szlib_only: skipping %sr r=posixirzdigest mismatch on write for %sz.py)hashed_invalidationzByte-compilation failed)exc_infozlib_only: returning Nonez1.0zentry_points.txt)consoleguiz %s_scriptszwrap_%s:z [%s],zAUnable to read legacy script metadata, so cannot generate scriptsrSzpython.commandsz8Unable to read JSON metadata, so cannot generate scripts wrap_consolewrap_guizValid script path not specifiedz = rAlibprefixzinstallation failed.)Ir8rrFr\r8rrrrrrrrr rrrrr rrrecordr`dont_write_bytecodetempfilemkdtemp source_dir target_dirinfolist isinstancer rr0str file_sizerrr startswithrrrr copy_streamchmod external_attrr7 byte_compile Exceptionwarningbasenamemakeset_executable_modeextendrrvaluesrGsuffixflagsjsonloadrritemsr rwrite_shared_locationswrite_installed_filesshutilrmtree exceptionrollback)CrNrmakerkwargsr8r2r3bc_hashed_invalidationrRrr'r metadata_namewheel_metadata_name record_namerrbwfrrrrrrrreaderrrdata_pfxinfo_pfx script_pfxfileopbcoutfilesworkdirzinfor/ u_arcnamekindvaluerr)r is_scriptwherer+outfile newdigestpycrworknamer, filenamesdistcommandsepepdatarrWr.rXsconsole_scripts gui_scripts script_dirscriptoptionssC r:installz Wheel.installs"-H%%::j%00!',JE!R!R7<< dm<<"iii6x'!H,!x1IJJ 'nXw??nXx88 "7++ Xs # #J 'r,-- 0WS\\+B// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)//Q77B !5!5"!5!5!566L 2222t)<888()V33y)y)G%% )b))))V%))F%( )))))))))))))))) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) !~h33H ~h33H")R@@J"'222F FM,,BH&((G 'E #E a '[[]]K3K3E#nG!'955<$+ $+NN7$;$; y11! !),C1vA#eo"6"6#a&"@"@.046?0@AAA1vC&)!fll3&:&: eWWW---#%7799D---------------$(MM$$=$= 6!U??"248:A4B#C#CC !I$8$8(H9M$N$N! %'> 5""$',,uU|\"=M=M"N"N%)'"2"25"9"9 >>&,&9&9'Nd':'f'f ( 4 4 4 4#,>>>!'/H8<!/!>!>!>!>!>>  W--l7.C.CDD#%7<<#<#<WWW--="..r8<<<==============="$w!7!7B+-($)JJrNN 229===  2222L8LL!;<<<DD $H#'9_#=L#u,,&^H6HII6!#;)5c):):;;;;;;;;;;;;;;;')H'966$03$6#$;;DF$FHY_$=-3AY-=-=-?-?%6%678xxx,J+,7)M,-388AG;L;L1L,LA45!& 6 )666"NN,5666666 F!#!7!7O3%,WS\\+/9R==+<+<\+J+J#+!O/7||&02='>'>!>/9E,(7(=(=(?(?FF167aa);,1JJv,>,> & : :9 E E E E*J+0$.,7,=,=,?,?!J!JDAq:;!!QQ-?F05 670K0KI$*$>$>y$I$I$I$I VX66A033D!KKEi(i(#)E%L33E7CCA+ ***..xx/6888  g&&&UJ 'J 'J 'J 'J 'J 'J 'J 'J     !7888!!!   g&&&&UJ 'J 'J 'J 'J 'J 'J 'J 'J 'J 's6l7 D3' l73D7 7l7:D7 ;B l7H G6* H 6G: :H =G: >H  l7 H l7H B l7 Ck!=N k!N" "k!%N" &Ek!+T k!T k!T A"k!8AW ? k! W k!W k!.,Xk!&Yk!YA&k!,[ k![ k![ B7k!a$_4 a_ a_ Al;ct^tjt t ddt jddz}t|atS)Nz dylib-cachez%s.%sr&) cacherFr\r8rrPr` version_infor)rNrs r:_get_dylib_cachezWheel._get_dylib_cachesT =7<< 0 0#m2D2D '#*:2A2*> >@@D$KKE r<c tj|j|j}|jd|j}d|z}tj|d}tj d}g}t|d5} | |5}||} tj | } |} | |} tj| j| } tj| stj| | D]\}}tj| t)|}tj|sd}nftj|j}t0j|}||}t1j|j}||k}|r||| |||f dddn #1swxYwYn#t<$rYnwxYwdddn #1swxYwY|S)Nr(r EXTENSIONSrrT)rFr\r8rrrrrrrr rr`rar prefix_to_dirrrmakedirsrbrrstatst_mtimedatetime fromtimestampgetinfo date_timeextractr7r)rNrRrrr/rr]rrrrSrrG cache_baserrdestr file_timer wheel_times r:_get_extensionszWheel._get_extensionss7<< dm<<"iii6!H,.<88"7++ Xs # # r WWW%%4 B!%2J 1133E"00::F!#ej&!A!AJ7==440 J///)3)9)9);); 4 4 g!w||J W8M8MNN!w~~d33=&*GG(* (>I(0(9(G(G (R(RI#%::g#6#6D)1):DN)KJ&09&I FH?3 I ?I I I I  I' II'II''I+.I+c t|S)zM Determine if a wheel is compatible with the running system. ) is_compatiblerMs r:rzWheel.is_compatiblesT"""r<cdS)zP Determine if a wheel is asserted as mountable by its metadata. Tr@rMs r: is_mountablezWheel.is_mountables tr<ctjtj|j|j}|sd|z}t||sd|z}t||tjvrt d|dS|r tj |n tj d||}|rTttjvr$tj tt||dSdS)Nz)Wheel %s not compatible with this Python.z$Wheel %s is marked as not mountable.z%s already in pathr)rFr\rr8rrrrrr`rrr7insertr_hook meta_pathrT)rNr7rRmsgrSs r:mountz Wheel.mounts>7??27<< dm#L#LMM!!## (=HC"3'' '  "" (88CC"3'' ' sx   LL-x 8 8 8 8 8 -))))8,,,--//J 0 --M((/// (J///// 0 0r<ctjtj|j|j}|t jvrtd|dSt j ||tj vrt |tj s9tt j vr(t j tdSdSdS)Nz%s not in path) rFr\rr8rrr`rrrYrrKr)rNrRs r:unmountz Wheel.unmount s7??27<< dm#L#LMM 38 # # LL)8 4 4 4 4 4 HOOH % % %5... X&&&& 0CM))M((///// 0 0))r<c.tj|j|j}|jd|j}d|z}d|z}tj|t}tj|d}tj|d}tj d}t|d5} | |5} || } t| } dddn #1swxYwY| dd d } td | D}i}| |5}t!| 5}|D]}|d }|||< dddn #1swxYwYdddn #1swxYwY| D]Q}|j}t%|t&r|}n|d}|d}d|vrt+d|z||rx||}|dr0t/|j|dkrt+d|z|d r|d dd \}}| |5}|}dddn #1swxYwY|||\}}||krt+d|zS ddddS#1swxYwYdS)Nr(rrrrrrrr*rc,g|]}t|Sr@rrs r:rz Wheel.verify..(rr<r6rr=..invalid entry in wheel: %rr&r9r:r;)rFr\r8rrrrrrrrr rrrrrrNrOr rrr0rPrQrr)rNrRrr'rrlrmrnrrrorrrrrrrprrrxr/ryrzr{rr)rs r:rz Wheel.verifysr7<< dm<<"iii6x'!H,!x1IJJ 'nXw??nXx88 "7++ Xs # #* ?r,-- 0WS\\+B// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)//Q77B !5!5"!5!5!566LG%% )b))))V%))F%( )))))))))))))))) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )  ? ?.gy118 'II 'w 7 7IOOC((199*,79B,CDDD??9--i(q6=c%/22c!f<<*,02;,<===q6?"%a&,,sA"6"6KD%)))R!wwyy))))))))))))))) $ dD 9 9IAv.046=0>???5 ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?* ?s.L C+ L +C/ /L 2C/ 3AL F E3' F 3E7 7F :E7 ;F > L  F L F D L J>2 L >K L K 6L  LLc Zd}d}tj|j|j}|jd|j}d|z}tj|d} t5} t|d5} i} | D]} | j}t|tr|}n| d}|| kr=d|vrtd |z| | | tj| t!|}|| |< d d d n #1swxYwY|| |\}}|| fi|}|r3|| |\}}|r||kr ||||/t#jd d | \}}tj|nVtj|std|ztj||j}t+| }tj| |}||f}||| |||||t3j||d d d n #1swxYwY|S)a Update the contents of a wheel in a generic way. The modifier should be a callable which expects a dictionary argument: its keys are archive-entry paths, and its values are absolute filesystem paths where the contents the corresponding archive entries can be found. The modifier is free to change the contents of the files pointed to, add new entries and remove entries, before returning. This method will extract the entire contents of the wheel to a temporary location, call the modifier, and then use the passed (and possibly updated) dictionary to write a new wheel. If ``dest_dir`` is specified, the new wheel is written there -- otherwise, the original wheel is overwritten. The modifier should return True if it updated the wheel, else False. This method returns the same value the modifier returns. c~dx}}|dt}||vrd|z}||vr||}t|j}||fS)Nr=z %s/PKG-INFOr\)rrr)path_maprrr\rs r: get_versionz!Wheel.update..get_version`sb! !Gd%XX'?'?@C(""#h.h}"---5D= r<c`d} t|}|d}|dkrd|z}nfd||dzddD}|dxxdz cc<|d|ddd |D}n+#t$rt d |YnwxYw|rft| }||_| t}| || t d ||dSdS)Nr(rz%s+1c,g|]}t|Sr@r)rrs r:rz8Wheel.update..update_version..rsHHHSVVHHHr<rr*r+c34K|]}t|VdSr?)rPrs r: z7Wheel.update..update_version..us(1H1HQ#a&&1H1H1H1H1H1Hr<z0Cannot update non-compliant (PEP-440) version %rr)r\legacyzVersion updated from %r to %r) rrrr8rrrrrrrr)rr\updatedrXrr9mdrs r:update_versionz$Wheel.update..update_versionjsxG 4%g..LL%%q55$w.GGHHWQUVV_-B-B3-G-GHHHE"IIINIII)0!),1H1H%1H1H1H)H)H)HJG* 4 4 4 *+244444 4 &4((($ '?@@d6222 #@#@#@KBHRLLLL7==22Q./Dx/OPPP gll8T]CCG $X^^%5%5 6 6 7<<::)""4-@@@w 666#OGX666Y, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7Zs8*J ;B3D;/ J ;D? ?J D? EJ  J$'J$)NFFr?)NN)F)rjrkrl__doc__r rrOpropertyrrrrrrrrrrrrr-r0rrrrrrrrrQr@r<r:rnrnsMI'2'2'2'2R;;X; $$X$++X+ _>_ < ! ! ! !%%%&&&    rrrrh666 k'k'k'Z   D###  0000* 0 0 06?6?6?pccccccr<rncddl}|}g}|ddkre|ddD]:}||rt |nd;t |}|S)Nrglibcrr*)platformlibc_verrr7isdigitrr)rverr]rs r:_get_glibc_versionrsOOO     C F 1vQc"" 8 8A MMAIIKK6#a&&&Q 7 7 7 7v Mr<c  tg}td}ttjddz ddD]9}|d|t |g:g}tjD]J\}}}| dr/|| dddK| tdkr| dt|dg}tg}tjd krt!jd t}|r|\} }}} t'|}| g} | d vr| d | d vr| d| dvr| d| dvr| d| dvr| d|dkr=| D]/} | d|d|d| } | tkr|| 0|dz}|dk=|D]}|D]} |dt(|df|| f|dkrhtj drH| dd} t-}t/|dkr|dkr;|dt(|df|d| zf|dkr;|dt(|df|d| zf|dkr;|dt(|df|d| zf|dt(|df|d|dd|dd| ft1|D]u\}}|dt(|fddf|dkr8|dt(|dfddfvt1|D]k\}}|dd |fddf|dkr3|dd |dfddflt3|S)!zG Return (pyver, abi, arch) tuples compatible with this Python. rrrr4z.abir*r&rqdarwinz(\w+)_(\d+)_(\d+)_(\w+)$)i386ppcfat)rrx86_64fat3)ppc64rfat64)rrintel)rrrrr universalr)linuxlinux_)r&z manylinux1_%s)r& zmanylinux2010_%s)r&zmanylinux2014_%s manylinux_rrr')r5ranger`rr7r8rPrc get_suffixesrRrsortrrrrrerrr IMP_PREFIXrErrgrset)versionsmajorminorabisr^r)r]archesr0rrmatchesrrr~r9rrs r:compatible_tagsrs?|H qMEs'*Q.R8866E 3445555 D(**11 1   V $ $ 1 KK S!,,Q/ 0 0 0IIKKK f}} AsKK FVF |x H0$ 7 7  '(xxzz $D%JJEfG&&u%%%000v&&&***w''')))w'''BBB{+++1**$))E)-uuueeeUUCADyy a(((  1**CC C CD MM277J #<==sDI J J Jf}}!8!8!A!A}||Hb11*,,u::?? rww HQK/H'I'I3'6'='?@@@'' rww HQK/H'I'I3'9D'@'BCCC'' rww HQK/H'I'I3'9D'@'BCCCMM277J +D#E#Ess;@888U1XXX;?4$A#BCCC! C* ))NN 7 rww G455vuEFFF 66 MM277J #;<rsv(''''' ######   ++++++++CCCCCCCCCCCCCC++++++111111111111!!!!!!!!!!!!!!!!!!!!!!!!@???????  8 $ $  73#$$JJ\V$$JJ\UJJJ %Y %&8 9 9 /#*2A2..J z j |~~c3''//S99iw'' 3>>* % %  ++j$ ' ' - -c 2 21 5CC +--Cbj]RZ!! "*]RZ !! RZ) * * BJ@AA6S=={HH//H!!!!!f!!!F  i i i i i Fi i i VMMM`"/##      r<PK!zhzh!__pycache__/index.cpython-311.pycnu[ ^iQddlZddlZddlZddlZddlZddlZ ddlmZn#e$r ddl mZYnwxYwddl m Z ddl m Z mZmZmZmZmZddlmZmZejeZdZdZGd d eZdS) N)Thread)DistlibException)HTTPBasicAuthHandlerRequestHTTPPasswordMgrurlparse build_opener string_types)zip_dir ServerProxyzhttps://pypi.org/pypipypiceZdZdZdZddZdZdZdZdZ d Z d Z dd Z dd Z dd Z ddZdZ ddZ ddZddZdZdZddZdS) PackageIndexzc This class represents a package index compatible with PyPI, the Python Package Index. s.----------ThIs_Is_tHe_distlib_index_bouNdaRY_$Nc|pt|_|t|j\}}}}}}|s|s|s|dvrt d|jzd|_d|_d|_d|_ttj d5}dD];} tj | dg||} | dkr | |_n,#t$rY8wxYwddddS#1swxYwYdS) z Initialise an instance. :param url: The URL of the index. If not specified, the URL for PyPI is used. )httphttpszinvalid repository: %sNw)gpggpg2z --versionstdoutstderrr) DEFAULT_INDEXurlread_configurationr rpassword_handler ssl_verifierrgpg_homeopenosdevnull subprocess check_callOSError) selfrschemenetlocpathparamsqueryfragsinksrcs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/index.py__init__zPackageIndex.__init__$s~'- !!!4    '''''' dr6c|j|jtdt}t |j\}}}}}}||j||j|jt||_ dS)zp Check that ``username`` and ``password`` have been set, and raise an exception if not. Nz!username and password must be set) r9r:rrr r add_passwordr;rr)r&pm_r(s r0rAzPackageIndex.check_credentials_s} = DM$9"#FGG G    ( 2 261aA  FDM4=III 4R 8 8r6c|||}d|d<||g}||}d|d<||g}||S)aq Register a distribution on PyPI, using the provided metadata. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the distribution to be registered. :return: The HTTP response received from PyPI upon submission of the request. verify:actionsubmit)rAvalidatetodictencode_requestitems send_request)r&metadatadrequestresponses r0registerzPackageIndex.registerks     OO  ) %%aggii44$$W--) %%aggii44  )))r6c |}|sn\|d}||t|d|s|dS)ar Thread runner for reading lines of from a subprocess into a buffer. :param name: The logical name of the stream (used for logging only). :param stream: The stream to read from. This will typically a pipe connected to the output stream of a subprocess. :param outbuf: The list to append the read lines to. Tutf-8z: N)readlinedecoderstripappendloggerdebugclose)r&namestreamoutbufr.s r0_readerzPackageIndex._readers /!!A !!((**A MM!    LLTTT11- . . .  /  r6c |jdddg}||j}|r|d|g||gdtj}t j|t j|dz}|dd d |d ||gt d d |||fS)a Return a suitable command for signing a file. :param filename: The pathname to the file to be signed. :param signer: The identifier of the signer of the file. :param sign_password: The passphrase for the signer's private key used for signing. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The signing command as a list suitable to be passed to :class:`subprocess.Popen`. --status-fd2--no-ttyN --homedir)z--batchz--passphrase-fd0z.ascz --detach-signz--armorz --local-userz--output invoking: %s ) rrextendtempfilemkdtempr!r)joinbasenamer[r\)r&filenamesigner sign_passwordkeystorer5tdsfs r0get_sign_commandzPackageIndex.get_sign_commandsxZ8  }H  0 JJ X. / / /  $ JJ::: ; ; ;     W\\"bg..x886A B B OYJH6 7 7 7 ^SXXc]]333Bwr6c@tjtjd}|tj|d<g}g}tj|fi|}t|jd|j|f}|t|jd|j|f}||3|j ||j | | | |j ||fS)a Run a command in a child process , passing it any input data specified. :param cmd: The command to run. :param input_data: If specified, this must be a byte string containing data to be sent to the child process. :return: A tuple consisting of the subprocess' exit code, a list of lines read from the subprocess' ``stdout``, and a list of lines read from the subprocess' ``stderr``. rNstdinr)targetargsr)r#PIPEPopenrrarstartrrwwriter]waitrm returncode) r&r5 input_datakwargsrrpt1t2s r0 run_commandzPackageIndex.run_commands!o o    !(oF7O  S + +F + +4> > OO    48 4JKKKK>>(FM*244 (D ! ! !QI ! ! ! ! ! ! ! ! ! ! ! ! ! ! ![++5577 y11;;==  $ # "$*      RW--h77CD  5h%% $6688 $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ LL/27+;+;H+E+E!# $ $ $ M"'//(33 4 4 4%%aggii77  )))s$<CC!$C!F&&F*-F*c(|tj|st d|ztj|d}tj|st d|z||j|j }}t| }dd|fd|fg}d||fg}| ||} | | S)a2 Upload documentation to the index. :param metadata: A :class:`Metadata` instance defining at least a name and version number for the documentation to be uploaded. :param doc_dir: The pathname of the directory which contains the documentation. This should be the directory that contains the ``index.html`` for the documentation. :return: The HTTP response received from PyPI upon submission of the request. znot a directory: %rz index.htmlz not found: %r)rI doc_uploadr^versionr)rAr!r)isdirrrmrrKr^rr getvaluerMrO) r&rPdoc_dirfnr^rzip_datafieldsrrRs r0upload_documentationz!PackageIndex.upload_documentation!s    w}}W%% D"#87#BCC C W\\'< 0 0w~~b!! 9"?R#788 8 x'7g7##,,..+4.9g"68T8,-%%fe44  )))r6c|jdddg}||j}|r|d|g|d||gtdd||S) a| Return a suitable command for verifying a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: The verifying command as a list suitable to be passed to :class:`subprocess.Popen`. rcrdreNrfz--verifyrhri)rrrjr[r\rm)r&signature_filename data_filenamerrr5s r0get_verify_commandzPackageIndex.get_verify_command=s}xZ8  }H  0 JJ X. / / / J 2MBCCC ^SXXc]]333 r6c|jstd||||}||\}}}|dvrtd|z|dkS)a6 Verify a signature for a file. :param signature_filename: The pathname to the file containing the signature. :param data_filename: The pathname to the file containing the signed data. :param keystore: The path to a directory which contains the keys used in verification. If not specified, the instance's ``gpg_home`` attribute is used instead. :return: True if the signature was verified, else False. z0verification unavailable because gpg unavailable)rrz(verify command failed with error code %sr)rrrr)r&rrrrr5r/rrs r0verify_signaturezPackageIndex.verify_signatureUsx 2"$122 2%%&8-&.00!--c22FF V  "$')+$,-- -Qwr6c <|d}tdn^t|ttfr|\}}nd}t t |}td|zt|d5}|t|} | } d} d} d} d} d | vrt| d } |r || | |  | | }|snS| t|z } |||r||| d z } |r || | | k |n#|wxYw dddn #1swxYwY| dkr| | krt#d | | fz|rQ|}||krt#|d|d|d|td|dSdS)a This is a convenience method for downloading a file from an URL. Normally, this will be a file from the index, though currently no check is made for this (i.e. a file can be downloaded from anywhere). The method is just like the :func:`urlretrieve` function in the standard library, except that it allows digest computation to be done during download and checking that the downloaded data matched any expected value. :param url: The URL of the file to be downloaded (assumed to be available via an HTTP GET request). :param destfile: The pathname where the downloaded file is to be saved. :param digest: If specified, this must be a (hasher, value) tuple, where hasher is the algorithm used (e.g. ``'md5'``) and ``value`` is the expected value. :param reporthook: The same as for :func:`urlretrieve` in the standard library. NzNo digest specifiedrzDigest specified: %swbi rzcontent-lengthzContent-LengthTrz1retrieval incomplete: got only %d out of %d bytesz digest mismatch for z : expected z, got zDigest verified: %s)r[r\ isinstancelisttuplegetattrrr rOrinfointrlenr}rr]rr)r&rdestfiledigest reporthookdigesterhasherdfpsfpheaders blocksizesizerblocknumblockactuals r0 download_filezPackageIndex.download_filens, >H LL. / / / /&4-00 !'/ww//11H LL/&8 9 9 9(D ! ! S##GCLL11C ((** #w..w'7899D:JxD999 >HHY//E CJJ&DIIe$$$/ ...MH!>" 8Y=== >  5               : 199"C,     8''))F&7=vvxxx7=vvvv(GHHH LL. 7 7 7 7 7  8 8s+#F2B0E8#F8FFF"%F"cg}|jr||j|jr||jt|}||S)z Send a standard library :class:`Request` to PyPI and return its response. :param req: The request to send. :return: The HTTP response from PyPI (a standard library HTTPResponse). )rrZrr r )r&reqhandlersopeners r0rOzPackageIndex.send_requestse   3 OOD1 2 2 2   / OOD- . . .x({{3r6c Lg}|j}|D]n\}}t|ttfs|g}|D]G}|d|zd|zdd|dfHo|D]<\}} } |d|zd|d| ddd| f=|d|zdzdfd|} d |z} | tt| d } t|j | | S) a& Encode fields and files for posting to an HTTP server. :param fields: The fields to send as a list of (fieldname, value) tuples. :param files: The files to send as a list of (fieldname, filename, file_bytes) tuple. s--z)Content-Disposition: form-data; name="%s"rVr6z&Content-Disposition: form-data; name="z "; filename=""s smultipart/form-data; boundary=)z Content-typezContent-length) boundaryrrrrjrrmstrrrr)r&rrpartsrkvaluesvkeyrovaluebodyctrs r0rMzPackageIndex.encode_requests|= ( (IAvftUm44 "  ( ( H$@wHHW%% '(((( (%*   C5 LL  ##xxx!"(&//       eh&.4555||E"" . 9!#d))nn  txw///r6ct|trd|i}t|jd} |||pd|dS#|dwxYw)Nr^g@)timeoutandr])rr r rsearch)r&termsoperator rpc_proxys r0rzPackageIndex.searchs e\ * * $UOE#666  !##E8+rsc '       '''&&&&&&&&';;;;;;;;;;;;;;;;&&&&&&&&  8 $ $'  a!a!a!a!a!6a!a!a!a!a!s ! //PK!!m5Q5Q#__pycache__/scripts.cpython-311.pycnu[ ^i8E ddlmZddlZddlZddlZddlZddlZddlmZm Z m Z ddl m Z ddl mZmZmZmZmZmZejeZdZejdZd Zd ZeZGd d eZdS) )BytesION) sysconfigdetect_encodingZipFile)finder) FileOperatorget_export_entry convert_pathget_executable get_platformin_venva s^#!.*pythonw?[0-9.]*([ ].*)?$z# -*- coding: utf-8 -*- import re import sys from %(module)s import %(import_name)s if __name__ == '__main__': sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) sys.exit(%(func)s()) cd|vrj|dr;|dd\}}d|vr|ds|d|d}n|dsd|z}|S)N z /usr/bin/env r"z "z"%s") startswithsplit) executableenv _executables /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/scripts.pyenquote_executabler3s j   1 1 1)//Q77 Ck!!+*@*@*E*E!*-##{{{; ((-- 1#j0 c6eZdZdZeZdZ ddZdZe j drdZ d Z d Zdd Zd ZeZdZdZdZdZddZdZedZejdZejdksejdkrejdkrdZddZ ddZ!dS) ScriptMakerz_ A class to copy or create scripts from source scripts or callable specifications. NTFc||_||_||_d|_d|_t jdkpt jdkot jdk|_td|_ |pt||_ t jdkpt jdkot jdk|_ tj|_dS)NFposixjava)X.Ynt) source_dir target_dir add_launchersforceclobberosname_nameset_modesetvariantsr _fileop_is_ntsys version_info)selfr"r#r$dry_runfileops r__init__zScriptMaker.__init__Ns$$*  G+FF1B2E13W1D K(( 6g!6!6 go4 Gv  2"(d"2 ,rc|ddr_|jrXtj|\}}|dd}tj||}|S)NguiFpythonpythonw)getr.r'pathrreplacejoin)r1roptionsdnfns r_get_alternate_executablez%ScriptMaker._get_alternate_executable_sf ;;ue $ $ . .W]]:..FBHi00Bb"--Jrrc t|5}|ddkcdddS#1swxYwYdS#ttf$rtd|YdSwxYw)zl Determine if the specified executable is a script (contains a #! line) z#!NzFailed to open %sF)openreadOSErrorIOErrorloggerwarning)r1rfps r _is_shellzScriptMaker._is_shellgs  *%%.771::-..................W%   2J???uu s,A7 A;A;A,A43A4c||r*ddl}|jjddkr|Sn)|dr|Sd|zS)Nrzos.nameLinuxz jython.exez/usr/bin/env %s)rJrlangSystem getPropertylowerendswith)r1rrs r_fix_jython_executablez"ScriptMaker._fix_jython_executabless|~~j)) " 9#// ::gEE%%F!!##,,\:: "!!$z1 1rctjdkrd}nAt|t|zdz}tjdkrd}nd}d|vo||k}|r d|z|zd z}nd }|d |z|zd zz }|d z }|S)a Build a shebang line. In the simple case (on Windows, or a shebang line which is not too long or contains spaces) use a simple formulation for the shebang. Otherwise, use /bin/sh as the executable, with a contrived shebang which allows the script to run either under Python or sh, using suitable quoting. Thanks to Harald Nordgren for his input. See also: http://www.in-ulm.de/~mascheck/various/shebang/#length https://hg.mozilla.org/mozilla-central/file/tip/mach rTdarwini s#! s #!/bin/sh s '''exec' s "$0" "$@" s' ''')r'r(lenr/platform)r1r post_interpsimple_shebangshebang_lengthmax_shebang_lengthresults r_build_shebangzScriptMaker._build_shebangs 7g  !NN!__s;/?/??!CN|x''%(""%("#:5E-1CC   Z'+5=FF#F lZ/+=O OF h F rrcd}|jr |j}d}n:tjst}nt rHt jtjddtj dz}nt jtj ddtj dtj d}t j |sGt jtj ddtj dz}|r| ||}tj d r||}|rt!|}|d }tj d kr d |vr d |vr|dz }|||} |d n #t($rt+d|zwxYw|d kr; ||n$#t($rt+d|d|dwxYw|S)NTFscriptszpython%sEXEBINDIRr7VERSIONrutf-8cliz -X:Framesz -X:FullFramess -X:Framesz,The shebang (%r) is not decodable from utf-8z The shebang (z-) is not decodable from the script encoding ())rris_python_buildr rr'r:r<get_pathget_config_varisfiler@r/rZrrRrencoder`decodeUnicodeDecodeError ValueError)r1encodingr[r=enquotershebangs r _get_shebangzScriptMaker._get_shebangs ? PJGG*,, P'))JJ YY Pi&8&C&C&)A%)H)HHJJJJ(222(7 BBB(7>>>@AAJ7>>*-- P W\\)*B8*L*L *i.Fu.M.M NPP  M77 GLLJ < " "6 * * A44Z@@J  8+J77J &&w// LE ! !k&D&D{22 = (K%%j+>>  J NN7 # # # #! J J J>HJJ J J w   Kx((((% K K K j7>wwJKKK Ks5H H(2I!I)c|jt|j|jdd|jzS)N.r)module import_namefunc)script_templatedictprefixsuffixr)r1entrys r_get_script_textzScriptMaker._get_script_textsD#d%,7<|7I7I#7N7Nq7Q05 '>'>'>> >rcTtj|}|j|zSN)r'r:basenamemanifest)r1exenamebases r get_manifestzScriptMaker.get_manifests$w((}t##rc|jo|j}tjd}||s||z }|s||z}n|dkr|d}n|d}t} t| d5} | d|dddn #1swxYwY| } ||z| z}|D]} tj |j | } |r.tj | \}}|dr|} d| z} |j| |nx#t$$rt&dd | z}tj |rtj|tj| ||j| |t&d  tj|n#t$$rYnwxYwYnwxYw|jr| d |zs| d |} tj | r$|jst&d | |j| ||jr|j| g|| dS) Nrfpytwz __main__.pyz.pyz%s.exez:Failed to write executable - trying to use .deleteme logicz %s.deletemez0Able to replace executable using .deleteme logicrvzSkipping existing file %s)r$r.r'lineseprmrQ _get_launcherrrwritestrgetvaluer:r<r#splitextrr-write_binary_file ExceptionrGrHexistsremoverenamedebugr&r*set_executable_modeappend)r1namesrs script_bytes filenamesext use_launcherrlauncherstreamzfzip_datar(outnamenedfnames r _write_scriptzScriptMaker._write_scriptsa)9dk *##G,,((  w G 9"\1LLd{{--c22--c22YYF%% 9 M<888 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9((H#g-8L! &! &Dgll4?D99G @w''001<<&& G"W,L227LIIII NN$9:::*W4Fw~~f--* &)))Igv...L227LIIILL"3444 &))))$ ;7w'7'7c 'B'B7)0##6G7>>'**4<NN#>HHH ..w EEE=@L44gY???   W % % % %C! &! &sICC CE22B&IH.-I. H;8I:H;;II-c<t}d|jvr||d|jvr$|||jdd|jvr9|||j|jdd|jd|S)NrXrr rvr)r+r,addr0variant_separator)r1r(r_s rget_script_filenamesz ScriptMaker.get_script_filenames$s    JJt    $-   JJt'8';';< = = = DM ! ! JJddD,B,B&*&7&:&:&:D %srspythonwrr) r'r:r<r"r r#rr%r-newerrGrrCreadlinerH FIRST_LINE_REmatchr;grouprFr2close copy_filer*rrinforseekrtrrD)r1rradjustrf first_linerr[rqlinesrsrrs r _copy_scriptzScriptMaker._copy_script?sdo|F/C/CDD',,t0@0@0H0HIIz $,"4"4VW"E"E  LL6 ? ? ? F  4VT""A J ?HHH!'' (:(:7E(J(JKKE 4#kk!nn3    < AAA    L " "67 3 3 3} < 00';;;   W % % % % % KK8& ) ) )<' K"1!*"="=%q ++HkBB++CCCG$$W--""A39cJJJ    s7EEEc|jjSrr-r2)r1s rr2zScriptMaker.dry_runrs |##rc||j_dSrr)r1values rr2zScriptMaker.dry_runvs$ rr!c@tjddkrd}nd}tdkrdnd}|||d}td d d }t ||}|sd |d |}t||jS)NP6432z win-arm64z-armrz.exervrrzUnable to find resource z in package ) structcalcsizer __name__rsplitrfindrpbytes)r1kindbitsplatform_suffixr(distlib_packageresourcemsgs rrzScriptMaker._get_launcher~ss##q(((4+(E(Eff2O#'4?D'ooc155a8Oo..33D99H & &EITT&( oo%> !rcg}t|}||||n|||||S)a Make a script. :param specification: The specification, which is either a valid export entry specification (to make a script from a callable) or a filename (to make a script by copying from a source location). :param options: A dictionary of options controlling script generation. :return: A list of all absolute pathnames written to. Nr)r rr)r1 specificationr=rr~s rmakezScriptMaker.makesU  // =   mY 7 7 7 7   eY  @ @ @rcfg}|D]+}||||,|S)z Take a list of specifications and make scripts from them, :param specifications: A list of specifications. :return: A list of all absolute pathnames written to, )extendr)r1specificationsr=rrs r make_multiplezScriptMaker.make_multiplesE  + @ @M   TYY}g>> ? ? ? ?r)TFN)rNr)"r __module__ __qualname____doc__SCRIPT_TEMPLATErzrr4r@r/rZrrJrRr`rtr_DEFAULT_MANIFESTrrrrrrrpropertyr2setterr'r(r)rrrrrrrEs&OJ=A'+----" |v&&2    2 2 2>CCCCJ>>> !H$$$2&2&2&h   IIII 111f$$X$ ^%%^% w$27f,,T1A1A " " "&&      rr) iorloggingr'rerr/compatrrr resourcesrutilr r r r r r getLoggerrrGstriprcompilerrr_enquote_executableobjectrrrrrs_ 7777777777::::::::::::::::  8 $ $ uww!& =>>     )hhhhh&hhhhhrPK!u __pycache__/util.cpython-311.pycnu[ ^iddlZddlmZddlZddlZddlmZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZ ddlZn #e$rdZYnwxYwddlZddlZddlZddlZddlZ ddlZn#e$rddlZYnwxYwddlZddlmZddlmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0e j1e2Z3e j4dZ5e j4dZ6e j4d Z7e j4d Z8e j4d Z9e j4d Z:e j4d Z;e j4dZdZ?dZ@dZAdqdZBdZCdZDdZEejFdZGejFdZHejFdrdZIGddeJZKdZLGdd eJZMd!ZNGd"d#eJZOe j4d$e jPZQd%ZRdsd&ZSd'ZTd(ZUd)ZVd*ZWd+ZXe j4d,e jYZZe j4d-Z[dsd.Z\e j4d/Z]d0Z^d1Z_d2Z`d3Zad4Zbd5ZcGd6d7eJZdGd8d9eJZeGd:d;eJZfdZhd?Zid@ZjGdAdBeJZke j4dCZle j4dDZme j4dEZndFZdGZoer:ddHlmpZqmrZrmsZsGdIdJe$jtZtGdKdLeqZpGdMdNepe'ZuejvddOZwewdPkr(GdQdRe$jxZxerGdSdTe$jyZyGdUdVe%jzZzerGdWdXe%j{Z{GdYdZe%j|Z|d[Z}Gd\d]eJZ~Gd^d_e~ZGd`dae~ZGdbdce(ZGdddeeJZdfZGdgdheJZdiZdjZdkZdldmdndoZdpZdS)uN)deque)iglob)DistlibException) string_types text_typeshutil raw_inputStringIOcache_from_sourceurlopenurljoinhttplib xmlrpclib splittype HTTPHandlerBaseConfigurator valid_ident Container configparserURLErrorZipFilefsdecodeunquoteurlparsez^([\w\.-]+)\s*z^([\w\.*+-]+)\s*z^(<=?|>=?|={2,3}|[~!]=)\s*z*^((<=?)|(>=?)|={2,3}|[~!]=|in|not\s+in)\s*z^or\b\s*z ^and\b\s*z(\S+)\s*z(([\s\w\.{}()*+#:;,/?!~`@$%^&=|<>\[\]-]+)cFdfdfdfd|S)ae Parse a marker string and return a dictionary containing a marker expression. The dictionary will contain keys "op", "lhs" and "rhs" for non-terminals in the expression grammar, or strings. A string contained in quotes is to be interpreted as a literal string, and a string not contained in quotes is a variable (such as os_name). ct|}|r8|d}||d}ns|st d|d}|dvrt d|zd|d}|dd}|g}|r|d|krn|d|kr |||dd}nwt|}|st d|z||d||d}|d|}t d|z||d|}|dd }||fS) Nrzunexpected end of inputz'"zinvalid expression: %srzerror in string literal: %szunterminated string: %s) IDENTIFIERmatchgroupsend SyntaxErrorreplaceappend STRING_CHUNKjoinlstrip) remainingmresultqoqpartsss /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/util.py marker_varz parse_marker..marker_varAs   Y ' '  /XXZZ]F!!%%''((+II /788 8! A~~!":Y"FGGGq"%%B!!"" ICE AQ<1$$q\R''LL$$$ )!"" II$**955AU)*G)*STTTLLA/// )!%%''(( 3I AGGENN!";a"?@@@ LLOOOWWU^^F!!"" ,,..Iy  c|ro|ddkrc|dd\}}|ddkrtd|z|dd}n{|\}}|rit|}|snL|d}||d}|\}}|||d}|i|}||fS)Nr(r)unterminated parenthesis: %soplhsrhs)r(r# MARKER_OPr r!r")r)r+r9r*r8r:markerr1s r0 marker_exprz!parse_marker..marker_expres  1,, &y}';';'='= > > FI|s""!"@9"LMMM!!"" ,,..II'Z 22NC 9OOI..XXZZ]%aeegghh/ !+I!6!6YC88 9Fy  r2c|\}}|rOt|}|sn2||d}|\}}d||d}|O||fS)Nandr7)ANDr r")r)r9r*r:r=s r0 marker_andz parse_marker..marker_andxs$Y//Y 8 )$$A !!%%''((+I([33NCs377C  8I~r2c|\}}|rOt|}|sn2||d}|\}}d||d}|O||fS)Norr7)ORr r")r)r9r*r:rAs r0r<zparse_marker..markers#I..Y 7##A !!%%''((+I'Z 22NCc#66C  7I~r2) marker_stringr<rAr=r1s @@@@r0 parse_markerrG8sx"!"!"!H!!!!!!&           6-  r2c|}|r|drdSt|}|st d|z|d}||d}dx}x}x}}|r"|ddkr|dd}|dkrt d|z|d|} ||dzd}g}| rt| }|st d | z| |d| |d} | sn<| dd krt d | z| dd} | |sd}|r|dd kr|dd}t|}|st d |z|d}t|} | j r| j st d|z||d}n.d} |ddkr| |\}}n|dd}|dkrt d|z|d|} ||dzd}t| r| | \}} nt| }|st d| z|d} | |d} | rt d| zd| fg}|rL|ddkrt d|z|dd}t!|\}}|r|ddkrt d|z|s|}n$|ddd|D}t%||||||S)z Parse a requirement passed in as a string. Return a Container whose attributes contain the various parts of the requirement. #Nzname expected: %sr[]rzunterminated extra: %szmalformed extra: %s,zcomma expected in extras: %s@zinvalid URI: %szInvalid URL: %sctt|}d}|rg} |d}||d}t|}|st d|z|d}|||f||d}|r |ddkrnO|dd}|sn0t|}|st d|z|sd}||fS)z| Return a list of operator, version tuples if any are specified, else None. NTrzinvalid version: %srLrinvalid constraint: %s) COMPARE_OPr r!r"VERSION_IDENTIFIERr#r%r() ver_remainingr*versionsr8vs r0 get_versionsz'parse_requirement..get_versionssT $$]33(!HXXXZZ](5aeegghh(? .44]CC U"-.Cm.S"T"TTHHJJqM Q000(5aeegghh(? ," a0@C0G0G!(5abb(9(@(@(B(B  -"!&,,];; X"-.F.V"W"WW%X&$(#'..r2r4r5r6rOz~=;zinvalid requirement: %szunexpected trailing data: %s , cg|]}d|zS)z%s %srE).0cons r0 z%parse_requirement.. s,O,O,OsWs],O,O,Or2)nameextras constraintsr<url requirement)strip startswithrr r#r!r"findr(r% NON_SPACErschemenetlocrPrQrGr'r)reqr)r*distnamer^ mark_exprrSuriir/trU_rTrss r0parse_requirementrps  I  ,,S11t##A ;- 9:::xxzz!}H!%%''((#I*..F.Y.CYq\S(( NN3 " " q556BCC C acNa!eff%,,..    ##A =!"7!";<<< MM!((**Q- ( ( (!%%''(( A ts{{!"@1"DEEE!"" A  FG+ Q<3  !!"" ,,..I **A A!"3i"?@@@((**Q-C A H ; ;!"3c"9:::!!%%''((+2244II / / /@|s""&2l9&=&=#))NN3**q55%&Dy&PQQQacN%a!eff-4466 ##A&& +".,q//KHaa*0033AH)*BQ*FGGG 1 A!%%''(( **,,AH)*BQ*FGGG!%q {H7 Q<3  7)CDD DabbM((** +I66 9FYq\S((89DEEE R  $)),O,Oh,O,O,O"P"P"P Q (6x%3B @ @ @@r2cd}i}|D]\}}}tj||}t|D]}tj||} t| D]v} ||| } ||| d'||| } |tjjdd} | dz| z|| <w|S)z%Find destinations for resources filesc|tjjd}|tjjd}||sJ|t |ddSN/)r$ospathseprclenr()rootrvs r0 get_rel_pathz)get_resources_dests..get_rel_pathsk||BGK--||BGK--t$$$$$CIIJJ&&s+++r2Nrt)rurvr'rpopr$rwrstrip)resources_rootrulesrz destinationsbasesuffixdestprefixabs_baseabs_globabs_path resource_filerel_pathrel_dests r0get_resources_destsrs,,,L# L Lfdnd33f L LHw||Hf55H!(OO L L , ^X F F < $$]D9999+|Hh??H#||BGK==DDSIIH2:S.82KL// L L r2cttdrd}n.tjttdtjk}|S)N real_prefixT base_prefix)hasattrsysrgetattrr+s r0in_venvr(s=sM""GwsM3:FFF Mr2cftj}t|tst |}|SN)r executable isinstancerrrs r0get_executabler2s/^F fi ( ("&!! Mr2c|} t|}|}|s|r|}|r)|d}||vrn |rd|||fz}C|S)NTrz %c: %s %s)r lower)prompt allowed_chars error_promptdefaultpr/cs r0proceedrDs|A = aLL  W A  =! AM!! = A|V#<< = Hr2ct|tr|}i}|D]}||vr ||||<|Sr)rrsplit)dkeysr+keys r0extract_by_keyrTsQ$ %%zz|| F!! !88C&F3K Mr2ctjddkrtjd|}|}t |} t j|}|ddd}|D]>\}}|D]$\}}|d|}t|} | J| ||<%?|S#t$r| ddYnwxYwd} tj } | | |nX#tj$rF|t!j|}t |}| | |YnwxYwi}| D]C} ix|| <}| | D]$\} }| d|}t|} | J| || <%D|S) Nrutf-8 extensionszpython.exportsexports = c~t|dr||dS||dS)N read_file)rrreadfp)cpstreams r0 read_streamz!read_exports..read_streamqsD 2{ # #  LL IIf     r2)r version_infocodecs getreaderreadr jsonloaditemsget_export_entry Exceptionseekr ConfigParserMissingSectionHeaderErrorclosetextwrapdedentsections)rdatajdatar+groupentrieskrTr/entryrrrr]values r0 read_exportsr]s: a*!'**622 ;;==D d^^F  &!!|$%56yA$llnn # #NE7  # #1!"AA&(++((("  #   Aq  " $ $B  B  1    t$$$ B  F{{}}"" ""s g88C== " "KD%!TT55)A$Q''E$$$!GDMM  " Ms&A>'**?+g5CCW^^G,,?RW^^G5L5L?4w>C F 'D!DEEE OFG , , , w'''''r2Nctj|rJ|tj|t d|||jsn|t|d}ntj|d|} tj ||| n#| wxYw| |dS)NzCopying stream %s to %swbwencoding)rurvisdirrrrrropenrr copyfileobjrr )rinstreamrr& outstreams r0 copy_streamzFileOperator.copy_streams7==))))) 00111 -xAAA| " $// "KxHHH  ""8Y777!!!! !!!! w'''''s "C C"c|tj||jsptj|rtj|t|d5}||dddn #1swxYwY| |dS)Nr#) rrurvrrrrr(rr )rrvrfs r0write_binary_filezFileOperator.write_binary_file's --...| w~~d##  $dD!! Q                 t$$$$$s=BB#&B#cX||||dSr)r/encode)rrvrr&s r0write_text_filezFileOperator.write_text_file0s* tT[[%:%:;;;;;r2c^tjdks tjdkrtjdkrz|D]y}|jrtd|%tj|j|z|z}td||tj||vdSdSdS)Nposixjavazchanging mode of %szchanging mode of %s to %o) rur]_namerrrrst_modechmod)rbitsmaskfilesr.modes r0set_modezFileOperator.set_mode3s 7g  "'V"3"3G8K8K & &<&KK 5q9999GAJJ.5=DKK ;QEEEHQ%%%%#4"38K8K & &r2c0|dd|S)Nimi)r=)r/r.s r0zFileOperator.?sqzz%'C'Cr2ctj|}||jvrtj|s|j|tj|\}}||t d|z|j stj ||j r |j |dSdSdSdS)Nz Creating %s)rurvrrrr rrrrrmkdirrr)rrvrr.s r0rzFileOperator.ensure_dirAswt$$ t| # #BGNN4,@,@ # L  T " " "7==&&DAq OOA    KK , - - -< { ,!%%d+++++ $ # # # , ,r2ct|| }td|||js|s|||r3|sd}n.||sJ|t |d}i}|r)ttdrtj j |d<tj |||dfi|| ||S)NzByte-compiling %s to %sPycInvalidationModeinvalidation_modeT) r rrrrrcrxr py_compilerC CHECKED_HASHcompiler ) rrvoptimizeforcerhashed_invalidationdpathdiagpathcompile_kwargss r0 byte_compilezFileOperator.byte_compileMs!$H 55 -tU;;;| N 2 4// 22#HH??622222#CKKLL1HN" bwz;P'Q'Q b6@6T6a23  tUHd M Mn M M M u%%% r2ctj|r+tj|rtj|sft d||jstj ||j r%||j vr|j |dSdSdStj|rd}nd}t d|||jstj ||j r'||j vr |j |dSdSdSdS)NzRemoving directory tree at %slinkfilezRemoving %s %s)rurvrr'rrdebugrr rrrrr)rrvr/s r0ensure_removedzFileOperator.ensure_removed^sX 7>>$   8w}}T"" 827>>$+?+? 8 >$''AAA -q$777|$IdOOO;8t111*11$77777% 8 8 8811r2cd}|sitj|r tj|tj}n*tj|}||krn|}|i|Sr)rurvraccessW_OKr)rrvr+parents r0 is_writablezFileOperator.is_writablessp w~~d## 411W__T**F~~D  r2c\|jsJ|j|jf}||S)zV Commit recorded changes, turn off recording, return changes. )rrrr)rr+s r0commitzFileOperator.commits8 {{#T%66  r2c|jst|jD]5}tj|rtj|6t|jd}|D]o}tj |}|rC|dgksJtj ||d}tj |tj |p| dS)NT)reverse __pycache__r) rlistrrurvrrsortedrlistdirr'rmdirr)rr.dirsrflistsds r0rollbackzFileOperator.rollbacks| $,-- ! !7>>!$$!IaLLL$+T:::D   1 ! ]O3333aq22BHRLLL  r2FTr)FFNF)rrrrrr rr!r,r/r2r=set_executable_moderrNrSrXrZrerEr2r0rrs """ )))CCC(((((" ( ( ( (%%%<<< & & &DC , , ,"888*   r2rc |tjvrtj|}nt|}||}nM|d}t ||d}|D]}t ||}|S)N.r)rmodules __import__rrr{) module_name dotted_pathmodr+r.rs r0resolverpsck!!k+&%%!!#&&eiill++ ( (AVQ''FF Mr2cDeZdZdZedZdZdZej Z dS) ExportEntryc>||_||_||_||_dSrr]rrr)rr]rrrs r0rzExportEntry.__init__s"    r2c6t|j|jSr)rprrr s r0rzExportEntry.valuest{DK000r2c Hd|jd|jd|jd|jd S)Nz rtr s r0__repr__zExportEntry.__repr__s204 4;;;04 TZZZI Ir2ct|tsd}n@|j|jko/|j|jko|j|jko|j|jk}|Sr)rrrr]rrr)rotherr+s r0__eq__zExportEntry.__eq__sh%-- 1FFi5:-0kU\10kU\10jEK/  r2N) rrrrrrrxr{r__hash__rEr2r0rrrrsb 11_1IIIHHHr2rrz(?P(\w|[-.+])+) \s*=\s*(?P(\w+)([:\.]\w+)*) \s*(\[\s*(?P[\w-]+(=\w+)?(,\s*\w+(=\w+)?)*)\s*\])? ct|}|sd}d|vsd|vrtd|zn|}|d}|d}|d}|dkr|d}}n0|dkrtd|z|d\}}|d } | d|vsd|vrtd|zg} nd | d D} t |||| }|S) NrJrKzInvalid specification '%s'r]callablerrrrc6g|]}|SrErb)rZr.s r0r\z$get_export_entry..s 9991QWWYY999r2rL)ENTRY_REsearchr groupdictcountrrr) specificationr*r+rr]rvcolonsrrrs r0rrsX &&A : -  3-#7#7"$*,9$:;; ;$8 KKMMy}C Q;;!4FFF{{&(.0=(>???!ZZ__NFF'  =m##sm';';&(.0=(>???EE99 C(8(8999ET66599 Mr2c|d}tjdkr.dtjvr tjd}ntjd}tj|r=tj|tj}|st d|nG tj |d}n/#t$r"t d |d d }YnwxYw|s.tj}t d |tj||S) a Return the default base location for distlib caches. If the directory does not exist, it is created. Use the suffix provided for the base directory, and default to '.distlib' if it isn't provided. On Windows, if LOCALAPPDATA is defined in the environment, then it is assumed to be a directory, and will be the parent directory of the result. On POSIX, and on Windows if LOCALAPPDATA is not defined, the user's home directory - using os.expanduser('~') - will be the parent directory of the result. The result is just the directory '.distlib' in the parent directory as determined above, or with the name specified with ``suffix``. Nz.distlibnt LOCALAPPDATAz $localappdata~z(Directory exists but is not writable: %sTzUnable to create %s)exc_infoFz#Default location unusable, using %s)rur]environrv expandvars expanduserr'rUrVrwarningmakedirsOSErrorrrr')rr+usables r0get_cache_basers:~ w$>RZ77##O44##C(( w}}V 627++ O NNEv N N N  K   FF    NN0&4N H H HFFF  F!##sV F A#1!\** F E  === Mr2z3([a-z0-9_]+([.-][a-z_][a-z0-9_]*)*)-([a-z0-9_.+-]+)z -py(\d\.?\d?)czd}d}t|dd}t|}|r1|d}|d|}|r{t |t |dzkrXtjtj |dz|}|r,| }|d|||dzd|f}|Gt|}|r+|d|d|f}|S)zw Extract name, version, python version from a filename (no extension) Return name, version, pyver or None NrW-rz\br) rr$PYTHON_VERSIONrrstartrxrer escaper"PROJECT_NAME_AND_VERSION)filename project_namer+pyverr*ns r0split_filenamerMs+ F Ex  ((c22Hh''A( JQWWYYJ';H L(9(9A(=== HRY|,,u4h ? ?  ;Abqb\8AEFF#3U:F ~ $ * *8 4 4  3WWQZZU2F Mr2z-(?P[\w .-]+)\s*\(\s*(?P[^\s)]+)\)$ct|}|std|z|}|d|dfS)z A utility method used to get name and version from a string. From e.g. a Provides-Dist value. :param p: A value in a form 'foo (1.0)' :return: The name and version as a tuple. z$Ill-formed name/version string: '%s'r]ver)NAME_VERSION_REr rrrbr)rr*rs r0parse_name_and_versionrisj a  A MG!KLLL A V9??   " " $ $ah ..r2ct}t|pg}t|pg}d|vr|d||z}|D]}|dkr|||drE|dd}||vrtd|z||vr||x||vrtd|z|||S)N*rrzundeclared extra: %s)rrr rcrr) requested availabler+runwanteds r0 get_extrasrxs UUFIO$$IIO$$I i)    88 JJqMMMM \\#   uHy((5@AAA6!! h''' !!59::: JJqMMMM Mr2ci} t|}|}|d}|dstd|n1t jd|}tj |}n3#t$r&}t d||Yd}~nd}~wwxYw|S)Nz Content-Typezapplication/jsonz(Unexpected response for JSON request: %srz&Failed to get external data for %s: %s) r rgetrcrrRrrrrr exception)r`r+respheadersctreaderes r0_get_external_datars FKs||))++ [[ ( (}}/00 ' LLCR H H H H.V%g..t44FYv&&F KKKA3JJJJJJJJK MsBB C)C  Cz'https://www.red-dove.com/pypi/projects/c|dd|d}tt|}t|}|S)Nrrtz /project.jsonupperr_external_data_base_urlr)r]r`r+s r0get_project_datarsB"&q'--////444 8C )3 / /C  $ $F Mr2c|dd|d|d}tt|}t|S)Nrrtz /package-z.jsonr)r]versionr`s r0get_package_datarsD%)!W]]____dddGGG DC )3 / /C c " ""r2c$eZdZdZdZdZdZdS)Cachez A class implementing a cache for resources that need to live in the file system e.g. shared libraries. This class was moved from resources to here because it could be used by other modules, e.g. the wheel module. cdtj|stj|tj|jdzdkrt d|tjtj ||_ dS)zu Initialise an instance. :param base: The base directory where the cache should be located. ?rzDirectory '%s' is not privateN) rurvr'rrr7rrrnormpathr)rrs r0rzCache.__init__sw}}T""  K    GDMM !D (Q . . NN>"%%&););&IbMMMMW]]2&&&M"%%% ' ' '""2&&&&& 'sBC  C-,C-N)rrr__doc__rrrrEr2r0rrsK < < <))) r2rc2eZdZdZdZd dZdZdZdZdS) EventMixinz1 A very simple publish/subscribe system. ci|_dSr) _subscribersr s r0rzEventMixin.__init__sr2Tc|j}||vrt|g||<dS||}|r||dS||dS)a` Add a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be added (and called when the event is published). :param append: Whether to append or prepend the subscriber to an existing subscriber list for the event. N)rrr% appendleft)revent subscriberr%subssqs r0r zEventMixin.addso     --DKKKeB * *%%%%% j)))))r2cv|j}||vrtd|z|||dS)z Remove a subscriber for an event. :param event: The name of an event. :param subscriber: The subscriber to be removed. zNo subscribers: %rN)rrr)rrrrs r0rzEventMixin.removesI    1E9:: : U :&&&&&r2cRt|j|dS)z Return an iterator for the subscribers for an event. :param event: The event to return subscribers for. rE)iterrr)rrs r0get_subscriberszEventMixin.get_subscriberss% D%))%44555r2cg}||D]Q} ||g|Ri|}n,#t$rtdd}YnwxYw||Rtd|||||S)a^ Publish a event and return a list of values returned by its subscribers. :param event: The event to publish. :param args: The positional arguments to pass to the event's subscribers. :param kwargs: The keyword arguments to pass to the event's subscribers. z"Exception during event publicationNz/publish %s: args = %s, kwargs = %s, result = %s)rrrrr%rR)rrargskwargsr+rrs r0publishzEventMixin.publish s..u55 ! !J " 5:4:::6::     !EFFF  MM%  FD&& 2 2 2 s (&AANrg) rrrrrr rrrrEr2r0rrsn****( ' ' '666r2rcfeZdZdZdZd dZdZdZdZdZ e d Z e d Z d S) SequencercHi|_i|_t|_dSr)_preds_succsr_nodesr s r0rzSequencer.__init__(s  ee r2c:|j|dSr)rr )rnodes r0add_nodezSequencer.add_node-s r2Fc0||jvr|j||rt|j|dD]}|||t|j|dD]}|||t |jD]\}}|s|j|=t |jD]\}}|s|j|=dSdS)NrE)rrrrrrr^r)rredgesrr/rrTs r0 remove_nodezSequencer.remove_node0s3 4;   K  t $ $ $  'r2233 % % At$$$$r2233 % % D!$$$$T[..0011 ' '1' AT[..0011 ' '1' A ' ' ' 'r2c||ksJ|j|t||j|t|dSr)r setdefaultrr r)rpredsuccs r0r z Sequencer.add@sit|||| tSUU++//555 tSUU++//55555r2c(||ksJ |j|}|j|}n #t$rtd|zwxYw ||||dS#t$rt|d|wxYw)Nz%r not a successor of anythingz not a successor of )rrKeyErrorrr)rrrpredssuccss r0rzSequencer.removeEst|||| FK%EK%EE F F F=DEE E F H LL    LL      H H H444FGG G Hs%A*A22Bc8||jvp||jvp||jvSr)rrr)rsteps r0is_stepzSequencer.is_stepRs. #$tt{':$ # %r2c ||std|zg}g}t}|||r|d}||vr1||kr*||||nZ|||||j|d}| ||t|S)Nz Unknown: %rrrE) rrrr%r{rr rrextendreversed)rfinalr+todoseenrrs r0 get_stepszSequencer.get_stepsVs||E"" 4]U233 3uu E #88A;;Dt|| 5==MM$'''MM$''' d### b11 E""" # r2cvdggiig|jfdD]}|vr |S)Nrc<d|<d|<dxxdz cc< | |}n#t$rg}YnwxYw|D]T}|vr+ |t|||<1| vrt|||<U||krZg} }||||krn1t |} |dSdS)Nrr)r%rminr{tuple) r successors successorconnected_component componentgraphindex index_counterlowlinksr+stack strongconnects r0rz3Sequencer.strong_connections..strongconnectzsx'*E$K*1-HTN !    !    LL    "4[      ' J J H,,!M),,,%($8K%L%LHTNN%''&)$i8H%I%IHTN~t,,&(#0 % I'..y999 D((%0""566  i(((((-,sA AA)r) rrrrrrr+rrs @@@@@@@r0strong_connectionszSequencer.strong_connectionsos   ) ) ) ) ) ) ) ) ) ) )D $ $D8## d### r2c dg}|jD]0}|j|}|D]}|d|d|d1|jD]}|d|z|dd|S)Nz digraph G {z z -> rVz %s;} )rr%rr')rr+rrrrs r0dotz Sequencer.dotsK < .check_paths$ ** (;;w''D GOOBGLL488 9 9||H%% A4BF):):;a?@@ @*;):r2)r"r%zip)rr#tgzzr:gz)r r$tbzzr:bz2r!tarrzUnknown format for %rrrr)rurvrrxrrrnamelisttarfiler(getnamesrr getmembersrr]rr( extractallr) archive_filenamer)formatrr+archiver<namesr]tarinfor*s ` @r0 unarchiver:sWAAAAAAwx((H x==DG ~  $ $%5 6 6 IFF  & &': ; ; IFDD  & &'; < < IFDD  & &v . . IFDD47GGHH H U??.44G %((**!%%DJt$$$$l#3T::G %((**!%%DJt$$$$ U??s/2Q66 #--// @ @!', ::@#*<#6#6w#?#?GL8$$$   MMOOOOO  7  MMOOOO s 4C9GG ctj}t|}t|d5}t j|D]k\}}}|D]b}tj||}||d} tj| |} ||| cl dddn #1swxYwY|S)z*zip a directory tree into a BytesIO objectr$N) ioBytesIOrxrruwalkrvr'r) directoryr+dlenzfryrbr;r]fullrelrs r0zip_dirrDs Z\\F y>>D   %!#!3!3 % % D$ % %w||D$//455kw||C..t$$$$  % %%%%%%%%%%%%%%%% MsBCCC)rKMGTPceZdZdZddZdZdZdZdZe d Z e d Z d Z e d Z e d ZdS)ProgressUNKNOWNrdcn|||ksJ|x|_|_||_d|_d|_d|_dS)NrF)r curmaxstartedelapseddone)rminvalmaxvals r0rzProgress.__init__sE~6!1!1!11$$48   r2c|j|ksJ|j ||jksJ||_tj}|j ||_dS||jz |_dSr)r rPrOtimerQrR)rcurvalnows r0updatezProgress.update sfx6!!!!x6TX#5#5#55ikk < DLLL-DLLLr2cP|dksJ||j|zdSNr)rZrO)rincrs r0 incrementzProgress.increments-qyyyy DHtO$$$$$r2c:||j|Sr)rZr r s r0rzProgress.starts DH r2cV|j||jd|_dSNT)rPrZrSr s r0stopz Progress.stops) 8  KK ! ! ! r2c,|j|jn|jSr)rPunknownr s r0maximumzProgress.maximum!s#x/t||TX=r2c||jrd}n1|jd}n'd|j|jz z|j|jz z }d|z}|S)Nz100 %z ?? %gY@z%3d %%)rSrPrOr )rr+rTs r0 percentagezProgress.percentage%sQ 9 "FF X FFDH,-DH1DEA\F r2c|dkr|j|j|jkrd}n'tjdtj|}|S)Nrz??:??:??z%H:%M:%S)rPrOr rWstrftimegmtime)rdurationr+s r0format_durationzProgress.format_duration0sI MMtx/48tx3G3GFF]:t{8/D/DEEF r2c"|jr d}|j}ned}|jd}nY|jdks|j|jkrd}n;t |j|jz }||j|jz z}|dz |jz}|d||S)NDonezETA rrrz: )rSrRrPrOr floatrl)rrrms r0ETAz Progress.ETA9s 9 +F AAFx""tx48';';$(TX-..TX((Udl*!664#7#7#:#:#:;;r2c|jdkrd}n|j|jz |jz }tD]}|dkrn|dz}d||fzS)Nrgig@@z%d %sB/s)rRrOr UNITS)rr+units r0speedzProgress.speedLsc <1  FFh)T\9F  D}} f FFVTN**r2N)rrM)rrrrdrrZr^rrbrrergrlrprtrEr2r0rKrKsG...%%% >>X>X<<X<$ + +X + + +r2rKz \{([^}]*)\}z[^/\\,{]\*\*|\*\*[^/\\,}]z^[^{]*\}|\{[^}]*$ct|rd}t||zt|rd}t||zt |S)zAExtended globbing function that supports ** and {opt1,opt2,opt3}.z7invalid glob %r: recursive glob "**" must be used alonez2invalid glob %r: mismatching set marker '{' or '}')_CHECK_RECURSIVE_GLOBrr_CHECK_MISMATCH_SET_iglob) path_globr s r0rrasj##I..*Ky)))!!),,*Fy))) )  r2c#Kt|d}t|dkrit|dks J||\}}}|dD].}td|||fD]}|V/dSd|vrt |D]}|VdS|dd\}}|dkrd}|dkrd}n*|d}|d }tj|D]Y\}}} tj |}ttj ||D]} | VZdS) NrrrLrz**rjrrt\) RICH_GLOBrrxrxr' std_iglobr(rur>rvr) ryrich_path_globrrritemrvradicaldirr;rs r0rxrxls__Y22N >Q>""a'''''',VIIcNN  Drwwf'=>>??       y !),,     (oodA66OFG||"}}"..--!....$&GFOO   c5w''-- dG!K++DNDMJJJ=>*-*;G'111GGGsIu55>48I01/G/???? } !2 "49#8#8#:#:DIFFFLL!4di@@@@@'I&&v'7888IOO%%%     s,A G::A I)rrrrrrrEr2r0rrs- $ $ $ $ $ r2rc"eZdZddZdZdZdS)rTcJtj|||_||_dSr)BaseHTTPSHandlerrrr)rrrs r0rzHTTPSHandler.__init__s(  %d + + +$DM ,D   r2c\t|i|}|jr|j|_|j|_|S)a This is called to create a connection instance. Normally you'd pass a connection class to do_open, but it doesn't actually check for a class, and just expects a callable. As long as we behave just as a constructor would have, we should be OK. If it ever changes so that we *must* pass a class, we'll create an UnsafeHTTPSConnection class which just sets check_domain to False in the class definition, and choose which one to pass to do_open. )rrr)rrrr+s r0 _conn_makerzHTTPSHandler._conn_makers9%d5f55F} 8"&-&*&7#Mr2c ||j|S#t$r3}dt|jvrt d|jzd}~wwxYw)Nzcertificate verify failedz*Unable to verify server certificate for %s)do_openrrstrreasonrr)rrhrs r0 https_openzHTTPSHandler.https_opensy ||D$4c:::   .#ah--??*,469h,?@@@  s A.AANrg)rrrrrrrEr2r0rrsF - - - -          r2rceZdZdZdS)HTTPSOnlyHandlerc&td|z)NzAUnexpected HTTP request on what should be a secure connection: %s)r)rrhs r0 http_openzHTTPSOnlyHandler.http_opens!,.1233 3r2N)rrrrrEr2r0rrs# 3 3 3 3 3r2rrceZdZddZdS)HTTPrNc Z|dkrd}||j||fi|dSr\_setup_connection_classrrrrs r0rz HTTP.__init__s@qyy KK..tTDDVDD E E E E Er2rNrrrrrEr2r0rrs. F F F F F Fr2rceZdZddZdS)HTTPSrNc Z|dkrd}||j||fi|dSr\rrs r0rzHTTPS.__init__s@199D 2D24HHHHIIIIIr2rrrEr2r0rrs. J J J J J Jr2rceZdZddZdZdS) TransportrcT||_tj||dSr)rrrrrr use_datetimes r0rzTransport.__init__s( $$T<88888r2c ||\}}}tdkrt||j}nG|jr||jdkr"||_|t j|f|_|jd}|S)Nr)rrr) get_host_info _ver_inforr _connection_extra_headersrHTTPConnection)rrhehx509r+s r0make_connectionzTransport.make_connections((.. 2t   !T\222FF# Ctt/?/B'B'B&(##')?)B)B#B %a(F r2NrrrrrrrEr2r0rrs79999     r2rceZdZddZdZdS) SafeTransportrcT||_tj||dSr)rrrrrs r0rzSafeTransport.__init__s("DL  # , ,T< @ @ @ @ @r2c||\}}}|si}|j|d<tdkrt|dfi|}nF|jr||jdkr!||_|t j|dfi|f|_|jd}|S)Nrrrr)rrrrrrrr)rrrrrr+s r0rzSafeTransport.make_connections ..t44MAr6  $ F9 F""tT44V44'O443CA3F+F+F*,D''+W-DQ.O.OGM.O.O(OD$)!,Mr2NrrrEr2r0rrs; A A A A     r2rceZdZdZdS) ServerProxyc &|ddx|_}|Yt|d}|dd}|dkrt}nt }|||x|d<}||_tjj ||fi|dS)Nrrrhttps)r transport) r{rrrrrrrrr)rrkrrrfrtclsrms r0rzServerProxy.__init__&s!'It!> >> r2c|SrrEr s r0__iter__zCSVReader.__iter__`rr2ct|j}tjddkrBt |D]2\}}t |t s|d||<3|SNrrr)nextrrrrrrr()rr+rlrs r0rzCSVReader.nextcsldk""  A  " "$V,, 5 54!$ 225 $ G 4 4F1I r2N)rrrrrr__next__rEr2r0rrTsB ? ? ?HHHr2rceZdZdZdZdS) CSVWriterc rt|d|_tj|jfi|j|_dS)Nr$)rrrwriterr)rrrs r0rzCSVWriter.__init__ns4C(( j>> >> r2ctjddkrHg}|D]A}t|tr|d}||B|}|j|dSr)rrrrr1r%rwriterow)rrowrrs r0rzCSVWriter.writerowrs~  A  " "A  dI..0;;w//DC S!!!!!r2N)rrrrrrEr2r0rrms2???"""""r2rc\eZdZeejZded<dfd ZdZdZdZ xZ S) Configurator inc_convertincNctt|||ptj|_dSr)superrrrurr)rconfigr __class__s r0rzConfigurator.__init__s7 lD!!**6222'BIKK r2c fd d}t|s|}dd}dd}|rt fd|D} fdD}t |}||i|}|r4|D]\}} t || |  |S)NcJt|ttfr%t|fd|D}n`t|tr6d|vr|}n1i}|D]}||||<n|}|S)Nc&g|] }|SrErE)rZrlconverts r0r\zBConfigurator.configure_custom..convert..s!!8!8!8''!**!8!8!8r2())rr^rtypedictconfigure_customr )or+rr rs r0r z.Configurator.configure_custom..converts!dE]++ ) a!8!8!8!8a!8!8!899At$$ )199!22155FFF22$+GAaDMMq 2aMr2r rjz[]rEc&g|] }|SrErE)rZrr s r0r\z1Configurator.configure_custom..s!333''!**333r2cTg|]$}t|||f%SrE)r)rZrrr s r0r\z1Configurator.configure_custom..s7KKKQKNNK!WWVAY''(KKKr2)r{r~rprrrsetattr) rrrpropsrrrr+rrTr s `` @r0rzConfigurator.configure_customs#       JJt  {{  QA 3%%zz$##  53333d33344DKKKKK&KKKeD#F##  /  / /1771::.... r2c|j|}t|tr#d|vr||x|j|<}|S)Nr )rrrr)rrr+s r0 __getitem__zConfigurator.__getitem__sMS! fd # # F(,(=(=f(E(E EDK v r2ctj|s%tj|j|}t j|dd5}tj|}dddn #1swxYwY|S)z*Default converter for the inc:// protocol.rrr%N) rurvisabsr'rrr(rr)rrr.r+s r0rzConfigurator.inc_convertsw}}U## 3GLLE22E [g 6 6 6 "!Yq\\F " " " " " " " " " " " " " " " sA==BBr) rrrrrvalue_convertersrrrr __classcell__)rs@r0rrst,=>>+U((((((> r2rc&eZdZdZddZdZdZdS)SubprocessMixinzC Mixin for running subprocesses and capturing their output FNc"||_||_dSr)verboseprogress)rrr s r0rzSubprocessMixin.__init__s   r2c~|j}|j} |}|sn| |||nr|s tjdn2tj|dtj|dS)z Read lines from a subprocess' output stream and either pass to a progress callable (if specified) or write progress information to sys.stderr. TNrjr) r rreadlinerstderrrr(flushr)rrrr rr/s r0rzSubprocessMixin.readers =, #!!A #G$$$$8J$$S))))J$$QXXg%6%6777   """ #  r2c 0tj|ftjtjd|}tj|j|jdf}|tj|j|jdf}|| | | |j | ddn&|j rtjd|S)N)stdoutr#r&)rrr#zdone.mainzdone. ) subprocessPopenPIPE threadingThreadrr&rr#waitr'r rrr)rcmdrrt1t2s r0 run_commandzSubprocessMixin.run_commands  S ?$.O ? ?7= ? ?  T[(7K L L L   T[(7K L L L       = $ MM'6 * * * * \ ( J  Y ' ' 'r2)FN)rrrrrrr1rEr2r0rrsP!!!!*r2rcRtjdd|S)z,Normalize a python package name a la PEP 503z[-_.]+r)rsubr)r]s r0normalize_namer4s$ 6(C & & , , . ..r2c*eZdZdZdZddZdZdZdS) PyPIRCFilezhttps://upload.pypi.org/legacy/pypiNc|=tjtjdd}||_||_dS)Nrz.pypirc)rurvr'rrr`)rrr`s r0rzPyPIRCFile.__init__s> :bg0055yAAB r2ci}tj|jr|jp|j}t j}||j| }d|vr| dd}d| dD}|gkr d|vrdg}n|D]}d|i}| |d|d<d|jfd |j fd fD]:\}} | ||r| ||||<5| ||<;|dkr||jdfvr |j|d<|d|kr|d|kri}nod |vrkd }| |dr| |d}n|j}| |d| |d |||j d }|S)N distutilsz index-serverscfg|].}|dk|/S)rr)rZservers r0r\z#PyPIRCFile.read.. s<555v%||~~33#LLNN333r2rr7r<r repositoryrealm)rNz server-loginr)rrr=r<r>)rurvrrr`DEFAULT_REPOSITORYrRawConfigParserrrrr DEFAULT_REALM has_option) rr+r=rr index_servers_serversr<rrs r0rzPyPIRCFile.readsJ 7>>$- ( (4 >))$*8"*(("*F!3-3ZZ -K-Kz*/;D > & 6: > >",$!/  r2ctj}|j}|||ds|d|dd||dd|t|d5}||ddddS#1swxYwYdS)Nr7rrr$) rr@rr has_sectionrrr(r)rrrrrr.s r0rZzPyPIRCFile.update9s-// ] B!!&)) '   v & & & 6:x000 6:x000 "c]] a LLOOO                  sB;;B?B?NN)rrrr?rArrrZrEr2r0r6r6sR:M 888t     r2r6cPt|jS)zG Read the PyPI access configuration as supported by distutils. )r`)r6r`rrs r0 _load_pypircrJEs# %) $ $ $ ) ) + ++r2c^t|j|jdSr)r6rZrrrIs r0 _store_pypircrLKs&LL77777r2ctjdkrrdtjvrdSdtjvrdSdtjvrdStjSdtjvrtjdStjd ksttd s tjStj\}}}}}| d d }| d d d d}|dddkr|d|S|dddkrQ|ddkrDd}dt|ddz |ddfz}ddd}|d|tj zz }n|dddkrddl m }|S|dd d!krMd!}tjd"tj}||}|r|}nI|dd d#kr;ddl} ddl} | | j|||\}}}|d|d|S)$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'. ramd64 win-amd64z(arm) win-arm32z(arm64)z win-arm64_PYTHON_HOST_PLATFORMr4unamertrrWrnrNlinuxsunosr5solarisz%d.%srr32bit64bit)ilz.%saix) aix_platformrcygwinz[\d.]+darwin)rur]rrrplatformrrrRr$intmaxsize _aix_supportr[rrGASCIIr r _osx_supportdistutils.sysconfigget_platform_osx sysconfigget_config_vars) osnamerreleasermachinebitnessr[rel_rer*rcr:s r0get_host_platformrmSs( w$ ck'')) ) ); ck'')) ) );  ))++ + +;|"*,,z122 w'W!5!5|13 -VT7GW\\^^ # #C , ,Fooc3''//S99G bqbzW"6677++ w   1:  FWQZ1!4gabbk BBG#*wGGG uws{33 3G u  ------|~~ x  Y11 LL ! !  ggiiG x  00000000#/#@#@(1(;(K(K(M(M(.$B$B  '' 22r2win32rOrP)x86x64armctjdkrtStjd}|t vrtSt |S)NrVSCMD_ARG_TGT_ARCH)rur]rmrr_TARGET_TO_PLAT)cross_compilation_targets r0 get_platformrvsQ w$ """!z~~.BCC66 """ 3 44r2rG)rrra)r collectionsr contextlibrglobrr}r<rloggingrurErrr ImportErrorr(rr1rrr+dummy_threadingrWrrcompatrrr r r r r rrrrrrrrrrrrrr getLoggerrrrGrrQrPr;rDr@rer&rGrprrrrrrrcontextmanagerrrrrrrrrprrVERBOSErrrrrrrrIrrrrrrrrrrrrrARCHIVE_EXTENSIONSr:rDrrrKr|rvrwrxrrrrrrrrrrrrrrrrrrrr4r6rJrLrmrtrvrEr2r0rsr    ######   JJJJ CCC ((((''''''( ((((((((((((((((((((((((((((((((((((((((((((((  8 $ $ RZ) * * RZ 344 RZ5 6 6 BJD E E RZ bj BJ{ # # rzEFF V!V!V!rz@z@z@z4$     ,,,^&   &&&&     f      6uuuuu6uuun   &8 2:: ' ' >&(&(&(&(R"   & & & &2:'89;??,--2"*9:: / / /2(D ### )))))F)))XCCCCCCCCPE!E!E!E!E!E!E!E!V.3333l   " $W+W+W+W+W+vW+W+W+z BJ~ & & " #?@@ bj!5666`3++++++++++)))))'1)))V'R33333<333  RaR  FFFFFw|FFF J J J J J JGM J J J #  /*<<<<<)'<<<,$$$     f   2 " " " " " " " "&44444#444n+++++f+++\///OOOOOOOOb,,, 888N3N3N3d   55555s!;AAA"" A.-A.PK!z("__pycache__/compat.cpython-311.pycnu[ ^iddlmZddlZddlZddlZ ddlZn #e$rdZYnwxYwejddkrddlmZe fZ e Z ddl mZddlZddlZddlmZddlmZmZmZmZmZdd lmZmZmZm Z m!Z!m"Z"m#Z#d Zddl$Z$dd l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-erdd l$m.Z.ddl/Z/ddl0Z0ddl1Z2dd l3m3Z3ddl4Z4e5Z5ddl6m7Z8ddl6m9Z:nddl;mZemZmZmZmZmZmZmZm#Z#ddl?m&Z&mZm%Z%m Z m!Z!m)Z)m*Z*m+Z+m,Z,m-Z-erdd l?m.Z.ddl@m(Z(m'Z'm"Z"ddlAmBZ/ddl?mCZ$ddlDmBZ0ddl2Z2dd lEm3Z3ddlFmGZ4eHZ5ddl6m:Z:e8Z8 ddlmIZImJZJn #e$rGddeKZJdTdZLdZIYnwxYw ddl mMZNn#e$rGddeOZNYnwxYw ddlmPZPn#e$rejQejRzdfdZPYnwxYwddlSmTZUeVeUd reUZTn"dd!lSmWZXGd"d#eXZWGd$d%eUZT dd&lYmZZZn#e$rd'ZZYnwxYw ddl[Z[n#e$r dd(lm[Z[YnwxYw e\Z\n#e]$r dd)l^m_Z_d*Z\YnwxYw ej`Z`ejaZan-#eb$r%ejcpd+Zdedd,krd-Zend.Zed/Z`d0ZaYnwxYw dd1lfmgZgn-#e$r%dd2lhmiZimjZjddlZejkd3Zld4Zmd5ZgYnwxYw dd6lnmoZon#e$r dd6lpmoZoYnwxYwejdd7d8kre3jqZqndd9lnmqZq dd:lrmsZsn6#e$r.dd;lrmtZt ddZwYnwxYwGd?d@etZsYnwxYw ddAlxmyZyn"#e$r ddAlzmyZyn#e$rdVdBZyYnwxYwYnwxYw ddClrm{Z{nI#e$rA ddDl|m}Z~n#e$r ddDlm}Z~YnwxYw ddElmZmZmZn #e$rYnwxYwGdFdGeZ{YnwxYw ddHlmZmZdS#e$rYejkdIejZdJZGdKdLeZdVdMZGdNdOeZGdPdQeZGdRdSeOZYdSwxYw)W)absolute_importN)StringIO)FileType)shutil)urlparse urlunparseurljoinurlsplit urlunsplit) urlretrievequoteunquote url2pathname pathname2urlContentTooShortError splittypectt|tr|d}t|S)Nutf-8) isinstanceunicodeencode_quote)ss /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/compat.pyrrs1 a ! ! "!!Aayy) RequesturlopenURLError HTTPErrorHTTPBasicAuthHandlerHTTPPasswordMgr HTTPHandlerHTTPRedirectHandler build_opener) HTTPSHandler) HTMLParser)ifilter) ifilterfalse) TextIOWrapper)r r r rrr r r) rrrrrr"r#r$r%r&)r!r r) filterfalse)match_hostnameCertificateErrorceZdZdS)r.N)__name__ __module__ __qualname__rrr.r.`s rr.clg}|sdS|d}|d|dd}}|d}||krtdt|z|s*||kS|dkr|dn|d s|d r(|tj|n;|tj| d d |D])}|tj|*tj d d |zdztj } | |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 wildcardsfragpats r_dnsname_matchrNds  5 #Ahabb )NN3'' } $ $ #>bIKK K 288::!1!11 1 s?? KK   ( ( EH,?,?,G,G E KK (++ , , , , KK (++33E7CC D D D ) )D KK $ ( ( ( (jD!1!11E92=IIyy"""rc z|stdg}|dd}|D]3\}}|dkr(t||rdS||4|sP|ddD]9}|D]4\}}|dkr)t||rdS||5:t |dkr;t d |d d tt|t |dkrt d |d |d t d)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. ztempty or no certificate, match_hostname needs a SSL socket or SSL context with either CERT_OPTIONAL or CERT_REQUIREDsubjectAltNamer3DNSNsubject commonNamerz hostname z doesn't match either of , z doesn't match rz=no appropriate commonName or subjectAltName fields were found) ValueErrorgetrNr;lenr.rAmapr9)certrEdnsnamessankeyvaluesubs rr-r-s ?>?? ?hh',, ' 'JCe||!%22FF&&& /xx 2.. / /"%//JCl**)%::#"FFF ... / x==1  ""88TYYs4':':;;;$=>> >]]a  ""88Xa[[$*++ +#$344 4r)SimpleNamespaceceZdZdZdZdS) ContainerzR A generic container for when multiple values need to be returned c :|j|dSN__dict__update)selfkwargss r__init__zContainer.__init__s M  ( ( ( ( (rN)r0r1r2__doc__rir3rrraras-   ) ) ) ) )rra)whichcfd}tjr||rSdS|*tjdtj}|sdS|tj}tj dkrtj |vr | dtj tjddtj}tfd|Drg}nfd |D}ng}t}|D]q}tj|}||vrL|||D]4} tj|| } || |r| ccS5rdS) aKGiven a command, mode, and a PATH string, return the path which conforms to the given mode on the PATH, or None if there is no such file. `mode` defaults to os.F_OK | os.X_OK. `path` defaults to the result of os.environ.get("PATH"), or can be overridden with a custom search path. ctj|o4tj||otj| Src)ospathexistsaccessisdir)fnmodes r _access_checkzwhich.._access_checksDGNN2&&.29R+>+>.GMM"--- /rNPATHwin32rPATHEXTc3K|]=}|V>dSrc)r:endswith.0extcmds r zwhich..sAHH399;;'' 44HHHHHHrcg|]}|zSr3r3r|s r zwhich..s666ss666r)rnrodirnameenvironrVdefpathr7pathsepsysplatformcurdirinsertanysetnormcaseaddrA) rrtrorupathextfilesseendirnormdirthefilenames ` rrkrks / / / 7??3   }S$''  4 <:>>&"*55D 4zz"*%% <7 " "9$$ Ary)))jnnY3399"*EEG HHHHHHHHH 76666g666EEuu $ $Cg&&s++Gd??!!!$$$G7<<W55D$}T400$# $tr)ZipFile __enter__) ZipExtFilec eZdZdZdZdZdS)rcD|j|jdSrcrd)rgbases rrizZipExtFile.__init__s M  / / / / /rc|Srcr3rgs rrzZipExtFile.__enter__Krc.|dSrcclosergexc_infos r__exit__zZipExtFile.__exit__ JJLLLLLrN)r0r1r2rirrr3rrrrsA 0 0 0        rrc eZdZdZdZdZdS)rc|Srcr3rs rrzZipFile.__enter__$rrc.|dSrcrrs rrzZipFile.__exit__'rrcJtj|g|Ri|}t|Src) BaseZipFileopenr)rgargsrhrs rrz ZipFile.open+s0#D:4:::6::Dd## #rN)r0r1r2rrrr3rrrr#sA       $ $ $ $ $rr)python_implementationcdtjvrdStjdkrdStjdrdSdS)z6Return a string identifying the Python implementation.PyPyjavaJython IronPythonCPython)rversionrnrr<r3rrrr2sH S[ 6 7f  8 ; ! !, / / <yr) sysconfig)Callablec,t|tSrc)rr)objs rcallablerFs#x(((rrmbcsstrictsurrogateescapect|tr|St|tr |tt St dt|jzNzexpect bytes or str, not %s) rbytes text_typer _fsencoding _fserrors TypeErrortyper0filenames rfsencoderZse h & & 5O ) , , 5??; :: :9 NN3455 5rct|tr|St|tr |tt St dt|jzr) rrrdecoderrrrr0rs rfsdecodercse h * * 5O % ( ( 5??; :: :9 NN3455 5r)detect_encoding)BOM_UTF8lookupzcoding[:=]\s*([-\w.]+)c|dddd}|dks|drdS|dvs|drd S|S) z(Imitates get_normal_name in tokenizer.c.N _-rzutf-8-)zlatin-1 iso-8859-1z iso-latin-1)zlatin-1-z iso-8859-1-z iso-latin-1-r)r:r?r<)orig_encencs r_get_normal_namertsvssm!!##++C55 '>>S^^H55>7 : : : >>E F F ;<rcR jjn#t$rdYnwxYwdd}d}fd}fd}|}|trd|dd}d}|s|gfS||}|r||gfS|}|s||gfS||}|r|||gfS|||gfS) a? The detect_encoding() function is used to detect the encoding that should be used to decode a Python source file. It requires one argument, readline, in the same way as the tokenize() generator. It will call readline a maximum of twice, and return the encoding used (as a string) and a list of any lines (left as bytes) it has read in. It detects the encoding from the presence of a utf-8 bom or an encoding cookie as specified in pep-0263. If both a bom and a cookie are present, but disagree, a SyntaxError will be raised. If the encoding cookie is an invalid charset, raise a SyntaxError. Note that if a utf-8 bom is found, 'utf-8-sig' is returned. If no encoding is specified, then the default of 'utf-8' will be returned. NFrc< S#t$rYdSwxYw)Nr) StopIteration)readlinesr read_or_stopz%detect_encoding..read_or_stops6 xzz!    ss s c |d}n7#t$r*d}d|}t|wxYwt|}|sdSt |d} t|}n;#t$r.d|z}nd|}t|wxYwr9|j dkr)d}nd}t||d z }|S) Nrz'invalid or missing encoding declarationz {} for {!r}rzunknown encoding: zunknown encoding for {!r}: {}zencoding problem: utf-8z encoding problem for {!r}: utf-8z-sig) rUnicodeDecodeErrorformat SyntaxError cookie_refindallrr LookupErrorr)line line_stringmsgmatchesencodingcodec bom_foundrs r find_cookiez$detect_encoding..find_cookiesV '#kk'22 % ' ' '?''..sH==C!#&&&  '  '' 44G t' 33H 'x(( ' ' '#.9CC9@@$&&C!#&&& ' #:(('7@GGQQ%c***F"Os4A B8C Trz utf-8-sig)__self__rAttributeErrorr<r) rrdefaultrrfirstsecondrrs ` @@rrrsG" (-HH   HHH        $ $ $ $ $ $ L    H % % "I!""IE!G B; ;u%%  %eW$ $ $UG# #;v&&  -eV_, ,''s  !!)r>)r)unescape)ChainMap)MutableMapping)recursive_repr...cfd}|S)zm Decorator to make a repr function return fillvalue for a recursive call ctfd}td|_td|_td|_tdi|_|S)Nct|tf}|vrS| |}|n#|wxYw|Src)id get_identrdiscard)rgr\result fillvalue repr_running user_functions rwrapperz=_recursive_repr..decorating_function..wrappersT((IKK/Cl**(( $$S)))2!.t!4!4$,,S1111 ,,S1111!Ms AA3r1rjr0__annotations__)rgetattrr1rjr0r)rrrrs` @rdecorating_functionz,_recursive_repr..decorating_functions"uu  " " " " " " "&-]L%I%I"")-"C"C#*=*#E#E *1-ARTV*W*W'rr3)rrs` r_recursive_reprrs$      *' &rceZdZdZdZdZdZddZdZdZ d Z d Z e d Z ed Zd ZeZdZedZdZdZdZdZdZdS)ra A ChainMap groups multiple dicts (or other mappings) together to create a single, updateable view. The underlying mappings are stored in a list. That list is public and can accessed or updated using the *maps* attribute. There is no other state. Lookups search the underlying mappings successively until a key is found. In contrast, writes, updates, and deletions only operate on the first mapping. c4t|pig|_dS)zInitialize a ChainMap by setting *maps* to the given mappings. If no mappings are provided, a single empty dictionary is used. N)listmaps)rgrs rrizChainMap.__init__s T *rdDIIIrc t|rc)KeyErrorrgr\s r __missing__zChainMap.__missing__s3-- rct|jD]} ||cS#t$rYwxYw||Src)rr r )rgr\mappings r __getitem__zChainMap.__getitem__s\9  "3<'''D##C(( (s  ""Nc||vr||n|Srcr3rgr\rs rrVz ChainMap.get's #t 499 8rcRttj|jSrc)rWrunionrrs r__len__zChainMap.__len__*s{suu{DI.// /rcRttj|jSrc)iterrrrrs r__iter__zChainMap.__iter__-s  TY/00 0rcDtfd|jDS)Nc3 K|]}|vV dSrcr3)r}mr\s rrz(ChainMap.__contains__..1s'33Asax333333rrrr s `r __contains__zChainMap.__contains__0s(333333333 3rc*t|jSrcrrs r__bool__zChainMap.__bool__3sty>> !rc d|dtt|jS)Nz{0.__class__.__name__}({1})rT)rrArXr9rrs r__repr__zChainMap.__repr__6s7077diiD$) 4 45577 7rc8|tj|g|RS)z?Create a ChainMap with a single dict created from the iterable.)dictfromkeys)clsiterablers rr#zChainMap.fromkeys;s&3t}X555566 6rcr|j|jdg|jddRS)zHNew ChainMap or subclass with a new copy of maps[0] and refs to maps[1:]rrN) __class__rcopyrs rr(z ChainMap.copy@s8!4>$)A,"3"3"5"5F !"" FFF Frc(|jig|jRS)z;New ChainMap with a new dict followed by all previous maps.r'rrs r new_childzChainMap.new_childFs!4>"1ty111 1rc0|j|jddS)zNew ChainMap from maps[1:].rNr*rs rparentszChainMap.parentsJs"4>49QRR=1 1rc&||jd|<dS)Nr)r)rgr\r]s r __setitem__zChainMap.__setitem__Os %DIaL   rc |jd|=dS#t$r#td|wxYw)Nr(Key not found in the first mapping: {!r})rr rr s r __delitem__zChainMap.__delitem__RsY WIaL%%% W W WIPPQTUUVVV Ws-?c| |jdS#t$rtdwxYw)zPRemove and return an item pair from maps[0]. Raise KeyError is maps[0] is empty.rz#No keys found in the first mapping.)rpopitemr rs rr4zChainMap.popitemXsN Fy|++--- F F FDEEE Fs!;c |jdj|g|RS#t$r#td|wxYw)zWRemove *key* from maps[0] and return its value. Raise KeyError if *key* not in maps[0].rr1)rpopr r)rgr\rs rr6z ChainMap.pop_sf W'ty|'3d3333 W W WIPPQTUUVVV Ws -AcD|jddS)z'Clear maps[0], leaving maps[1:] intact.rN)rclearrs rr8zChainMap.clearfs IaL   rrc)r0r1r2rjrir rrVrrrrrr  classmethodr#r(__copy__r+propertyr-r/r2r4r6r8r3rrrrsq  + + +    ) ) ) 9 9 9 9 0 0 0 1 1 1 4 4 4 " " "    7 7   7  7 7  7 G G G 2 2 2  2 2  2 & & & W W W  F F F W W W ! ! ! ! !rr)cache_from_sourcecP|dsJ|d}|rd}nd}||zS)Nz.pyTco)r{)rodebug_overridesuffixs rr<r<psC=='' ' ''%!* &= r) OrderedDict)r)KeysView ValuesView ItemsViewceZdZdZdZejfdZejfdZdZdZ dZ dd Z d Z d Z d Zd ZdZdZdZeZeZefdZddZddZdZdZeddZdZdZdZdZ dZ!dS)rBz)Dictionary that remembers insertion orderct|dkrtdt|z |jn*#t$rgx|_}||dg|dd<i|_YnwxYw|j|i|dS)zInitialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. rz$expected at most 1 arguments, got %dN)rWr_OrderedDict__rootr_OrderedDict__map_OrderedDict__update)rgrkwdsroots rrizOrderedDict.__init__s 4yy1}} FT RSSS  !   %'' dt,QQQ   DM4 (4 ( ( ( ( (s<$A#"A#ct||vr&|j}|d}|||gx|d<x|d<|j|<||||dS)z!od.__setitem__(i, y) <==> od[i]=yrrN)rHrI)rgr\r] dict_setitemrLlasts rr/zOrderedDict.__setitem__s[${Aw7;T36GGQG$q'DJsO LsE * * * * *rcn||||j|\}}}||d<||d<dS)z od.__delitem__(y) <==> del od[y]rrN)rIr6)rgr\ dict_delitem link_prev link_nexts rr2zOrderedDict.__delitem__sF Ls # # #(, s(;(; %Iy#$IaL$IaLLLrc#`K|j}|d}||ur|dV|d}||udSdS)zod.__iter__() <==> iter(od)rrNrHrgrLcurrs rrzOrderedDict.__iter__P;D7Dd""1g Awd""""""rc#`K|j}|d}||ur|dV|d}||udSdS)z#od.__reversed__() <==> reversed(od)rrNrUrVs r __reversed__zOrderedDict.__reversed__rXrc |jD]}|dd=|j}||dg|dd<|jn#t$rYnwxYwt |dS)z.od.clear() -> None. Remove all items from od.N)rI itervaluesrHr8rr")rgnoderLs rr8zOrderedDict.clears  J1133  DQQQ{t,QQQ   """"!     JJt     sA A AATc|std|j}|r|d}|d}||d<||d<n|d}|d}||d<||d<|d}|j|=t||}||fS)zod.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. zdictionary is emptyrrr)r rHrIr"r6)rgrOrLlinkrRrSr\r]s rr4zOrderedDict.popitems  64555;D $Aw G # ! #QAw G #Q# ! q'C 3HHT3''E: rc t|S)zod.keys() -> list of keys in od)rrs rkeyszOrderedDict.keys:: rc fdDS)z#od.values() -> list of values in odc g|] }| Sr3r3r}r\rgs rrz&OrderedDict.values..s...#DI...rr3rs`rvalueszOrderedDict.valuess....... .rc fdDS)z.od.items() -> list of (key, value) pairs in odc$g|] }||f Sr3r3res rrz%OrderedDict.items..s"555S$s)$555rr3rs`ritemszOrderedDict.itemss5555555 5rc t|S)z0od.iterkeys() -> an iterator over the keys in od)rrs riterkeyszOrderedDict.iterkeysrbrc#(K|D] }||V dS)z2od.itervalues -> an iterator over the values in odNr3rgks rr\zOrderedDict.itervaluess.  1g   rc#,K|D]}|||fVdS)z=od.iteritems -> an iterator over the (key, value) items in odNr3rms r iteritemszOrderedDict.iteritemss6 # #$q'l"""" # #rct|dkr tdt|fz|std|d}d}t|dkr|d}t|tr|D] }||||<n@t |dr#|D] }||||<n |D] \}}|||< |D] \}}|||< dS) aod.update(E, **F) -> None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v rz8update() takes at most 2 positional arguments (%d given)z,update() takes at least 1 argument (0 given)rr3rraN)rWrrr"hasattrrari)rrKrgotherr\r]s rrfzOrderedDict.update s>4yy1}}!7:=d))!FGGG P NOOO7DE4yyA~~Q%&& & ++C %c DII+'' & ::<<++C %c DII+#(&&JC %DII"jjll " " U!S  " "rcX||vr ||}||=|S||jurt||S)zod.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. )_OrderedDict__markerr )rgr\rrs rr6zOrderedDict.pop,s@ d{{cI $-''smm#NrNc(||vr||S|||<|S)zDod.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in odr3rs r setdefaultzOrderedDict.setdefault9s#d{{Cy DINrc|si}t|tf}||vrdSd||< |s|jjd||=S|jjd|d||=S#||=wxYw)zod.__repr__() <==> repr(od)rr()())r _get_identr'r0ri)rg _repr_runningcall_keys rr zOrderedDict.__repr__@s 4"-$xx-H=((u&'M( # ,?%)^%<%<%<>"(++$(>#:#:#:DJJLLLLI!(++M(+++++sA)#A))A.cfdD}t}ttD]}||d|r j|f|fSj|ffS)z%Return state information for picklingc$g|] }||g Sr3r3)r}rnrgs rrz*OrderedDict.__reduce__..Ps!000aaa\000rN)varsr(rBr6r')rgri inst_dictrns` r __reduce__zOrderedDict.__reduce__Ns00004000ET ))I+--(( ' ' a&&&& =)<<>E8+ +rc,||S)z!od.copy() -> a shallow copy of od)r'rs rr(zOrderedDict.copyXs>>$'' 'rc.|}|D]}|||<|S)zOD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). r3)r$r%r]dr\s rr#zOrderedDict.fromkeys\s. A  #Hrct|trJt|t|ko)||kSt||S)zod.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. )rrBrWrir"__eq__rgrss rrzOrderedDict.__eq__gs\ %-- O4yy#e**,N1NN;;tU++ +rc||k Srcr3rs r__ne__zOrderedDict.__ne__psu}$ $rc t|S)z@od.viewkeys() -> a set-like object providing a view on od's keys)rCrs rviewkeyszOrderedDict.viewkeysusD>> !rc t|S)z an object providing a view on od's values)rDrs r viewvalueszOrderedDict.viewvaluesysd## #rc t|S)zBod.viewitems() -> a set-like object providing a view on od's items)rErs r viewitemszOrderedDict.viewitems}sT?? "r)Trc)"r0r1r2rjrir"r/r2rrZr8r4rarfrirkr\rprfrJobjectrur6rwr rr(r9r#rrrrrr3rrrBrBs33 ) ) ) 8<7G + + + +150@ % % % %             2    / / / 6 6 6        # # #  " " ">688#+         , , , , , , , ( ( (       , , , % % %  " " " $ $ $ # # # # #rrB)BaseConfigurator valid_identz^[a-z_][a-z0-9_]*$cbt|}|std|zdS)Nz!Not a valid Python identifier: %rT) IDENTIFIERrCrU)rrs rrrs7   Q   F@1DEE Etrc eZdZdZdZddZdS)ConvertingDictz A converting dictionary wrapper.ct||}|j|}||ur6|||<t |t t tfvr||_||_ |Src) r"r configuratorconvertrrConvertingListConvertingTupleparentr\rgr\r]rs rrzConvertingDict.__getitem__s$$T3//E&..u55FF"""S <[a-z]+)://(?P.*)$z ^\s*(\w+)\s*z^\.\s*(\w+)\s*z^\[\s*(\w+)\s*\]\s*z^\d+$ ext_convert cfg_convert)r~cfgcFt||_||j_dSrc)rconfigr)rgrs rrizBaseConfigurator.__init__s!(00DK'+DK $ $ $rc|d}|d} ||}|D]P}|d|zz } t||}#t$r(||t||}YMwxYw|S#t $rEt jdd\}}td|d|}||c|_ |_ |wxYw)zl Resolve strings to objects using standard import and attribute syntax. r5rrNzCannot resolve z: ) r7r6importerrr ImportErrorrrrU __cause__ __traceback__) rgrrusedfoundrLetbvs rresolvezBaseConfigurator.resolves 773<.Ws,LLLa[^^LAvay>LLLrr3)r6rrr"risetattr)rgrr>propsrhrrr]s ` rconfigure_customz!BaseConfigurator.configure_customPs 4  AA;; $LLOOJJsD))ELLLL6LLLMMFQ[[[[F 1#(;;==11KD%FD%0000MrcNt|trt|}|S)z0Utility function which converts lists to tuples.)rrrrs ras_tuplezBaseConfigurator.as_tuple^s$%&& %e LrN)r0r1r2rjr=r@rrrrrr staticmethod __import__rrirrrrrrr3rrrrs  %"*%MNN!rz/22  bj!233 " #9:: " 8,, "!    < ++ , , ,   . ' ' '   D   8        rr)r)rrc) __future__rrnr=rsslr version_infor basestringrrrtypesr file_type __builtin__builtins ConfigParser configparser _backportrr r r r r urllibrrrrrrrrurllib2rrr r!r"r#r$r%r&r'httplib xmlrpclibQueuequeuer(htmlentitydefs raw_input itertoolsr)filterr*r,iostrr+ urllib.parseurllib.request urllib.error http.clientclientrequest xmlrpc.client html.parser html.entitiesentitiesinputr-r.rUrNr_rarrkF_OKX_OKzipfilerrrrrBaseZipExtFilerrrr NameErrorcollections.abcrrrrgetfilesystemencodingrrtokenizercodecsrrr@rrhtmlr>cgir collectionsrrreprlibrrimportlib.utilr<imprBthreadrr| dummy_thread_abcollrCrDrEr"logging.configrrIrrr6rrrrr3rrrs '&&&&& JJJJ CCCA!!!!!!;LI++++++""""''''!!!!!!LLLLLLLLLLLLLLGGGGGGGGGGGGGGGGGG NNN'''''''''''''''''''''' )((((((NNN%%%%%%I++++++5555555 4LI------OOOMMMHHHHHHHHHHHHHHHHHHHH........................  0//////FFFFFFFFFF!!!!!!$$$$$$%%%%%%LLL&&&&&&******I%%%%%% Fa4444444444_4_4_4     :   /#/#/#/#d(4(4(4(4(4o_4D)2222222))))))))F))))))@>>>"')<<<<<<>F+***** 7; $$$GG444444^ $ $ $ $ $+ $ $ $ .......    %%%%$$$$$$$$%)HH)))(((((()))))) 5{H{HH555,#+--8Kf % 55555555-5>k((((((((i(i(i('''''''' III 455I   X(X(X(X(X(#i(XBQB&  z||$HHE!$$$$$$$C!C!C!******'======= ''' ' ' ' ' ' ''<`!`!`!`!`!>`!`!`!`!`!GC!J!0000000 ! ! ! !)))))))  ! ! ! ! ! ! ! ! ! ! !E#'''''''C#C#C#92222222 999888888889 ;;;;;;;;;;;      t#t#t#t#t#dt#t#t#t#t#C#Ja<<<<<<<<<<___0"$77J 6.     %   CCCCC6CCCCCCy_s##EE.-E.2E99FFFF54F50G77HHH HHH H10H15I'I.-I.2I99'J#"J#'J.. J<;J<)K00 L#<LL# L L#LL#"L#'L..M 4L;:M ; MM MM  M MNM%$N% M30N2M33N7 NNN N N  NN"N,,AP  P PK!-$__pycache__/locators.cpython-311.pycnu[ ^iHddlZddlmZddlZddlZddlZddlZddlZ ddlZn#e $rddl ZYnwxYwddl Z ddl m Z ddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZddlmZm Z m!Z!ddl"m#Z#m$Z$ddl%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-dd l.m/Z/m0Z0dd l1m2Z2m3Z3ej4e5Z6ej7d Z8ej7d ej9Z:ej7d Z;dZGdde?Z@Gdde@ZAGdde@ZBGdde?ZCGdde@ZDGdde@ZEGdde@ZFGd d!e@ZGGd"d#e@ZHeHeFeDd$d%&d'(ZIeIjJZJGd)d*e?ZKdS),N)BytesIO)DistlibException)urljoinurlparse urlunparse url2pathname pathname2urlqueuequoteunescape build_openerHTTPRedirectHandler text_typeRequest HTTPErrorURLError) DistributionDistributionPath make_dist)MetadataMetadataInvalidError)cached_property ensure_slashsplit_filenameget_project_dataparse_requirementparse_name_and_version ServerProxynormalize_name) get_schemeUnsupportedVersionError)Wheel is_compatiblez^(\w+)=([a-f0-9]+)z;\s*charset\s*=\s*(.*)\s*$ztext/html|application/x(ht)?mlzhttps://pypi.org/pypic|t}t|d} ||dS#|dwxYw)z Return all distribution names known by an index. :param url: The URL of the index. :return: A list of all known distribution names. N@timeoutclose) DEFAULT_INDEXr list_packages)urlclients /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/locators.pyget_all_distribution_namesr/)si  { c * * *F##%%wws AAc$eZdZdZdZexZxZZdS)RedirectHandlerzE A class to work around a bug in some Python 3.2.x releases. c6d}dD]}||vr ||}n|dSt|}|jdkrNt||}t |dr|||n|||<t j||||||S)N)locationurireplace_header)rschemer get_full_urlhasattrr6BaseRedirectHandlerhttp_error_302) selfreqfpcodemsgheadersnewurlkeyurlpartss r.r;zRedirectHandler.http_error_302@s&  Cg~~  > FF## ?b S--//88Fw 011 &&&sF3333% "1$Rs29;; ;N)__name__ __module__ __qualname____doc__r;http_error_301http_error_303http_error_307rEr.r1r17s9;;;(8FENE^nnnrEr1ceZdZdZdZdZdZdZedzZddZ d Z d Z d Z d Z d Zee eZdZdZdZdZdZdZdZdZdZddZdS)LocatorzG A base class for locators - things that locate distributions. )z.tar.gzz.tar.bz2z.tarz.zipz.tgzz.tbz)z.eggz.exe.whl)z.pdfN)rPdefaultci|_||_tt|_d|_t j|_dS)a^ Initialise an instance. :param scheme: Because locators look for most recent versions, they need to know the version scheme to use. This specifies the current PEP-recommended scheme - use ``'legacy'`` if you need to support existing distributions on PyPI. N) _cacher7rr1openermatcherr Queueerrors)r<r7s r.__init__zLocator.__init__fsC  #?#4#455  kmm rEc,g}|jsx |jd}||n#|jj$rY[wxYw|j|jx|S)z8 Return any errors which have occurred. F)rWemptygetappendEmpty task_done)r<resultes r. get_errorszLocator.get_errorsys+##%% $ KOOE** a    ;$     K ! ! # # # +##%% $ s/A AAc.|dS)z> Clear any errors which may have been logged. N)rar<s r. clear_errorszLocator.clear_errorss rEc8|jdSN)rSclearrcs r. clear_cachezLocator.clear_caches rEc|jSrf_schemercs r. _get_schemezLocator._get_schemes |rEc||_dSrfrj)r<values r. _set_schemezLocator._set_schemes  rEc td)a= For a given project, get a dictionary mapping available versions to Distribution instances. This should be implemented in subclasses. If called from a locate() request, self.matcher will be set to a matcher for the requirement to satisfy, otherwise it will be None. Please implement in the subclassNotImplementedError)r<names r. _get_projectzLocator._get_projects""DEEErEc td)J Return all the distribution names known to this locator. rqrrrcs r.get_distribution_nameszLocator.get_distribution_namess""DEEErEc|j||}nJ||jvr|j|}n3|||}||j|<|S)z For a given project, get a dictionary mapping available versions to Distribution instances. This calls _get_project to do all the work, and just implements a caching layer on top. )rSrurd)r<rtr_s r. get_projectzLocator.get_projectsr ; &&t,,FF T[ [&FF      &&t,,F &DK  rEc,t|}tj|j}d}|d}||j}|r"t t||j}|j dkd|j v||||fS)zu Give an url a score which can be used to choose preferred URLs for a given project release. TrPhttpszpypi.org) r posixpathbasenamepathendswithdownloadable_extensionsr$r# wheel_tagsr7netloc)r<r,tr~ compatibleis_wheelis_downloadables r. score_urlzLocator.score_urls SMM%af-- $$V,,"++D,HII  I&uXHHJG#Z18%;:xA ArEc|}|rq||}||}||kr|}||krtd||ntd|||S)a{ Choose one of two URLs where both are candidates for distribution archives for the same version of a distribution (for example, .tar.gz vs. zip). The current implementation favours https:// URLs over http://, archives from PyPI over those from other locations, wheel compatibility (if a wheel) and then the archive name. zNot replacing %r with %rzReplacing %r with %r)rloggerdebug)r<url1url2r_s1s2s r. prefer_urlzLocator.prefer_urls  A%%B%%BBww~~ 7tDDDD 3T4@@@ rEc"t||S)zZ Attempt to split a filename in project name, version and Python version. )r)r<filename project_names r.rzLocator.split_filenamesh 555rEc 8d}d}t|\}}}}} } | drtd|| t | } | r| \} } nd\} } |}|r|ddkr |dd}|dr t|}t||j std |nd|d }n||j |}|rL|j |j |jt||||| d fd d |jDd}n #t$$r%}td|Yd}~nd}~wwxYw||jstd|nt+j|x}}|jD]}||r|dt/| }|||}|std|n5|\}}}|r |||r!|||t||||| d fd}|r||d<n|r | r| |d| z<|S)a See if a URL is a candidate for a download URL for a project (the URL has typically been scraped from an HTML page). If it is, a dictionary is returned with keys "name", "version", "filename" and "url"; otherwise, None is returned. cBt|t|kSrf)r )name1name2s r. same_projectz:Locator.convert_url_to_download_info..same_projects!%((N5,A,AA ArENzegg=z %s: version hint in fragment: %r)NN/rPzWheel not compatible: %sTr5z, c bg|],}dt|dd-S).N)joinlist).0vs r. z8Locator.convert_url_to_download_info..s2 L L L1$qu++!6!6 L L LrE)rtversionrr,python-versionzinvalid path for wheel: %szNot downloadable: %sz No match for project/version: %s)rtrrr,r %s_digest)rlower startswithrr HASHER_HASHmatchgroupsrr#r$rrtrrrrpyver Exceptionwarningrr}r~lenr)r<r,rrr_r7rrparamsqueryfragmalgodigestorigpathwheelincluder`rextrrtrrs r.convert_url_to_download_infoz$Locator.convert_url_to_download_infosM B B B4 > > wrEFc4d}t|}|td|zt|j}||jx|_}t d|t|j | |j }t|dkrg}|j } |D]q} | dvr || sn'|s| | js|| F#t"$rt d|| YnwxYwt|dkrt'||j}|r+t d ||d } || }|r|jr |j|_|d i| t/|_i} |d i} |jD]}|| vr | || |<| |_d|_|S) a Find the most recent distribution which matches the given requirement. :param requirement: A requirement of the form 'foo (1.0)' or perhaps 'foo (>= 1.0, < 2.0, != 1.3)' :param prereleases: If ``True``, allow pre-release versions to be located. Otherwise, pre-release versions are not returned. :return: A :class:`Distribution` instance, or ``None`` if no such distribution could be located. NzNot a valid requirement: %rzmatcher: %s (%s)rrrzerror matching %s with %rr)rCzsorted list: %srrr)rrr!r7rU requirementrrtyperFrzrtr version_classr is_prereleaser\rrsortedrCextrasr[r download_urlsr)r<r prereleasesr_rr7rUversionsslistvclskrdsdr,s r.locatezLocator.locate_s6 k * * 9"#@;#NOO ODK((!' !>!>> w '$w--2HIII##AF++ x==1  E(D  +++ "==++,&,dd1gg.C,!LLOOO!NN#>KKKD5zzA~~u&*555 + .666)!'*  x ) ! #+<<#;#;#?#?#O#OF Ai,,B+ % %"99WAcFFN  s =D&D0/D0)rQ)F)rFrGrHrIsource_extensionsbinary_extensionsexcluded_extensionsrrrXrardrhrlropropertyr7rurxrzrrrrrrrrMrEr.rOrOVs_P0# J/);$$$$&   Xk; / /F F F FFFF " A A A,666 HHHT..999999rErOc.eZdZdZfdZdZdZxZS)PyPIRPCLocatorz This locator uses XML-RPC to locate distributions. It therefore cannot be used with simple mirrors (that only mirror file content). c tt|jdi|||_t |d|_dS)z Initialise an instance. :param url: The URL to use for XML-RPC. :param kwargs: Passed to the superclass constructor. r&r'NrM)superrrXbase_urlrr-r<r,kwargs __class__s r.rXzPyPIRPCLocator.__init__sG -nd##,66v666 !#s333 rEcNt|jSrw)rr-r+rcs r.rxz%PyPIRPCLocator.get_distribution_namess 4;,,..///rEc$iid}|j|d}|D]k}|j||}|j||}t |j}|d|_|d|_|d|_ |dg|_ |d|_ t|}|r|d } | d |_ || |_||_|||<|D]e} | d } || } |d |t%| | |d | <fm|S) NrTrrtrlicensekeywordssummaryrr,rr)r-package_releases release_urls release_datarr7rtrr[rrrrrrrrrrr) r<rtr_rrrdatarrrr,rs r.ruzPyPIRPCLocator._get_projects,,;//d;; 4 4A;++D!44D;++D!44Dt{333H LHM#IH #xx 22H  $R 8 8H #xx 22H ))D 4Aw&*5k#"..t44 #  q  44Du+C!--d33F6N--a77;;C@@@-3F9%c** rErFrGrHrIrXrxru __classcell__rs@r.rrs` 4 4 4 4 4000 rErc.eZdZdZfdZdZdZxZS)PyPIJSONLocatorzw This locator uses PyPI's JSON interface. It's very limited in functionality and probably not worth using. c ptt|jdi|t||_dS)NrM)rrrXrrrs r.rXzPyPIJSONLocator.__init__s9-ot$$-77777$S)) rEc tdrwzNot available from this locatorrrrcs r.rxz&PyPIJSONLocator.get_distribution_names""CDDDrEc|iid}t|jdt|z} |j|}|}tj|}t|j }|d}|d|_ |d|_ | d|_| dg|_| d |_t#|}||_|d } |||j <|d D]} | d }|j||| |j|<|d |j t1||| |d |<|d D]\} } | |j krt|j } |j | _ | | _ t#| }||_||| <| D]} | d }|j||| |j|<|d | t1||| |d |<nY#t4$rL}|jt;|t<d|Yd}~nd}~wwxYw|S)Nrz%s/jsonrrrtrrrrrr,rreleaseszJSON fetch failed: %s) rrr rTopenreaddecodejsonloadsrr7rtrr[rrrrrrrrrrritemsrrWputrr exception)r<rtr_r,resprrrrrrrinfosomdodistr`s r.ruzPyPIJSONLocator._get_projects,,dmYt%<==/ 9;##C((D99;;%%''D 4  A---BV9D6lBGiBJ),,BJ((:r22BK),,BJ##DDLV9D!%F2: &  @ @5k"&&s+++$($4$4T$:$: S!v))"*cee<<@@EEE)-)9)9$)?)?y!#&&"#J-"5"5"7"7 D Dbj((dk2227% $S)) $ "'w!DDDu+C'++C000)-)9)9$)?)?EM#&6N--gsuu==AA#FFF-1-=-=d-C-CF9%c** D D. 9 9 9 KOOIaLL ) ) )   4a 8 8 8 8 8 8 8 8 9 sJ6K## L9-AL44L9rrs@r.rrsc*****EEE 3333333rErceZdZdZejdejejzejzZ ejdejejzZ dZ ejdejZ e dZdS)Pagez4 This class represents a scraped HTML page. z (rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*))\s+)? href\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)) (\s+rel\s*=\s*(?:"(?P[^"]*)"|'(?P[^']*)'|(?P[^>\s ]*)))? z!]+)c||_|x|_|_|j|j}|r|d|_dSdS)zk Initialise an instance with the Unicode page contents and the URL they came from. rN)rrr,_basesearchgroup)r<rr,rs r.rXz Page.__init__ sW  #&&  J  di ( (  'GGAJJDMMM ' 'rEz[^a-z0-9$&+,/:;=?@.#%_\\|-]cd}t}|j|jD]}|d}|dp'|dp|dp|dp|dp|d}|d p|d p|d }t |j|}t|}|j d |}| ||ft|d d}|S)z Return the URLs of all the links on a page together with information about their "rel" attribute, for determining which ones to treat as downloads and which ones to queue for further scraping. crt|\}}}}}}t||t||||fS)zTidy up an URL.)rrr )r,r7rrrrrs r.cleanzPage.links..clean4sD8@ 5FFD&%vvuT{{%ud455 5rEr5rel1rel2rel3rel4rel5rel6rrurl3cLdt|dzS)Nz%%%2xr)ordr)rs r.zPage.links..BswQWWQZZ/HrEc|dS)NrrM)rs r.rzPage.links..Fs adrET)rCreverse) r_hreffinditerr groupdictrrr _clean_resubrr)r<rr_rrrelr,s r.linksz Page.links-s 5 5 5 Z((33 # #E##AV97& 7QvY7V97 !& 7-.vY F)5qy5AfIC$---C3--C.$$%H%H#NNC JJSz " " " "NNDAAA rEN)rFrGrHrIrecompileISXr!rrXr$rr'rMrEr.r r s BJTBD[24   E BJ? M ME ' ' ' 924@@I_rEr ceZdZdZejdddZdfd ZdZd Z d Z e j d e j Zd Zd ZdZdZdZe j dZdZxZS)SimpleScrapingLocatorz A locator which scrapes HTML pages to locate downloads for a distribution. This runs multiple threads to do the I/O; performance is at least as good as pip's PackageFinder, which works in an analogous fashion. cjtjt|S)N)fileobj)gzipGzipFilerrbs r.rzSimpleScrapingLocator.Ts%$- ;;;@@BBrEc|SrfrMr3s r.rzSimpleScrapingLocator.Us!rE)deflater1noneN c tt|jdi|t||_||_i|_t|_tj |_ t|_ d|_ ||_tj|_tj|_d|_dS)a Initialise an instance. :param url: The root URL to use for scraping. :param timeout: The timeout, in seconds, to be applied to requests. This defaults to ``None`` (no timeout specified). :param num_workers: The number of worker threads you want to do I/O, This defaults to 10. :param kwargs: Passed to the superclass. FNrM)rr.rXrrr( _page_cacher_seenr rV _to_fetch _bad_hostsskip_externals num_workers threadingRLock_lock_gplockplatform_check)r<r,r(r?rrs r.rXzSimpleScrapingLocator.__init__Xs 4#T**3==f===$S))  UU %%#&_&& !(( #rEcg|_t|jD]_}tj|j}|d||j|`dS)z Threads are created only when get_project is called, and terminate before it returns. They are there primarily to parallelise I/O (i.e. fetching web pages). )targetTN) _threadsranger?r@Thread_fetch setDaemonstartr\)r<irs r._prepare_threadsz&SimpleScrapingLocator._prepare_threadsss|  t'(( $ $A  444A KK    GGIII M  # # # #  $ $rEc|jD]}|jd|jD]}|g|_dS)zu Tell all the threads to terminate (by sending a sentinel value) and wait for them to do so. N)rGr<rr)r<rs r. _wait_threadsz#SimpleScrapingLocator._wait_threadssY % %A N  t $ $ $ $  A FFHHHH rEc>iid}|j5||_||_t|jdt |z}|j|j|  t d||j ||j |n#|wxYw|`dddn #1swxYwY|S)Nrz%s/z Queueing %s)rCr_rrrr r;rgr:rNrrr<rrrP)r<rtr_r,s r.ruz"SimpleScrapingLocator._get_projectsN,, \   DK $D $-t)<==C J        " " $ $ $  ! ! # # # % ]C000""3'''##%%%""$$$$""$$$$                 s+A:DAC+D+DDDDz<\b(linux_(i\d86|x86_64|arm\w+)|win(32|_amd64)|macosx_?\d+)\bc6|j|S)zD Does an URL refer to a platform-specific download? )platform_dependentr)r<r,s r._is_platform_dependentz,SimpleScrapingLocator._is_platform_dependents&--c222rEc*|jr||rd}n|||j}td|||r:|j5||j|dddn #1swxYwY|S)a% See if an URL is a suitable download for a project. If it is, register information in the result dictionary (for _get_project) about the specific version it's for. Note that the return value isn't actually used other than as a boolean value. Nzprocess_download: %s -> %s) rDrTrrrrrBrr_)r<r,rs r._process_downloadz'SimpleScrapingLocator._process_downloads   M4#>#>s#C#C MDD44S$:KLLD 13===  = = =))$+t<<< = = = = = = = = = = = = = = = s BB B ct|\}}}}}}||j|jz|jzrd}n|jr||jsd}n|||jsd}n_|dvrd}nX|dvrd}nQ||rd}n9| ddd} | dkrd}nd}t d |||||S) z Determine whether a link URL from a referring page and with a particular "rel" attribute should be queued for scraping. F)homepagedownload)httpr|ftp:rr localhostTz#should_queue: %s (%s) from %s -> %s) rrrrrr>rrrTsplitrrr) r<linkreferrerr&r7rr_r_hosts r. _should_queuez#SimpleScrapingLocator._should_queues8 )1%aA ==/$2HH12 3 3 FF   )G)G FF$$T]33 FF 0 0 0FF 3 3 3FF  ( ( . . FF<<Q''*Dzz||{** :D#v ' ' ' rEc |j} |r||}| |jO|jD]\}}||jvr |j|||sM||||r6t d|||j |#t$rYwxYwn>#t$r1}|j t|Yd}~nd}~wwxYw|jn#|jwxYw|sdSo)z Get a URL to fetch from the work queue, get the HTML page, examine its links for download candidates and candidates for further scraping. This is a handy method to run in a thread. TNzQueueing %s from %s)r<r[get_pager^r'r;rrVrcrrrrrrWr)r<r,pager_r&r`s r.rJzSimpleScrapingLocator._fetchs .$$&&C + %==--D| ((****&*Z % % ctz11% $ t 4 4 4(,(>(>t(D(D!=$($6$6tS#$F$F!=$*LL1Fc$R$R$R$(N$6$6t$<$<$<#7%%% $%2 . . .  ! -------- .((****((**** 1 sZC5C5&A]*>([^<]+)>>rEc iid}tj|jD]\}}}|D]}|||rtj||}t ddttj|dddf}| ||}|r| |||j sn|S)Nrrhr5) rjwalkr~rrrrr r}rrr|) r<rtr_rootdirsfilesfnr,rs r.ruzDirectoryLocator._get_projectas,,!#!7!7   D$ @ @&&r400@dB//B$fb&227??23F3F&G&G&("b&233C <   rEc t}tj|jD]\}}}|D]}|||rtj||}tddttj |dddf}| |d}|r| |d|j sn|S)rwrhr5Nrt) rrjrr~rrrrr r}rrr|)r<r_rrrrr,rs r.rxz'DirectoryLocator.get_distribution_namesqs!#!7!7   D$ 1 1&&r4001dB//B$fb&227??23F3F&G&G&("b&233C <   rE) rFrGrHrIrXrrurxrrs@r.rzrzCso"??? rErzceZdZdZdZdZdS) JSONLocatora This locator uses special extended metadata (not available on PyPI) and is the basis of performant dependency resolution in distlib. Other locators require archive downloads before dependencies can be determined! As you might imagine, that can be slow. c tdrrrrcs r.rxz"JSONLocator.get_distribution_namesrrEc viid}t|}|r!|dgD] }|ddks |ddkrt|d|d|d d |j }|j}|d |_d |vr|d rd|d f|_|di|_|di|_|||j <|d |j t |d  |S)Nrrptypesdist pyversionsourcertrrzPlaceholder for summary)rr7r,rr requirementsexportsr) rr[rr7rrr dependenciesrrrrr)r<rtr_rrrrs r.ruzJSONLocator._get_projectsL,,%%  P"-- P P=G++tK/@H/L/L!ftI)-)2K*M*M(, 555] $U  t##X##($x."9DK"&((>2">">#xx 266 '+t|$v))$,>>BB4;OOOO rEN)rFrGrHrIrxrurMrEr.rrs? EEE rErc(eZdZdZfdZdZxZS)DistPathLocatorz This locator finds installed distributions in a path. It can be useful for adding to an :class:`AggregatingLocator`. c tt|jdi|t|tsJ||_dS)zs Initialise an instance. :param distpath: A :class:`DistributionPath` instance to search. NrM)rrrX isinstancerdistpath)r<rrrs r.rXzDistPathLocator.__init__sJ .ot$$-77777($455555  rEc |j|}|iid}n<|j|d|jt|jgid|jtdgii}|S)Nrrr)rget_distributionrrr)r<rtrr_s r.ruzDistPathLocator._get_projectso}--d33 < R00FF dsDO+<'='=>DL#tf++6F  rE)rFrGrHrIrXrurrs@r.rrsQ!!!!!       rErcjeZdZdZfdZfdZdZeej j eZ dZ dZ xZ S)AggregatingLocatorzI This class allows you to chain and/or merge a list of locators. c|dd|_||_tt|jdi|dS)a Initialise an instance. :param locators: The list of locators to search. :param kwargs: Passed to the superclass constructor, except for: * merge - if False (the default), the first successful search from any of the locators is returned. If True, the results from all locators are merged (this can be slow). mergeFNrM)rrlocatorsrrrX)r<rrrs r.rXzAggregatingLocator.__init__sKZZ//   0 $''0::6:::::rEctt||jD]}|dSrf)rrrhr)r<rrs r.rhzAggregatingLocator.clear_cachesP  $''33555} " "G    ! ! ! ! " "rEc6||_|jD] }||_ dSrf)rkrr7)r<rnrs r.rozAggregatingLocator._set_schemes- } # #G"GNN # #rEcBi}|jD]}||}|r|jr|di}|di}|||d}|r6|r4|D]\}} ||vr||xx| zcc<| ||< |d} |r| r| ||jd} n%d} |D] }|j|rd} n!| r|}n|S)NrrTF)rrzrr[updaterrUr) r<rtr_rrrrdfrrddfounds r.ruzAggregatingLocator._get_projectst}' ' G##D))A% :$"JJvr22E$jjB77GMM!$$$F++B**$)KKMM**DAq Bww "1 ()1I..B+2+ '***|+ $ %!"&&A#|11!44&(, %&!" rEct}|jD]*} ||z}#t$rY'wxYw|Sr)rrrxrs)r<r_rs r.rxz)AggregatingLocator.get_distribution_namess`}  G '88:::&     s 1 >>)rFrGrHrIrXrhrorrOr7fgetrurxrrs@r.rrs;;;;; """"" ### Xgn); 7 7F***X       rErzhttps://pypi.org/simple/r&r'legacyrc@eZdZdZd dZdZdZdZdZdZ d d Z dS) DependencyFinderz0 Locate dependencies for distributions. Nc^|pt|_t|jj|_dS)zf Initialise an instance, using the specified locator to locate distributions. N)default_locatorrr!r7)r<rs r.rXzDependencyFinder.__init__/s( 1/  !455 rEcjtd||j}||j|<||j||jf<|jD]m}t|\}}td||||j |t ||fndS)z Add a distribution to the finder. This will update internal information about who provides what. :param dist: The distribution to add. zadding distribution %szAdd to provided: %s, %s, %sN) rrrC dists_by_namedistsrprovidesrprovidedrrr)r<rrtprs r.add_distributionz!DependencyFinder.add_distribution7s  -t444x#'4 +/ D$,'( G GA2155MD' LL6gt L L L M $ $T355 1 1 5 5wo F F F F G GrEcFtd||j}|j|=|j||jf=|jD]_}t|\}}td||||j|}| ||f|s|j|=`dS)z Remove a distribution from the finder. This will update internal information about who provides what. :param dist: The distribution to remove. zremoving distribution %sz Remove from provided: %s, %s, %sN) rrrCrrrrrrremove)r<rrtrrss r.remove_distributionz$DependencyFinder.remove_distributionFs  /666x  t $ Jdl+ , ( (A2155MD' LL;T7D Q Q Q d#A HHgt_ % % % (M$'  ( (rEc |j|}nD#t$r7|d}|j|}YnwxYw|S)z Get a version matcher for a requirement. :param reqt: The requirement :type reqt: str :return: A version matcher (an instance of :class:`distlib.version.Matcher`). r)r7rUr"r^)r<reqtrUrts r. get_matcherzDependencyFinder.get_matcherXsj 0k))$//GG& 0 0 0::<<?Dk))$//GGG 0s>AAc||}|j}t}|j}||vrP||D]G\}} ||}n#t $rd}YnwxYw|r||nH|S)z Find the distributions which can fulfill a requirement. :param reqt: The requirement. :type reqt: str :return: A set of distribution which can fulfill the requirement. F)rrCrrrr"r) r<rrUrtr_rrproviderrs r.find_providerszDependencyFinder.find_providershs""4(({= 8  %-d^  !"#MM'22EE."""!EEE"JJx(((E sA A)(A)c |j|}t}|D]F}||}||js||G|r)|d||t |fd}ns|||j|=|D]<}|j|t|=| |d}|S)a Attempt to replace one provider with another. This is typically used when resolving dependencies from multiple sources, e.g. A requires (B >= 1.0) while C requires (B >= 1.1). For successful replacement, ``provider`` must meet all the requirements which ``other`` fulfills. :param provider: The provider we are trying to replace with. :param other: The provider we're trying to replace. :param problems: If False is returned, this will contain what problems prevented replacement. This is currently a tuple of the literal string 'cantreplace', ``provider``, ``other`` and the set of requirements that ``provider`` couldn't fulfill. :return: True if we can replace ``other`` with ``provider``, else False. cantreplaceFT) reqtsrrrrr frozensetrrr) r<rotherproblemsrlist unmatchedrrUr_s r.try_to_replacezDependencyFinder.try_to_replaces& 5!EE  ! !A&&q))G==!122 ! a     LL-5#I..0 1 1 1FF  $ $U + + + 5! > > %%h66::1====  ! !( + + +F rEFci|_i|_i|_i|_t |pg}d|vr)|d|t gdz}t |tr |x}}t d|nM|j ||x}}|td|zt d|d|_ t }t |g}t |g}|rb|}|j} | |jvr||n*|j| } | |kr||| ||j|jz} |j} t } |r(||vr$d D]!}d |z}||vr| t+|d |zz} "| | z| z}|D]}||}|s t d ||j ||}||s|j |d}|3t d ||d|fn|j|j}}||f|jvr|||||| vr9||vr5||t d|j|D]w}|j} | |jvr;|j|t |M|j| } | |kr||| |x|bt |j}|D]2}||v|_|jr t d|j3t d|||fS)a Find a distribution and all distributions it depends on. :param requirement: The requirement specifying the distribution to find, or a Distribution instance. :param meta_extras: A list of meta extras such as :test:, :build: and so on. :param prereleases: If ``True``, allow pre-release versions to be returned - otherwise, don't return prereleases unless they're all that's available. Return a set of :class:`Distribution` instances and a set of problems. The distributions returned should be such that they have the :attr:`required` attribute set to ``True`` if they were from the ``requirement`` passed to ``find()``, and they have the :attr:`build_time_dependency` attribute set to ``True`` unless they are post-installation dependencies of the ``requirement``. The problems should be a tuple consisting of the string ``'unsatisfied'`` and the requirement which couldn't be satisfied by any distribution known to the locator. z:*:)z:test:z:build:z:dev:zpassed %s as requirement)rNzUnable to locate %rz located %sT)testbuilddevz:%s:z %s_requireszNo providers found for %rzCannot satisfy %r unsatisfiedzAdding %s to install_distsz#%s is a build-time dependency only.zfind done for %s)rrrrrrrrrrrrr requestedrrCrr run_requires meta_requiresbuild_requiresgetattrrrrname_and_versionrvaluesbuild_time_dependency)r<r meta_extrasrrr rtodo install_distsrtrireqtssreqtsereqtsrCr` all_reqtsr providersrnrrrs r.findzDependencyFinder.findsp4   ++,, K     u % % % 3===>> >K k< 0 0 .& &D5 LL3U ; ; ; ;<..{;F/HH HD5|&'<{'JKKK LLu - - -55D6{{UG 1 D88::D8D4---%%d++++*40D==''eX>>>&);;F(FUUF Et}443EEC AK'''$ 0C"D"DD&0I D D //22  DLL!>>> $ 24 8 A:: //5(CCCDS1 DfDJ%%''(( 4 4D)-])BD &) 4 B!2444 '///hrErf)NF) rFrGrHrIrXrrrrrrrMrEr.rr*s6666 G G G((($ 0&&&PllllllrErrf)Lr1iorrloggingrjr}r(r@ ImportErrordummy_threadingrwr5rcompatrrrr r r r r rrr:rrrrdatabaserrrrrrutilrrrrrrrr rr!r"rr#r$ getLoggerrFrr)rr*rorlr*r/r1objectrOrrr r.rzrrrrrrrMrEr.rs    ((((''''''( 33333333333333333333333333333333@?????????44444444####################98888888''''''''  8 $ $bj.// "*2BD 9 9BJ?@@'     FFFFF)FFF>BBBBBfBBBJ .....W...`BBBBBgBBBJ777776777twwwwwGwwwr?????w???B$$$$$'$$$Lg8VVVVVVVVv%$KMM))*D25777# %%%  jjjjjvjjjjjs % 11PK!Y6$__pycache__/database.cpython-311.pycnu[ ^isdZddlmZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZmZddlmZmZmZmZdd lmZmZmZmZmZmZm Z gd Z!ej"e#Z$d Z%d Z&d eddde%dfZ'dZ(Gdde)Z*Gdde)Z+Gdde)Z,Gdde,Z-Gdde-Z.Gdde-Z/e.Z0e/Z1Gdd e)Z2d&d"Z3d#Z4d$Z5d%Z6dS)'zPEP 376 implementation.)unicode_literalsN)DistlibException resources)StringIO) get_schemeUnsupportedVersionError)MetadataMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAME)parse_requirementcached_propertyparse_name_and_version read_exports write_exports CSVReader CSVWriter) DistributionBaseInstalledDistributionInstalledDistributionEggInfoDistributionDistributionPathzpydist-exports.jsonzpydist-commands.json INSTALLERRECORD REQUESTED RESOURCESSHAREDz .dist-infoc$eZdZdZdZdZdZdS)_CachezL A simple cache mapping names and .dist-info paths to distributions c0i|_i|_d|_dS)zZ Initialise an instance. There is normally one for each DistributionPath. FN)namepath generatedselfs /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/database.py__init__z_Cache.__init__1s  cx|j|jd|_dS)zC Clear the cache, setting it to its initial state. FN)r"clearr#r$r%s r'r+z _Cache.clear9s3  r)c|j|jvrD||j|j<|j|jg|dSdS)z` Add a distribution to the cache. :param dist: The distribution to add. N)r#r" setdefaultkeyappendr&dists r'addz _Cache.addAsW 9DI % %#'DIdi I 2 . . 5 5d ; ; ; ; ; & %r)N)__name__ __module__ __qualname____doc__r(r+r2r)r'r r -sK<<<<r+r?r%s r' clear_cachezDistributionPath.clear_cacheks2  r)c#Kt}|jD]}tj|}||d}|r|js9t |j}|D]}||}|r |j|vr$|jr|trtttg}|D]0}tj||} || } | rn1tj| 5} t%| d} dddn #1swxYwYt&d|j||jt-|j| |V2|jrf|drQt&d|j||jt1|j|VdS)zD Yield .dist-info and/or .egg(-info) distributions. NlegacyfileobjschemezFound %s)metadataenv) .egg-info.egg)setr#rfinder_for_pathfind is_containersortedr<endswith DISTINFO_EXTr r r posixpathjoin contextlibclosing as_streamr loggerdebugr2new_dist_classr=old_dist_class) r&seenr#finderrrsetentrypossible_filenamesmetadata_filename metadata_pathpydiststreamrRs r'_yield_distributionsz%DistributionPath._yield_distributionsssuuI" 7" 7D.t44F~ BA AN !+&&D 7 7KK&&AFdNN%7%..*F*F7*;*A*B*D&.@!!)(1u>O(P(P !']!;!;!"!E"!#+F,<,<,>,>??M6#+F8#L#L#LMMMMMMMMMMMMMMMLLQV444HHQV$$$((-13333333&75>>;B,C,C7LLQV444HHQV$$$(666665 7" 7" 7sD99D= D= cR|jj }|jo |jj }|s|r|D]L}t |t r|j|2|j|M|r d|j_|rd|j_dSdSdS)zk Scan the path for distributions and populate the cache with those that are found. TN)r>r$r=r?rp isinstancerr2)r&gen_distgen_eggr1s r'_generate_cachez DistributionPath._generate_caches {,,#EDO,E(E  1w 11133 . .d$9::.KOOD))))O''---- -(, % 1,0))) 1 1 1 1r)cl|dd}d||gtzS)ao The *name* and *version* parameters are converted into their filename-escaped form, i.e. any ``'-'`` characters are replaced with ``'_'`` other than the one in ``'dist-info'`` and the one separating the name from the version number. :parameter name: is converted to a standard distribution name by replacing any runs of non- alphanumeric characters with a single ``'-'``. :type name: string :parameter version: is converted to a standard version string. Spaces become dots, and all other non-alphanumeric characters (except dots) become dashes, with runs of multiple dashes condensed to a single dash. :type version: string :returns: directory name :rtype: string-_)replacer^r\)clsr"versions r'distinfo_dirnamez!DistributionPath.distinfo_dirnames2&||C%%xxw((<77r)c# K|js|D]}|VdS||jjD]}|V|jr%|jjD]}|VdSdS)a5 Provides an iterator that looks for distributions and returns :class:`InstalledDistribution` or :class:`EggInfoDistribution` instances for each one of them. :rtype: iterator of :class:`InstalledDistribution` and :class:`EggInfoDistribution` instances N)r@rprur>r#valuesr=r?r0s r'get_distributionsz"DistributionPath.get_distributionss" 1133       " " " (//11      O07799DJJJJ  r)c^d}|}|js'|D]}|j|kr|}nnh|||jjvr|jj|d}n-|jr&||jjvr|jj|d}|S)a= Looks for a named distribution on the path. This function only returns the first result found, as no more than one value is expected. If nothing is found, ``None`` is returned. :rtype: :class:`InstalledDistribution`, :class:`EggInfoDistribution` or ``None`` Nr) lowerr@rpr.rur>r"r=r?)r&r"resultr1s r'get_distributionz!DistributionPath.get_distributionszz||" 71133  8t##!FE$  " " "t{''')$/2" 7tt/C'C'C-d3A6 r)c#Kd}|E |j|d|d}n##t$rtd|d|wxYw|D]|}t |dst d|.|j}|D]D}t|\}}| ||kr|Vn##||kr| |r|VnE}dS)a Iterates over all distributions to find which distributions provide *name*. If a *version* is provided, it will be used to filter the results. This function only returns the first result found, since no more than one values are expected. If the directory is not found, returns ``None``. :parameter version: a version specifier that indicates the version required, conforming to the format in ``PEP-345`` :type name: string :type version: string N ()zinvalid name or version: , provideszNo "provides": %s) rAmatcher ValueErrorrrhasattrrbrcrrmatch) r&r"r{rr1providedpp_namep_vers r'provides_distributionz&DistributionPath.provides_distributionsB   7,..DDD'''/JKK 7 7 7&&'+ttWW(6777 7**,, " "D4,, " 0$7777=! " "A$:1$=$=MFE!T>>"&JJJ!E*"T>>gmmE.B.B>"&JJJ!E# " "s ) A c~||}|td|z||S)z5 Return the path to a resource file. Nzno distribution named %r found)r LookupErrorget_resource_path)r&r" relative_pathr1s r' get_file_pathzDistributionPath.get_file_path!sD$$T** <>EFF F%%m444r)c#K|D]A}|j}||vr4||}|||vr ||V&|D]}|VBdS)z Return all of the exported entries in a particular category. :param category: The category to search for entries. :param name: If specified, only entries with that name are returned. N)rexportsr~)r&categoryr"r1rhdvs r'get_exported_entriesz%DistributionPath.get_exported_entries*s**,, D A1}}hK#qyyg XXZZ   r))NFrD)r3r4r5r6r(rFrIproperty cache_enabledrKrpru classmethodr|rrrrrr7r)r'rrKs----(###$$$H/1CDDM   *7*7*7X111&88[8*,4'"'"'"'"R555      r)rceZdZdZdZ dZ dZedZeZ edZ edZ dZ edZ ed Zed Zed Zed Zd ZdZdZdZdS)rz A base class for distributions, whether installed or from indexes. Either way, it must have some metadata, so that's all that's needed for construction. Fc||_|j|_|j|_|j|_d|_d|_d|_d|_t|_ i|_ dS)z Initialise an instance. :param metadata: The instance of :class:`Metadata` describing this distribution. N) rRr"rr.r{locatordigestextrascontextrV download_urlsdigests)r&rRs r'r(zDistribution.__init__Osd ! M 9??$$'      UU r)c|jjS)zH The source archive download URL for this distribution. )rR source_urlr%s r'rzDistribution.source_url`s }''r)c&|jd|jdS)zX A utility property which displays the name and version in parentheses. rrr"r{r%s r'name_and_versionzDistribution.name_and_versionis !IIIt|||44r)ct|jj}|jd|jd}||vr|||S)z A set of distribution names and versions provided by this distribution. :return: A set of "name (version)" strings. rr)rRrr"r{r/)r&plistss r'rzDistribution.providespsA  &DLLL 1 E>> LLOOO r)c|j}td|t ||}t |||j|jS)Nz%Getting requirements from metadata %r)rrS) rRrbrctodictgetattrrVget_requirementsrr)r&req_attrmdreqtss r'_get_requirementszDistribution._get_requirements|si ] DnnT**GGG  +{  A2155MFE~~  u--*     s$AABB C"" C/.C/cV|jr d|jz}nd}d|jd|jd|dS)zC Return a textual representation of this instance, z [%s]rMz)rr"r{)r&suffixs r'__repr__zDistribution.__repr__s? ? t.FFF-1YYY fffMMr)ct|t|urd}n0|j|jko|j|jko|j|jk}|S)a< See if this distribution is the same as another. :param other: The distribution to compare with. To be equal to one another. distributions must have the same type, name, version and source_url. :return: True if it is the same, else False. F)typer"r{r)r&otherrs r'__eq__zDistribution.__eq__s] ;;d4jj ( (FFi5:-:lem3:o)99  r)c~t|jt|jzt|jzS)zH Compute hash in a way which matches the equality test. )hashr"r{rr%s r'__hash__zDistribution.__hash__s0DIdl!3!33d4?6K6KKKr)N)r3r4r5r6build_time_dependency requestedr(rr download_urlrrrrrrrrrrrrr7r)r'rr=sw " I5"((X( L 55X5   X :::66X677X788X877X766X6   DNNN LLLLLr)rc0eZdZdZdZdfd ZddZxZS)rz] This is the base class for installed distributions (whether PEP 376 or legacy). Ncttt||||_||_dS)a Initialise an instance. :param metadata: An instance of :class:`Metadata` which describes the distribution. This will normally have been initialised from a metadata file in the ``path``. :param path: The path of the ``.dist-info`` or ``.egg-info`` directory for the distribution. :param env: This is normally the :class:`DistributionPath` instance where this distribution was found. N)superrr(r# dist_path)r&rRr#rS __class__s r'r(z"BaseInstalledDistribution.__init__s6 '..77AAA r)c.||j}|tj}d}ntt|}d|jz}||}t j|dd}||S)a Get the hash of some data, using a particular hash algorithm, if specified. :param data: The data to be hashed. :type data: bytes :param hasher: The name of a hash implementation, supported by hashlib, or ``None``. Examples of valid values are ``'sha1'``, ``'sha224'``, ``'sha384'``, '``sha256'``, ``'md5'`` and ``'sha512'``. If no hasher is specified, the ``hasher`` attribute of the :class:`InstalledDistribution` instance is used. If the hasher is determined to be ``None``, MD5 is used as the hashing algorithm. :returns: The hash of the data. If a hasher was explicitly specified, the returned hash will be prefixed with the specified hasher followed by '='. :rtype: str NrMz%s==ascii) hasherhashlibmd5rrbase64urlsafe_b64encoderstripdecode)r&datarprefixrs r'get_hashz"BaseInstalledDistribution.get_hashs& >[F >[FFFWf--FT[(F$$&&)&1188>>EEgNN((r)rD)r3r4r5r6rr(r __classcell__rs@r'rrsb F      ))))))))r)rceZdZdZdZdfd ZdZdZdZe dZ d Z d Z d Z d ZddZdZe dZddZdZdZdZdZejZxZS)ra  Created with the *path* of the ``.dist-info`` directory provided to the constructor. It reads the metadata contained in ``pydist.json`` when it is instantiated., or uses a passed in Metadata instance (useful for when dry-run mode is being used). sha256Ncxg|_tj|x|_}|t d|z|r-|jr&||jjvr|jj|j}n|| t}|| t}|| t}|t dtd|tj|5}t!|d}dddn #1swxYwYt#t$|||||r!|jr|j|| d}|du|_t,j|d}t,j|rjt3|d5}|d } dddn #1swxYwY| |_dSdS) Nzfinder unavailable for %szno z found in rNrOr top_level.txtrbutf-8)modulesrrWrgrr@r>r#rRrXr r r r_r`rar rrr(r2rosr^existsopenreadr splitlines) r&r#rRrSrgrhrorfrrs r'r(zInstalledDistribution.__init__s (8>>> f >84?@@ @  E3% E$#*/*A*Azt,5HH   -..AyKK 788yKK 899y j8I8I8I8<">???#AKKMM22 Ef#F8DDD E E E E E E E E E E E E E E E #T**33HdCHHH  !3% ! JNN4 KK $ $$ W\\$ 0 0 7>>!   -a 0!vvxxw// 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0??,,DLLL - -s$=DD"D (HHHc8d|jd|jd|jdS)Nzz6InstalledDistribution._get_records..Ss@@@t@@@r)N)get_distinfo_resourcer_r`rarrangelenr/) r&resultsrhro record_readerrowmissingr#checksumsizes r' _get_recordsz"InstalledDistribution._get_recordsDsX  & &x 0 0   . . ;&&))) ;]);;C@@U3s88Q-?-?@@@G+.=(D(DNND(D#9:::: ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;s6CAB* C*B. .C1B. 2CCCcji}|t}|r|}|S)a Return the information exported by this distribution. :return: A dictionary of exports, mapping an export category to a dict of :class:`ExportEntry` instances describing the individual export entries, and keyed by name. )r EXPORTS_FILENAMEr)r&rrhs r'rzInstalledDistribution.exports[s;  & &'7 8 8  )&&((F r)ci}|t}|rMtj|5}t |}dddn #1swxYwY|S)z Read exports data from a file in .ini format. :return: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. N)r rr_r`rar)r&rrhros r'rz"InstalledDistribution.read_exportsis  & &'7 8 8  .#AKKMM22 .f%f-- . . . . . . . . . . . . . . . sA!!A%(A%c|t}t|d5}t||ddddS#1swxYwYdS)a Write a dictionary of exports to a file in .ini format. :param exports: A dictionary of exports, mapping an export category to a list of :class:`ExportEntry` instances describing the individual export entries. wN)get_distinfo_filerrr)r&rrfrs r'rz#InstalledDistribution.write_exportsxs # #$4 5 5 "c]] &a '1 % % % & & & & & & & & & & & & & & & & & &sA  A A cr|d}tj|5}t |5}|D]'\}}||kr|ccdddcdddS( dddn #1swxYwYdddn #1swxYwYt d|z)aW NOTE: This API may change in the future. Return the absolute path to a resource file with the given relative path. :param relative_path: The path, relative to .dist-info, of the resource of interest. :return: The absolute path where the resource is to be found. rrNz3no resource file with relative path %r is installed)r r_r`rarKeyError)r&rrhroresources_readerrelative destinations r'rz'InstalledDistribution.get_resource_paths  & &{ 3 3   . . +&&))) +-=-=++)Hk=00*** + + + + + + + + + + + + + + +1+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + &(5677 7sAB B B7B9 BB B B BB #B c#@K|D]}|VdS)z Iterates over the ``RECORD`` entries and returns a tuple ``(path, hash, size)`` for each line. :returns: iterator of (path, hash, size) N)r)r&rs r'list_installed_filesz*InstalledDistribution.list_installed_filess8''))  FLLLL  r)Fcrtj|d}tj|j}||}tj|d}|d}t d||rdSt|5}|D]}tj |s| drdx} } nqdtj |z} t|d5} | | } dddn #1swxYwY||s|r5||r tj||}||| | f||r tj||}||ddfdddn #1swxYwY|S)z Writes the ``RECORD`` file, using the ``paths`` iterable passed in. Any existing ``RECORD`` file is silently overwritten. prefix is used to determine when to write absolute paths. rMr creating %sNz.pycz.pyoz%dr)rr#r^dirname startswithrrbinforisdirr[getsizerrrrelpathwriterow) r&pathsrdry_runbasebase_under_prefix record_pathwriterr# hash_valuerfps r'write_installed_filesz+InstalledDistribution.write_installed_filessqfb))wty)) OOF33w||D"%%,,X66  M;///  4 { # # 3v : :7==&&>$--8H*I*I>(**J"'//$"7"77DdD))>R%)]]27799%=%= >>>>>>>>>>>>>>>??4((7->7-1__V-D-D77??466Dz4 89999%%d++ A gook4@@ OO["b1 2 2 2# 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3$s8=A1H,.(E" H,"E& &H,)E& *B6H,,H03H0cg}tj|j}|d}|D]\}}}tj|s tj||}||krMtj|s||dddftj |rttj |}|r ||kr||d||f|rd|vr| ddd}nd }t|d 5} || |} | |kr||d || fd d d n #1swxYwY|S)  Checks that the hashes and sizes of the files in ``RECORD`` are matched by the files themselves. Returns a (possibly empty) list of mismatches. Each entry in the mismatch list will be a tuple consisting of the path, 'exists', 'size' or 'hash' according to what didn't match (existence is checked first, then size, then hash), the expected value and the actual value. rrTFr=rrNrr)rr#r&rr"isabsr^rr/isfilestrr*rrrr) r& mismatchesr/r1r#r3r actual_sizerr actual_hashs r'check_installed_filesz+InstalledDistribution.check_installed_filess wty)),,X66 &*&?&?&A&A W W "D*d7==&& 0w||D$//{""7>>$'' W!!44"?@@@@%% W!"'//$"7"788  WK4//%%tVT;&GHHHH Wj((!+!1!1#q!9!9!!<!%dD))WQ&*mmAFFHHf&E&E &*44&--tVZ.UVVVWWWWWWWWWWWWWWWs8AG  G G ci}tj|jd}tj|rt j|dd5}|}dddn #1swxYwY|D]P}|dd\}}|dkr*| |g |K|||<Q|S) a A dictionary of shared locations whose keys are in the set 'prefix', 'purelib', 'platlib', 'scripts', 'headers', 'data' and 'namespace'. The corresponding value is the absolute path of that category for this distribution, and takes into account any paths selected by the user at installation time (e.g. via command-line arguments). In the case of the 'namespace' key, this would be a list of absolute paths for the roots of namespace packages in this distribution. The first time this property is accessed, the relevant information is read from the SHARED file in the .dist-info directory. rrhrencodingNr8r namespace) rr#r^r:codecsrrrrr-r/)r&r shared_pathrlinesliner.rHs r'shared_locationsz&InstalledDistribution.shared_locationss gll49h77 7>>+ & & ([#@@@ .A++-- . . . . . . . . . . . . . . . ( (!ZZQ// U+%%%%c2..55e<<<<"'F3KK s'BBBc:tj|jd}td||rdSg}dD]I}||}tj||r||d|J|ddD]}|d|ztj |d d 5}| d |dddn #1swxYwY|S) aa Write shared location information to the SHARED file in .dist-info. :param paths: A dictionary as described in the documentation for :meth:`shared_locations`. :param dry_run: If True, the action is logged but no file is actually written. :return: The path of the file written to. rr$N)rlibheadersscriptsrr8rCr7z namespace=%srrrA ) rr#r^rbr(r)r/getrDrwrite) r&r-r.rErFr.r#nsrs r'write_shared_locationsz,InstalledDistribution.write_shared_locationssUgll49h77  M;///  4B 5 5C:Dw}}U3Z(( 5 dd3444))K,, . .B LL", - - - - [cG < < < & GGDIIe$$ % % % & & & & & & & & & & & & & & &s)DDDc|tvrtd|d|jtj|j}|td|jz||S)N#invalid path for a dist-info file: rzUnable to get a finder for %s) DIST_FILESrr#rrWrX)r&r#rgs r'r z+InstalledDistribution.get_distinfo_resourcesw z ! !""15tyy$BCC C*4955 >"#BTY#NOO O{{4   r)c |tjdkr{|tjdd\}}||jtjdkr#t d|d|jd|jd|tvrt d |d |jtj |j|S) a Returns a path located under the ``.dist-info`` directory. Returns a string representing the path. :parameter path: a ``'/'``-separated path relative to the ``.dist-info`` directory or an absolute path; If *path* is an absolute path and doesn't start with the ``.dist-info`` directory path, a :class:`DistlibException` is raised :type path: str :rtype: str rNzdist-info file z does not belong to the rz distributionrSr) rXrseprr#rr"r{rTr^)r&r#r|s r'rz'InstalledDistribution.get_distinfo_file$s 99RV   ! !%)ZZ%7%7%< " d49??26#:#:2#>>>&&&*ddDIIIt|||EFFF z ! !""15tyy$BCC Cw||DIt,,,r)c#BKtj|j}|D]c\}}}tj|s tj||}||jr|VddS)z Iterates over the ``RECORD`` entries and returns paths for each line if the path is pointing to a file located in the ``.dist-info`` directory or one of its subdirectories. :returns: iterator of paths N)rr#r&rr9r^r')r&r/r#rrs r'list_distinfo_filesz)InstalledDistribution.list_distinfo_filesAswty))$($5$5$7$7   D(D7==&& 0w||D$//ty))    r)cLt|to|j|jkSrD)rrrr#r&rs r'rzInstalledDistribution.__eq__Qs&5"788( UZ' )r))NNF)r3r4r5r6rr(rrrrrrrrr"r5r?rHrQr rrZrobjectrrrs@r'rrs`F - - - - - -D000333.  _     & & &777(!!!!F!!!F_42!!!---: ))) HHHHHr)rcfeZdZdZdZiZd fd ZdZdZdZ dZ d Z dd Z d Z ejZxZS)raCreated with the *path* of the ``.egg-info`` directory or file provided to the constructor. It reads the metadata contained in the file itself, or if the given path happens to be a directory, the metadata is read from the file ``PKG-INFO`` under that directory.TNcd}||_||_|rD|jr=||jjvr/|jj|j}|||j|jnO||}|||j|j|r!|jr|j|tt| |||dS)NcT||_||_||_dSrD)r"rr.r{)rnrs r'set_name_and_versionz:EggInfoDistribution.__init__..set_name_and_versioncs#AFGGIIAEAIIIr)) r#rr@r?rRr"r{ _get_metadatar2rrr()r&r#rSrcrRrs r'r(zEggInfoDistribution.__init__bs       )3% )$#.2E*E*E~*409H x}h6F G G G G))$//H ! x}h6F G G G )s) )""4((( !4((11(D#FFFFFr)c4d}dfd}dx}}|drtj|rtj|d}tj|d}t |d}tj|d} tj|d }|| }nt j|} t| d  d } t | d } | d } | d d}| d}n#t$rd}YnwxYw|drtj|rktj|d} || }tj|d}tj|d }t |d}ntd|z|r| ||p|ntj|rOt|d5} |  d}dddn #1swxYwY|sg}n|}||_|S)Nc0g}|}|D]}|}|drtd|nt |}|std|u|jrtd|js||j d d|jD}||j d|d|S) zCreate a list of dependencies from a requires.txt file. *data*: the contents of a setuptools-produced requires.txt file. [z.Unexpected line: quitting requirement scan: %rz#Not recognised as a requirement: %rz4extra requirements in requires.txt are not supportedrc3 K|] }d|zV dS)z%s%sNr7)rcs r' zQEggInfoDistribution._get_metadata..parse_requires_data..s&$G$GAVaZ$G$G$G$G$G$Gr)rr) rstripr'rbrrr constraintsr/r"r^)rreqsrFrGrhconss r'parse_requires_dataz>EggInfoDistribution._get_metadata..parse_requires_datazs' DOO%%E < <zz||??3''NN#S#')))E%d++NN#H$OOO84NN$3444}<KK''''99$G$G$G$G$GGGDKKQVVVTTT :;;;;Kr)cg} tj|dd5}|}dddn #1swxYwYn#t$rYnwxYw|S)zCreate a list of dependencies from a requires.txt file. *req_path*: the path to a setuptools-produced requires.txt file. rhrN)rDrrIOError)req_pathrmr4ros r'parse_requires_pathz>EggInfoDistribution._get_metadata..parse_requires_paths D [388:B..rwwyy99D:::::::::::::::    Ks3AA AA  A A  A AArUzEGG-INFOzPKG-INFOrN)r#rQz requires.txtrzEGG-INFO/PKG-INFOutf8rOzEGG-INFO/requires.txtzEGG-INFO/top_level.txtrrTz,path must end with .egg-info or .egg, got %rr)r[rr#r)r^r zipimport zipimporterrget_datarrqradd_requirementsrrrrr)r&r#requiresrstl_pathtl_datar meta_pathrRrrzipfrPrrros @r'rdz!EggInfoDistribution._get_metadataws9   6     ! ' ==  4w}}T"" $GLLz22GLLJ77 #8DDD7<<>::',,q/::..x88!,T22"MM"566==fEEGG#GHEEE$==)@AAD"mm,DEELLWUUG224;;w3G3GHHHH$$$#HHH$ ]]; ' ' 4w}}T"" >7<<n==..x88w||D*55',,t_==T(;;;HH"$,.2$344 4  0  % %h / / / ?"rw~~g'>'>"'4((7Affhhoog66G777777777777777 +GG((**G s%>AF F)(F)9(K--K14K1c8d|jd|jd|jdS)Nz>+ & & E"7799 E E a;&&w~~d++E%%tXtU&CDDDr)c d}d}tj|jd}g}tj|r._md5s`T4  A &&((  ;w''1133 3s ;Ac4tj|jSrD)rstatst_size)r#s r'_sizez7EggInfoDistribution.list_installed_files.._sizes74==( (r)rrhrrAzNon-existent file: %sr%N) rr#r^rrDrrknormpathrbrr[r)r/)r&rrr1rrrGrs r'r"z(EggInfoDistribution.list_installed_filess 4 4 4 ) ) )gll49.CDD  7>>+ & & 5[#@@@ >A > >D::<>!,,%'>BBB::&677%$7==++> q$$q''5588&<=== > > > > > > > > > > > > > > > > MM;d3 4 4 4 s%C5E''E+.E+Fc#Ktj|jd}tj|rd}t j|dd5}|D]}|}|dkrd}|sgtjtj|j|}||jr |r|V|V ddddS#1swxYwYdSdS) a  Iterates over the ``installed-files.txt`` entries and returns paths for each line if the path is pointing to a file located in the ``.egg-info`` directory or one of its subdirectories. :parameter absolute: If *absolute* is ``True``, each returned path is transformed into a local absolute path. Otherwise the raw value from ``installed-files.txt`` is returned. :type absolute: boolean :returns: iterator of paths rTrhrrAz./FN) rr#r^rrDrrkrr')r&absoluter1skiprrGrs r'rZz'EggInfoDistribution.list_distinfo_filessQgll49.CDD 7>>+ & & +D[#@@@ +A + +D::<C>cLt|to|j|jkSrD)rrrr#r\s r'rzEggInfoDistribution.__eq__.s&5"566( UZ' )r)rDr])r3r4r5r6rrHr(rdrrr?r"rZrr^rrrs@r'rrYs// IGGGGGG*XXXt000333&$$$L++++:))) HHHHHr)rcNeZdZdZdZdZddZdZdZdd Z dd Z d Z d Z dS)DependencyGrapha Represents a dependency graph between distributions. The dependency relationships are stored in an ``adjacency_list`` that maps distributions to a list of ``(other, label)`` tuples where ``other`` is a distribution and the edge is labeled with ``label`` (i.e. the version specifier, if such was provided). Also, for more efficient traversal, for every distribution ``x``, a list of predecessors is kept in ``reverse_list[x]``. An edge from distribution ``a`` to distribution ``b`` means that ``a`` depends on ``b``. If any missing dependencies are found, they are stored in ``missing``, which is a dictionary that maps distributions to a list of requirements that were not provided by any other distributions. c0i|_i|_i|_dSrD)adjacency_list reverse_listrr%s r'r(zDependencyGraph.__init__Is  r)c.g|j|<g|j|<dS)zAdd the *distribution* to the graph. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` N)rr)r& distributions r'add_distributionz DependencyGraph.add_distributionNs$ -/L)*,,'''r)Nc|j|||f||j|vr"|j||dSdS)aAdd an edge from distribution *x* to distribution *y* with the given *label*. :type x: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type y: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type label: ``str`` or ``None`` N)rr/r)r&xylabels r'add_edgezDependencyGraph.add_edgeXsa A%%q%j111 D%a( ( (  a ' ' * * * * * ) (r)ctd|||j|g|dS)a Add a missing *requirement* for the given *distribution*. :type distribution: :class:`distutils2.database.InstalledDistribution` or :class:`distutils2.database.EggInfoDistribution` :type requirement: ``str`` z %s missing %rN)rbrcrr-r/)r&rrs r' add_missingzDependencyGraph.add_missinggsF  _lK@@@  b1188EEEEEr)c$|jd|jSrrr0s r' _repr_distzDependencyGraph._repr_distrrr)rc||g}|j|D]\}}||}||d|d}|d|zt|z|||dz}|d}||ddd|S)zPrints only a subgraphNz []z rrM)rrr/r; repr_noderextendr^)r&r1leveloutputrr suboutputsubss r'rzDependencyGraph.repr_nodeus//$''( /5 $ $LE5??5))D $(DD%%%0 MM&5.3t994 5 5 5ueai88I??4((D MM$qrr( # # # #yy   r)Tc g}|d|jD]\}}t|dkr|s|||D]W\}}|*|d|jd|jd|d1|d|jd|jdX|st|dkr|d |d |d |D]4}|d |jz|d 5|d|ddS)a9Writes a DOT output for the graph to the provided file *f*. If *skip_disconnected* is set to ``True``, then all distributions that are not dependent on any other distribution are skipped. :type f: has to support ``file``-like operations :type skip_disconnected: ``bool`` zdigraph dependencies { rN"z" -> "z " [label="z"] z" zsubgraph disconnected { zlabel = "Disconnected" zbgcolor = red z"%s"rMz} )rOritemsr r/r")r&rskip_disconnected disconnectedr1adjsrrs r'to_dotzDependencyGraph.to_dots  *+++-3355 H HJD$4yyA~~&7~##D))) $ H H u}GGG!YYY EEE;<<<<GGG 5:::FGGGG  H ! S%6%6%:%: GG/ 0 0 0 GG. / / / GG% & & &$  *+++ GGENNN r)cg}i}|jD]\}}|dd||< gt|ddD]\}}|s|||= snf|D]\}}fd|D||<tddD||t|fS)aa Perform a topological sort of the graph. :return: A tuple, the first element of which is a topologically sorted list of distributions, and the second element of which is a list of distributions that cannot be sorted because they have circular dependencies and so form a cycle. NTc&g|] \}}|v ||fSr7r7)rrrh to_removes r'r z4DependencyGraph.topological_sort..s+GGGtq!AY4F4FQF4F4F4Fr)zMoving to result: %sc2g|]}|jd|jdS)rrr)rrs r'r z4DependencyGraph.topological_sort..s)MMMaqvvvqyyy9MMMr))rrlistr/rbrcrkeys)r&ralistkrrs @r'topological_sortz DependencyGraph.topological_sortsF'--//  DAqtE!HH %IU[[]]++AAA. ! !1!$$Q'''a   H H1GGGGqGGGa LL/MM9MMM O O O MM) $ $ $ % tEJJLL))))r)cg}|jD]-\}}|||.d|S)zRepresentation of the graphrM)rrr/rr^)r&rr1rs r'rzDependencyGraph.__repr__s\-3355 0 0JD$ MM$.... / / / /yy   r)rD)r)T) r3r4r5r6r(rrrrrrrrr7r)r'rr9s   --- + + + + F F F333 ! ! ! !@***>!!!!!r)rr:cjt|}t}i}|D]{}|||jD]\}t |\}}t d|||||g||f]||D]}|j |j z|j z|j z}|D]} | | } nZ#t$rMt d| | d}| |} YnwxYw| j}d} ||vrT||D]K\}} | |} n#t$rd} YnwxYw| r||| | d} nL| s||| |S)a6Makes a dependency graph from the given distributions. :parameter dists: a list of distributions :type dists: list of :class:`distutils2.database.InstalledDistribution` and :class:`distutils2.database.EggInfoDistribution` instances :rtype: a :class:`DependencyGraph` instance zAdd to provided: %s, %s, %srrFT)rrrrrrbrcr-r/rrrrrr rrr.rrr)distsrQgraphrr1rr"r{ryrrmatchedproviderrs r' make_graphrs:  F   EHBB t$$$ B BA2155MD' LL6gt L L L   b ) ) 0 0'4 A A A A B --%(::'(*.*;< - -C / ..--* / / /L"$$$yy{{1~ ....  /;DGx)1$  %GX& ' g 6 62&&& %&tXs;;;"& -!!$,,,3 -4 Ls%CAD43D4E(( E7 6E7 cP||vrtd|jzt|}|g}|j|}|rT|}|||j|D]}||vr|||T|d|S)zRecursively generate a list of distributions from *dists* that are dependent on *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested 1given distribution %r is not a member of the listr)rr"rrpopr/)rr1rdeptodorsuccs r'get_dependent_distsrs 5 -/3y 9:: : u  E &C  d #D " HHJJ 1 &q) " "D3 D!!! "GGAJJJ Jr)c0||vrtd|jzt|}g}|j|}|rZ|d}|||j|D]}||vr|||Z|S)zRecursively generate a list of distributions from *dists* that are required by *dist*. :param dists: a list of distributions :param dist: a distribution, member of *dists* for which we are interested rr)rr"rrrr/)rr1rrrrpreds r'get_required_distsrs 5 -/3y 9:: : u  E C   %D " HHJJqM 1 (+ " "D3 D!!! " Jr)c |dd}tdi|}||_||_|pd|_t |S)zO A convenience method for making a dist given just a name and version. summaryzPlaceholder for summaryr7)rr r"r{rr)r"r{kwargsrrs r' make_distr2sTjj$=>>G   F  BBGBJ55BJ   r))r:)7r6 __future__rrrDr_rloggingrr]r;rurMrrcompatrr{rr rRr r r r utilrrrrrrr__all__ getLoggerr3rbrCOMMANDS_FILENAMErTr\r^r rrrrrrdrerrrrrr7r)r'rsj ''''''   ))))))))88888888111111111111FFFFFFFFFFFFFFFFFF     8 $ $(*,h +X7  <<<<Z?ej"d-Z@d7d/ZAGd0d1e>ZBd2ZCd3ZDd4ZEGd5d6e>ZFdS)8zImplementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, 1.3/2.1 and withdrawn 2.0). )unicode_literalsN)message_from_file)DistlibException __version__)StringIO string_types text_type) interpret)extract_by_key get_extras) get_schemePEP440_VERSION_REceZdZdZdS)MetadataMissingErrorzA required metadata is missingN__name__ __module__ __qualname____doc__/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/metadata.pyrrs((((rrceZdZdZdS)MetadataConflictErrorz>Attempt to read or write metadata fields that are conflictual.Nrrrrrr sHHHHrrceZdZdZdS) MetadataUnrecognizedVersionErrorz Unknown metadata version number.Nrrrrrr$s****rrceZdZdZdS)MetadataInvalidErrorzA metadata value is invalidNrrrrrr(s%%%%rr)MetadataPKG_INFO_ENCODINGPKG_INFO_PREFERRED_VERSIONutf-81.1z \| ) Metadata-VersionNameVersionPlatformSummary DescriptionKeywords Home-pageAuthor Author-emailLicense)r&r'r(r)Supported-Platformr*r+r,r-r.r/r0 Classifier Download-URL ObsoletesProvidesRequires)r4r5r6r2r3)r&r'r(r)r1r*r+r,r-r.r/ MaintainerMaintainer-emailr0r2r3Obsoletes-Dist Project-URL Provides-Dist Requires-DistRequires-PythonRequires-External)r;r<r=r9r>r7r8r:)r&r'r(r)r1r*r+r,r-r.r/r7r8r0r2r3r9r:r;r<r=r>Private-Version Obsoleted-BySetup-Requires-Dist ExtensionProvides-Extra)r?rCr@rArB)Description-Content-Typer6r5r4)rDz"extra\s*==\s*("([^"]+)"|'([^']+)')c|dkrtS|dkrtS|dkrtS|dvr&ttdtDzS|dkrt St |)N1.0r$1.2)1.32.1c3,K|]}|tv |VdSN) _345_FIELDS).0fs r z%_version2fieldlist..zs,"R"RQk=Q=Q1=Q=Q=Q=Q"R"Rr2.0) _241_FIELDS _314_FIELDSrLtuple _566_FIELDS _426_FIELDSr)versions r_version2fieldlistrWqs% E   E   N " "U"R"Rk"R"R"RRRRR E   *7 3 33rcd}g}|D]"\}}|gddfvr ||#gd}|D]w}|tvr4d|vr0|dtd||t vr4d|vr0|dtd||tvr4d |vr0|d td ||tvr4d |vr0|d td ||tvr:d |vr6|dkr0|d td||tvr4d|vr0|dtd|yt|dkr|dSt|dkr*td|tdd|vo||t}d |vo||t}d |vo||t}d|vo||t} t!|t!|zt!|zt!| zdkrtd|s|s|s| st"|vrt"S|rdS|rd S|rd SdS)z5Detect the best version depending on the fields used.c|D] }||vrdS dS)NTFr)keysmarkersmarkers r _has_markerz"_best_version.._has_markers+  F~~tturUNKNOWNN)rFr$rGrHrPrIrFzRemoved 1.0 due to %sr$zRemoved 1.1 due to %srGzRemoved 1.2 due to %srHzRemoved 1.3 due to %srIr+zRemoved 2.1 due to %srPzRemoved 2.0 due to %srrz)Out of options - unknown metadata set: %szUnknown metadata setz,You used incompatible 1.1/1.2/2.0/2.1 fields)itemsappendrQremoveloggerdebugrRrLrTrUlenr _314_MARKERS _345_MARKERS _566_MARKERS _426_MARKERSintr") fieldsr]rZkeyvaluepossible_versionsis_1_1is_1_2is_2_1is_2_0s r _best_versionrrsi Dllnn U RD) ) )  CBBB77 k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 k ! !e/@&@&@m##!((/// 4c::: k ! !e/@&@&@  $ $U + + + LL0# 6 6 6 "" ##   1 $ $ @&III#$:;;;' ' KKKl,K,KF ' ' KKKl,K,KF ' ' KKKl,K,KF ' ' KKKl,K,KF 6{{S[[ 3v;;.Vrys?-1DJJLLc""Drci|]\}}|| Srr)rMattrfields rryrysBBB{tUudBBBr)r<r9r;)r=)r()r)r2r4r6r5r9r;r<r>r:r1rArCrB)r:)r,)r.r7r*r+z[^A-Za-z0-9.]+Fc|rJtd|}td|dd}|d|S)zhReturn the distribution name with version. If for_filename is true, return a filename-escaped form.rt .) _FILESAFEsubrw)rxrV for_filenames r_get_name_and_versionrsT@}}S$''--W__S#%>%>??ddGG $$rceZdZdZ d"dZdZdZdZdZd Z d Z d Z d Z d Z dZd#dZdZdZdZdZd#dZd#dZd$dZdZefdZd#dZd#dZdZdZdZdZd Z d!Z!dS)%LegacyMetadataaoThe legacy metadata of a release. Supports versions 1.0, 1.1, 1.2, 2.0 and 1.3/2.1 (auto-detected). You can instantiate the class with one of these arguments (or none): - *path*, the path to a metadata file - *fileobj* give a file-like object with metadata as content - *mapping* is a dict-like object - *scheme* is a version scheme name NdefaultcR|||gddkrtdi|_g|_d|_||_|||dS|||dS|+||| dSdS)N'path, fileobj and mapping are exclusive) count TypeError_fieldsrequires_files _dependenciesschemeread read_fileupdateset_metadata_version)selfpathfileobjmappingrs r__init__zLegacyMetadata.__init__s '7 # ) )$ / /! 3 3EFF F  !   IIdOOOOO  NN7 # # # # #  KK  % % ' ' ' ' '! rc>t|j|jd<dSNr&)rrrrs rrz#LegacyMetadata.set_metadata_version s+8+F+F '(((rc<||d|ddS)Nz:  )write)rrrxrls r _write_fieldzLegacyMetadata._write_field s' DDD%%%011111rc,||SrK)getrrxs r __getitem__zLegacyMetadata.__getitem__sxx~~rc.|||SrK)set)rrxrls r __setitem__zLegacyMetadata.__setitem__sxxe$$$rc|||} |j|=dS#t$rt|wxYwrK) _convert_namerKeyError)rrx field_names r __delitem__zLegacyMetadata.__delitem__sQ''--  ! Z((( ! ! !4..  !s!;cL||jvp|||jvSrK)rrrs r __contains__zLegacyMetadata.__contains__s. $9""4((DL8 :rc|tvr|S|dd}t||S)Nrtru) _ALL_FIELDSrwrv _ATTR2FIELDrrs rrzLegacyMetadata._convert_name!sE ;  K||C%%++--tT***rc.|tvs |tvrgSdS)Nr^) _LISTFIELDS_ELEMENTSFIELDrs r_default_valuezLegacyMetadata._default_value's! ;  $."8"8Iyrc|jdvrtd|Std|S)NrFr$r)metadata_version_LINE_PREFIX_PRE_1_2r_LINE_PREFIX_1_2rrls r_remove_line_prefixz"LegacyMetadata._remove_line_prefix,s<  N 2 2'++D%88 8#''e44 4rcB|tvr||St|rK)rAttributeErrorrs r __getattr__zLegacyMetadata.__getattr__2s% ;  : T"""rFc<t|d|d|S)zhReturn the distribution name with version. If filesafe is true, return a filename-escaped form.r'r()r)rfilesafes r get_fullnamezLegacyMetadata.get_fullname=s%T&\4 ?HMMMrc>||}|tvS)z+return True if name is a valid metadata key)rrrs ris_fieldzLegacyMetadata.is_fieldCs !!$''{""rc>||}|tvSrK)rrrs ris_multi_fieldzLegacyMetadata.is_multi_fieldHs !!$''{""rctj|dd} |||dS#|wxYw)z*Read the metadata values from a file path.rr#encodingN)codecsopenrclose)rfilepathfps rrzLegacyMetadata.readLsR [3 9 9 9  NN2    HHJJJJJBHHJJJJs AAct|}|d|jd<tD]y}||vr|tvrC||}|t vr| d|D}|||S||}||dkr|||z|}|r|n|d|d<dS)z,Read the metadata values from a file object.zmetadata-versionr&NcRg|]$}t|d%S,)rSsplitrMrls r z,LegacyMetadata.read_file..as,JJJ%eEKK$4$455JJJrr^r+)rrrrget_all_LISTTUPLEFIELDSr get_payload)rfileobmsgr|valuesrlbodys rrzLegacyMetadata.read_fileTs''+./A+B '(! + +EC ##U++,,,1CJJ6JJJF''''E $)););HHUE***  &*Cdd]0C]rctj|dd} ||||dS#|wxYw)z&Write the metadata fields to filepath.wr#rN)rr write_filer)rr skip_unknownrs rrzLegacyMetadata.writepsT [3 9 9 9  OOB - - - HHJJJJJBHHJJJJs AAc|t|dD]}||}|r |dgdgfvr"|tvr+|||d|V|t vr?|dkr6|jdvr|dd}n|dd}|g}|tvr d |D}|D]}||||d S) z0Write the PKG-INFO format data to a file object.r&r^rr+rrr%z |c8g|]}d|Srjoinrs rrz-LegacyMetadata.write_file..s">>>e#((5//>>>rN) rrWrrrrrrrwr)r fileobjectrr|rrls rrzLegacyMetadata.write_filexs; !!###'-?(@AA < >!'l!C!C!'l!C!C (((>>v>>> < <!!*eU;;;; <% < ._setsIk!!e!++C00%88888"!!!rrZN)hasattrrZr_)rotherkwargsrkvs` rrzLegacyMetadata.updates 9 9 9 9 9   UF # # ZZ\\ " "Qa!!!! "  1Q     1Q     rc||}|tvs|dkrTt|ttfs8t|t r d|dD}nCg}n@|tvr7t|ttfst|t r|g}ng}t tj r|d}t|j }|tvrS|Q|D]M}||ddstd|||Nn{|t"vr5|3||std |||n=|t&vr4|2||std ||||t*vr|d kr||}||j|<dS) z"Control then set a metadata field.r)c6g|]}|Sr)strip)rMrs rrz&LegacyMetadata.set..s ===q===rrr'N;rz$'%s': '%s' is not valid (field '%s')z.'%s': '%s' is not a valid version (field '%s')r+)rr isinstancelistrSr rrrb isEnabledForloggingWARNINGrr_PREDICATE_FIELDSis_valid_matcherwarning_VERSIONS_FIELDSis_valid_constraint_list_VERSION_FIELDSis_valid_version_UNICODEFIELDSrr)rrxrl project_namerrs rrzLegacyMetadata.sets"!!$'' ^ # #tz'9'954-00(:%.. ==EKK,<,<===k!!UT5M22"%..    w / / >33A!221773<<?CC3B(!T3333)))e.?66u==>NN#S#/>>>((U->..u55>NN#S#/>>> > ! !}$$0077" Trc||}||jvr |tur||}|S|tvr|j|}|S|t vr\|j|}|gSg}|D]D}|t vr||!||d|dfE|S|tvr7|j|}t|tr| dS|j|S)zGet a metadata field.Nrrr) rr_MISSINGrrrrr`rrr r)rrxrrlresvals rrzLegacyMetadata.gets$!!$'' t| # #(""--d33N > ! !L&EL [ L&E} C 1 1///JJsOOOOJJAA/0000J ^ # #L&E%.. ({{3'''|D!!rc> |gg}}dD]}||vr|||r-|gkr'dd|z}t|dD]}||vr|||ddkr||fSt |j fd}t |ft jft j ffD]H\}}|D]@} | | d} | &|| s|d | d | AI||fS) zkCheck if the metadata is compliant. If strict is True then raise if no Name or Version are provided)r'r(zmissing required metadata: %s, )r-r.r&rGct|D]3}|ddsdS4dS)NrrFT)rr)rlrrs rare_valid_constraintsz3LegacyMetadata.check..are_valid_constraintssG ! !..qwws||A??! 55!4rNzWrong value for 'z': ) rr`rrrrrrrrrr) rstrictmissingwarningsr{rrrj controllerr|rlrs @rcheckzLegacyMetadata.checks !!###' % %D4t$$$  ,gmm1DIIg4F4FFC&s++ ++ % %D4t$$$ " #u , ,H$ $DK((      %67L#M$4$*$C$E$3$*$;$=#> Q Q FJ   Q Q--$ZZ->->$OOO%%%$OPPP Q   rc|t|d}i}|D]A}|r ||jvr4t|}|dkr ||||<,d||D||<B|S)aReturn fields as a dict. Field names will be converted to use the underscore-lowercase style instead of hyphen-mixed case (i.e. home_page instead of Home-page). This is as per https://www.python.org/dev/peps/pep-0566/#id17. r& project_urlc8g|]}d|Srr)rMus rrz)LegacyMetadata.todict..5s" G G G! G G Gr)rrWr _FIELD2ATTR)r skip_missingrjdatarrks rtodictzLegacyMetadata.todict"s !!####D);$<==  H HJ H:#=#=!*--'' $Z 0DII G Gd:6F G G GDI rcV|ddkr dD] }||vr||= |dxx|z cc<dS)Nr&r$)r4r6r5r<r)r requirementsr|s radd_requirementszLegacyMetadata.add_requirements9sU " #u , ,> $ $D==U  _-rcFtt|dSr)rrWrs rrZzLegacyMetadata.keysDs&t,>'?@@AAArc#@K|D]}|VdSrKrZ)rrks r__iter__zLegacyMetadata.__iter__Gs299;;  CIIII  rcDfdDS)Nc g|] }| SrrrMrkrs rrz)LegacyMetadata.values..Ls111cS 111rrrs`rrzLegacyMetadata.valuesKs%1111TYY[[1111rcDfdDS)Nc$g|] }||f Srrrs rrz(LegacyMetadata.items..Os"888Sd3i 888rrrs`rr_zLegacyMetadata.itemsNs%8888DIIKK8888rcBd|jjd|jd|jdS)N) __class__rrxrVrs r__repr__zLegacyMetadata.__repr__Qs-#~666 #|||- -rNNNrFrK)"rrrrrrrrrrrrrrrrrrrrrrrrrrr rrrZrrr_r%rrrrrs9=!(((( GGG222%%%!!!:::+++  555 ###NNNN ### ###DDD8<<<<28*#*#*#X!)"""":*!*!*!*!X....BBB222999-----rrz pydist.jsonz metadata.jsonMETADATAc,eZdZdZejdZejdejZe Z ejdZ dZ de zZdddd Zd Zd Zedfedfe dfe dfd Zd Z d7dZedZdefZdefZdefdefeeedefeeeedefddd Z[[dZd8dZdZedZ edZ!e!j"dZ!d9dZ#ed Z$ed!Z%e%j"d"Z%d#Z&d$Z'd%Z(d&Z)d'd(d)d*d+d,d-d.d/dd0 Z*d1Z+d:d4Z,d5Z-d6Z.dS);r z The metadata of a release. This implementation uses 2.0 (JSON) metadata where possible. If not possible, it wraps a LegacyMetadata instance which handles the key-value metadata format. z ^\d+(\.\d+)*$z!^[0-9A-Z]([0-9A-Z_.-]*[0-9A-Z])?$z .{1,2047}rPz distlib (%s)r)legacy)rxrVsummaryzqname version license summary description author author_email keywords platform home_page classifiers download_urlzwextras run_requires test_requires build_requires dev_requires provides meta_requires obsoleted_by supports_environments)rrxrVr+)_legacy_datarNrcl|||gddkrtdd|_d|_||_|[ |||||_dS#t $r.t|||_|YdSwxYwd}|r=t|d5}| }dddn #1swxYwYn|r| }||j |j d|_dSt|ts|d} t!j||_||j|dS#t$$r;tt'|||_|YdSwxYw)Nrr)rrrbr generatorr#)rr)rrr,r-r_validate_mappingrrvalidaterrMETADATA_VERSION GENERATORrr decodejsonloads ValueErrorr)rrrrrrrNs rrzMetadata.__init__s '7 # ) )$ / /! 3 3EFF F     &&w777$ 3   -gfMMM   D &$%%$6688D$$$$$$$$$$$$$$$ &||~~|)-(=!% "$ 220;;w//D $!%D!1!1DJ**4:v>>>>>! $ $ $$2(4..9?$A$A$ADLMMOOOOOO $s7A##4BB2CCC84E..AF32F3)rxrVlicensekeywordsr+r<rArCr2)r3N)r&N) run_requiresbuild_requires dev_requires test_requires meta_requiresextrasmodules namespacesexportscommands classifiers source_urlrct|d}t|d}||vr<||\}}|jr.||dn |}nt|j|}nX|dn |}|dvr|j||}n)t}|}|jd} | r|dkr| d|}n}|dkr.| d} | r| ||}nI| d } | s|jd } | r| ||}||ur|}n\||vrt||}n<|jr|j|}n|j|}|S) N common_keys mapped_keysrErDrBrCrF extensionsrEpython.commandsrFpython.detailspython.exports)object__getattribute__r,rr-) rrkcommonmappedlkmakerresultrlsentinelds rrQzMetadata.__getattribute__s((}==((}== &==s IB| ':%*]TTFF!\--b11FF % 5577...!Z^^C77FF &xxH%F |44A ;*,,%&UU+(>"GGa''"&"#%%..F":=!"}!5!5!=&/&<&CCEMM$"7"7f.process_entriessEEE 9 9geeM***  9 9A 9u 9 ! !# =%4u%rAsorted) rrrVnmdrrrXfoundrr1r2s r _to_legacyzMetadata._to_legacysg   *z.$,...!!j)//11 # #FBb%(( #99!$RF2JAaD$j1 %#!"F2J _T.1CC D D _T043DD E E ; ;'-dk':':F# $"(**(.r $% s5A>>BBFTcD||gddkrtd||rW|jr|j}n|}|r|||dS|||dS|jr|}n|j}|rtj ||ddddStj |dd5}tj ||dddddddS#1swxYwYdS) Nrz)Exactly one of path and fileobj is needed)rTr) ensure_asciiindent sort_keysrr#) rr9r3r,rrrr|r-r7dumprr)rrrr*r legacy_mdrXrNs rrzMetadata.writes '?  & &! + +HII I   .| . L  OO--  I<@@@@@$$W<$HHHHH| %%''J . !W4$(******[sG44.Iaa(,......................s.DDDcR|jr|j|dS|jdg}d}|D]}d|vrd|vr|}n|d|i}|d|dSt |dt |z}t ||d<dS)Nr<rprorqr)r,rr-rcinsertrr)rrr<alwaysentryrsets rrzMetadata.add_requirements s < 2 L ) ), 7 7 7 7 7:00DDLF%   --'2F2F"FE~%|5##Av.....6*-..\1B1BB%+D\\z"""rc b|jpd}|jpd}d|jjd|jd|d|d S)Nz (no name)z no versionr"r~rjz)>)rxrVr$rr)rrxrVs rr%zMetadata.__repr__sNy'K,.,$(N$;$;$;$($9$9$9444J Jrr&rK)NN)NNFT)/rrrrrecompileMETADATA_VERSION_MATCHERI NAME_MATCHERrVERSION_MATCHERSUMMARY_MATCHERr4rr5rrrr[ __slots__rrrIr none_listdict none_dictrJrQr`rdpropertyrgrisetterrwr}rr2r3rr|rrrrr%rrrr r [s *rz*:;;2:A24HHL'O bj--O,IN !J/O 6r:{+#[1#[1 /I8<!+$+$+$+$Z#KLLKt It I)$/0$7!""#T*$d+,6K 9)))VJJJJ%(%(%(NDDXDX_++_+ ((((TX DDXD %%% / / /<<<<5>$BMAIBP$9E  N000d....4222"JJJJJrr r')Gr __future__rrrrr7rrrrrcompatrr r r[r utilr r rVrr getLoggerrrbrrrr__all__r!r"rrrrQrRrerLrfrUrhrTrgrrrEXTRA_RErWrrrr_rrrrrrrrrPrrrrMETADATA_FILENAMEWHEEL_METADATA_FILENAMELEGACY_METADATA_FILENAMEr rrrrs (''''' ######  ,+++++++5555555555,,,,,,,,22222222  8 $ $)))))+)))IIIII,III+++++'7+++&&&&&+&&& J I I#2:n--!rz,// '  7 3 ! 4 BB - cee ; ; ; ; ; 2:? @ @ 4 4 4EEER5@ CBk.?.?.A.ABBB H'. $C 688 BJ' ( (  % % % %e-e-e-e-e-Ve-e-e-P ")%GJGJGJGJGJvGJGJGJGJGJrPK!bCC#__pycache__/version.cpython-311.pycnu[ ^i[ dZddlZddlZddlmZddlmZgdZeje Z Gdde Z Gd d e ZGd d e Zejd ZdZeZGddeZdZGddeZejddfejddfejddfejddfejddfejddfejddfejd d!fejd"d#fejd$d%ff Zejd&dfejd'dfejd(dfejddfejd)dffZejd*Zd+Zd,Zejd-ejZd.d.d/d.d0ddd1Zd2ZGd3d4eZ Gd5d6eZ!ejd7ejZ"d8Z#d9Z$Gd:d;eZ%Gd<d=eZ&Gd>d?e Z'e'eeee'ee!d@e'e$e&edAZ(e(dBe(dC<dDZ)dS)Ez~ Implementation of a flexible versioning scheme providing support for PEP-440, setuptools-compatible and semantic versioning. N) string_typesparse_requirement)NormalizedVersionNormalizedMatcher LegacyVersion LegacyMatcherSemanticVersionSemanticMatcherUnsupportedVersionError get_schemeceZdZdZdS)r zThis is an unsupported version.N)__name__ __module__ __qualname____doc__/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/version.pyr r s))Drr cleZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zed ZdS)Versionc|x|_}||x|_}t |t sJt |dksJdS)Nr)strip_stringparse_parts isinstancetuplelen)selfspartss r__init__zVersion.__init__sY7799$ q"jjmm+ e%'''''5zzA~~~~~~rc td)Nzplease implement in a subclassNotImplementedErrorr!r"s rrz Version.parse%s!"BCCCrcpt|t|krtd|d|dSNzcannot compare z and )type TypeErrorr!others r_check_compatiblezVersion._check_compatible(s< ::e $ $)$$$FGG G % $rcL|||j|jkSNr/rr-s r__eq__zVersion.__eq__,s% u%%%{el**rc.|| Sr1r3r-s r__ne__zVersion.__ne__0;;u%%%%rcL|||j|jkSr1r2r-s r__lt__zVersion.__lt__3s% u%%%{U\))rcX||p|| Sr1r9r3r-s r__gt__zVersion.__gt__7s(KK&&<$++e*<*<==rcV||p||Sr1r;r-s r__le__zVersion.__le__:%{{5!!7T[[%7%77rcV||p||Sr1)r<r3r-s r__ge__zVersion.__ge__=r?rc*t|jSr1)hashrr!s r__hash__zVersion.__hash__AsDK   rc0|jjd|jdS)Nz('z') __class__rrrDs r__repr__zVersion.__repr__Ds!^444dlllCCrc|jSr1rrDs r__str__zVersion.__str__G |rc td)NzPlease implement in subclasses.r&rDs r is_prereleasezVersion.is_prereleaseJs!"CDDDrN)rrrr$rr/r3r6r9r<r>rArErIrLpropertyrOrrrrrs DDDHHH+++&&&***>>>888888!!!DDDEEXEEErrc eZdZdZdddddddd d Zd Zd Zd ZedZ dZ dZ dZ dZ dZdZdS)MatcherNc||kSr1rvcps rzMatcher.T QUrc||kSr1rrTs rrXzMatcher.UrYrc||kp||kSr1rrTs rrXzMatcher.Va1foArc||kp||kSr1rrTs rrXzMatcher.Wr\rc||kSr1rrTs rrXzMatcher.X a1frc||kSr1rrTs rrXzMatcher.Ys qAvrc||kp||kSr1rrTs rrXzMatcher.[r\rc||kSr1rrTs rrXzMatcher.\r_r)<><=>======~=!=c t|Sr1rr(s rrzMatcher.parse_requirementas ###rcZ|jtd|x|_}||}|std|z|j|_|j|_g}|jr|jD]\}}| dr8|dvrtd|z|ddd}}||n||d}}| |||ft||_ dS) NzPlease specify a version classz Not valid: %rz.*)rgrjz#'.*' not allowed for %r constraintsTF) version_class ValueErrorrrrnamelowerkey constraintsendswithappendrr)r!r"rclistopvnprefixs rr$zMatcher.__init__dsM   %=>> >7799$ q  " "1 % % 2_q011 1F 9??$$ = / / /A::d## >--(*:<>*?@@@"#3B3B&&r****"&!3!3A!6!6B b"f-....Ell rcXt|tr||}|jD]w\}}}|j|}t|trt ||}|s |d|jj}t|||||sdSxdS)z Check if the provided version matches the constraints. :param version: The version to match against this instance. :type version: String or :class:`Version` instance. z not implemented for FT) rrrnr _operatorsgetgetattrrHrr')r!versionoperator constraintrzfmsgs rmatchz Matcher.matchs g| , , 2((11G,0K   (Hj&##H--A!\** %D!$$ /#+88T^-D-DF)#...1Wj&11 uu trcd}t|jdkr(|jdddvr|jdd}|S)Nrr)rgrh)r r)r!results r exact_versionzMatcher.exact_versionsF t{  q T[^A%6-%G%G[^A&F rct|t|ks|j|jkrtd|d|dSr*)r+rpr,r-s rr/zMatcher._check_compatiblesK ::e $ $ UZ(?(?)$$$FGG G)@(?rcl|||j|jko|j|jkSr1)r/rrrr-s rr3zMatcher.__eq__s3 u%%%x59$D )DDrc.|| Sr1r5r-s rr6zMatcher.__ne__r7rcTt|jt|jzSr1)rCrrrrDs rrEzMatcher.__hash__sDH~~T[ 1 111rc0|jjd|jdS)N()rGrDs rrIzMatcher.__repr__s>222DLLLAArc|jSr1rKrDs rrLzMatcher.__str__rMr)rrrrnr|rr$rrPrr/r3r6rErIrLrrrrRrROsM# " " "----$$%%--$$  J$$$###:*X HHHEEE&&&222BBBrrRzk^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?(\.(post)(\d+))?(\.(dev)(\d+))?(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$c2|}t|}|std|z|}t d|ddD}t|dkr5|ddkr)|dd}t|dkr |ddk)|dsd}nt|ddd}|dd}|d d }|d d }|d }|dkrd}n|dt|df}|dkrd}n|dt|df}|dkrd}n|dt|df}|d}nhg} |dD]A} | rdt| f} nd| f} | | Bt | }|s |s|rd}nd}|sd}|sd}||||||fS)NzNot a valid version: %sc34K|]}t|VdSr1int.0rUs r z_pep_440_key..s(66AQ666666rr.r )NNr)ar)z)_)final) rPEP440_VERSION_RErr groupsrsplitr risdigitru) r"mrnumsepochprepostdevlocalr#parts r _pep_440_keyrsc  A""A E%&?!&CDDD XXZZF 66!5!5666 6 6D d))a--DHMMCRCy d))a--DHMM !9$F1IcrcN## 1+C !A#;D B-C 2JE l!fc#a&kk! |AwDG $ l!fc#a&kk! }KK$$  D||~~ !3t99~4y LL    e    CCC   $T3 --rcHeZdZdZdZegdZedZdS)raIA rational version. Good: 1.2 # equivalent to "1.2.0" 1.2.0 1.2a1 1.2.3a2 1.2.3b1 1.2.3c1 1.2.3.4 TODO: fill this out Bad: 1 # minimum two numbers 1.2a # release level must have a release serial 1.2.3b ct|}t|}|}t d|ddD|_|S)Nc34K|]}t|VdSr1rrs rrz*NormalizedVersion.parse..s($J$JSVV$J$J$J$J$J$Jrrr)_normalized_keyrrrrr_release_clause)r!r"rrrs rrzNormalizedVersion.parse se ##  # #A & &$$J$JVAY__S5I5I$J$J$JJJ r)rbrVrcrcDtfdjDS)Nc3:K|]}||djvVdS)rN) PREREL_TAGS)rtr!s rrz2NormalizedVersion.is_prerelease..s4FFAF1Q44++FFFFFFr)anyrrDs`rrOzNormalizedVersion.is_prereleases(FFFFT[FFFFFFrN) rrrrrsetrrPrOrrrrrsc"   #22233K GGXGGGrrct|}t|}||krdS||sdSt|}||dkS)NTFr)str startswithr )xyns r _match_prefixrsV AA AAAvvt <<??u AA Q43;rc ^eZdZeZddddddddd Zd Zd Zd Zd Z dZ dZ dZ dZ dZdS)r_match_compatible _match_lt _match_gt _match_le _match_ge _match_eq_match_arbitrary _match_ne)rircrdrerfrgrhrjc|rd|vo |jd}n|jd o |jd}|r6|jddd}||}||fS)N+rrr)rrrrn)r!rrrz strip_localr"s r _adjust_localzNormalizedMatcher._adjust_local6s  KZ/FGN24FKK )/33Jr8JK  ,%%c1--a0A((++G ""rc||||\}}||krdS|j}dd|D}t|| S)NFrc,g|]}t|Srrris r z/NormalizedMatcher._match_lt..I7771A777rrrjoinrr!rrrzrelease_clausepfxs rrzNormalizedMatcher._match_ltDi"00*fMM j 5#3hh7777788 #....rc||||\}}||krdS|j}dd|D}t|| S)NFrc,g|]}t|Srrrs rrz/NormalizedMatcher._match_gt..Qrrrrs rrzNormalizedMatcher._match_gtLrrcB||||\}}||kSr1rr!rrrzs rrzNormalizedMatcher._match_leT)"00*fMM*$$rcB||||\}}||kSr1rrs rrzNormalizedMatcher._match_geXrrcl||||\}}|s||k}nt||}|Sr1rrr!rrrzrs rrzNormalizedMatcher._match_eq\sF"00*fMM 8+FF"7J77F rcBt|t|kSr1rrs rrz"NormalizedMatcher._match_arbitraryds7||s:..rcn||||\}}|s||k}nt|| }|Sr1rrs rrzNormalizedMatcher._match_negsI"00*fMM <+FF&w ;;;F rc||||\}}||krdS||krdS|j}t|dkr |dd}dd|D}t ||S)NTFrrrc,g|]}t|Srrrs rrz7NormalizedMatcher._match_compatible..zrr)rrr rrrs rrz#NormalizedMatcher._match_compatibleos"00*fMM j 4 Z  5$3 ~   " "+CRC0Nhh7777788Wc***rN)rrrrrnr|rrrrrrrrrrrrrr's%M"  !  J # # #//////%%%%%%/// + + + + +rrz[.+-]$z^[.](\d)z0.\1z^[.-]z ^\((.*)\)$\1z^v(ersion)?\s*(\d+)z\2z^r(ev)?\s*(\d+)z[.]{2,}rz\b(alfa|apha)\balphaz\b(pre-alpha|prealpha)\bz pre.alphaz \(beta\)$betaz ^[:~._+-]+z [,*")([\]]z[~:+_ -]z\.$z (\d+(\.\d+)*)c|}tD]\}}|||}|sd}t|}|sd}|}n%|dd}d|D}t|dkr(| dt|dk(t|dkr|| d}nNd d|ddD|| dz}|dd}d d|D}|}|r#tD]\}}|||}|s|}nd |vrd nd }||z|z}t|sd}|S) z Try to suggest a semantic form for a version for which _suggest_normalized_version couldn't come up with anything. z0.0.0rrc,g|]}t|Srrrs rrz-_suggest_semantic_version..s)))Q#a&&)))rNc,g|]}t|Srrrs rrz-_suggest_semantic_version..s:::!s1vv:::rc,g|]}t|Srrrs rrz-_suggest_semantic_version..s222a3q66222rr-r)rrq _REPLACEMENTSsub_NUMERIC_PREFIXrrrr ruendr_SUFFIX_REPLACEMENTS is_semver)r"rpatreplrrzsuffixseps r_suggest_semantic_versionrs WWYY__  F"'' Tv&&  f%%A  A$$S))))&)))&kkAoo MM!   &kkAoo v;;!  AEEGGHH%FFXX::vabbz:::;;fQUUWWXX>NNFBQBZF22622233 +. + +ICWWT6**FF 'f__cc##& V   Mrc t||S#t$rYnwxYw|}dD]\}}|||}t jdd|}t jdd|}t jdd|}t jdd |}t jd d |}|d r |d d}t jdd |}t jdd|}t jdd|}t jdd|}t jdd|}t jdd|}t jdd|}t jdd|}t jdd|}t jdd|}t jdd |} t|n#t$rd}YnwxYw|S)!aSuggest a normalized version close to the given version string. If you have a version string that isn't rational (i.e. NormalizedVersion doesn't like it) then you might be able to get an equivalent (or close) rational version from this function. This does a number of simple normalizations to the given string, based on observation of versions currently in use on PyPI. Given a dump of those version during PyCon 2009, 4287 of them: - 2312 (53.93%) match NormalizedVersion without change with the automatic suggestion - 3474 (81.04%) match when using this suggestion method @param s {str} An irrational version string. @returns A rational version string, or None, if couldn't determine one. ))z-alphar)z-betar)rr)rr)rrV)z-finalr)z-prerV)z-releaser)z.releaser)z-stabler)rr)rr) r)z.finalr)rrzpre$pre0zdev$dev0z([abc]|rc)[\-\.](\d+)$z\1\2z[\-\.](dev)[\-\.]?r?(\d+)$z.\1\2z[.~]?([abc])\.?rrUrNz\b0+(\d+)(?!\d)z (\d+[abc])$z\g<1>0z\.?(dev-r|dev\.r)\.?(\d+)$z.dev\2z-(a|b|c)(\d+)$z[\.\-](dev|devel)$z.dev0z(?![\.\-])dev$z(final|stable)$rz\.?(r|-|-r)\.?(\d+)$z.post\2z\.?(dev|git|bzr)\.?(\d+)$z\.?(pre|preview|-c)(\d+)$zc\g<2>zp(\d+)$z.post\1)rr rqreplacererr)r"rsorigrs r_suggest_normalized_versionr s1"  "      B&$$ d ZZd # # " % %B " % %B )7B 7 7B -x < .get_partsCs$$QWWYY// ! !A $$Q**A !!BQB%&&&&3&&&&& AAaA a    h rrrrz*final-00000000)rpoprur)r"rrrWs r _legacy_keyrBs   F Yq\\ <<   8||!y!8!8JJLLL!y!8!8 VBZ:55  VBZ:55 a ==rc*eZdZdZedZdS)r c t|Sr1)rr(s rrzLegacyVersion.parse]s1~~rcd}|jD]6}t|tr|dr |dkrd}n7|S)NFrrT)rrrr)r!rrs rrOzLegacyVersion.is_prerelease`sV  A1l++  S0A0A H  rNrrrrrPrOrrrr r \s>Xrr cbeZdZeZeejZded<ej dZ dZ dS)r rriz^(\d+(\.\d+)*)c4||krdS|jt|}|std||dS|d}d|vr|ddd}t||S)NFzACannot compute compatible match for version %s and constraint %sTrrr) numeric_rerrloggerwarningrrsplitr)r!rrrzrr"s rrzLegacyMatcher._match_compatibless Z  5 O ! !#j// 2 2  NN018* F F F4 HHJJqM !88a  #AWa(((rN) rrrr rndictrRr|rcompiler!rrrrr r ksV!Mg())J*Jt-..J ) ) ) ) )rr zN^(\d+)\.(\d+)\.(\d+)(-[a-z0-9]+(\.[a-z0-9-]+)*)?(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$c6t|Sr1) _SEMVER_REr)r"s rrrs   A  rcd}t|}|st||}d|ddD\}}}||dd||dd}}|||f||fS)Nc~||f}n6|ddd}td|D}|S)Nrrcdg|]-}|r|dn|.S)r)rr)rrWs rrz5_semantic_key..make_tuple..s3LLL!))++.make_tuplesL 9YFFabbEKK$$ELLeLLLMMF rc,g|]}t|Srrrs rrz!_semantic_key..s666a3q66666rr|r)rr r) r"r-rrmajorminorpatchrbuilds r _semantic_keyr5s ! A )%a((( XXZZF666"1":666E5%F1Is++ZZq 3-G-GC 5% #u ,,rc*eZdZdZedZdS)r c t|Sr1)r5r(s rrzSemanticVersion.parsesQrc0|jdddkS)Nrrr/)rrDs rrOzSemanticVersion.is_prereleases{1~a C''rNrrrrr r s>   ((X(((rr ceZdZeZdS)r N)rrrr rnrrrr r s#MMMrr c.eZdZddZdZdZdZdZdS) VersionSchemeNc0||_||_||_dSr1)rrmatcher suggester)r!rrr=r>s rr$zVersionScheme.__init__s "rcf |j|d}n#t$rd}YnwxYw|SNTF)r=rnr r!r"rs ris_valid_versionzVersionScheme.is_valid_versionsM  L & &q ) ) )FF&   FFF  s  ..c\ ||d}n#t$rd}YnwxYw|Sr@)r=r rAs ris_valid_matcherzVersionScheme.is_valid_matchersF  LLOOOFF&   FFF  s  ))cp|dr |dd}|d|zS)z: Used for processing some metadata fields ,Nrzdummy_name (%s))rtrDr(s ris_valid_constraint_listz&VersionScheme.is_valid_constraint_lists= ::c?? #2#A$$%6%:;;;rcD|jd}n||}|Sr1)r>rAs rsuggestzVersionScheme.suggests' > !FF^^A&&F rr1)rrrr$rBrDrGrIrrrr;r;sd#### <<<rr;c|Sr1rr(s rrXrXsr) normalizedlegacysemanticrKdefaultcR|tvrtd|zt|S)Nzunknown scheme name: %r)_SCHEMESro)rps rrrs+ 82T9::: D>r)*rloggingrcompatrutilr__all__ getLoggerrr"ror objectrrRr&rrrrrrrrrrr Irrrr r r(rr5r r r;rPrrrrrXs   ###### 4 4 4  8 $ $     j   .E.E.E.E.Ef.E.E.EbaaaaafaaaHBJ FGG :.:.:.z!G!G!G!G!G!G!G!GHT+T+T+T+T+T+T+T+nRZ2RZ g&RZ"RZ &RZ&''/RZ"##U+RZ C RZ"##W-RZ+,,RZ v&  RZ r"RZ #RZ S!RZ C RZ "*-..+++\llld 0"$77    4     G   )))))G)))2RZ:;=4AA ---*(((((g((($$$$$g$$$$$$$$F$$$N -1B ;==mK8I8IJJ m_799   |,rPK!eJeJ%__pycache__/resources.cpython-311.pycnu[ ^iD*4ddlmZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddl m Z mZmZejeZdaGddeZGdd eZGd d eZGd d eZGddeZGddeZedee jeiZ ddlZn#e $rddl!ZYnwxYweeej"<eeej#<eeej$<[n #e e%f$rYnwxYwdZ&iZ'dZ(ej)e*dZ+dZ,dS))unicode_literalsN)DistlibException)cached_propertyget_cache_baseCachec,eZdZdfd ZdZdZxZS) ResourceCacheNc|9tjtt d}t t ||dS)Nzresource-cache)ospathjoinrstrsuperr __init__)selfbase __class__s /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/resources.pyrzResourceCache.__init__sP <7<< 0 0#6F2G2GHHD mT""++D11111cdS)z Is the cache stale for the given resource? :param resource: The :class:`Resource` being cached. :param path: The path of the resource in the cache. :return: True if the cache is stale. Trresourcer s ris_stalezResourceCache.is_stale"s trcZ|j|\}}||}ntj|j|||}tj|}tj|stj |tj |sd}n| ||}|rBt|d5}| |jdddn #1swxYwY|S)z Get a resource into the cache, :param resource: A :class:`Resource` instance. :return: The pathname of the resource in the cache. NTwb)finderget_cache_infor r rr prefix_to_dirdirnameisdirmakedirsexistsropenwritebytes)rrprefixr resultr!stalefs rgetzResourceCache.get-s< 55h??  >FFW\\$)T-?-?-G-GNNFgoof--G7==)) % G$$$7>>&)) 6 h55 ,&$'',1GGHN+++,,,,,,,,,,,,,,, s9D  D$'D$N)__name__ __module__ __qualname__rrr, __classcell__rs@rr r s[222222   rr ceZdZdZdS) ResourceBasec"||_||_dSr-)rname)rrr6s rrzResourceBase.__init__Hs  rN)r.r/r0rrrrr4r4Gs#rr4c^eZdZdZdZdZedZedZedZ dS)Resourcez A class representing an in-package resource, such as a data file. This is not normally instantiated by user code, but rather by a :class:`ResourceFinder` which manages the resource. Fc6|j|S)z Get the resource as a stream. This is not a property to make it obvious that it returns a new stream each time. )r get_streamrs r as_streamzResource.as_streamUs{%%d+++rc`ttat|Sr-)cacher r,r;s r file_pathzResource.file_path^s" =!OOEyyrc6|j|Sr-)r get_bytesr;s rr'zResource.byteses{$$T***rc6|j|Sr-)rget_sizer;s rsizez Resource.sizeis{##D)))rN) r.r/r0__doc__ is_containerr<rr?r'rDrrrr8r8Ms L,,,_ ++_+**_***rr8c(eZdZdZedZdS)ResourceContainerTc6|j|Sr-)r get_resourcesr;s r resourceszResourceContainer.resourcesqs{((...rN)r.r/r0rFrrKrrrrHrHns2L//_///rrHceZdZdZejdrdZndZdZdZ dZ dZ d Z d Z d Zd Zd ZdZdZeejjZdZdS)ResourceFinderz4 Resource finder for file system resources. java).pyc.pyoz.class)rOrPc||_t|dd|_tjt|dd|_dS)N __loader____file__)modulegetattrloaderr r r!r)rrUs rrzResourceFinder.__init__sA flD99 GOOGFJ$C$CDD rc@tj|Sr-)r r realpathrr s r _adjust_pathzResourceFinder._adjust_pathsw%%%rct|trd}nd}||}|d|jt jj|}||S)N//r) isinstancer'splitinsertrr r rr[)r resource_nameseppartsr)s r _make_pathzResourceFinder._make_pathsm mU + + CCC##C(( Q """u%  (((rc@tj|Sr-)r r r$rZs r_findzResourceFinder._findsw~~d###rcd|jfSr-)r rrs rrzResourceFinder.get_cache_infosX]""rc||}||sd}n=||rt||}nt ||}||_|Sr-)rerg _is_directoryrHr8r )rrbr r)s rfindzResourceFinder.findsp}--zz$ FF!!$'' 7*4??!$ 66FK rc,t|jdSNrb)r%r ris rr:zResourceFinder.get_streamsHM4(((rct|jd5}|cdddS#1swxYwYdSrn)r%r read)rrr+s rrAzResourceFinder.get_bytess (- & & !6688                  s 7;;cJtj|jSr-)r r getsizeris rrCzResourceFinder.get_sizeswx}---rctfdtfdtj|jDS)NcF|dko|j S)N __pycache__)endswithskipped_extensions)r+rs rallowedz-ResourceFinder.get_resources..alloweds,&8JJt677,8 9rc*g|]}| |Srr).0r+rys r z0ResourceFinder.get_resources..s&GGG!GGAJJGAGGGr)setr listdirr )rrrys` @rrJzResourceFinder.get_resourcessN 9 9 9 9 9GGGGrz(-88GGGHHHrc6||jSr-)rkr ris rrFzResourceFinder.is_containers!!(-000rc#TK||}||g}|r|d}|V|jrc|j}|jD]T}|s|}nd||g}||}|jr||P|VU|dSdSdS)Nrr^)rlpoprFr6rKrappend)rrbrtodornamer6new_namechilds riteratorzResourceFinder.iterators99]++  :D (88A;;( ($ME ( 2 ( ($?'+HH'*xx '>'>H $ ( 3 3 -( KK...."'KKKK ( ( (  ( (rN)r.r/r0rEsysplatform startswithrxrr[rergrrlr:rArCrJrF staticmethodr r r"rkrrrrrMrMvs |v&&.7-EEE &&& ) ) )$$$###   )))...III 111!L//M(((((rrMcReZdZdZfdZdZdZdZdZdZ dZ d Z d Z xZ S) ZipResourceFinderz6 Resource finder for resources in .zip files. cLtt|||jj}dt |z|_t|jdr|jj|_ntj ||_t|j|_ dS)Nr_files) rrrrWarchivelen prefix_lenhasattrr zipimport_zip_directory_cachesortedindex)rrUrrs rrzZipResourceFinder.__init__s &&//777+%c'll* 4; ) ) B+,DKK#8ADKDK(( rc|Sr-rrZs rr[zZipResourceFinder._adjust_paths rc||jd}||jvrd}nu|r%|dtjkr|tjz}t j|j|} |j||}n#t$rd}YnwxYw|s't d||j j n&t d||j j |S)NTFz_find failed: %r %rz_find worked: %r %r) rrr rcbisectrr IndexErrorloggerdebugrWr()rr r)is rrgzZipResourceFinder._findsDO$$% 4;  FF %RBF**bf} dj$//A A11$77     J LL.dk6H I I I I LL.dk6H I I I s A?? B Bc`|jj}|jdt|zd}||fS)Nr)rWrr r)rrr(r s rrz ZipResourceFinder.get_cache_infos2$}QV_--.t|rc@|j|jSr-)rWget_datar ris rrAzZipResourceFinder.get_bytess{##HM222rcPtj||Sr-)ioBytesIOrAris rr:zZipResourceFinder.get_streamsz$..22333rcP|j|jd}|j|dS)N)r rrrs rrCzZipResourceFinder.get_sizes(}T_--.{4 ##rc2|j|jd}|r%|dtjkr|tjz }t |}t }t j|j|}|t |jkr|j||snk|j||d}| | tjdd|dz }|t |jk|S)Nrrr) r rr rcrr}rrraddr`)rrr plenr)rss rrJzZipResourceFinder.get_resourcess}T_--.  DH&& BFND4yy M$*d + +#dj//!!:a=++D11  1 dee$A JJqwwrvq))!, - - - FA #dj//!!  rc||jd}|r%|dtjkr|tjz }tj|j|} |j||}n#t $rd}YnwxYw|S)NrF)rr rcrrrr)rr rr)s rrkzZipResourceFinder._is_directorysDO$$%  DH&& BFND M$*d + + Z]--d33FF   FFF  s A33 BB)r.r/r0rErr[rgrrAr:rCrJrkr1r2s@rrrs ) ) ) ) )$ 333444$$$          rrc4|tt|<dSr-)_finder_registrytype)rW finder_makers rregister_finderr2s%1T&\\"""rc|tvrt|}n|tjvrt|tj|}t |dd}|t dt |dd}t t|}|t d|z||}|t|<|S)z Return a resource finder for a package. :param package: The name of the package. :return: A :class:`ResourceFinder` instance for the package. __path__Nz8You cannot get a finder for a module, only for a packagerRzUnable to locate finder for %r) _finder_cachermodules __import__rVrrr,r)packager)rUr rWrs rrr9s -w' #+ % % w   W%vz400 <"$899 9t44'++DLL99  "#Cg#MNN Nf%%!' g Mr __dummy__c>d}tj|tj|}t t |}|r>t}tj |d|_ ||_ ||}|S)z Return a resource finder for a path, which should represent a container. :param path: The path. :return: A :class:`ResourceFinder` instance for the path. NrT) pkgutil get_importerrpath_importer_cacher,rr _dummy_moduler r rrSrR)r r)rWrrUs rfinder_for_pathrUsF   $ ( ( . .F  ! !$v,, / /F  ',,tR00" Mr)- __future__rrrloggingr rrtypesrrTrutilrrr getLoggerr.rr>r objectr4r8rHrMrr zipimporterr_frozen_importlib_external_fi ImportError_frozen_importlibSourceFileLoader FileFinderSourcelessFileLoaderAttributeErrorrrr ModuleTyperrrrrrrs('''''   8888888888  8 $ $ )))))E)))X6 *****|***B///// ///W(W(W(W(W(VW(W(W(tKKKKKKKK^ DJJ ,  (00000 (((''''''(-;S)*'5S^$1?S-. ^$   D 222 2! [!1!122 s03B87C'8 CC'C"C''C10C1PK!61zz/_backport/__pycache__/sysconfig.cpython-311.pycnu[ ^ihdZddlZddlZddlZddlZddlmZmZ ddlZn#e $rddl ZYnwxYwgdZ dZ ej r)eje ej Zne ejZejdkrBdeddvr$e ejeeZejdkrCd ed dvr%e ejeeeZejdkrCd ed dvr%e ejeeeZd ZeZdadZejZejdZdZdejddzZdejddzZ dejddzZ!ej"ej#Z$ej"ej%Z&da'dZ(dZ)dZ*dZ+dZ,dZ-dZ.d/dZ/dZ0dZ1d Z2d/d!Z3d"Z4d#Z5d$Z6e-dd%fd&Z7e-dd%fd'Z8d(Z9d)Z:d*Z;d+Ze?d.kr e>dSdS)0z-Access to Python's configuration information.N)pardirrealpath) get_config_h_filenameget_config_varget_config_varsget_makefile_filenameget_pathget_path_names get_paths get_platformget_python_versionget_scheme_namesparse_config_hcF t|S#t$r|cYSwxYwN)rOSError)paths /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/_backport/sysconfig.py_safe_realpathr"s7~~  s   ntpcbuildiz\pc\viz\pcbuild\amd64icdD]H}tjtjtd|rdSIdS)N)z Setup.distz Setup.localModulesTF)osrisfilejoin _PROJECT_BASE)fns ris_python_buildr:sJ+ 7>>"',,}iDD E E 44  5Fctsddlm}tddd}||}|d}|s Jd|5}t|dddn #1swxYwYtr=dD]:}t |d d t |d d ;d adSdS)N)finder.rz sysconfig.cfgzsysconfig.cfg exists) posix_prefix posix_homeincludez{srcdir}/Include platincludez{projectbase}/.T) _cfg_read resourcesr#__name__rsplitfind as_stream_SCHEMESreadfp _PYTHON_BUILDset)r#backport_package_finder_cfgfilesschemes r_ensure_cfg_readr9Ds>  &&&&&&#??32215&)**<<00/////x    ! ! Q OOA                    G8 G G VY0BCCC V]4EFFFF   s/BBBz \{([^{]*?)\}c ~t|dr|d}nt}|}|D]?}|dkr |D]3\}}|||r||||4@|d|D]t}t||fd}||D]5\}}|||t ||6udS)Nglobalscp|d}|vr|S|dSNr%rgroup)matchobjname variabless r _replacerz"_expand_globals.._replaceros;>>!$$Dy   &>>!$$ $r ) r9 has_sectionitemstuplesections has_optionr3remove_sectiondict _VAR_REPLsub)configr;rGsectionoptionvaluerCrBs @r_expand_globalsrQYsz )$$,,y))''  H// i   $ / /MFE  &11  JJw . . . . / )$$$??$$ I Ig..//  % % % % % $\\'22 I IMFE JJw i(G(G H H H H I I Ir z%s.%s.%sz%s.%sr"z%s%scDfd}t||S)zIn the string `path`, replace tokens like {some.thing} with the corresponding value from the map `local_vars`. If there is no corresponding value, leave the token unchanged. c|d}|vr|S|tjvrtj|S|dSr=)r?renviron)r@rA local_varss rrCz_subst_vars.._replacersV~~a   :  d# # RZ  :d# #~~a   r rKrL)rrVrCs ` r _subst_varsrXs2 !!!!! ==D ) ))r cv|}|D]\}}||vr |||<dSr)keysrE) target_dict other_dict target_keyskeyrPs r _extend_dictr_sW""$$K &&((!! U +    C!!r cDi}|i}t|tt|D]b\}}tjdvrtj|}tjt||||<c|S)N)posixr) r_rr0rErrAr expandusernormpathrX)r8varsresr^rPs r _expand_varsrfs C |(()))nnV,,>> U 7o % %G&&u--E7##Kt$<$<==C Jr cDfd}t||S)Ncp|d}|vr|S|dSr=r>)r@rArds rrCzformat_value.._replacers9~~a   4<<: ~~a   r rW)rPrdrCs ` r format_valueris2!!!!! ==E * **r c>tjdkrdStjS)Nrar&)rrAr r_get_default_schemerls w'~ 7Nr c ztjdd}d}tjdkr1tjdpd}|r|S||dStjdkr8t d}|r'|r|S|dd |d tjdd zS|r|S|dd S) NPYTHONUSERBASEcbtjtjj|Sr)rrrbr)argss rjoinuserz_getuserbase..joinusers!w!!"',"5666r rAPPDATA~PythondarwinPYTHONFRAMEWORKLibraryz%d.%dr"z.local)rrUgetrAsysplatformr version_info)env_baserqbase frameworks r _getuserbasersz~~.55H777 w$z~~i((/C  ,O8D(++ + |x"#455  6 6xY 7 # 0! 4<5666'xX&&&r ctjd}tjd}tjd}|i}i}i}tj|dd5}|}dddn #1swxYwY|D]} | ds| d kr0|| } | r| d d \} } | } | d d } d | vr| || < t| } | || <#t$r| d d || <YwxYwt| }d}t|dkrt|D]}||}||p||} | ~| d } d}| |vrt#|| }nz| |vrd}ns| t$jvrt$j| }nR| |vrG|dr|dd|vrd }n*d| z|vrd}n t#|d| z}nd x|| <}|r|| d}|d| |z|z}d |vr|||<. t|}|||<n'#t$r|||<YnwxYw|||dr|dd|vr|dd}||vr|||<|||<||t|dk|D]1\}} t1| t"r| ||<2|||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. z"([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_]*)}Nzutf-8surrogateescape)encodingerrors#r%r"z$$$)CFLAGSLDFLAGSCPPFLAGSrTFPY_rR)recompilecodecsopen readlines startswithstripmatchr?replaceint ValueErrorlistrZlenrFsearchstrrrUendstartremoverE isinstanceupdate)filenamerd _variable_rx _findvar1_rx _findvar2_rxdonenotdoneflineslinemnvtmpvrBrenamed_variablesrArPfounditemafterks r_parse_makefilers:CDDL:>??L:<==L | DG X8I J J Ja    ??3   4::<<2#5#5    t $ $  771a==DAq A99T2&&Dd{{  AA  DGG "333iic22DGGG3 $W\\^^$$I : i..1  )$$6 '6 'DDME##E**Hl.A.A%.H.HA}GGAJJ99tAw<I 1j ! ! -!*,,Ccll  %&&H (^^ $q 1d # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $ >I 1j ! ! -!*,,Ccll - ,Z--sP! A!1AA!3B+B B+B##B+&B#'B++ C+51C&&C+c td|d<td|d<td|d<d|d<d |d <t|d <tjt t j|d <d S)z+Initialize the module as appropriate for NTrLIBDEST platstdlib BINLIBDESTr( INCLUDEPYz.pydSOz.exeEXEVERSIONBINDIRN)r _PY_VERSION_SHORT_NO_DOTrrdirnamerry executable)rds r_init_non_posixrrsyx((DO!,//D ++DDJDK.DOW__^CN%C%CDDDNNNr c|i}tjd}tjd} |}|sn||}|r@|dd\}} t |}n#t $rYnwxYw|||<n/||}|rd||d<|S)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_]+) [*]/ Tr%r"r)rrreadlinerr?rr)fprd define_rxundef_rxrrrrs rrrs | @AAIzCDDH%{{}}   OOD ! ! %771a==DAq FF    DGGt$$A %#$QWWQZZ % Ks6B BBctr>tjdkr&tjt d}nt }nt d}tj|dS)zReturn the path of pyconfig.h.rPCr)z pyconfig.h)r2rrArrrr )inc_dirs rrrsV* 7d??gll=$77GG#GG=)) 7<< . ..r chtttS)z,Return a tuple containing the schemes names.)rFsortedr0rGrkr rrrs$ ))++,, - --r c6tdS)z*Return a tuple containing the paths names.r&)r0optionsrkr rr r s   N + ++r Tct|rt||Stt|S)zReturn a mapping containing an install scheme. ``scheme`` is the install scheme name. If not provided, it will return the default scheme for the current platform. )r9rfrJr0rE)r8rdexpands rr r sB  ,FD)))HNN6**+++r c0t||||S)z[Return a path corresponding to the scheme. ``scheme`` is the install scheme name. )r )rAr8rdrs rr r s VT6 * *4 00r ctiattd<ttd<ttd<ttd<tdtdztd<ttd <ttd <t td < t jtd <n#t$r d td <YnwxYwtj dvrtttj dkrttt j dkrttd<dtvrt td<n"ttdtd<t rtj dkrt } tj}n#t$$rd}YnwxYwtjtdsX||krRtj|td}tj|td<t jdkrtjd}t3|dd}|dkrIdD]E}t|}t7jdd|}t7jdd|}|t|<FndtjvrLtjd}dD]7}t|}t7jdd|}|dz|z}|t|<8tdd } t7jd| } | f| d} tj!| s2dD]/}t|}t7jdd|}|t|<0|r6g} |D]/} | "t| 0| StS)ayWith no arguments, return a dictionary of all configuration variables relevant for the current platform. On Unix, this means every variable defined in Python's installed Makefile; On Windows and Mac OS 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. Nprefix exec_prefix py_versionpy_version_shortrr"py_version_nodotr}platbase projectbaserr)ros2raz2.6userbasesrcdirrur$)r BASECFLAGSr PY_CFLAGSrz -arch\s+\w+\s z-isysroot [^ ]* ARCHFLAGSrz-isysroot\s+(\S+)r%z-isysroot\s+\S+(\s|$))# _CONFIG_VARS_PREFIX _EXEC_PREFIX _PY_VERSIONrrryrAttributeErrorrrArrversionrrr2getcwdrrisabsrrcrzunamersplitrrLrUrxrr?existsappend)rpr}cwdrkernel_version major_versionr^flagsarchrrsdkvalsrAs rrrs ") X&2 ]#%0 \"+< '(+6q>KN+J '(& V#/ Z &3 ]# *'*|L $ $ * * *')L $ $ $ * 7m # # L ) ) ) 7g    % % % ;%  '3~~L $ < ' '%2L " "%3L4J%K%KL "  BRW// D ikk    GMM,x"899 B dL,BCC)+)9)9&)A)A X& <8 # #XZZ]N 4 4S 9 9! <==Mq  <..C)-EF#3S%@@EF#6UCCE(-L%%."*,,:k2D <22 !-S 1 "'7e D D % d 2,1 S))&))(B77I2F;;=''!**C7>>#..6$@66C %1$5E$&F+CS%$P$PE05L--  0 0D KK ((.. / / / / s$B--CC F!! F0/F0cDt|S)zReturn the value of a single variable using the dictionary returned by 'get_config_vars()'. Equivalent to get_config_vars().get(name) )rrx)rAs rrrPs     & &&r ctjdkrd}tj|}|dkr tjStjd|}tj|t |z|}|dkrdS|dkrdStjStjd ksttd s tjStj \}}}}}| d d }| d d}| d d}|dddkr|d|S|dddkr5|ddkr'd}dt|ddz |ddfz}n|dddkr|d|S|dddkr |d|d|S|dddkrCd}tj d } | |} | r| }n)|ddd!krt!} | d"} | } t%d$} tjd%|} |n#|wxYw| Cd| d&ddd} n#t0$rYnwxYw| s| } | r1| }d'}| dzd(krd)t!d*d vrd+}t!d*}tjd,|}t7t9t;|}t |d&kr |d}nq|d-krd+}nh|d.krd/}n_|d0krd1}nV|d2krd3}nM|d4krd5}nDt=d6||d7krtjd8krd9}n|d:vrtjd8krd;}nd<}|d|d|S)=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. for IRIX the architecture isn't particularly important (IRIX only runs on SGI hardware), but for Linux the kernel version isn't particularly important. Examples of returned values: linux-i586 linux-alpha (?) solaris-2.6-sun4u irix-5.3 irix64-6.2 Windows will return one of: win-amd64 (64bit Windows on AMD64 (aka x86_64, Intel64, EM64T, etc) win-ia64 (64bit Windows on Itanium) win32 (all others - specifically, sys.platform is returned) For other non-POSIX platforms, currently just returns 'sys.platform'. rz bit ()amd64z win-amd64itaniumzwin-ia64rar/rr_-Nlinuxsunosr5solarisz%d.%srRr"irixaixr$cygwinz[\d.]+ruMACOSX_DEPLOYMENT_TARGETTz0/System/Library/CoreServices/SystemVersion.plistz=ProductUserVisibleVersion\s*(.*?)r%macosxz10.4.z-archrfatz -arch\s+(\S+))i386ppc)rx86_64intel)rrrfat3)ppc64rfat64)rrrr universalz#Don't know machine value for archs=rlr)PowerPCPower_Macintoshrr) rrAryrr.rzrlowerrrrrrrrr?rrxrrreadcloserrrrfindallrFrr3rmaxsize)rijlookosnamehostreleasermachinerel_rercfgvarsmacver macreleasercflagsarchss rr r Ys2 w$ K  V $ $ 77<  K  S! $ ${1S[[=?+1133 7??; 9  :| w'W!5!5|/1hjj+FD'7G\\^^ # #C , ,Fooc3''Gooc3''G bqbzW"6677++ w   1:  FWQZ1!4gabbk BBG v   &&''** u  #VVWWWgg66 x  I&& LL ! !  ggiiG x  "##788 E J EKLL  #<=>VVXXGGAGGIIIIAGGIIII=!$!''!***:*:3*?*?*C!D!DJ     F / $GFc!g--?,,002>>DDFFFF (**..x88 #3V<<fSZZ0011u::??#AhGGo--#GG000%GG777$GG111%GG@@@)GG$*BG%IKKKF"";%''&G:::;%''%GG#G'' 22s L 0'J,,K LLctSr)rrkr rr r s r ctt|D]6\}\}}|dkrtd|ztd|d|d7dS)Nrz%s:  z = "") enumeraterrEprint)titledataindexr^rPs r _print_dictr=sx( )=)=>>,,|U A:: &E" # # # sssEEE*++++,,r cbtdtztdtztdtztt dt tt dt dS)z*Display all information sysconfig detains.zPlatform: "%s"zPython version: "%s"z!Current installation scheme: "%s"Paths VariablesN)r9r r rlr=r rrkr r_mainrAs \^^ +,,, #5#7#7 7888 -0C0E0E EFFF GGG%%% GGG _../////r __main__r)@__doc__rrrryos.pathrr configparser ImportError ConfigParser__all__rrrrrrrAr"rrr2r*r9RawConfigParserr0rrKrQr{rrrrcrrrrr _USER_BASErXr_rfrirlrrrrrrrrr r r rrr r r=rAr,rkr rrKso 43 $$$$$$$$((((''''''(   >0GOONN3>$B$BCCMM#N929;;//M7d??yM"##$6$<$<$>$>>>"N27<< v#F#FGGM7d??yM#$$$7$=$=$?$???"N27<< vv#N#NOOM7d??)]344-@-F-F-H-HHH"N27<< vv#N#NOOM  !!  $ (< ' ) ) BJ ' ' IIIB3+BQB// c.rr22!C$4RaR$88 '  3: & &w00    * * * !!!   +++''':sssslIII---8 E E E > / / /... ,,, )(**d , , , ,.-//d41111@@@F'''_3_3_3D,,,000 z EGGGGGs ! --PK!L))._backport/__pycache__/__init__.cpython-311.pycnu[ ^i dZdS)a Modules copied from Python 3 standard libraries, for internal use only. Individual classes and functions are found in d2._backport.misc. Intended usage is to always import things missing from 3.1 from that module: the built-in/stdlib objects will be used if found. N)__doc__/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/_backport/__init__.pyrsrPK!亅-_backport/__pycache__/tarfile.cpython-311.pycnu[ ^ii ddlmZ dZdZdZdZdZdZddlZddl Z ddl Z ddl Z ddl Z ddl Z ddlZddlZ ddlZddlZn#e$rdxZZYnwxYweefZ eefz Zn #e$rYnwxYwgd Zejdd krddlZnddlZejZd Zd Zed zZ dZ!dZ"dZ#dZ$dZ%dZ&d Z'dZ(dZ)dZ*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5d Z6d!Z7e6Z8e&e'e(e)e,e-e.e*e+e/e0e1f Z9e&e'e.e1fZ:e/e0e1fZ;d"Z<e=d#Z>e?e?e?e@e@e@d$ZAd%ZBd&ZCd'ZDd(ZEd)ZFd*ZGd+ZHd,ZId ZJd-ZKd.ZLd/ZMd0ZNd1ZOd2ZPd3ZQd!ZRd ZSe jTd4vrd5ZUnejVZUd6ZWd7ZXd8ZYd2e8fd9ZZd:Z[dsd;Z\eBdfeEd?feFd@feGdAffeKdBffeLdCffeMeHzdDfeHdEfeMdFffeNdBffeOdCffePeIzdDfeIdEfePdFffeQdBffeRdCffeSeJzdGfeJdHfeSdFfff Z]dIZ^GdJdKe_Z`GdLdMe`ZaGdNdOe`ZbGdPdQe`ZcGdRdSe`ZdGdTdUe`ZeGdVdWeeZfGdXdYeeZgGdZd[eeZhGd\d]eeZiGd^d_eeZjGd`daekZlGdbdcekZmGdddeekZnGdfdgekZoGdhdiekZpGdjdkekZqGdldmekZrGdndoekZsGdpdqekZtdrZueZvesjZdS)t)print_functionz $Revision$z0.9.0u"Lars Gustäbel (lars@gustaebel.de)z5$Date: 2011-02-25 17:42:01 +0200 (Fri, 25 Feb 2011) $z?$Id: tarfile.py 88586 2011-02-25 15:42:01Z marc-andre.lemburg $u4Gustavo Niemeyer, Niels Gustäbel, Richard Townsend.N)TarFileTarInfo is_tarfileTarErrorsustar sustar00d01234567LKSxgX)pathlinkpathsizemtimeuidgidunamegname)rrr$r%)atimectimer!r"r#r iii`@i ii@ )ntcezutf-8cx|||}|d||t|z tzzS)z8Convert a string to a null-terminated bytes object. N)encodelenNUL)slengthencodingerrorss /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/_backport/tarfile.pystnr<s9 6""A WfW:#a&&C/ //cx|d}|dkr |d|}|||S)z8Convert a null-terminated bytes object to a string. r N)finddecode)r7r9r:ps r;ntsrCs= u ABww bqbE 88Hf % %%r=c@|dtdkr@ tt|ddpdd}na#t$rt dwxYwd}t t |dz D]"}|dz}|t||dzz }#|S) z/Convert a number field to a python number. rr+asciistrict0r/zinvalid headerr)chrintrC ValueErrorInvalidHeaderErrorranger5ord)r7nis r;ntirPs  ts5zz 7C7H--4a88AA 7 7 7$%566 6 7 s1vvz""  A !GA Qq1uX AA Hs !=Acd|cxkr d|dz zkr)nn&d|dz |fzdtz}n|tks |d|dz zkrtd|dkr.t jdt jd |d}t}t|dz D] }| d|d z|dz}!| dd |S) z/Convert a python number to a number field. rr/rz%0*orEr*zoverflow in number fieldLlr+) r4r6 GNU_FORMATrJstructunpackpack bytearrayrLinsert)rNdigitsformatr7rOs r;itnr]s A!!!!fqj!!!!!! vz1o % - -g 6 6 < Z  1 (;#;#;788 8 q55 c6;sA#6#677:A KKvz""  A HHQE " " " !GAA E Hr=c 6dttjd|ddtjd|ddzz}dttjd|ddtjd |ddzz}||fS) aCalculate the checksum for a member's header by summing up all characters except for the chksum field which is treated as if it was filled with spaces. According to the GNU tar sources, some tars (Sun and NeXT) calculate chksum with signed char, which will be different if there are chars in the buffer with the high bit set. So we calculate two checksums, unsigned and signed. r*148BN356Br 148b356b)sumrVrW)bufunsigned_chksum signed_chksums r; calc_chksumsrisC fc$3$i @ @6=QWY\]`ad]dYeCfCf fgggO#fmFCI>>vWZ[^_b[bWcAdAddeeeM M ))r=c|dkrdS|1 |d}|sn||.dSd}t||\}}t|D]N}||}t ||krt d||O|dkrL||}t ||krt d||dS)zjCopy length bytes from fileobj src to fileobj dst. If length is None, copy the entire content. rNTr(zend of file reached)readwritedivmodrLr5IOError)srcdstr8rfBUFSIZEblocks remainderbs r; copyfileobjrus{{ ~ ((7##C  IIcNNN   Gvw//FI 6]]hhw s88g  /00 0 #A~~hhy!! s88i  /00 0 # Fr=rS-rtdcrBrwr7SxtTcg}tD]?}|D]%\}}||z|kr||n&|d@d|S)zcConvert a file's mode to a string of the form -rwxrwxrwx. Used by TarFile.list() rv)filemode_tableappendjoin)modepermtablebitchars r;filemoder8s{ D  ICczS   D!!!! KK    774==r=ceZdZdZdS)rzBase exception.N__name__ __module__ __qualname____doc__r=r;rrGsDr=rceZdZdZdS) ExtractErrorz%General exception for extract errors.Nrrr=r;rrJs//Dr=rceZdZdZdS) ReadErrorz&Exception for unreadable tar archives.Nrrr=r;rrMs00Dr=rceZdZdZdS)CompressionErrorz.Exception for unavailable compression methods.Nrrr=r;rrPs88Dr=rceZdZdZdS) StreamErrorz=Exception for unsupported operations on stream-like TarFiles.Nrrr=r;rrSsGGDr=rceZdZdZdS) HeaderErrorz!Base exception for header errors.Nrrr=r;rrVs++Dr=rceZdZdZdS)EmptyHeaderErrorzException for empty headers.Nrrr=r;rrYs&&Dr=rceZdZdZdS)TruncatedHeaderErrorz Exception for truncated headers.Nrrr=r;rr\s**Dr=rceZdZdZdS)EOFHeaderErrorz"Exception for end of file headers.Nrrr=r;rr_s,,Dr=rceZdZdZdS)rKzException for invalid headers.Nrrr=r;rKrKbs((Dr=rKceZdZdZdS)SubsequentHeaderErrorz3Exception for missing and invalid extended headers.Nrrr=r;rres==Dr=rc*eZdZdZdZdZdZdZdS) _LowLevelFilezLow-level file object. Supports reading and writing. It is used instead of a regular file object for streaming access. ctjtjtjztjzd|}t tdr|tjz}tj||d|_dS)N)ryrzO_BINARYi) osO_RDONLYO_WRONLYO_CREATO_TRUNChasattrropenfd)selfnamers r;__init__z_LowLevelFile.__init__rsirz)BJ6    2z " " BK D'$e,,r=c8tj|jdSN)rcloserrs r;rz_LowLevelFile.close{s r=c6tj|j|Sr)rrkrrr s r;rkz_LowLevelFile.read~swtw%%%r=c:tj|j|dSr)rrlrrr7s r;rlz_LowLevelFile.writes !r=N)rrrrrrrkrlrr=r;rrlsZ ---&&&r=rc^eZdZdZdZdZdZdZdZdZ dZ d Z dd Z dd Z dZdZd S)_StreamaClass that serves as an adapter between TarFile and a stream-like object. The stream-like object only needs to have a read() or write() method and is accessed blockwise. Use of gzip or bzip2 compression is possible. A stream-like object could be for example: sys.stdin, sys.stdout, a socket, a tape device etc. _Stream is intended to be used only internally. c2d|_|t||}d|_|dkr#t|}|}|pd|_||_||_||_||_d|_ d|_ d|_ |dkrs ddl }n#t$rtd wxYw||_ |d|_|d kr|n||d krf ddl}n#t$rtd wxYw|d kr"d|_||_dS||_dSdS#|js|jd|_ xYw) z$Construct a _Stream object. TNF*rr=rgzzzlib module is not availablerybz2bz2 module is not available) _extfileobjr _StreamProxy getcomptyperrcomptypefileobjbufsizerfposclosedzlib ImportErrorrcrc32crc _init_read_gz_init_write_gzrdbufBZ2Decompressorcmp BZ2Compressorr)rrrrrrrrs r;rz_Stream.__init__s  ?#D$//G$D  s??#7++G**,,H         4KKKKK"KKK*+IJJJK  ::c??3;;&&(((('')))5  JJJJJ"JJJ*+HIIIJ3;; #DI"2244DHHH"0022DHHH!  # % ""$$$DK sCE, BE,B++AE,D E, D$$)E,E,,*Fcdt|dr|js|dSdSdS)Nr)rrrrs r;__del__z_Stream.__del__sB 4 " " 4;  JJLLLLL    r=c|jd|jj|jj |jjd|_t jdttj }| d|zdz|j dr|j dd|_ | |j d d tzdS) z6Initialize for writing with gzip compression. r-1Y-@,@,0I,C,-//Kc$)++&6&677  (94{BCCC 9  e $ $ ' #2#DI TY%%lI>>DEEEEEr=c|jdkr%|j||j|_|xjt |z c_|jdkr|j|}||dS)z&Write string s to the stream. rtarN) rrrrrr5rcompressrrs r;rlz _Stream.writesu =D yq$(33DH CFF =E ! !!!!$$A Qr=c(|xj|z c_t|j|jkrd|j|jd|j|j|jd|_t|j|jkbdSdS)z]Write string s to the stream if a whole new block is ready to be written. N)rfr5rrrlrs r;__writez_Stream.__writes A $(mmdl** L  tx  6 7 7 7x .DH$(mmdl******r=c:|jrdS|jdkr2|jdkr'|xj|jz c_|jdkr|jr|j|jd|_|jdkrj|jtj d|j dz|jtj d|j dz|j s|j d|_dS) z[Close the _Stream object. No operation should be done on it afterwards. Nrzrr=rrlT)rrrrfrflushrrlrVrXrrrrrs r;rz _Stream.closes ;  F 9    6 6 HH(( (HH 9    L  tx ( ( (DH}$$ ""6;tTX 5J#K#KLLL ""6;tTX 5J#K#KLLL ! L    r=c|j|jj |_d|_|ddkrt d|ddkrtdt|d}|d|d zr]t|dd t|dzz}| ||d zr% |d}|r |tkrn$|d zr% |d}|r |tkrn$|dzr|ddSdS)z:Initialize for reading a gzip compressed fileobj. r=rsnot a gzip filerzunsupported compression methodr0r*r/Tr.N) r decompressobjrrr _Stream__readrrrMrkr6)rflagxlenr7s r;rz_Stream._init_read_gzs9**DI,?+?@@  ;;q>>[ ( (-.. . ;;q>>W $ $"#CDD D4;;q>>"" A !8 t{{1~~&&s4;;q>>/B/B)BBD IIdOOO !8  KKNNAHH  "9  KKNNAHH  !8  KKNNNNN  r=c|jS)z3Return the stream's file pointer position. rrs r;tellz _Stream.tell#s xr=rc||jz dkrbt||jz |j\}}t|D]}||j||nt d|jS)zXSet the stream's file pointer to pos. Negative seeking is forbidden. rz seeking backwards is not allowed)rrmrrLrkr)rrrrrsrOs r;seekz _Stream.seek(s >Q   &sTX~t| D D FI6]] ( ( $,'''' IIi @AA Axr=Nc|Lg} ||j}|sn||3d|}n||}|xjt |z c_|S)zReturn the next size number of bytes from the stream. If size is not defined, return all bytes of the stream up to EOF. NTr)_readrrrrr5)rr r}rfs r;rkz _Stream.read5s <A jj..   ''!**CC**T""C CHH r=c|jdkr||St|j}||kr~||j}|sna |j|}n#t$rtdwxYw|xj|z c_|t|z }||k~|jd|}|j|d|_|S)z+Return size bytes from the stream. rzinvalid compressed dataN) rrr5rrr decompressrnrrr rxrfs r;rz _Stream._readGs =E ! !;;t$$ $  NN$hh++dl++C  ;h))#.. ; ; ; 9::: ; II II SMA$hhiIdee$  s A44Bct|j}||krJ|j|j}|sn(|xj|z c_|t|z }||kJ|jd|}|j|d|_|S)zsReturn size bytes from stream. If internal buffer is empty, read another block from the stream. N)r5rfrrkrrs r;__readz_Stream.__read\s MM$hh,##DL11C  HHOHH SMA $hh huuo8DEE? r=)rr)rrrrrrrrlrrrrrrkrrrr=r;rrs222h F F F///8>    $*     r=rc*eZdZdZdZdZdZdZdS)rzsSmall proxy class that enables transparent compression detection for the Stream interface (mode 'r|*'). c\||_|jt|_dSr)rrk BLOCKSIZErf)rrs r;rz_StreamProxy.__init__qs$ <$$Y//r=c2|jj|_|jSr)rrkrfrs r;rkz_StreamProxy.readusL% xr=cv|jdrdS|jdrdSdS)NsrsBZh91rr)rf startswithrs r;rz_StreamProxy.getcomptypeysA 8   / / 4 8  x ( ( 5ur=c8|jdSr)rrrs r;rz_StreamProxy.closes r=N)rrrrrrkrrrr=r;rrlsZ000r=rc@eZdZdZdZdZdZdZdZdZ dZ d Z d S) _BZ2ProxyaSmall proxy class that enables external file object support for "r:bz2" and "w:bz2" modes. This is actually a workaround for a limitation in bz2 module's BZ2File class which (unlike gzip.GzipFile) has no support for a file object argument. r(c||_||_t|jdd|_|dS)Nr)rrgetattrrinit)rrrs r;rz_BZ2Proxy.__init__s6  DL&$77  r=cddl}d|_|jdkr<||_|jdd|_dS||_dS)Nrryr=) rrrrbz2objrrrfr)rrs r;r z_BZ2Proxy.initsj  9  --//DK L  a DHHH++--DKKKr=ct|j}||krd|j|j}|snB|j|}|xj|z c_|t|z }||kd|jd|}|j|d|_|xjt|z c_|Sr)r5rfrrk blocksizer rr)rr r|rawdatarfs r;rkz_BZ2Proxy.reads MM$hh,##DN33C ;))#..D HH HH TNA $hhhuuo8DEE? CHH r=c~||jkr||||jz dSr)rr rk)rrs r;rz_BZ2Proxy.seeks8 >> IIKKK #.!!!!!r=c|jSrrrs r;rz_BZ2Proxy.tells xr=c|xjt|z c_|j|}|j|dSr)rr5r rrrl)rrrs r;rlz_BZ2Proxy.writesI CIIk""4(( 3r=c|jdkr5|j}|j|dSdS)Nrz)rr rrrl)rrs r;rz_BZ2Proxy.closesF 9  +##%%C L  s # # # # #  r=N) rrrrr rr rkrrrlrrr=r;rrsI ...   """    $$$$$r=rc4eZdZdZddZdZdZdZddZdS) _FileInFilezA thin wrapper around an existing file object that provides a part of its data as an individual file object. Nc||_||_||_d|_|d|fg}d|_g|_d}|j}|D]T\}}||kr|jd||df|jd|||z|f||z }||z}U||jkr%|jd||jdfdSdS)NrFT)roffsetr position map_indexmapr)rrrr blockinfolastposrealposs r;rz_FileInFile.__init__s     T I+% $ $LFD >??? HOOT66D='B C C C tOGtmGG TY   HOOUGTY= > > > > >  r=cbt|jdsdS|jS)NseekableT)rrrrs r;rz_FileInFile.seekables/t|Z00 4|$$&&&r=c|jS)*Return the current file position. rrs r;rz_FileInFile.tells }r=c||_dS)(Seek to a position in the file. Nr")rrs r;rz_FileInFile.seeks! r=cD||j|jz }nt||j|jz }d}|dkr |j|j\}}}}||jcxkr|krnnn5|xjdz c_|jt |jkrd|_bt|||jz }|rC|j||j|z z||j|z }n |t|zz }||z}|xj|z c_|dk|S)z!Read data from the file. Nr=rTr) r rminrrr5rrrkr6)rr rfrstartstoprr8s r;rkz_FileInFile.readsJ <9t},DDtTY677DQhh +,0HT^,D)eT6DM0000D00000NNa'NN~TX66)* +tdm344F $ !!&DME,A"BCCCt|((000sV|# FND MMV #MM!Qhh" r=r) rrrrrrrrrkrr=r;rrss ????.'''  !!! r=rcneZdZdZdZdZdZdZdZddZ e Z dd Z d Z d Z ejfd ZdZdZdS) ExFileObjectzaFile-like object for reading an archive member. Is returned by TarFile.extractfile(). r)ct|j|j|j|j|_|j|_d|_d|_|j|_d|_d|_ dS)NryFrr=) rr offset_datar sparserrrrbuffer)rtarfiletarinfos r;rzExFileObject.__init__s["7?#*#6#*<#*>33 L   L   r=cdSNTrrs r;readablezExFileObject.readable!str=cdSNFrrs r;writablezExFileObject.writable$sur=c4|jSr)rrrs r;rzExFileObject.seekable's|$$&&&r=Nc~|jrtdd}|jr4||j}d|_n#|jd|}|j|d|_|||jz }n-||j|t |z z }|xjt |z c_|S)z~Read at most size bytes from the file. If size is not present or None, read all data until EOF is reached. I/O operation on closed filer=N)rrJr.rrkr5r)rr rfs r;rkzExFileObject.read*s ; =;<< < ; 1|k! k%4%("k$%%0 < 4<$$&& &CC 4<$$TCHH_55 5C S!  r=r?c|jrtd|jddz}|dkro |j|j}|xj|z c_|rd|vr8|jddz}|dkrt|j}nn|dkrt||}|jd|}|j|d|_|xj t|z c_ |S)zRead one entire line from the file. If size is present and non-negative, return a string with at most that size, which may be an incomplete line. r9 rrTr?N) rrJr.r@rrkr r5r&r)rr rrfs r;readlinezExFileObject.readlineEs  ; =;<< <ku%%) !88 l''77 s" esll+**511A5Caxx!$+..  2::dC..Ck$3$k#$$'  S!  r=cfg} |}|sn||-|S)z0Return a list with all remaining lines. )r<r)rresultlines r; readlineszExFileObject.readlinesbsA ==??D  MM$     r=c<|jrtd|jS)r!r9)rrJrrs r;rzExFileObject.tellls% ; =;<< <}r=c>|jrtd|tjkr)t t |d|j|_n|tjkrG|dkrt |j|zd|_nst |j|z|j|_nP|tj kr1t t |j|z|jd|_ntdd|_ |j |jdS)r$r9rzInvalid argumentr=N) rrJrSEEK_SETr&maxr rSEEK_CURSEEK_ENDr.rr)rrwhences r;rzExFileObject.seekts ; =;<< < R[ C TY77DMM r{ " "Qww #DMC$7 ; ; #DMC$7 C C r{ " "DIOTY ? ?CCDMM/00 0  $-(((((r=cd|_dS)zClose the file object. TN)rrs r;rzExFileObject.closes r=c#BK |}|sdS|V)z/Get an iterator over the file's lines. TN)r<)rr?s r;__iter__zExFileObject.__iter__s3 ==??D JJJ  r=r)r?)rrrrr rr3r6rrkread1r<r@rrrCrrrJrr=r;r*r*sI   '''2 E: "{))))* r=r*ceZdZdZdZd.dZdZdZeeeZ dZ dZ ee e Z d Z d Zeed fd Zd ZdZdZedZdZedZedZedZedZedZedZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&d Z'd!Z(d"Z)d#Z*d$Z+d%Z,d&Z-d'Z.d(Z/d)Z0d*Z1d+Z2d,Z3d-S)/raInformational class which holds the details about an archive member given by a tar header block. TarInfo objects are returned by TarFile.getmember(), TarFile.getmembers() and TarFile.gettarinfo() and are usually created internally. )rrr"r#r r!chksumtypelinknamer$r%devmajordevminorrr, pax_headersr-r/_sparse_structs _link_targetrc||_d|_d|_d|_d|_d|_d|_t|_d|_ d|_ d|_ d|_ d|_ d|_d|_d|_i|_dS)zXConstruct a TarInfo object. name is the optional name of the member. irrN)rrr"r#r r!rMREGTYPErNrOr$r%rPrQrr,r-rRrrs r;rzTarInfo.__init__s             r=c|jSrrrs r;_getpathzTarInfo._getpaths yr=c||_dSrrYrWs r;_setpathzTarInfo._setpaths  r=c|jSrrOrs r; _getlinkpathzTarInfo._getlinkpaths }r=c||_dSrr^)rrOs r; _setlinkpathzTarInfo._setlinkpaths   r=cJd|jj|jt|fzS)Nz<%s %r at %#x>) __class__rridrs r;__repr__zTarInfo.__repr__s!4>#:49RXX"NNNr=c&|j|jdz|j|j|j|j|j|j|j|j |j |j |j d }|dtkr+|dds|dxxdz cc<|S)z9Return the TarInfo's attributes as a dictionary. ) rrr"r#r r!rMrNrOr$r%rPrQrNr/)rrr"r#r r!rMrNrOr$r%rPrQDIRTYPEr)rinfos r;get_infozTarInfo.get_infos  F*            <7 " "4<+@+@+E+E " LLLC LLL r=surrogateescapec|}|tkr||||S|tkr||||S|t kr|||Std)zNPXZ`aa aCT((z8VLLLLr=ct|d<|j}ddtfddtfddfD]h\}}}||vr ||dd n#t $r||||<Y@wxYwt|||kr ||||<id D]Y\}}||vrd ||<||}d |cxkr d |d z zkrnnt|trt|||<d ||<Z|r| |t|} nd} | | |tddzS)zReturn the object as a ustar header block. If it cannot be represented this way, prepend a pax extended header sequence with supplement information. rurrrOr)r$r$r-)r%r%r-rErF))r"r/)r#r/)r )r!rrr/rr=r)rwrRcopyryrxr4UnicodeEncodeErrorr5 isinstancefloatstr_create_pax_generic_headerXHDTYPEr{rn) rrjr9rRrhnamer8r[valrfs r;rrzTarInfo.create_pax_headers $W &++-- - J /T&(>$@ 0 0 D% ## T !!'84444%   %)$Z E" 4:''%)$Z E"R  LD&{""T t*C////aFQJ//////:c53I3I/$'HH D!T   11+wQQCCCT((|WiPPPPsA##A;:A;c:||tdS)zAReturn the object as a pax global header block sequence. utf8)rXGLTYPE)clsrRs r;create_pax_global_headerz TarInfo.create_pax_global_headerDs--k7FKKKr=c|dtdz}|r$|ddkr|dd}|r |ddk|t|d}|dd}|rt|tkrtd||fS)zUSplit a name longer than 100 chars into a prefix and a name part. Nrr?rhzname is too long) LENGTH_PREFIXr5ryrJ)rrrvs r;rzzTarInfo._posix_split_nameJs(}q(() !s**CRC[F !s**CKKLL! 1T[00/00 0t|r=ct|ddd||t|dddzd|t|ddd|t|d dd|t|d dd |t|d dd |d |dtt|ddd|||dtt|ddd||t|ddd||t|ddd|t|ddd|t|ddd||g}t jdtzd|}t|t dd}|ddd|z dz|ddz}|S)zReturn a header block. info is a dictionary with file information, format must be one of the *_FORMAT constants. rrr rrrgr/r"r#r rr!s rNrOrur$r-r%rPrQrvr z%dsr=Niz%06orEi) r<getr]rVrwrVrXrrrir4)rjr\r9r:partsrfrMs r;r{zTarInfo._create_headerYs $$c8V < < ##f,a 8 8 ""Av . . ""Av . . ##R 0 0 !$$b& 1 1  HHVW % % R((#x @ @ HHWk * * "%%r8V < < "%%r8V < < Q''F 3 3 Q''F 3 3 2&&Xv > > $k%)+SXXe__==c9*++.//2%4%jHv-55g>>>TUUK r=ctt|t\}}|dkr|t|z tzz }|S)zdReturn the string payload filled with zero bytes up to the next 512 byte border. r)rmr5rr6)payloadrrrss r;_create_payloadzTarInfo._create_payloadus@ #3w<<;; q==  I-4 4Gr=c|||tz}i}d|d<||d<t||d<t|d<||t ||||zS)zTReturn a GNUTYPE_LONGNAME or GNUTYPE_LONGLINK sequence for name. z ././@LongLinkrrNr ru)r4r6r5r}r{rnr)rrrNr9r:rjs r;r~zTarInfo._create_gnu_long_headers {{8V,,s2&V V 4yyV !W !!$ hGG##D))* *r=cd}|D]/\}} |dd#t$rd}YnwxYwd}|r|dz }|D]\}}|d}|r||d}n|d}t|t|zdz}d x} } |tt | z} | | krn| } )|t t | d d z|zd z|zd zz }i} d| d<|| d<t|| d<t | d<|| td d| |zS)zReturn a POSIX.1-2008 extended or global header sequence that contains a list of keyword, value pairs. The values must be strings. FrrFTr=s21 hdrcharset=BINARY rlrrrE =r;z././@PaxHeaderrrNr rur) itemsr4rr5rbytesrwr{rnr) rrRrNr9binarykeywordvaluerecordsrSrNrBrjs r;rz"TarInfo._create_pax_generic_headers)//11  NGU  VX....%      1 0 0G)//11 V VNGUnnV,,G - X/@AA V,,G s5zz)A-AIA CFF O66   uSVVW--4w>EMPUU UGG'V V 7||V #W !!$ gyII##G,,- -s4 AAct|dkrtdt|tkrtd|t tkrt dt|dd}|t|vrtd|}t|dd|||_ t|dd |_ t|d d |_ t|d d |_t|d d |_t|d d|_||_|dd |_t|d d|||_t|dd|||_t|dd|||_t|dd|_t|dd|_t|dd||}|jt0kr&|j dr t4|_|jt6krd}g}t9dD]h} t|||dz} t||dz|dz} n#t:$rYn!wxYw|| | f|dz }it?|d} t|dd} || | f|_ |!r|j "d|_ |r |jtFvr|dz|j z|_ |S)zAConstruct a TarInfo object from a 512 byte bytes object. rz empty headerztruncated headerzend of file headerr`rbz bad checksumr lt|ii i)iIiQiYirhir0riii)$r5rrrcountr6rrPrirKrCrrr"r#r r!rMrNrOr$r%rPrQAREGTYPErriGNUTYPE_SPARSErLrJrboolrSisdirrstrip GNU_TYPES)rrfr9r:rMobjrvrstructsrOrnumbytes isextendedorigsizes r;frombufzTarInfo.frombufsF s88q==">22 2 s88y &'9:: : 99S>>Y & & !566 6SS\"" c** * *$^44 4cees1S5z8V44s3s7|$$c#c'l##c#c'l##s3s7|$$CG %%  s3w<3s3w<6:: CG h77 CG h77 3s3w<(( 3s3w<(( SS\8V44 8x  CH$5$5c$:$: CH 8~ % %CG1XX   Sr\!233F"3sRxb'8#9::HH!EE1222r c#hJ3s3w<((H#*J"AC  99;; ,xs++CH  /chi//|ch.CH s7J<< K  K c|jt}|||j|j}|jtz |_||S)zOReturn the next TarInfo object from TarFile object tarfile. ) rrkrrr9r:rr _proc_member)rr/rfrs r; fromtarfilezTarInfo.fromtarfilesa o""9--kk#w/@@_))++i7 (((r=c*|jttfvr||S|jtkr||S|jt ttfvr| |S| |S)zYChoose the right processing method depending on the type and call it. ) rNrr _proc_gnulongr _proc_sparserrSOLARIS_XHDTYPE _proc_pax _proc_builtinrr/s r;rzTarInfo._proc_members 9)+;< < <%%g.. . Y. ( ($$W-- - Y7G_= = =>>'** *%%g.. .r=c(|j|_|j}|s|jt vr|||jz }||_| |j |j |j |S)zfProcess a builtin type or an unknown type which will be treated as a regular file. ) rrr,isregrNSUPPORTED_TYPES_blockr r_apply_pax_inforRr9r:)rr/rs r;rzTarInfo._proc_builtin$s#?//11! ::<< -49O;; dkk$),, ,F W0'2BGNSSS r=c|j||j} ||}n#t $rt dwxYw|j|_|jtkr!t||j |j |_ n0|jtkr t||j |j |_|S)zSProcess the blocks that hold a GNU longname or longlink member. missing or bad subsequent header)rrkrr rrrrrNrrCr9r:rrrO)rr/rfnexts r;rzTarInfo._proc_gnulong5so""4;;ty#9#9:: L##G,,DD L L L'(JKK K L k 9( ( (C!17>BBDII Y* * *W%5w~FFDM s A A$c2|j\}}}|`|r|jt}d}t dD]l} t |||dz}t ||dz|dz} n#t $rYn%wxYw|r| r||| f|dz }mt|d}|||_ |j |_ |j | |j z|_||_ |S)z8Process a GNU sparse header plus extra headers. rrri)rSrrkrrLrPrJrrr-rr,rr r) rr/rrrrfrrOrrs r;rzTarInfo._proc_sparseKsF)-(<%X   (/&&y11CC2YY   Sr\!233F"3sRxb'8#9::HH!EE7h7NNFH#5666r c#hJ ( "?//11)DKK ,B,BB  s7A;; B B c(|j||j}|jt kr|j}n|j}tj d|}|+| d d|d<| d}|dkr|j }nd}tjd}d} |||}|sn|\} } t#| } ||d dz|d| zdz } || dd|j} | t,vr#|| ||j |j} n|| dd|j} | || <|| z } ||} n#t0$rt3d wxYwd |vr|| |ned |vr|| ||nI| ddkr0| ddkr|| |||jt:t<fvr~| ||j |j|j | _ d|vrM| j!} | "s| jtFvr| | | jz } | |_ | S)zVProcess an extended or global header as described in POSIX.1-2008. s\d+ hdrcharset=([^\n]+)\nNrr hdrcharsetBINARYs(\d+) ([^=]+)=rTrrGNU.sparse.mapGNU.sparse.sizezGNU.sparse.major1zGNU.sparse.minorrGr )$rrkrr rNrrRrresearchgrouprArr9compilematchgroupsrIendr'_decode_pax_fieldr:PAX_NAME_FIELDSrrr_proc_gnusparse_01_proc_gnusparse_00_proc_gnusparse_10rrrrr,rr)rr/rfrRrrr9regexrr8rrrrs r;rzTarInfo._proc_paxgs= o""4;;ty#9#9:: 9  !-KK!-2244K 7==  (- A(=(=f(E(EK % !__\22  ! !'HHH  -.. KKS))E #llnnOFG[[F ! q(Q&)@1)DDEE,,WffN$$G/))..uh@P((..uff(($)K 6MC5 : L##G,,DD L L L'(JKK K L { * *  # #D+ 6 6 6 6 + - -  # #D+s ; ; ; ; __/ 0 0C 7 7KOOL^<_<_cf O O O+DK$$)::<<549O#C#Cdkk$)444F!' s G""G<cg}tjd|D]7}|t|d8g}tjd|D]7}|t|d8t t |||_dS)z?Process a GNU tar extended sparse header, version 0.0. s\d+ GNU.sparse.offset=(\d+)\nrs\d+ GNU.sparse.numbytes=(\d+)\nN)rfinditerrrIrlistzipr-)rrrRrfoffsetsrrs r;rzTarInfo._proc_gnusparse_00s[!BCHH 0 0E NN3u{{1~~.. / / / /[!DcJJ 1 1E OOC A// 0 0 0 03w1122 r=c d|ddD}tt|ddd|ddd|_dS)z?Process a GNU tar extended sparse header, version 0.1. c,g|]}t|Sr)rI).0r|s r; z.TarInfo._proc_gnusparse_01..sKKKQ#a&&KKKr=r,Nrr)splitrrr-)rrrRr-s r;rzTarInfo._proc_gnusparse_01s]LK+.>"?"E"Ec"J"JKKK3vccc{F14a4L99:: r=c Zd}g}|jt}|dd\}}t |}t ||dzkrwd|vr"||jtz }|dd\}}|t |t ||dzkw|j|_tt|ddd|ddd|_ dS)z?Process a GNU tar extended sparse header, version 1.0. Nr;rr) rrkrrrIr5rrr,rrr-)rrrRr/fieldsr-rfnumbers r;rzTarInfo._proc_gnusparse_10so""9--iiq)) V&kkFQJ&&Cw++I666))E1--KFC MM#f++ & & & &kkFQJ&& #?//113vccc{F14a4L99:: r=c|D]\}}|dkrt|d||dkrt|dt|B|dkrt|dt|g|tvr^|tvr) t ||}n#t $rd}YnwxYw|dkr|d}t|||||_dS) zoReplace fields with supplemental information from a previous pax extended or global header. zGNU.sparse.namerrr zGNU.sparse.realsizerrhN) rsetattrrI PAX_FIELDSPAX_NUMBER_FIELDSrJrrrR)rrRr9r:rrs r;rzTarInfo._apply_pax_infos/*//11 . .NGU+++fe,,,,---fc%jj1111111fc%jj1111J&&///" 1' :5 A A%""" !"f$$!LL--Egu---&++--sB%% B43B4c| ||dS#t$r|||cYSwxYw)z1Decode a single field from a pax record. rF)rAUnicodeDecodeError)rrr9fallback_encodingfallback_errorss r;rzTarInfo._decode_pax_fieldsV D<<(33 3! D D D<< 1?CC C C C Ds  ;;cTt|t\}}|r|dz }|tzS)z_Round up a byte count by BLOCKSIZE and return it, e.g. _block(834) => 1024. r)rmr)rrrrrss r;rzTarInfo._block s4#5)44   aKF !!r=c|jtvSr)rN REGULAR_TYPESrs r;rz TarInfo.isregsyM))r=c*|Sr)rrs r;isfilezTarInfo.isfileszz||r=c"|jtkSr)rNrirs r;rz TarInfo.isdiryG##r=c"|jtkSr)rNSYMTYPErs r;issymz TarInfo.issymrr=c"|jtkSr)rNLNKTYPErs r;islnkz TarInfo.islnkrr=c"|jtkSr)rNCHRTYPErs r;ischrz TarInfo.ischr rr=c"|jtkSr)rNBLKTYPErs r;isblkz TarInfo.isblk"rr=c"|jtkSr)rNFIFOTYPErs r;isfifozTarInfo.isfifo$syH$$r=c|jduSr)r-rs r;issparsezTarInfo.issparse&s{$&&r=c8|jtttfvSr)rNrrrrs r;isdevz TarInfo.isdev(syWgx888r=N)r)4rrrr __slots__rrZr\propertyrr_rarrerkDEFAULT_FORMATENCODINGrsrorprr classmethodrrz staticmethodr{rr~rrrrrrrrrrrrrrrrrrrrrr r r rr=r;rrs ?I 4 8Hh ' 'D!!!x l33HOOO0*HEV / / / / I I I M M M/Q/Q/QbLL[L   \6\**[* 0-0-[0-d<<[<|))[)( / / /",8dddL 3 3 3;;; ;;; ....DDD"""***$$$$$$$$$$$$$$$%%%'''99999r=rc~eZdZdZdZdZdZdZeZ e Z dZ e ZeZ d3dZedddefd Zed4d Zed5d Zed5d ZddddZdZdZdZdZd6dZd7dZd8dZd9dZ d:dZ!d;dZ"dZ#d7d Z$d!Z%d"Z&d#Z'd$Z(d%Z)d&Z*d'Z+d(Z,d)Z-d*Z.d#AL :4H/.L /)JL  J#I??JBL *L7c R|s|std|dvr|jD]u}t||j|}||} ||d|fi|cS#tt f$r!} |||Yd} ~ nd} ~ wwxYwt dd|vrc|dd\} }| pd} |pd}||jvrt||j|}nt d |z||| |fi|Sd |vrw|d d\} }| pd} |pd}| d vrtd t|| |||} ||| | fi|} n#| xYwd | _ | S|dvr|j |||fi|Std)a|Open a tar archive for reading, writing or appending. Return an appropriate TarFile class. mode: 'r' or 'r:*' open for reading with transparent compression 'r:' open for reading exclusively uncompressed 'r:gz' open for reading with gzip compression 'r:bz2' open for reading with bzip2 compression 'a' or 'a:' open for appending, creating the file if necessary 'w' or 'w:' open for writing without compression 'w:gz' open for writing with gzip compression 'w:bz2' open for writing with bzip2 compression 'r|*' open a stream of tar blocks with transparent compression 'r|' open an uncompressed stream of tar blocks for reading 'r|gz' open a gzip compressed stream of tar blocks 'r|bz2' open a bzip2 compressed stream of tar blocks 'w|' open an uncompressed stream for writing 'w|gz' open a gzip compressed stream for writing 'w|bz2' open a bzip2 compressed stream for writing znothing to open)ryzr:*Nryz%file could not be opened successfully:rrzunknown compression type %r|rwmode must be 'r' or 'w'Frzundiscernible mode) rJ OPEN_METHrrrrrrrrrtaropen) rrrrrkwargsrfunc saved_posr'rstreamr}s r;rz TarFile.opensR0 0G 0.// / <  M  sCM($;<<& ' I4c7==f=====!#34* Y///HHHHCDD D D[[!%C!3!3 Hh3H(5H3=((sCM($;<<&'Dx'OPPP4h::6:: : D[[!%C!3!3 Hh3H(5Ht## !:;;;T8XwHHF Ch99&99  !AMH T\\3;tT7==f== =-...s$ A  B1B  B E##E:c dt|dks|dvrtd||||fi|S)zCOpen uncompressed tar archive name for reading or writing. rrr)r5rJ)rrrrr/s r;r.zTarFile.taropensH t99q==D--;<< <s4w11&111r=rc t|dks|dvrtd ddl}|jn$#tt f$rt dwxYw|du} |||dz||}|j|||fi|}nQ#t$r+|s|| |td|s|| xYw||_ |S) zkOpen gzip compressed tar archive name for reading or writing. Appending is not allowed. rr+r,rNzgzip module is not availablertr) r5rJgzipGzipFilerAttributeErrorrr.rnrrr) rrrr compresslevelr/r5 extfileobjr}s r;gzopenzTarFile.gzopens7 t99q==D,,677 7 C KKK MMM^, C C C"#ABB B CD(  mmD$*mWMMG D$::6::AA / / / '"5 -.. .  '"5  " s 4!A+B ACc t|dks|dvrtd ddl}n#t$rt dwxYw|t ||}n||||} |j|||fi|}n8#ttf$r$| tdwxYwd |_ |S) zlOpen bzip2 compressed tar archive name for reading or writing. Appending is not allowed. rr+zmode must be 'r' or 'w'.rNr)r8znot a bzip2 fileF) r5rJrrrrBZ2Filer.rnEOFErrorrrr)rrrrr8r/rr}s r;bz2openzTarFile.bz2open$s  t99q==D,,788 8 B JJJJ B B B"#@AA A B  ..GGkk$MkJJG 0 D$::6::AA" 0 0 0 MMOOO.// / 0 s-A6B5B<r.r:r>)rrrc|jrdS|jdvr|jtt dzz|xjt dzz c_t|jt\}}|dkr*|jtt|z z|j s|j d|_dS)zlClose the TarFile. In write-mode, two finishing zero blocks are appended to the archive. NrrrT) rrrrlr6rrrm RECORDSIZErr)rrrrss r;rz TarFile.closeHs ;  F 9   L  si!m4 5 5 5 KKIM *KK!'t{J ? ? FI1}} ""3*y*@#ABBB ! L    r=cX||}|td|z|S)aReturn a TarInfo object for member `name'. If `name' can not be found in the archive, KeyError is raised. If a member occurs more than once in the archive, its last occurrence is assumed to be the most up-to-date version. Nzfilename %r not found) _getmemberKeyError)rrr0s r; getmemberzTarFile.getmember\s3 //$'' ?2T9:: :r=cn||js||jS)zReturn the members of the archive as a list of TarInfo objects. The list has the same order as the members in the archive. )_checkr$_loadr#rs r; getmemberszTarFile.getmembersgs0 |  JJLLL|r=c>d|DS)zReturn the members of the archive as a list of their names. It has the same order as the list returned by getmembers(). cg|] }|j SrrY)rr0s r;rz$TarFile.getnames..us>>> >>>r=)rHrs r;getnameszTarFile.getnamesqs"?>DOO,=,=>>>>r=c|d||j}||}tj|\}}|tjd}|d}|}||_ |Fttdr|j stj |}n;tj |}n&tj|}d}|j}tj|ri|j|jf} |j s:|jdkr/| |jvr&||j| krt,} |j| }nt.} | dr ||j| <ntj|rt2} ntj|rt6} njtj|rt:} tj|}n:tj|rt@} ntj!|rtD} ndS||_||_#|j$|_%|j&|_'| t.kr |j(|_)nd|_)|j*|_+| |_,||_-t\r6 t]j/|j%d|_0n#tb$rYnwxYwtdr6 tej3|j'd|_4n#tb$rYnwxYw| t@tDfvrfttdrQttd rzlink to)rFprintrrr$r"r%r#rrrPrQr r localtimer!rrrrOr)rverboser0s r;rz TarFile.lists   G Dhw|,,#6666!='+!=!=!(!='+!=?DGIIII==??:gmmoo:&G'.'79I&J%KLQTVVVVV&7</S99993w}55bqb9:?BDDDD ',"@##bAs K K K K @==??;$ 0c::::==??@)W%53???? GGGG)  r=cD|d||}|Fddl}|dtd||r|dd|zdS|jCt j||jkr|dd|zdS|d|| ||}||dd |zdS|(||}||dd|zdS| r ? ? ? F  fWooG !3d:;;; ==?? "$%%A LL! $ $ $ GGIIIII ]]__ " LL ! ! ! ?D))??AHHRW\\$22BGLL!4L4L%wv???? ? ??? LL ! ! ! ! !r=cT|dtj|}||j|j|j}|j||xjt|z c_|t||j|j t|j t\}}|dkr/|jtt|z z|dz }|xj|tzz c_|j|dS)a]Add the TarInfo object `tarinfo' to the archive. If `fileobj' is given, tarinfo.size bytes are read from it and added to the archive. You can create TarInfo objects using gettarinfo(). On Windows platforms, `fileobj' should always be opened with mode 'rb' to avoid irritation about the file size. rNrr)rFrrsr\r9r:rrlrr5rur rmrr6r#r)rr0rrfrrrss r;r{zTarFile.addfile4s D)G$$mmDK DD 3 s3xx    w| < < < &w|Y ? ? FI1}} ""3)i*?#@AAA!  KK6I- -KK G$$$$$r=.cg}||}|D]q}|r0||tj|}d|_|||| r|d||D]}tj ||j } | ||| ||| ||k#t$r/}|jdkr|dd|zYd}~d}~wwxYwdS)aMExtract all members from the archive to the current working directory and set owner, modification time and permissions on directories afterwards. `path' specifies a different directory to extract to. `members' is optional and must be a subset of the list returned by getmembers(). N set_attrsc|jSrrY)rs r;z$TarFile.extractall..dsqvr=)keyr tarfile: %s)rrrrextractsortreverserrrrchownutimechmodrr"rz)rrr# directoriesr0dirpathr's r; extractallzTarFile.extractallNs ?G G GG}} %""7+++)G,,$ LL$gmmoo2EL F F F F --...# 4 4Ggll466G 4 7G,,, 7G,,, 7G,,,, 4 4 4?Q&&IIa!233333333  4 4 4sAD E %EE rc|dt|tr||}n|}|r*t j||j|_ | |t j||j |dS#t$ri}|j dkr|j|dd|jzn,|dd|jd|jYd}~dSYd}~dSd}~wt"$r0}|j dkr|dd|zYd}~dSd}~wwxYw) axExtract a member from the archive to the current working directory, using its full name. Its file information is extracted as accurately as possible. `member' may be a filename or a TarInfo object. You can specify a different directory using `path'. File attributes (owner, mtime, mode) are set unless `set_attrs' is False. ryrrNrrz tarfile: rq)rFrrrDrrrrrOrT_extract_memberrEnvironmentErrorr"filenamerzstrerrorr)rmemberrrr0r's r;rzTarFile.extractts C fc " " nnV,,GGG ==?? H#%7<<g6F#G#GG  0  "',,tW\*J*J+4 ! 6 6 6 6 6 N N N"":%IIa!;<<<<IIaaQZZZ!LMMMMMMMMM=<<<<< 0 0 0"" !]Q./////////  0s%;B?? E* AD-- E*:%E%%E*c|dt|tr||}n|}|r|||S|jtvr|||S|s| rQt|j trtd| ||SdS)aExtract a member from the archive as a file object. `member' may be a filename or a TarInfo object. If `member' is a regular file, a file-like object is returned. If `member' is a link, a file-like object is constructed from the link's target. If `member' is none of the above, None is returned. The file-like object is read-only and provides the following methods: read(), readline(), readlines(), seek() and tell() ryz'cannot extract (sym)link as file objectN)rFrrrDr fileobjectrNrrrrrr extractfile_find_link_target)rrr0s r;rzTarFile.extractfiles C fc " " nnV,,GGG ==?? ??411 1 \ 0 0??411 1 ]]__   $,00 I""KLLL''(>(>w(G(GHHH4r=c|d}|dtj}tj|}|r3tj|stj||s| r&| d|j d|j n| d|j | r|||n|r|||n|r|||n|s|r|||nz|s| r|||n;|jt0vr|||n||||rX|||| s0||||||dSdSdS)z\Extract the TarInfo object tarinfo to a physical file called targetpath. rhrz -> N)rrrrQrdirnamermakedirsrrrzrrOrmakefilermakedirr makefiforrmakedevmakelinkrNr makeunknownrrr)rr0 targetpathr upperdirss r;rzTarFile._extract_membersZ &&s++ ''RV44 GOOJ//  #RW^^I66 # K " " " ==?? 'gmmoo ' IIaw|||W5E5EF G G G G IIa & & & ==?? / MM': . . . . ]]__ / LL* - - - - ^^   / MM': . . . . ]]__ /  / LL* - - - - ]]__ /  / MM': . . . . \ 0 0   Wj 1 1 1 1 MM': . . .  0 JJw + + +==?? 0 7J/// 7J/////  0 0 0 0r=c tj|ddS#t$r!}|jtjkrYd}~dSd}~wwxYw)z,Make a directory called targetpath. rN)rmkdirrerrnoEEXISTrr0rr's r;rzTarFile.makedirsf  HZ ' ' ' ' '   w%,&&'&&&&& s A?Ac|j}||jt|d}|j4|jD]+\}}||t |||,nt |||j||j||dS)z'Make a file called targetpath. rN) rrr,rr-rur truncater)rr0rsourcetargetrr s r;rzTarFile.makefiles G'(((:t,, > % ' 2 2  F###FFD1111 2  5 5 5 GL!!! r=cn||||dd|jzdS)zYMake a file from a TarInfo object with an unknown type at targetpath. rz9tarfile: Unknown file type %r, extracted as regular file.N)rrzrNrr0rs r;rzTarFile.makeunknown sO gz*** !24;LA B B B B Br=cvttdrtj|dStd)z'Make a fifo called targetpath. mkfifozfifo not supported by systemN)rrrrrs r;rzTarFile.makefifo s; 2x  ? Ij ! ! ! ! !=>> >r=cRttdrttdstd|j}|r|t jz}n|t jz}tj||tj |j |j dS)z?? A A A A Ar=c |rtj|j|nhtj|jrtj|j|n)|| || || ||dS#t$rtdwxYw#t$ri|rJtj tj|j|j}YdS|j}YdSwxYw)zMake a (symbolic) link called targetpath. If it cannot be created (platform limitation), we try to make a copy of the referenced file instead of a link. z%unable to resolve link inside archiveN)rrsymlinkrOrrrTlinkrrrCrsymlink_exceptionrrr)rr0rrs r;rzTarFile.makelink' sg  L}} 5 7+Z88887>>'"6775GG0*====(()?)?)H)H)3555 L$$T%;%;G%D%D%/11111 L L L"#JKKK L! , , ,}} ,7<< (E(E(/(8::#+  ,s%BC")CC"A%E EEcttr+ttdrtjdkr t j|jd}n#t$r |j}YnwxYw tj |j d}n#t$r |j }YnwxYw | r-ttdrtj |||dStjdkrtj|||dSdS#t"$r}t%dd}~wwxYwdSdSdS)z6Set owner of targetpath according to tarinfo. geteuidrrlchownos2emxzcould not change ownerN)rerrrrggetgrnamr%rCr#getpwnamr$r"rrsysplatformrrr)rr0rgur's r;rz TarFile.chownD sj  =72y)) =bjlla.?.? L//2   K  L//2   K  ===??3wr8'<'<3Ij!Q/////|x//Q222220/# = = ="#;<<< =! = = = =.?.?sAAA,+A,0BB$#B$(?D)&D D1D,,D1cttdr> tj||jdS#t$r}t dd}~wwxYwdS)zASet file permissions of targetpath according to tarinfo. rzcould not change modeN)rrrrrrrs r;rz TarFile.chmodZ sm 2w   < <W\22222# < < <"#:;;; < < !>???KK9,KKHHHH& , , ,$,IIat{A.>!>???KK9,KKHHHH[A%%#CFF+++&%%%%# 2 2 2;!###L111$#' , , ,;!###CFF+++$####( ( ( (A''' (    L   ( ( ( (DLsHA,, G6>GcB|}||d||}|rtj|}t |D]:}|r%tj|j}n|j}||kr|cS;dS)z}Find an archive member by name from bottom to top. If tarinfo is given, it is used as the starting point. N)rHindexrrnormpathreversedr)rrr0 normalizer#r member_names r;rBzTarFile._getmember s //##  5w}}W5556G  *7##D))Dw''  F * g..v{;; $k {"" #   r=cF |}|nd|_dS)zWRead through the entire archive file and look for readable members. TN)rr$rr0s r;rGz TarFile._load s. iikkG  r=c|jrtd|jjz| |j|vrtd|jzdSdS)znCheck if TarFile is still open, and if the operation's mode corresponds to TarFile's mode. z %s is closedNzbad operation for mode %r)rrnrcrr)rrs r;rFzTarFile._check s] ; D.4>+BBCC C    5 55 ABB B   5 5r=c|r2tj|jdz|jz}d}n |j}|}|||d}|td|z|S)zZFind the target member of a symlink or hardlink member in the archive. rhNT)r0rzlinkname %r not found)rrrrrrOrBrC)rr0rOlimitrs r;rzTarFile._find_link_target s ==?? ww|44s:W=MMHEE'HE5DII >2X=>> > r=cV|jrt|jSt|S)z$Provide an iterator object. )r$iterr#TarIterrs r;rJzTarFile.__iter__ s* < ! %% %4== r=cV||jkrt|tjdSdS)z.Write debugging output to sys.stderr. )fileN)r!rrrstderr)rlevelmsgs r;rzz TarFile._dbg s4 DJ   #CJ ' ' ' ' ' '  r=c.||Sr)rFrs r; __enter__zTarFile.__enter__ s  r=c||dS|js|jd|_dSr2)rrrr)rrNr tracebacks r;__exit__zTarFile.__exit__ sD < JJLLLLL# % ""$$$DKKKr=) NryNNNNNNrlNNN)ryN)ryNr)NNN)T)NTNNr)rN)rTr5)7rrrrr!rr r"rr\rr9r:rr0r*rrrr@rr.r:r>r-rrDrHrKrorr}r{rrrrrrrrrrrrrrrBrGrFrrJrzrrrr=r;rr,s$ EKLJFH FGJAEHLOS^^^^V#tZI/I/I/[I/V222[2[<[6I(   ??? ````D:<"<"<"<"|%%%%4$4$4$4$4L!0!0!0!0F$$$L)0)0)0)0`    BBB??? A A ALLL:===,<<<EEE,,,b.CCCC&!!!((( r=rc(eZdZdZdZdZdZeZdS)rzMIterator Class. for tarinfo in TarFile(...): suite... c"||_d|_dS)z$Construct a TarIter object. rN)r/rrs r;rzTarIter.__init__ s  r=c|S)z Return iterator object. rrs r;rJzTarIter.__iter__ s  r=c|jjs/|j}|sd|j_tn. |jj|j}n#t $rtwxYw|xjdz c_|S)zReturn the next item using TarFile's next() method. When all members have been read, set TarFile as _loaded. Tr)r/r$r StopIterationr#r IndexErrorrs r;__next__zTarIter.__next__ s|# $l''))G $'+ $## $ $,.tz: $ $ $## $ a s AA'N)rrrrrrJrrrr=r;rr sL   ( DDDr=rcp t|}|dS#t$rYdSwxYw)zfReturn True if name points to a tar archive that we are able to handle, else return False. TF)rrr)rr}s r;rr# sF JJ  t uus #' 55r)w __future__r __version__version __author____date__ __cvsid__ __credits__rrrSrrrVrrrgrerr7NotImplementedErrorr WindowsError NameError__all__ version_info __builtin__builtinsr_openr6rr@r}rwryrxrrVrrrrrrirCONTTYPErrrrrrrnrUrqrrrrrsetrrrIrS_IFLNKS_IFREGrS_IFDIRrS_IFIFOTSUIDTSGIDTSVTXTUREADTUWRITETUEXECTGREADTGWRITETGEXECTOREADTOWRITETOEXECrrgetfilesystemencodingr<rCrPr]rirurr ExceptionrrrrrrrrrrKrobjectrrrrrr*rrrrrrr=r;rs8&%%%%% 6 EO H  OOOOOOOOC###$%89 ,(   D  ; : :A"""""OOO     ^                    HgGXWg#%5! #(>+ /   . #<==                          7lHH(s(**H 000 &&&   "N    6 * * *    <C C C C C C  C C UlC C C C C UlC C C C C UlC C C-6        y        8                x        (        (        {        ;        [                K   F0eeeeefeeeP609$9$9$9$9$9$9$9$~GGGGG&GGGVGGGGG6GGGZN 9N 9N 9N 9N 9fN 9N 9N 9bJJJJJfJJJZ%%%%%f%%%T     |s!> A  A AA! A!PK!̳-*_backport/__pycache__/misc.cpython-311.pycnu[ ^idZddlZddlZgdZ ddlmZn#e$rd dZYnwxYw eZn#e$r ddl m Z dZYnwxYw ej Z dS#e $rd Z YdSwxYw) z/Backports for individual classes and functions.N)cache_from_sourcecallablefsencode)rTc|rdpd}||zS)Nco)py_filedebugexts /builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/_backport/misc.pyrrsm"s})Callablec,t|tS)N) isinstancer)objs r rrs#x(((rct|tr|St|tr&|t jSt dt|jz)Nzexpect bytes or str, not %s) rbytesstrencodesysgetfilesystemencoding TypeErrortype__name__)filenames r rr"sl h & & 5O # & & 5??3#<#>#>?? ?9 NN3455 5r)T) __doc__osr__all__impr ImportErrorr NameError collectionsrrAttributeErrorr rr r%s 65 7 7 7%%%%%%% )HH)))$$$$$$)))))) 5{HHH5555555555s) ##*;;AAAPK!t,_backport/__pycache__/shutil.cpython-311.pycnu[ ^ikddZddlZddlZddlZddlmZddlZ ddlmZn#e $r ddl mZYnwxYwddl Z ddl m Z  ddlZdZn #e $rdZYnwxYw dd lmZn #e $rdZYnwxYw dd lmZn #e $rdZYnwxYwgd ZGd d eZGddeZGddeZGddeZGddeZ en #e$rdZYnwxYwdGdZdZdZ dZ!dZ"dZ#dZ$dZ%dde$dfdZ&dHd Z'd!Z(d"Z)d#Z*d$Z+d%Z, dId'Z-dJd(Z.dKd)Z/e-d*gd+fe-d,gd-fe-d.gd/fe/gd0fd1Z0er e-d,gd-fe0d2<d3Z1dLd5Z2d6Z3 dMd7Z4d8Z5d9Z6 dLd:Z7d;Z8d<Z9d=Z:d>Z;d?d@ge;gd+fdAge;gd/fdBge:gd0fdCZdS)OzUtility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. N)abspath)Callable)tarfileTF)getpwnam)getgrnam) copyfileobjcopyfilecopymodecopystatcopycopy2copytreemovermtreeErrorSpecialFileError ExecError make_archiveget_archive_formatsregister_archive_formatunregister_archive_formatget_unpack_formatsregister_unpack_formatunregister_unpack_formatunpack_archiveignore_patternsceZdZdS)rN)__name__ __module__ __qualname__/builddir/build/BUILDROOT/alt-python311-pip-21.3.1-4.el8.x86_64/opt/alt/python311/lib/python3.11/site-packages/pip/_vendor/distlib/_backport/shutil.pyrr/sDr#rceZdZdZdS)rz|Raised when trying to do a kind of operation (e.g. copying) which is not supported on a special file (e.g. a named pipe)Nrr r!__doc__r"r#r$rr2s;;;;r#rceZdZdZdS)rz+Raised when a command could not be executedNr&r"r#r$rr6s5555r#rceZdZdZdS) ReadErrorz%Raised when an archive cannot be readNr&r"r#r$r*r*9s////r#r*ceZdZdZdS) RegistryErrorzVRaised when a registry operation with the archiving and unpacking registries failsNr&r"r#r$r,r,<s&&&&r#r,@cb ||}|sdS||/)z=copy data from file-like object fsrc to file-like object fdstrN)readwrite)fsrcfdstlengthbufs r$r r Fs9ii  E 3 r#cttjdr2 tj||S#t$rYdSwxYwtjtj|tjtj|kS)NsamefileF)hasattrospathr6OSErrornormcasersrcdsts r$ _samefiler?Nsrw ## 7##C-- -   55  G  RW__S11 2 2 G  RW__S11 2 2 34s< A  A ct||rtd|d|d||fD]R} tj|}tj|jrt d|zC#t$rYOwxYwt|d5}t|d5}t||dddn #1swxYwYddddS#1swxYwYdS)zCopy data from src to dst`z` and `z` are the same filez`%s` is a named piperbwbN) r?rr8statS_ISFIFOst_moderr:openr )r=r>fnstr1r2s r$r r ZscDecccBCCCCj D D DB }RZ(( D&'='BCCC D     D  c4$D #t__ $ d # # # $ $ $ $ $ $ $ $ $ $ $ $ $ $ $$$$$$$$$$$$$$$$$$$sGA.. A;:A;CB<0 C<C CC CCCcttdrDtj|}tj|j}tj||dSdS)zCopy mode bits from src to dstchmodN)r7r8rDS_IMODErFrK)r=r>rImodes r$r r nsTr7 WS\\|BJ'' dr#c.tj|}tj|j}t tdr!tj||j|jft tdrtj||t tdrpt |drb tj ||j dS#t$r6}t tdr|j tj krYd}~dSd}~wwxYwdSdS)zCCopy all stat info (mode bits, atime, mtime, flags) from src to dstutimerKchflagsst_flags EOPNOTSUPPN)r8rDrLrFr7rOst_atimest_mtimerKrPrQr:errnorR)r=r>rIrMwhys r$r r us B < # #Dr72 r{BK0111r7 dr9'"j"9"9  JsBK ( ( ( ( (   E<00  U---.----- s4C D+D  Dctj|r=tj|tj|}t ||t ||dS)zVCopy data and mode bits ("cp src dst"). The destination may be a directory. N)r8r9isdirjoinbasenamer r r<s r$r r e  w}}S7gll3 0 0 5 566 S# S#r#ctj|r=tj|tj|}t ||t ||dS)z]Copy data and all stat info ("cp -p src dst"). The destination may be a directory. N)r8r9rXrYrZr r r<s r$rrr[r#cfd}|S)zFunction that can be used as copytree() ignore parameter. Patterns is a sequence of glob-style patterns that are used to exclude filescg}D]*}|tj||+t|SN)extendfnmatchfilterset)r9names ignored_namespatternpatternss r$_ignore_patternsz)ignore_patterns.._ignore_patternssJ  A AG  w!?!? @ @ @ @=!!!r#r")rgrhs` r$rrs$ """"" r#c xtj|}| |||}nt}tj|g}|D]r} | |vrtj|| } tj|| } tj| r[tj| } |rtj| | nntj | s|r|| | n?tj | rt| | |||n || | #t$r+} | | jdYd} ~ 4d} ~ wt$r0}|| | t#|fYd}~ld}~wwxYw t%||nY#t&$rL}t(t+|t(rn%| ||t#|fYd}~nd}~wwxYw|rt|dS)aRecursively copy a directory tree. The destination directory must not already exist. If exception(s) occur, an Error is raised with a list of reasons. If the optional symlinks flag is true, symbolic links in the source tree result in symbolic links in the destination tree; if it is false, the contents of the files pointed to by symbolic links are copied. If the file pointed by the symlink doesn't exist, an exception will be added in the list of errors raised in an Error exception at the end of the copy process. You can set the optional ignore_dangling_symlinks flag to true if you want to silence this exception. Notice that this has no effect on platforms that don't support os.symlink. The optional ignore argument is a callable. If given, it is called with the `src` parameter, which is the directory being visited by copytree(), and `names` which is the list of `src` contents, as returned by os.listdir(): callable(src, names) -> ignored_names Since copytree() is called recursively, the callable will be called once for each directory that is copied. It returns a list of names relative to the `src` directory that should not be copied. The optional copy_function argument is a callable that will be used to copy each file. It will be called with the source path and the destination path as arguments. By default, copy2() is used, but any function that supports the same signature (like copy()) can be used. Nr)r8listdirrcmakedirsr9rYislinkreadlinksymlinkexistsrXrrr`argsEnvironmentErrorappendstrr r: WindowsError isinstance)r=r>symlinksignore copy_functionignore_dangling_symlinksrdreerrorsnamesrcnamedstnamelinktoerrrVs r$rrsrH JsOOE sE**  K F88 = ',,sD))',,sD)) 8w~~g&& 0W--4Jvw////7>>&11!6N! !M'73333w'' 0'8V]KKKK gw/// ' ' ' MM#(1+ & & & & & & & & 8 8 8 MM7GSXX6 7 7 7 7 7 7 7 7 80c 000  # 3 (E(E #  MM3SXX. / / / 0 FmmsEA,EA E F; E>> F; %F66F;?G H&AH!!H&c|rd}n|d} tj|rtdn>#t$r1|tjj|t jYdSwxYwg} tj|}n=#tj$r+|tj|t jYnwxYw|D]}tj||} tj |j }n#tj$rd}YnwxYwtj |rt|||z tj|#tj$r+|tj|t jYwxYw tj|dS#tj$r,|tj|t jYdSwxYw)aRecursively delete a directory tree. If ignore_errors is set, errors are ignored; otherwise, if onerror is set, it is called to handle the error with arguments (func, path, exc_info) where func is os.listdir, os.remove, or os.rmdir; path is the argument to that function that caused it to fail; and exc_info is a tuple returned by sys.exc_info(). If ignore_errors is false and onerror is None, an exception is raised. cdSr_r"rps r$onerrorzrmtree..onerrors Dr#Ncr_r"rs r$rzrmtree..onerrors r#z%Cannot call rmtree on a symbolic linkr)r8r9rlr:sysexc_inforjerrorrYlstatrFrDS_ISDIRrremovermdir)r9 ignore_errorsrrdr{fullnamerMs r$rrs<         7>>$   CABB B C clnn555 E2 4   8222 D#,..111112 = =7<<d++ 8H%%-DDx   DDD  <   = 8]G 4 4 4 4 = (####8 = = = 8S\^^<<<<< =0  8000$ //////0sW.<7A76A7=B7C  C 4DD"!D" E!!7FFF557G0/G0ctj|tjjSr_)r8r9rZrstripsep)r9s r$ _basenamer*s* 7  DKK 44 5 55r#c|}tj|rt||rtj||dStj|t |}tj|rtd|z tj||dS#t$rtj|rJt||rtd|d|dt||dt|YdSt||tj|YdSwxYw)aRecursively move a file or directory to another location. This is similar to the Unix "mv" command. If the destination is a directory or a symlink to a directory, the source is moved inside the directory. The destination path must not already exist. If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics. If the destination is on our current filesystem, then rename() is used. Otherwise, src is copied to the destination and then removed. A lot more could be done here... A look at a mv.c shows a lot of the issues this implementation glosses over. Nz$Destination path '%s' already existszCannot move a directory 'z' into itself 'z'.T)rv)r8r9rXr?renamerYrrorr: _destinsrcrrrunlink)r=r>real_dsts r$rr/s^"H w}}S K S#    Ic3    F7<<Ys^^44 7>>( # # K>IJJ J  #x      7==   #s## [ePSPSPSUXUXUXYZZZ S(T 2 2 2 2 3KKKKKK #x IcNNNNNNs(B??A0E2$EEcHt|}t|}|tjjs|tjjz }|tjjs|tjjz }||Sr_)rendswithr8r9r startswithr<s r$rrWsv #,,C #,,C << $ $ rw{ << $ $ rw{ >>#  r#cvt|dS t|}n#t$rd}YnwxYw||dSdS)z"Returns a gid, given a group name.N)rKeyErrorr{results r$_get_gidr`\4<t$  ay 4  ,,cvt|dS t|}n#t$rd}YnwxYw||dSdS)z"Returns an uid, given a user name.Nr)rrrs r$_get_uidrlrrgzipcddd}ddi} tr d|d<d| d<|&|| vr"td ||d z| |dz} tj| } tj| s.||d | |st j | ||d ttfd} |sdtj | d||z} | || | n#| wxYw| S)aCreate a (possibly compressed) tar file from all the files under 'base_dir'. 'compress' must be "gzip" (the default), "bzip2", or None. '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_name' + ".tar", possibly plus the appropriate compression extension (".gz", or ".bz2"). Returns the output filename. gz)rNrz.gzbz2bzip2.bz2NzCbad value for 'compress', or compression format not supported : {0}.tar creating %szCreating tar archivecH|_|_|_|_|Sr_)gidgnameuiduname)tarinforgroupownerrs r$ _set_uid_gidz#_make_tarball.._set_uid_gids. ?GK!GM ?GK!GMr#zw|%s)rb)_BZ2_SUPPORTED ValueErrorformatgetr8r9dirnameroinforkrrrrGaddclose) base_namebase_dircompressverbosedry_runrrloggertar_compression compress_ext archive_name archive_dirrtarrrs `` @@r$ _make_tarballrxs $2..OE?L'#( & W < <++16(+;+;== =v% (8(82(F(FFL'//,//K 7>>+ & &%   KK { 3 3 3 % K $ $ $ *+++ 5//C 5//C l</(2K)KLL  GGH\G 2 2 2 IIKKKKCIIKKKK s -EE/c|rd}nd}ddlm}ddlm} |d|||g|dS#|$rt d|zwxYw) Nz-rz-rqr)DistutilsExecError)spawnzip)rzkunable to create zip file '%s': could neither import the 'zipfile' module nor find a standalone zip utility)distutils.errorsrdistutils.spawnrr)r zip_filenamerr zipoptionsrrs r$_call_external_ziprs  333333%%%%%%< uj,97KKKKKK <<<,--/;< <>+ & &%   KK { 3 3 3 % K $ $ $ 8\7GDDDD   KK=$h 0 0 0 //,.5.B"DDC130A0A = =,9%==D7++BGLL$,G,GHHDw~~d++= $---!-"KK t<<< = IIKKK s3A88 BB)rrzgzip'ed tar-file)rrzbzip2'ed tar-file)rNzuncompressed tar filezZIP file)gztarbztarrrrctdtD}||S)zReturns a list of supported formats for archiving and unarchiving. Each element of the returned sequence is a tuple (name, description) c(g|]\}}||dfS)rr").0r{registrys r$ z'get_archive_formats..s1)))~tXhqk")))r#)_ARCHIVE_FORMATSitemssortformatss r$rrs> ))%%'')))G LLNNN Nr#rcR|g}t|tstd|zt|ttfstd|D]@}t|ttfrt |dkrtdA|||ft |<dS)auRegisters an archive format. name is the name of the format. function is the callable that will be used to create archives. If provided, extra_args is a sequence of (name, value) tuples that will be passed as arguments to the callable. description can be provided to describe the format, and will be returned by the get_archive_formats() function. NzThe %s object is not callablez!extra_args needs to be a sequencerz+extra_args elements are : (arg_name, value))rur TypeErrortuplelistlenr)r{function extra_args descriptionelements r$rr s h ) )D7(BCCC j5$- 0 0=;<<<KK'E4=11 KS\\A5E5EIJJ J6F' K@Tr#ct|=dSr_)rr{s r$rr sr#c tj} |M||d|tj|}|stj|| tj}||d} t|} n #t$rtd|zwxYw| d} | dD] \} }|| | < |dkr || d<|| d < | ||fi| }|,||d | tj| n4#|-||d | 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", "bztar" or "gztar". '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')rrzunknown archive format '%s'rrrrrzchanging back to '%s') r8getcwddebugr9rchdircurdirrrr)rrroot_dirrrrrrrsave_cwdkwargs format_infofuncargvalfilenames r$rr#s$y{{H   LL-x 8 8 8GOOI..   HX   9 F 3 3FA&v. AAA6?@@@A q>DNSs  ww4 866v66  ! 4h??? HX     ! 4h??? HX     Os7 BB" D 1D;ctdtD}||S)zReturns a list of supported formats for unpacking. Each element of the returned sequence is a tuple (name, extensions, description) c6g|]\}}||d|dfS)rr")rr{rs r$rz&get_unpack_formats..`s7(((JD$d1gtAw'(((r#)_UNPACK_FORMATSrrrs r$rrZs> (($$&&(((G LLNNN Nr#ci}tD]\}}|dD]}|||<|D]"}||vrd}t||||fz#t|tst ddS)z+Checks what gets registered as an unpacker.rz!%s is already registered for "%s"z*The registered function must be a callableN)r rr,rurr) extensionsrrexisting_extensionsr{rext extensionmsgs r$_check_unpack_optionsres%++--,, d7 , ,C'+  $ $ , HH + + +5Cy':9'E'G!GHH H , h ) )FDEEEFFr#cL|g}t|||||||ft|<dS)aMRegisters an unpack format. `name` is the name of the format. `extensions` is a list of extensions corresponding to the format. `function` is the callable that will be used to unpack archives. The callable will receive archives to unpack. If it's unable to handle an archive, it needs to raise a ReadError exception. If provided, `extra_args` is a sequence of (name, value) tuples that will be passed as arguments to the callable. description can be provided to describe the format, and will be returned by the get_unpack_formats() function. N)rr )r{r rrrs r$rrws:" *h ;;;&*kIODr#ct|=dS)z*Removes the pack format from the registry.N)r rs r$rrsr#ctj|}tj|stj|dSdS)z1Ensure that the parent directory of `path` existsN)r8r9rrXrk)r9rs r$_ensure_directoryrsKgood##G 7== ! ! Gr#c ddl}n#t$rtdwxYw||std|z||} |D]}|j}|dsd|vr#tj j |g| dR}|sPt|| dsp||j}t|d} |||~#|~wxYw |dS#|wxYw)z+Unpack zip `filename` to `extract_dir` rNz/zlib not supported, cannot unpack this archive.z%s is not a zip file/z..rC)rrr* is_zipfilerinfolistrrr8r9rYsplitrrr/rGr0r) r extract_dirrrrr{targetdatafs r$_unpack_zipfilersK KKKIJJJK   h ' ';.9::: //( # #CLLNN  D=Ds## tt||W\+@ 3@@@F  f % % %==%% xx ..&&GGDMMMGGIIIGGIIIHHHH  ,  s-!!B2E1D?)E1?EE11Fc tj|}n%#tj$rtd|zwxYw |||dS#|wxYw)z:Unpack tar/tar.gz/tar.bz2 `filename` to `extract_dir` z/%s is not a compressed or uncompressed tar fileN)rrGTarErrorr* extractallr)rrtarobjs r$_unpack_tarfiler#sJh''  JJJ = HJJ JJ+&&&  s"9A((A>z.tar.gzz.tgzrr)rrrrctD]+\}}|dD]}||r|ccS,dS)Nr)r rr)rr{rrs r$_find_unpack_formatr%sh%++-- da  I  ++     4r#c|tj}|f t|}n0#t$r#t d|wxYw|d}|||fit |ddSt|}|"td|t|d}t t|d}|||fi|dS)aUnpack an archive. `filename` is the name of the archive. `extract_dir` is the name of the target directory, where the archive is unpacked. If not provided, the current working directory is used. `format` is the archive format: one of "zip", "tar", or "gztar". Or any other registered format. If not provided, unpack_archive will use the filename extension and see if an unpacker was registered for that extension. In case none is found, a ValueError is raised. NzUnknown unpack format '{0}'rrzUnknown archive format '{0}') r8rr rrrdictr%r*)rrrrrrs r$rrsikk   K)&1KK K K K:AA&IIJJ J K1~ X{;;d;q>&:&:;;;;;%X.. >:AA(KKLL Lv&q)of-a011 X{--f-----s '-A)r-)FN)rrrNNN)FF)rrN)Nr)NNrrNNN)NN)?r'r8rrDos.pathrracollections.abcrr collectionsrUrrrrpwdrgrpr__all__rqrrrr* Exceptionr,rt NameErrorr r?r r r r rrrrrrrrrrrrrrrrrrrrrrrr#r r%rr"r#r$r0s   %(((((((%%%$$$$$$$$% JJJNNNNNHHHHHH L L L        ;;;;;';;;66666 66600000 000&&&&&I&&& LLLLL 4 4 4$$$(         !&d%&+PPPPd.0.0.0.0b666 &&&P      LM15<<<<|<<<<"----`235G H346I J013J KR , 5!.1F0G 3!5WAAAA*KL;?4444n   FFF$CG')JJJJ, ###J   &!?B8J Kh-D EhZ 8 5!'/2 3 5OG".".".".".".sS! //AA AAA#"A#'A..A87A8C CCPK!E8E8E scripts.pynu[PK!x5g99 rEmanifest.pynu[PK!j#__pycache__/locators.cpython-39.pycnu[PK!=>. _backport/__pycache__/sysconfig.cpython-39.pycnu[PK!mR  - _backport/__pycache__/__init__.cpython-39.pycnu[PK! N22, _backport/__pycache__/tarfile.cpython-39.pycnu[PK!yhhx _backport/sysconfig.pynu[PK!o9 9 % _backport/sysconfig.cfgnu[PK!DBCii$0 _backport/tarfile.pynu[PK!#g< _backport/__init__.pynu[PK!y}}  markers.pynu[PK!ՀD*D* J resources.pynu[PK!]oEE  __init__.pynu[PK!J wheel.pynu[PK!@css A database.pynu[PK!7Y99$K__pycache__/metadata.cpython-312.pycnu[PK!bC#|__pycache__/markers.cpython-312.pycnu[PK!," __pycache__/compat.cpython-312.pycnu[PK!3::$__pycache__/manifest.cpython-312.pycnu[PK!,iviv#__pycache__/version.cpython-312.pycnu[PK! S$tp__pycache__/database.cpython-312.pycnu[PK! M M#p__pycache__/scripts.cpython-312.pycnu[PK!X^^!3__pycache__/index.cpython-312.pycnu[PK!ܒ$a__pycache__/__init__.cpython-312.pycnu[PK!AقWW "__pycache__/util.cpython-312.pycnu[PK!ܯ]""!z__pycache__/wheel.cpython-312.pycnu[PK!XbCC%H__pycache__/resources.cpython-312.pycnu[PK!y$__pycache__/locators.cpython-312.pycnu[PK!-D  uw64-arm.exenu[PK!``-w32.exenu[PK!dhw64.exenu[PK!z t64-arm.exenu[PK!y!sָt64.exenu[PK!zz Wt32.exenu[PK!"gg D version.pycnu[PK!rjz/z/ 8!manifest.pycnu[PK!~== Qh!__init__.pyonu[PK!* m!compat.pyonu[PK!. "metadata.pyonu[PK!"\N\N "index.pycnu[PK!bޑ66 "resources.pycnu[PK!bG |#markers.pycnu[PK!V 7#compat.pycnu[PK!:Yn #database.pycnu[PK!zoo $markers.pyonu[PK!bޑ66 $resources.pyonu[PK!t(x$_backport/__init__.pyonu[PK!l>$_backport/misc.pyonu[PK!"ND7D7W$_backport/tarfile.pycnu[PK!;VgVg)&_backport/shutil.pycnu[PK!"ND7D7z&_backport/tarfile.pyonu[PK!਱BQBQ'_backport/sysconfig.pycnu[PK!q@SQQ(_backport/sysconfig.pyonu[PK!l>k(_backport/misc.pycnu[PK!t(q(_backport/__init__.pycnu[PK!;VgVgs(_backport/shutil.pyonu[PK!:}yy N(wheel.pycnu[PK!F22_backport/__pycache__/shutil.cpython-35.pycnu[PK!:l.DD.'?_backport/__pycache__/sysconfig.cpython-35.pycnu[PK!M!||'l?__pycache__/compat.cpython-36.opt-1.pycnu[PK!D ' '(?__pycache__/scripts.cpython-36.opt-1.pycnu[PK!O1'').@__pycache__/manifest.cpython-36.opt-1.pycnu[PK!uQQ(79@__pycache__/version.cpython-36.opt-1.pycnu[PK!*(*(#@__pycache__/manifest.cpython-36.pycnu[PK!̒1yiyi#@__pycache__/metadata.cpython-36.pycnu[PK!#(`A__pycache__/markers.cpython-36.opt-1.pycnu[PK!//1NN)4A__pycache__/locators.cpython-36.opt-1.pycnu[PK!D ' '">A__pycache__/scripts.cpython-36.pycnu[PK!ҐCC A__pycache__/index.cpython-36.pycnu[PK!'iQQ"}6B__pycache__/version.cpython-36.pycnu[PK!B||!B__pycache__/compat.cpython-36.pycnu[PK!^N*N**C__pycache__/resources.cpython-36.opt-1.pycnu[PK!_.mWW%>0C__pycache__/util.cpython-36.opt-1.pycnu[PK!Lmaa C__pycache__/wheel.cpython-36.pycnu[PK!kxx#?D__pycache__/locators.cpython-36.pycnu[PK!֮֮D__pycache__/util.cpython-36.pycnu[PK!B`NN)E__pycache__/database.cpython-36.opt-1.pycnu[PK!B`NN#R*F__pycache__/database.cpython-36.pycnu[PK!^N*N*$F__pycache__/resources.cpython-36.pycnu[PK!|#F__pycache__/__init__.cpython-36.pycnu[PK!|)F__pycache__/__init__.cpython-36.opt-1.pycnu[PK!hQ2i2i)G__pycache__/metadata.cpython-36.opt-1.pycnu[PK!Ku{aFF"RkG__pycache__/markers.cpython-36.pycnu[PK!ҐCC&G__pycache__/index.cpython-36.opt-1.pycnu[PK!o|7a7a&G__pycache__/wheel.cpython-36.opt-1.pycnu[PK!-VM>M>.](H_backport/__pycache__/sysconfig.cpython-36.pycnu[PK!ۨO/gH_backport/__pycache__/misc.cpython-36.opt-1.pycnu[PK!T3)GkH_backport/__pycache__/misc.cpython-36.pycnu[PK!A-oH_backport/__pycache__/__init__.cpython-36.pycnu[PK!A3hqH_backport/__pycache__/__init__.cpython-36.opt-1.pycnu[PK!k_n>>4VsH_backport/__pycache__/sysconfig.cpython-36.opt-1.pycnu[PK!BB$ӱH__pycache__/manifest.cpython-311.pycnu[PK!`Rnn#H__pycache__/markers.cpython-311.pycnu[PK!1h$I__pycache__/__init__.cpython-311.pycnu[PK!/sg!I__pycache__/wheel.cpython-311.pycnu[PK!zhzh!J__pycache__/index.cpython-311.pycnu[PK!!m5Q5Q#jJ__pycache__/scripts.cpython-311.pycnu[PK!u 4J__pycache__/util.cpython-311.pycnu[PK!z("o@L__pycache__/compat.cpython-311.pycnu[PK!-$hM__pycache__/locators.cpython-311.pycnu[PK!Y6$|N__pycache__/database.cpython-311.pycnu[PK!kzg$&O__pycache__/metadata.cpython-311.pycnu[PK!bCC#O__pycache__/version.cpython-311.pycnu[PK!eJeJ%feP__pycache__/resources.cpython-311.pycnu[PK!61zz/ P_backport/__pycache__/sysconfig.cpython-311.pycnu[PK!L)).*Q_backport/__pycache__/__init__.cpython-311.pycnu[PK!亅- -Q_backport/__pycache__/tarfile.cpython-311.pycnu[PK!̳-*]R_backport/__pycache__/misc.cpython-311.pycnu[PK!t,R_backport/__pycache__/shutil.cpython-311.pycnu[PKaF)S