�ɲɾ�����ӯ�����һ��ˣ��������С���˴��ͣ�������P���ҹ��ñ˽��ά�Բ��������˸߸ԣ�������ơ��ҹ��ñ�����ά�Բ���ˡ���˳^�ӣ������ӡ� ���ͯj�ӣ��ƺ���ӣ� ? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!? PNG ?%k25u25%fgd5n!dictconfig.py000064400000055070152527625730007254 0ustar00# This is a copy of the Python logging.config.dictconfig module, # reproduced with permission. It is provided here for backwards # compatibility for Python versions prior to 2.7. # # Copyright 2009-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permission notice appear in # supporting documentation, and that the name of Vinay Sajip # not be used in advertising or publicity pertaining to distribution # of the software without specific, written prior permission. # VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING # ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL # VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR # ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER # IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT # OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. from __future__ import absolute_import import logging.handlers import re import sys import types from pip._vendor import six # flake8: noqa 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 # # This function is defined in logging only in recent versions of Python # try: from logging import _checkLevel except ImportError: def _checkLevel(level): if isinstance(level, int): rv = level elif str(level) == level: if level not in logging._levelNames: raise ValueError('Unknown level: %r' % level) rv = logging._levelNames[level] else: raise TypeError('Level not an integer or a ' 'valid string: %r' % level) return rv # 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 = __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, six.string_types): # str for py3k 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 hasattr(c, '__call__') and hasattr(types, 'ClassType') and type(c) != types.ClassType: 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 class DictConfigurator(BaseConfigurator): """ Configure logging using a dictionary-like object to describe the configuration. """ def configure(self): """Do the configuration.""" config = self.config if 'version' not in config: raise ValueError("dictionary doesn't specify a version") if config['version'] != 1: raise ValueError("Unsupported version: %s" % config['version']) incremental = config.pop('incremental', False) EMPTY_DICT = {} logging._acquireLock() try: if incremental: handlers = config.get('handlers', EMPTY_DICT) # incremental handler config only if handler name # ties in to logging._handlers (Python 2.7) if sys.version_info[:2] == (2, 7): for name in handlers: if name not in logging._handlers: raise ValueError('No handler found with ' 'name %r' % name) else: try: handler = logging._handlers[name] handler_config = handlers[name] level = handler_config.get('level', None) if level: handler.setLevel(_checkLevel(level)) except StandardError as e: raise ValueError('Unable to configure handler ' '%r: %s' % (name, e)) loggers = config.get('loggers', EMPTY_DICT) for name in loggers: try: self.configure_logger(name, loggers[name], True) except StandardError as e: raise ValueError('Unable to configure logger ' '%r: %s' % (name, e)) root = config.get('root', None) if root: try: self.configure_root(root, True) except StandardError as e: raise ValueError('Unable to configure root ' 'logger: %s' % e) else: disable_existing = config.pop('disable_existing_loggers', True) logging._handlers.clear() del logging._handlerList[:] # Do formatters first - they don't refer to anything else formatters = config.get('formatters', EMPTY_DICT) for name in formatters: try: formatters[name] = self.configure_formatter( formatters[name]) except StandardError as e: raise ValueError('Unable to configure ' 'formatter %r: %s' % (name, e)) # Next, do filters - they don't refer to anything else, either filters = config.get('filters', EMPTY_DICT) for name in filters: try: filters[name] = self.configure_filter(filters[name]) except StandardError as e: raise ValueError('Unable to configure ' 'filter %r: %s' % (name, e)) # Next, do handlers - they refer to formatters and filters # As handlers can refer to other handlers, sort the keys # to allow a deterministic order of configuration handlers = config.get('handlers', EMPTY_DICT) for name in sorted(handlers): try: handler = self.configure_handler(handlers[name]) handler.name = name handlers[name] = handler except StandardError as e: raise ValueError('Unable to configure handler ' '%r: %s' % (name, e)) # Next, do loggers - they refer to handlers and filters # we don't want to lose the existing loggers, # since other threads may have pointers to them. # existing is set to contain all existing loggers, # and as we go through the new configuration we # remove any which are configured. At the end, # what's left in existing is the set of loggers # which were in the previous configuration but # which are not in the new configuration. root = logging.root existing = list(root.manager.loggerDict) # The list needs to be sorted so that we can # avoid disabling child loggers of explicitly # named loggers. With a sorted list it is easier # to find the child loggers. existing.sort() # We'll keep the list of existing loggers # which are children of named loggers here... child_loggers = [] # now set up the new ones... loggers = config.get('loggers', EMPTY_DICT) for name in loggers: if name in existing: i = existing.index(name) prefixed = name + "." pflen = len(prefixed) num_existing = len(existing) i = i + 1 # look at the entry after name while (i < num_existing) and\ (existing[i][:pflen] == prefixed): child_loggers.append(existing[i]) i = i + 1 existing.remove(name) try: self.configure_logger(name, loggers[name]) except StandardError as e: raise ValueError('Unable to configure logger ' '%r: %s' % (name, e)) # Disable any old loggers. There's no point deleting # them as other threads may continue to hold references # and by disabling them, you stop them doing any logging. # However, don't disable children of named loggers, as that's # probably not what was intended by the user. for log in existing: logger = root.manager.loggerDict[log] if log in child_loggers: logger.level = logging.NOTSET logger.handlers = [] logger.propagate = True elif disable_existing: logger.disabled = True # And finally, do the root logger root = config.get('root', None) if root: try: self.configure_root(root) except StandardError as e: raise ValueError('Unable to configure root ' 'logger: %s' % e) finally: logging._releaseLock() def configure_formatter(self, config): """Configure a formatter from a dictionary.""" if '()' in config: factory = config['()'] # for use in exception handler try: result = self.configure_custom(config) except TypeError as te: if "'format'" not in str(te): raise # Name of parameter changed from fmt to format. # Retry with old name. # This is so that code can be used with older Python versions #(e.g. by Django) config['fmt'] = config.pop('format') config['()'] = factory result = self.configure_custom(config) else: fmt = config.get('format', None) dfmt = config.get('datefmt', None) result = logging.Formatter(fmt, dfmt) return result def configure_filter(self, config): """Configure a filter from a dictionary.""" if '()' in config: result = self.configure_custom(config) else: name = config.get('name', '') result = logging.Filter(name) return result def add_filters(self, filterer, filters): """Add filters to a filterer from a list of names.""" for f in filters: try: filterer.addFilter(self.config['filters'][f]) except StandardError as e: raise ValueError('Unable to add filter %r: %s' % (f, e)) def configure_handler(self, config): """Configure a handler from a dictionary.""" formatter = config.pop('formatter', None) if formatter: try: formatter = self.config['formatters'][formatter] except StandardError as e: raise ValueError('Unable to set formatter ' '%r: %s' % (formatter, e)) level = config.pop('level', None) filters = config.pop('filters', None) if '()' in config: c = config.pop('()') if not hasattr(c, '__call__') and hasattr(types, 'ClassType') and type(c) != types.ClassType: c = self.resolve(c) factory = c else: klass = self.resolve(config.pop('class')) # Special case for handler which refers to another handler if issubclass(klass, logging.handlers.MemoryHandler) and\ 'target' in config: try: config['target'] = self.config['handlers'][config['target']] except StandardError as e: raise ValueError('Unable to set target handler ' '%r: %s' % (config['target'], e)) elif issubclass(klass, logging.handlers.SMTPHandler) and\ 'mailhost' in config: config['mailhost'] = self.as_tuple(config['mailhost']) elif issubclass(klass, logging.handlers.SysLogHandler) and\ 'address' in config: config['address'] = self.as_tuple(config['address']) factory = klass kwargs = dict((k, config[k]) for k in config if valid_ident(k)) try: result = factory(**kwargs) except TypeError as te: if "'stream'" not in str(te): raise # The argument name changed from strm to stream # Retry with old name. # This is so that code can be used with older Python versions #(e.g. by Django) kwargs['strm'] = kwargs.pop('stream') result = factory(**kwargs) if formatter: result.setFormatter(formatter) if level is not None: result.setLevel(_checkLevel(level)) if filters: self.add_filters(result, filters) return result def add_handlers(self, logger, handlers): """Add handlers to a logger from a list of names.""" for h in handlers: try: logger.addHandler(self.config['handlers'][h]) except StandardError as e: raise ValueError('Unable to add handler %r: %s' % (h, e)) def common_logger_config(self, logger, config, incremental=False): """ Perform configuration which is common to root and non-root loggers. """ level = config.get('level', None) if level is not None: logger.setLevel(_checkLevel(level)) if not incremental: # Remove any existing handlers for h in logger.handlers[:]: logger.removeHandler(h) handlers = config.get('handlers', None) if handlers: self.add_handlers(logger, handlers) filters = config.get('filters', None) if filters: self.add_filters(logger, filters) def configure_logger(self, name, config, incremental=False): """Configure a non-root logger from a dictionary.""" logger = logging.getLogger(name) self.common_logger_config(logger, config, incremental) propagate = config.get('propagate', None) if propagate is not None: logger.propagate = propagate def configure_root(self, config, incremental=False): """Configure a root logger from a dictionary.""" root = logging.getLogger() self.common_logger_config(root, config, incremental) dictConfigClass = DictConfigurator def dictConfig(config): """Configure logging using a dictionary.""" dictConfigClass(config).configure() __init__.pyc000064400000012127152527625730007041 0ustar00 abc @`sdZddlmZmZddlZddlZddlmZyddlm Z Wn!e k r{ddl m Z nXyddl mZWn!e k rddlmZnXyddlZWn]e k r#yddlmZWq$e k rddlZeje_eje_q$XnXyddlZdZWn*e k ridd lmZd ZnXd d d dddddddg Zejd)kreZddlmZn3ddl Z e!e dZere jZndZejd*krdZ#e$dZ%ndZ#e$dZ%dZ&dZ'dZ(d+Z)ejd,krbe)d-7Z)nej*j+d%pej*d&koej,d'kZ-d(Z.dS(.sKStuff that differs in different Python versions and platform distributions.i(tabsolute_importtdivisionN(t text_type(t dictConfig(t OrderedDict(t ipaddresscC`s1tjdtjdg}ttt|S(Ntstdlibt platstdlib(t sysconfigtget_pathtsettfiltertbool(tpaths((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyt get_stdlib"s (RcC`s=tjdttjdtdtg}ttt|S(Nt standard_libt plat_specific(Rtget_python_libtTrueR R R (R ((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR+stlogging_dictConfigRt uses_pycachetconsole_to_strt native_strt get_path_uidt stdlib_pkgstWINDOWStsamefileRii(tcache_from_sourceRcC`s9y|jtjjSWntk r4|jdSXdS(Ntutf_8(tdecodetsyst __stdout__tencodingtUnicodeDecodeError(ts((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRGs cC`s/t|tr+|jd|r$dndS|S(Nsutf-8treplacetstrict(t isinstancetbytesR(R"R#((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRMscC`s|S(N((R"((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRSscC`s t|tr|jdS|S(Nsutf-8(R%Rtencode(R"R#((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRVs cC`sHt|dr|jS|j|j|jddd}|dSdS(Nt total_secondsiii ii@Bi@B(thasattrR(t microsecondstsecondstdays(ttdtval((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR(]s #cC`sttdrMtj|tjtjB}tj|j}tj|n7tjj |sttj |j}nt d||S(s) Return path's uid. Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003 Placed this function in compat due to differences on AIX and Jython, that should eventually go away. :raises OSError: When path is a symlink or can't be read. t O_NOFOLLOWs1%s is a symlink; Will not return uid for symlinks( R)tostopentO_RDONLYR/tfstattst_uidtclosetpathtislinktstattOSError(R6tfdtfile_uid((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRes  cC`sAtjj|}|jdr=|jdr=|d}n|S(sl Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 s~/s//i(R0R6t expandusert startswith(R6texpanded((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR<s tpythontwsgirefiitargparsetwintclitntcC`sottjdr%tjj||Stjjtjj|}tjjtjj|}||kSdS(s>Provide an alternative for os.path.samefile on Windows/Python2RN(R)R0R6Rtnormcasetabspath(tfile1tfile2tpath1tpath2((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRs (ii(i(R?R@(ii(RA(/t__doc__t __future__RRR0Rtpip._vendor.sixRtlogging.configRRt ImportErrortpip.compat.dictconfigt collectionsRtpip._vendor.ordereddictRt pip._vendortipaddrt IPAddresst ip_addresst IPNetworkt ip_networkRRt distutilst__all__t version_infoRRtimportlib.utilRtimpR)tNoneRtFalseRR(RR<RtplatformR=tnameRR(((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pytsh                      dictconfig.pyo000064400000040437152527625730007434 0ustar00 abc@@s ddlmZddlZddlZddlZddlZddlmZej dej Z dZ yddlm Z Wnek rdZ nXdefd YZd efd YZd efd YZdefdYZdefdYZeZdZdS(i(tabsolute_importN(tsixs^[a-z_][a-z0-9_]*$cC@s,tj|}|s(td|ntS(Ns!Not a valid Python identifier: %r(t IDENTIFIERtmatcht ValueErrortTrue(tstm((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt valid_ident"s(t _checkLevelcC@spt|tr|}nTt||kr\|tjkrLtd|ntj|}ntd||S(NsUnknown level: %rs*Level not an integer or a valid string: %r(t isinstancetinttstrtloggingt _levelNamesRt TypeError(tleveltrv((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyR .s  tConvertingDictcB@s/eZdZdZddZddZRS(s A converting dictionary wrapper.cC@sqtj||}|jj|}||k rm|||[a-z]+)://(?P.*)$s ^\s*(\w+)\s*s^\.\s*(\w+)\s*s^\[\s*(\w+)\s*\]\s*s^\d+$t ext_converttextt cfg_converttcfgcC@st||_||j_dS(N(RtconfigR(RR.((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt__init__sc C@s|jd}|jd}yy|j|}x_|D]W}|d|7}yt||}Wq7tk r|j|t||}q7Xq7W|SWnVtk rtjd\}}td||f}|||_ |_ |nXdS(s` Resolve strings to objects using standard import and attribute syntax. t.iisCannot resolve %r: %sN( tsplitR!timportertgetattrtAttributeErrort ImportErrortsystexc_infoRt __cause__t __traceback__( RRtnametusedtfoundtfragtettbtv((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pytresolves"    cC@s |j|S(s*Default converter for the ext:// protocol.(RA(RR((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.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_PATTERNRR%RtendR.tgroupst DOT_PATTERNt INDEX_PATTERNt DIGIT_PATTERNR R(RRtrestRtdR'tn((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyR,s2     cC@s2t|t r7t|tr7t|}||_nt|t rnt|trnt|}||_nt|t rt|trt|}||_nt|tj r.|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. tprefixtsuffixN(R RRRRR&RR(Rt string_typestCONVERT_PATTERNRt groupdicttvalue_convertersRR%R3(RRRRIRKt converterRL((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRs*         c@sjd}t|d rUttdrUt|tjkrU|j|}njdd}tfdD}||}|rx-|jD]\}}t |||qWn|S(s1Configure an object with a user-supplied factory.s()t__call__t ClassTypeR0c3@s+|]!}t|r||fVqdS(N(R(t.0tk(R.(s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pys sN( R!thasattrttypesRRSRAR%Rtitemstsetattr(RR.tctpropstkwargsRR:R((R.s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pytconfigure_customs4 cC@s"t|trt|}n|S(s0Utility function which converts lists to tuples.(R R&R((RR((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pytas_tuples(R"R#R$tretcompileRNRBRERFRGRPt __import__R2R/RAR*R,RR]R^(((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyR)s"     "  tDictConfiguratorcB@sheZdZdZdZdZdZdZdZe dZ e dZ e d Z RS( s] Configure logging using a dictionary-like object to describe the configuration. cC@sq|j}d|kr$tdn|ddkrKtd|dn|jdt}i}tjz|r|jd|}tjd dkrFx|D]}|tj krtd |qyItj |}||}|jd d}|r|j t |nWqt k r>} td || fqXqWn|jd |} xU| D]M}y|j|| |tWq_t k r} td || fq_Xq_W|jdd} | r^y|j| tWqt k r} td| qXq^nV|jdt} tj jtj2|jd|} xU| D]M}y|j| || |RfRgtdisable_existingRiRjtexistingt child_loggerstitprefixedtpflent num_existingtlogtlogger((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt configures                         cC@sd|kr|d}y|j|}Wqtk r}dt|krSn|jd|d<||d<|j|}qXn6|jdd}|jdd}tj||}|S(s(Configure a formatter from a dictionary.s()s'format'tformattfmttdatefmtN(R]RR R!RR%R t Formatter(RR.tfactoryRtteRtdfmt((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRus   cC@sCd|kr|j|}n!|jdd}tj|}|S(s%Configure a filter from a dictionary.s()R:t(R]RR tFilter(RR.RR:((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRvs  cC@s]xV|D]N}y|j|jd|Wqtk rT}td||fqXqWdS(s/Add filters to a filterer from a list of names.RjsUnable to add filter %r: %sN(t addFilterR.RpR(RtfiltererRjtfR>((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt add_filterss  c @sjdd}|r\y|jd|}Wq\tk rX}td||fq\Xnjdd}jdd}dkrjd}t|d rttdrt|tjkr|j |}n|}n|j jd }t |t j j rsd krsy|jd d d ss'stream'tstreamtstrmN(R!R%R.RpRRVRWRRSRAt issubclassR Ret MemoryHandlert SMTPHandlerR^t SysLogHandlerRRR t setFormatterRoR R( RR.RR>RRjRZRtklassR\RR((R.s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRxsX 4     cC@s]xV|D]N}y|j|jd|Wqtk rT}td||fqXqWdS(s.Add handlers to a logger from a list of names.ResUnable to add handler %r: %sN(t addHandlerR.RpR(RRRethR>((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt add_handlers s  cC@s|jdd}|dk r4|jt|n|sx|jD]}|j|qEW|jdd}|r|j||n|jdd}|r|j||qndS(sU Perform configuration which is common to root and non-root loggers. RReRjN(RR%RoR Ret removeHandlerRR(RRR.RdRRReRj((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pytcommon_logger_configs cC@sPtj|}|j||||jdd}|dk rL||_ndS(s.Configure a non-root logger from a dictionary.RN(R t getLoggerRRR%R(RR:R.RdRR((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRq#s  cC@s#tj}|j|||dS(s*Configure a root logger from a dictionary.N(R RR(RR.RdRg((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRr+s ( R"R#R$RRuRvRRxRRkRRqRr(((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRbs   5   cC@st|jdS(s%Configure logging using a dictionary.N(tdictConfigClassR(R.((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt dictConfig3s(t __future__Rtlogging.handlersR R_R6RWt pip._vendorRR`tIRRR R5RRR&RR(RtobjectR)RbRR(((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyts&       & __init__.pyo000064400000012127152527625730007055 0ustar00 abc @`sdZddlmZmZddlZddlZddlmZyddlm Z Wn!e k r{ddl m Z nXyddl mZWn!e k rddlmZnXyddlZWn]e k r#yddlmZWq$e k rddlZeje_eje_q$XnXyddlZdZWn*e k ridd lmZd ZnXd d d dddddddg Zejd)kreZddlmZn3ddl Z e!e dZere jZndZejd*krdZ#e$dZ%ndZ#e$dZ%dZ&dZ'dZ(d+Z)ejd,krbe)d-7Z)nej*j+d%pej*d&koej,d'kZ-d(Z.dS(.sKStuff that differs in different Python versions and platform distributions.i(tabsolute_importtdivisionN(t text_type(t dictConfig(t OrderedDict(t ipaddresscC`s1tjdtjdg}ttt|S(Ntstdlibt platstdlib(t sysconfigtget_pathtsettfiltertbool(tpaths((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyt get_stdlib"s (RcC`s=tjdttjdtdtg}ttt|S(Nt standard_libt plat_specific(Rtget_python_libtTrueR R R (R ((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR+stlogging_dictConfigRt uses_pycachetconsole_to_strt native_strt get_path_uidt stdlib_pkgstWINDOWStsamefileRii(tcache_from_sourceRcC`s9y|jtjjSWntk r4|jdSXdS(Ntutf_8(tdecodetsyst __stdout__tencodingtUnicodeDecodeError(ts((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRGs cC`s/t|tr+|jd|r$dndS|S(Nsutf-8treplacetstrict(t isinstancetbytesR(R"R#((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRMscC`s|S(N((R"((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRSscC`s t|tr|jdS|S(Nsutf-8(R%Rtencode(R"R#((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRVs cC`sHt|dr|jS|j|j|jddd}|dSdS(Nt total_secondsiii ii@Bi@B(thasattrR(t microsecondstsecondstdays(ttdtval((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR(]s #cC`sttdrMtj|tjtjB}tj|j}tj|n7tjj |sttj |j}nt d||S(s) Return path's uid. Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003 Placed this function in compat due to differences on AIX and Jython, that should eventually go away. :raises OSError: When path is a symlink or can't be read. t O_NOFOLLOWs1%s is a symlink; Will not return uid for symlinks( R)tostopentO_RDONLYR/tfstattst_uidtclosetpathtislinktstattOSError(R6tfdtfile_uid((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRes  cC`sAtjj|}|jdr=|jdr=|d}n|S(sl Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 s~/s//i(R0R6t expandusert startswith(R6texpanded((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyR<s tpythontwsgirefiitargparsetwintclitntcC`sottjdr%tjj||Stjjtjj|}tjjtjj|}||kSdS(s>Provide an alternative for os.path.samefile on Windows/Python2RN(R)R0R6Rtnormcasetabspath(tfile1tfile2tpath1tpath2((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pyRs (ii(i(R?R@(ii(RA(/t__doc__t __future__RRR0Rtpip._vendor.sixRtlogging.configRRt ImportErrortpip.compat.dictconfigt collectionsRtpip._vendor.ordereddictRt pip._vendortipaddrt IPAddresst ip_addresst IPNetworkt ip_networkRRt distutilst__all__t version_infoRRtimportlib.utilRtimpR)tNoneRtFalseRR(RR<RtplatformR=tnameRR(((s7/usr/lib/python2.7/site-packages/pip/compat/__init__.pytsh                      dictconfig.pyc000064400000040437152527625730007420 0ustar00 abc@@s ddlmZddlZddlZddlZddlZddlmZej dej Z dZ yddlm Z Wnek rdZ nXdefd YZd efd YZd efd YZdefdYZdefdYZeZdZdS(i(tabsolute_importN(tsixs^[a-z_][a-z0-9_]*$cC@s,tj|}|s(td|ntS(Ns!Not a valid Python identifier: %r(t IDENTIFIERtmatcht ValueErrortTrue(tstm((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt valid_ident"s(t _checkLevelcC@spt|tr|}nTt||kr\|tjkrLtd|ntj|}ntd||S(NsUnknown level: %rs*Level not an integer or a valid string: %r(t isinstancetinttstrtloggingt _levelNamesRt TypeError(tleveltrv((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyR .s  tConvertingDictcB@s/eZdZdZddZddZRS(s A converting dictionary wrapper.cC@sqtj||}|jj|}||k rm|||[a-z]+)://(?P.*)$s ^\s*(\w+)\s*s^\.\s*(\w+)\s*s^\[\s*(\w+)\s*\]\s*s^\d+$t ext_converttextt cfg_converttcfgcC@st||_||j_dS(N(RtconfigR(RR.((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt__init__sc C@s|jd}|jd}yy|j|}x_|D]W}|d|7}yt||}Wq7tk r|j|t||}q7Xq7W|SWnVtk rtjd\}}td||f}|||_ |_ |nXdS(s` Resolve strings to objects using standard import and attribute syntax. t.iisCannot resolve %r: %sN( tsplitR!timportertgetattrtAttributeErrort ImportErrortsystexc_infoRt __cause__t __traceback__( RRtnametusedtfoundtfragtettbtv((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pytresolves"    cC@s |j|S(s*Default converter for the ext:// protocol.(RA(RR((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.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_PATTERNRR%RtendR.tgroupst DOT_PATTERNt INDEX_PATTERNt DIGIT_PATTERNR R(RRtrestRtdR'tn((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyR,s2     cC@s2t|t r7t|tr7t|}||_nt|t rnt|trnt|}||_nt|t rt|trt|}||_nt|tj r.|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. tprefixtsuffixN(R RRRRR&RR(Rt string_typestCONVERT_PATTERNRt groupdicttvalue_convertersRR%R3(RRRRIRKt converterRL((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRs*         c@sjd}t|d rUttdrUt|tjkrU|j|}njdd}tfdD}||}|rx-|jD]\}}t |||qWn|S(s1Configure an object with a user-supplied factory.s()t__call__t ClassTypeR0c3@s+|]!}t|r||fVqdS(N(R(t.0tk(R.(s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pys sN( R!thasattrttypesRRSRAR%Rtitemstsetattr(RR.tctpropstkwargsRR:R((R.s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pytconfigure_customs4 cC@s"t|trt|}n|S(s0Utility function which converts lists to tuples.(R R&R((RR((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pytas_tuples(R"R#R$tretcompileRNRBRERFRGRPt __import__R2R/RAR*R,RR]R^(((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyR)s"     "  tDictConfiguratorcB@sheZdZdZdZdZdZdZdZe dZ e dZ e d Z RS( s] Configure logging using a dictionary-like object to describe the configuration. cC@sq|j}d|kr$tdn|ddkrKtd|dn|jdt}i}tjz|r|jd|}tjd dkrFx|D]}|tj krtd |qyItj |}||}|jd d}|r|j t |nWqt k r>} td || fqXqWn|jd |} xU| D]M}y|j|| |tWq_t k r} td || fq_Xq_W|jdd} | r^y|j| tWqt k r} td| qXq^nV|jdt} tj jtj2|jd|} xU| D]M}y|j| || |RfRgtdisable_existingRiRjtexistingt child_loggerstitprefixedtpflent num_existingtlogtlogger((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt configures                         cC@sd|kr|d}y|j|}Wqtk r}dt|krSn|jd|d<||d<|j|}qXn6|jdd}|jdd}tj||}|S(s(Configure a formatter from a dictionary.s()s'format'tformattfmttdatefmtN(R]RR R!RR%R t Formatter(RR.tfactoryRtteRtdfmt((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRus   cC@sCd|kr|j|}n!|jdd}tj|}|S(s%Configure a filter from a dictionary.s()R:t(R]RR tFilter(RR.RR:((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRvs  cC@s]xV|D]N}y|j|jd|Wqtk rT}td||fqXqWdS(s/Add filters to a filterer from a list of names.RjsUnable to add filter %r: %sN(t addFilterR.RpR(RtfiltererRjtfR>((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt add_filterss  c @sjdd}|r\y|jd|}Wq\tk rX}td||fq\Xnjdd}jdd}dkrjd}t|d rttdrt|tjkr|j |}n|}n|j jd }t |t j j rsd krsy|jd d d ss'stream'tstreamtstrmN(R!R%R.RpRRVRWRRSRAt issubclassR Ret MemoryHandlert SMTPHandlerR^t SysLogHandlerRRR t setFormatterRoR R( RR.RR>RRjRZRtklassR\RR((R.s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRxsX 4     cC@s]xV|D]N}y|j|jd|Wqtk rT}td||fqXqWdS(s.Add handlers to a logger from a list of names.ResUnable to add handler %r: %sN(t addHandlerR.RpR(RRRethR>((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt add_handlers s  cC@s|jdd}|dk r4|jt|n|sx|jD]}|j|qEW|jdd}|r|j||n|jdd}|r|j||qndS(sU Perform configuration which is common to root and non-root loggers. RReRjN(RR%RoR Ret removeHandlerRR(RRR.RdRRReRj((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pytcommon_logger_configs cC@sPtj|}|j||||jdd}|dk rL||_ndS(s.Configure a non-root logger from a dictionary.RN(R t getLoggerRRR%R(RR:R.RdRR((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRq#s  cC@s#tj}|j|||dS(s*Configure a root logger from a dictionary.N(R RR(RR.RdRg((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRr+s ( R"R#R$RRuRvRRxRRkRRqRr(((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyRbs   5   cC@st|jdS(s%Configure logging using a dictionary.N(tdictConfigClassR(R.((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyt dictConfig3s(t __future__Rtlogging.handlersR R_R6RWt pip._vendorRR`tIRRR R5RRR&RR(RtobjectR)RbRR(((s9/usr/lib/python2.7/site-packages/pip/compat/dictconfig.pyts&       & __init__.py000064400000011100152527625730006664 0ustar00"""Stuff that differs in different Python versions and platform distributions.""" from __future__ import absolute_import, division import os import sys from pip._vendor.six import text_type try: from logging.config import dictConfig as logging_dictConfig except ImportError: from pip.compat.dictconfig import dictConfig as logging_dictConfig try: from collections import OrderedDict except ImportError: from pip._vendor.ordereddict import OrderedDict try: import ipaddress except ImportError: try: from pip._vendor import ipaddress except ImportError: import ipaddr as ipaddress ipaddress.ip_address = ipaddress.IPAddress ipaddress.ip_network = ipaddress.IPNetwork try: import sysconfig def get_stdlib(): paths = [ sysconfig.get_path("stdlib"), sysconfig.get_path("platstdlib"), ] return set(filter(bool, paths)) except ImportError: from distutils import sysconfig def get_stdlib(): paths = [ sysconfig.get_python_lib(standard_lib=True), sysconfig.get_python_lib(standard_lib=True, plat_specific=True), ] return set(filter(bool, paths)) __all__ = [ "logging_dictConfig", "ipaddress", "uses_pycache", "console_to_str", "native_str", "get_path_uid", "stdlib_pkgs", "WINDOWS", "samefile", "OrderedDict", ] if sys.version_info >= (3, 4): uses_pycache = True from importlib.util import cache_from_source else: import imp uses_pycache = hasattr(imp, 'cache_from_source') if uses_pycache: cache_from_source = imp.cache_from_source else: cache_from_source = None if sys.version_info >= (3,): def console_to_str(s): try: return s.decode(sys.__stdout__.encoding) except UnicodeDecodeError: return s.decode('utf_8') def native_str(s, replace=False): if isinstance(s, bytes): return s.decode('utf-8', 'replace' if replace else 'strict') return s else: def console_to_str(s): return s def native_str(s, replace=False): # Replace is ignored -- unicode to UTF-8 can't fail if isinstance(s, text_type): return s.encode('utf-8') return s def total_seconds(td): if hasattr(td, "total_seconds"): return td.total_seconds() else: val = td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6 return val / 10 ** 6 def get_path_uid(path): """ Return path's uid. Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003 Placed this function in compat due to differences on AIX and Jython, that should eventually go away. :raises OSError: When path is a symlink or can't be read. """ if hasattr(os, 'O_NOFOLLOW'): fd = os.open(path, os.O_RDONLY | os.O_NOFOLLOW) file_uid = os.fstat(fd).st_uid os.close(fd) else: # AIX and Jython # WARNING: time of check vulnerability, but best we can do w/o NOFOLLOW if not os.path.islink(path): # older versions of Jython don't have `os.fstat` file_uid = os.stat(path).st_uid else: # raise OSError for parity with os.O_NOFOLLOW above raise OSError( "%s is a symlink; Will not return uid for symlinks" % path ) return file_uid def expanduser(path): """ Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 """ expanded = os.path.expanduser(path) if path.startswith('~/') and expanded.startswith('//'): expanded = expanded[1:] return expanded # packages in the stdlib that may have installation metadata, but should not be # considered 'installed'. this theoretically could be determined based on # dist.location (py27:`sysconfig.get_paths()['stdlib']`, # py26:sysconfig.get_config_vars('LIBDEST')), but fear platform variation may # make this ineffective, so hard-coding stdlib_pkgs = ('python', 'wsgiref') if sys.version_info >= (2, 7): stdlib_pkgs += ('argparse',) # windows detection, covers cpython and ironpython WINDOWS = (sys.platform.startswith("win") or (sys.platform == 'cli' and os.name == 'nt')) def samefile(file1, file2): """Provide an alternative for os.path.samefile on Windows/Python2""" if hasattr(os.path, 'samefile'): return os.path.samefile(file1, file2) else: path1 = os.path.normcase(os.path.abspath(file1)) path2 = os.path.normcase(os.path.abspath(file2)) return path1 == path2 accessx000064400000002141152527764030006131 0ustar00default partial xkb_compatibility "basic" { interpret AccessX_Enable { action= LockControls(controls=AccessXKeys); }; }; partial xkb_compatibility "full" { interpret AccessX_Enable { action= LockControls(controls=AccessXKeys); }; interpret AccessX_Feedback_Enable { action= LockControls(controls=AccessXFeedback); }; interpret RepeatKeys_Enable { action= LockControls(controls=RepeatKeys); }; interpret SlowKeys_Enable { action= LockControls(controls=SlowKeys); }; interpret BounceKeys_Enable { action= LockControls(controls=BounceKeys); }; interpret StickyKeys_Enable { action= LockControls(controls=StickyKeys); }; interpret MouseKeys_Enable { action= LockControls(controls=MouseKeys); }; interpret MouseKeys_Accel_Enable { action= LockControls(controls=MouseKeysAccel); }; interpret Overlay1_Enable { action= LockControls(controls=Overlay1); }; interpret Overlay2_Enable { action= LockControls(controls=Overlay2); }; interpret AudibleBell_Enable { action= LockControls(controls=AudibleBell); }; }; mousekeys000064400000010774152527764030006537 0ustar00// Interpretations for arrow keys and a bunch of // other common keysyms which make it possible to // bind "mouse" keys using xmodmap and activate or // deactivate them from the keyboard. default partial xkb_compatibility "mousekeys" { // Keypad actions. interpret.repeat= True; interpret KP_1 { action = MovePtr(x=-1,y= +1); }; interpret KP_End { action = MovePtr(x=-1,y= +1); }; interpret KP_2 { action = MovePtr(x=+0,y= +1); }; interpret KP_Down { action = MovePtr(x=+0,y= +1); }; interpret KP_3 { action = MovePtr(x=+1,y=+1); }; interpret KP_Next { action = MovePtr(x=+1,y=+1); }; interpret KP_4 { action = MovePtr(x=-1,y=+0); }; interpret KP_Left { action = MovePtr(x=-1,y=+0); }; interpret KP_6 { action = MovePtr(x=+1,y=+0); }; interpret KP_Right { action = MovePtr(x=+1,y=+0); }; interpret KP_7 { action = MovePtr(x=-1,y=-1); }; interpret KP_Home { action = MovePtr(x=-1,y=-1); }; interpret KP_8 { action = MovePtr(x=+0,y=-1); }; interpret KP_Up { action = MovePtr(x=+0,y=-1); }; interpret KP_9 { action = MovePtr(x=+1,y=-1); }; interpret KP_Prior { action = MovePtr(x=+1,y=-1); }; interpret KP_5 { action = PointerButton(button=default); }; interpret KP_Begin { action = PointerButton(button=default); }; interpret KP_F2 { action = SetPtrDflt(affect=defaultButton,button=1); }; interpret KP_Divide { action = SetPtrDflt(affect=defaultButton,button=1); }; interpret KP_F3 { action = SetPtrDflt(affect=defaultButton,button=2); }; interpret KP_Multiply { action = SetPtrDflt(affect=defaultButton,button=2); }; interpret KP_F4 { action = SetPtrDflt(affect=defaultButton,button=3); }; interpret KP_Subtract { action = SetPtrDflt(affect=defaultButton,button=3); }; interpret KP_Separator { action = PointerButton(button=default,count=2); }; interpret KP_Add { action = PointerButton(button=default,count=2); }; interpret KP_0 { action = LockPointerButton(button=default,affect=lock); }; interpret KP_Insert { action = LockPointerButton(button=default,affect=lock); }; interpret KP_Decimal { action = LockPointerButton(button=default,affect=unlock); }; interpret KP_Delete { action = LockPointerButton(button=default,affect=unlock); }; // Additional mappings for Solaris keypad compatibility. interpret F25 { // aka KP_Divide action = SetPtrDflt(affect=defaultButton,button=1); }; interpret F26 { // aka KP_Multiply action = SetPtrDflt(affect=defaultButton,button=2); }; interpret F27 { // aka KP_Home action = MovePtr(x=-1,y=-1); }; interpret F29 { // aka KP_Prior action = MovePtr(x=+1,y=-1); }; interpret F31 { // aka KP_Begin action = PointerButton(button=default); }; interpret F33 { // aka KP_End action = MovePtr(x=-1,y= +1); }; interpret F35 { // aka KP_Next action = MovePtr(x=+1,y=+1); }; interpret.repeat= False; // New keysym actions. interpret Pointer_Button_Dflt { action= PointerButton(button=default); }; interpret Pointer_Button1 { action= PointerButton(button=1); }; interpret Pointer_Button2 { action= PointerButton(button=2); }; interpret Pointer_Button3 { action= PointerButton(button=3); }; interpret Pointer_DblClick_Dflt { action= PointerButton(button=default,count=2); }; interpret Pointer_DblClick1 { action= PointerButton(button=1,count=2); }; interpret Pointer_DblClick2 { action= PointerButton(button=2,count=2); }; interpret Pointer_DblClick3 { action= PointerButton(button=3,count=2); }; interpret Pointer_Drag_Dflt { action= LockPointerButton(button=default); }; interpret Pointer_Drag1 { action= LockPointerButton(button=1); }; interpret Pointer_Drag2 { action= LockPointerButton(button=2); }; interpret Pointer_Drag3 { action= LockPointerButton(button=3); }; interpret Pointer_EnableKeys { action= LockControls(controls=MouseKeys); }; interpret Pointer_Accelerate { action= LockControls(controls=MouseKeysAccel); }; interpret Pointer_DfltBtnNext { action= SetPtrDflt(affect=defaultButton,button= +1); }; interpret Pointer_DfltBtnPrev { action= SetPtrDflt(affect=defaultButton,button= -1); }; // Allow an indicator for MouseKeys. indicator "Mouse Keys" { //!allowExplicit; indicatorDrivesKeyboard; controls= MouseKeys; }; }; ledcaps000064400000000725152527764030006121 0ustar00// Use the Caps Lock LED to show either // Caps Lock, Group, or Shift Lock state. default partial xkb_compatibility "caps_lock" { indicator "Caps Lock" { !allowExplicit; whichModState= Locked; modifiers= Lock; }; }; partial xkb_compatibility "group_lock" { indicator "Caps Lock" { modifiers= None; groups=All-group1; }; }; partial xkb_compatibility "shift_lock" { indicator "Caps Lock" { whichModState= Locked; modifiers= Shift; }; }; japan000064400000001732152527764030005576 0ustar00// Japanese keyboards need the Eisu and Kana Shift // and Lock keys, which are typically bound to the // second shift level of some other modifier key. // These interpretations disable the default // interpretation (which would have these keys set // to the same modifier as the level one symbol). default partial xkb_compatibility "japan" { interpret.repeat= False; interpret Eisu_Shift+Lock { action= NoAction(); }; interpret Eisu_toggle+Lock { action= NoAction(); }; interpret Kana_Shift+Lock { action= NoAction(); }; interpret Kana_Lock+Lock { action= NoAction(); }; }; // Some Japanese keyboards have an explict // Kana Lock key and matching LED. partial xkb_compatibility "kana_lock" { virtual_modifiers Kana_Lock; interpret Kana_Lock+AnyOfOrNone(all) { virtualModifier= Kana_Lock; useModMapMods=level1; action= LockGroup(group=+1); }; indicator "Kana" { !allowExplicit; groups= All-Group1; }; }; caps000064400000000773152527764030005437 0ustar00partial xkb_compatibility "caps_lock" { // Keysym Caps_Lock locks the Lock modifier. // With this definition, the keysym Caps_Lock can be used without binding // the whole key to a real modifier. This is essential when you don't // want to use Caps_Lock on the first level. // This should not have any compatibility issues when used together with // other layouts which don't utilize this capability. interpret Caps_Lock { action = LockMods(modifiers = Lock); }; }; pc98000064400000002312152527764030005263 0ustar00// Minimal set of symbol interpretations to provide // reasonable default behavior (Num lock, Shift lock, // and Mode switch) and set up the automatic updating // of common keyboard LEDs. default xkb_compatibility "basic" { virtual_modifiers NumLock,AltGr; interpret.repeat= False; setMods.clearLocks= True; latchMods.clearLocks= True; latchMods.latchToLock= True; interpret Shift_Lock+AnyOf(Shift+Lock) { action= LockMods(modifiers=Shift); }; // interpret Any+Lock { // action= LockMods(modifiers=Lock); // }; interpret Num_Lock+Any { virtualModifier= NumLock; action= LockMods(modifiers=NumLock); }; interpret Mode_switch { useModMapMods= level1; virtualModifier= AltGr; action= SetGroup(group=2,clearLocks); }; interpret Any + Any { action= SetMods(modifiers=modMapMods); }; group 2 = AltGr; group 3 = AltGr; group 4 = AltGr; indicator.allowExplicit= False; indicator "Caps Lock" { whichModState= Locked; modifiers= Lock; }; indicator "Num Lock" { whichModState= Locked; modifiers= NumLock; }; indicator "Shift Lock" { whichModState= Locked; modifiers= Shift; }; indicator.allowExplicit= True; }; complete000064400000000344152527764030006313 0ustar00default xkb_compatibility "complete" { include "basic" augment "iso9995" augment "mousekeys" augment "accessx(full)" augment "misc" augment "xfree86" augment "level5" augment "caps(caps_lock)" }; xtest000064400000002661152527764030005656 0ustar00default xkb_compatibility "xtest" { // Minimal set of symbol interpretations to provide // reasonable behavior for testing. // The X Test Suite assumes that it can set any modifier // by simulating a KeyPress and clear it by simulating a // KeyRelease. Because of the way that XKB implements // locking/latching modifiers, this approach fails in // some cases (typically the Lock or NumLock modifiers). // These symbol interpretations make all modifier keys // just set the corresponding modifier so that xtest // will see the behavior it expects. virtual_modifiers NumLock,AltGr; interpret.repeat= False; setMods.clearLocks= True; latchMods.clearLocks= True; latchMods.latchToLock= False; interpret Shift_Lock+AnyOf(Shift+Lock) { action= SetMods(modifiers=Shift); }; interpret Num_Lock+Any { virtualModifier= NumLock; action= SetMods(modifiers=NumLock); }; interpret Mode_switch { useModMapMods= level1; virtualModifier= AltGr; action= SetGroup(group=2); }; interpret Any + Any { action= SetMods(modifiers=modMapMods); }; group 2 = AltGr; group 3 = AltGr; group 4 = AltGr; indicator.allowExplicit= False; indicator "Caps Lock" { modifiers= Lock; }; indicator "Num Lock" { modifiers= NumLock; }; indicator "Shift Lock" { whichModState= Locked; modifiers= Shift; }; indicator.allowExplicit= True; }; basic000064400000002036152527764030005564 0ustar00// Minimal set of symbol interpretations to provide // reasonable default behavior (Num lock, Shift lock, // Caps lock, and Mode switch) and set up the // automatic updating of common keyboard LEDs. default xkb_compatibility "basic" { virtual_modifiers NumLock,AltGr; interpret.repeat= False; setMods.clearLocks= True; latchMods.clearLocks= True; latchMods.latchToLock= True; interpret Shift_Lock+AnyOf(Shift+Lock) { action= LockMods(modifiers=Shift); }; interpret Any+Lock { action= LockMods(modifiers=Lock); }; interpret Num_Lock+Any { virtualModifier= NumLock; action= LockMods(modifiers=NumLock); }; interpret Mode_switch { useModMapMods= level1; virtualModifier= AltGr; action= SetGroup(group=+1); }; interpret Any + Any { action= SetMods(modifiers=modMapMods); }; group 2 = AltGr; group 3 = AltGr; group 4 = AltGr; include "ledcaps" include "lednum" indicator "Shift Lock" { !allowExplicit; whichModState= Locked; modifiers= Shift; }; }; README000064400000003260152527764030005440 0ustar00The core protocol interpretation of keyboard modifiers does not include direct support for multiple keyboard groups, so XKB reports the effective keyboard group to XKB-aware clients using some of the reserved bits in the state field of some core protocol events. This modified state field would not be interpreted correctly by XKB-unaware clients, so XKB provides a group compatibility mapping which remaps the keyboard group into a core modifier mask that has similar effects, when possible. XKB maintains three compatibility state components that are used to make XKB-unaware clients(*) work as well as possible: - The compatibility state which corresponds to the effective modifier and effective group state. - The compatibility lookup state which is the core-protocol equivalent of the lookup state. - The compatibility grab state which is the nearest core-protocol equivalent of the grab state. Compatibility states are essentially the corresponding XKB states, but with the keyboard group possibly encoded as one or more modifiers. Modifiers that correspond to each keyboard group are described in this group compatibility map. ---- (*) The implementation of XKB invisibly extends the X library to use the keyboard extension if it is present. That means, clients that use library or toolkit routines to interpret keyboard events automatically use all of XKB's features; clients that directly interpret the state field of core-protocol events or the keymap directly may be affected by some of the XKB differences. Thus most clients can take all advantages without modification but it also means that XKB state can be reported to clients that have not explicitly requested the keyboard extension. pc000064400000000524152527764030005105 0ustar00default partial xkb_compatibility "pc" { // Sets the "Alt" virtual modifier. virtual_modifiers Alt; setMods.clearLocks= True; interpret Alt_L+Any { virtualModifier= Alt; action = SetMods(modifiers=modMapMods); }; interpret Alt_R+Any { virtualModifier= Alt; action = SetMods(modifiers=modMapMods); }; }; lednum000064400000000722152527764030005767 0ustar00// Use the Num Lock LED to show either // Num Lock, Group, or Shift Lock state. default partial xkb_compatibility "num_lock" { indicator "Num Lock" { !allowExplicit; whichModState= Locked; modifiers= NumLock; }; }; partial xkb_compatibility "group_lock" { indicator "Num Lock" { modifiers= None; groups=All-group1; }; }; partial xkb_compatibility "shift_lock" { indicator "Num Lock" { whichModState= Locked; modifiers= Shift; }; }; olpc000064400000002155152527764030005442 0ustar00// // Map the OLPC game keys to virtual modifiers. // // Created by Bernardo Innocenti // default xkb_compatibility "olpc" { include "complete" virtual_modifiers Square,Cross,Triangle,Circle; interpret KP_Home+Any { //useModMapMods= level1; virtualModifier= Square; action = SetMods(modifiers=modMapMods); }; interpret KP_Home { action = SetMods(modifiers=Square); }; interpret KP_Next+Any { //useModMapMods= level1; virtualModifier= Cross; action = SetMods(modifiers=modMapMods); }; interpret KP_Next { action = SetMods(modifiers=Cross); }; interpret KP_End+Any { //useModMapMods= level1; virtualModifier= Circle; action = SetMods(modifiers=modMapMods); }; interpret KP_End { action = SetMods(modifiers=Circle); }; interpret KP_Prior+Any { //useModMapMods= level1; virtualModifier= Triangle; action = SetMods(modifiers=modMapMods); }; interpret KP_Prior { action = SetMods(modifiers=Triangle); }; }; level5000064400000002564152527764030005705 0ustar00// Fairly complete set of symbol interpretations // to provide reasonable default behavior. default partial xkb_compatibility "default" { virtual_modifiers LevelFive; interpret.repeat= False; setMods.clearLocks= True; latchMods.clearLocks= True; latchMods.latchToLock= True; interpret ISO_Level5_Shift+Any { useModMapMods= level1; virtualModifier= LevelFive; action= SetMods(modifiers=LevelFive); }; interpret ISO_Level5_Shift { action= SetMods(modifiers=LevelFive); }; interpret ISO_Level5_Latch+Any { useModMapMods= level1; virtualModifier= LevelFive; action= LatchMods(modifiers=LevelFive); }; interpret ISO_Level5_Latch { action= LatchMods(modifiers=LevelFive); }; interpret ISO_Level5_Lock+Any { useModMapMods= level1; virtualModifier= LevelFive; action= LockMods(modifiers=LevelFive); }; interpret ISO_Level5_Lock { action= LockMods(modifiers=LevelFive); }; }; partial xkb_compatibility "level5_lock" { // This defines a Level5-Lock using the NumLock real modifier // in order to create arbitrary level-behaviour, which would // not be possible with the virtual modifier. // See also: types/level5 : EIGHT_LEVEL_LEVEL_FIVE_LOCK // See also: symbols/level5(lock) virtual_modifiers NumLock; interpret ISO_Level5_Lock { action = LockMods(modifiers = NumLock); }; }; misc000064400000005244152527764030005442 0ustar00default partial xkb_compatibility "misc" { virtual_modifiers Alt,Meta,Super,Hyper,ScrollLock; // Interpretations for some other useful keys. interpret Terminate_Server { action = Terminate(); }; setMods.clearLocks= True; // Sets the "Alt" virtual modifier. interpret Alt_L+Any { //useModMapMods= level1; virtualModifier= Alt; action = SetMods(modifiers=modMapMods); }; interpret Alt_L { action = SetMods(modifiers=Alt); }; interpret Alt_R+Any { //useModMapMods= level1; virtualModifier= Alt; action = SetMods(modifiers=modMapMods); }; interpret Alt_R { action = SetMods(modifiers=Alt); }; // Sets the "Meta" virtual modifier. interpret Meta_L+Any { //useModMapMods= level1; virtualModifier= Meta; action = SetMods(modifiers=modMapMods); }; interpret Meta_L { action = SetMods(modifiers=Meta); }; interpret Meta_R+Any { //useModMapMods= level1; virtualModifier= Meta; action = SetMods(modifiers=modMapMods); }; interpret Meta_R { action = SetMods(modifiers=Meta); }; // Sets the "Super" virtual modifier. interpret Super_L+Any { //useModMapMods= level1; virtualModifier= Super; action = SetMods(modifiers=modMapMods); }; interpret Super_L { action = SetMods(modifiers=Super); }; interpret Super_R+Any { //useModMapMods= level1; virtualModifier= Super; action = SetMods(modifiers=modMapMods); }; interpret Super_R { action = SetMods(modifiers=Super); }; // Sets the "Hyper" virtual modifier. interpret Hyper_L+Any { //useModMapMods= level1; virtualModifier= Hyper; action = SetMods(modifiers=modMapMods); }; interpret Hyper_L { action = SetMods(modifiers=Hyper); }; interpret Hyper_R+Any { //useModMapMods= level1; virtualModifier= Hyper; action = SetMods(modifiers=modMapMods); }; interpret Hyper_R { action = SetMods(modifiers=Hyper); }; // Sets the "ScrollLock" virtual modifier and // makes it actually lock when pressed. Sets // up a map for the scroll lock indicator. interpret Scroll_Lock+Any { virtualModifier= ScrollLock; action = LockMods(modifiers=modMapMods); }; include "ledscroll" include "misc(assign_shift_left_action)" }; partial xkb_compatibility "assign_shift_left_action" { // Because of the irrevertable modifier mapping in symbols/pc, // is getting bound to the Lock modifier when using // symbols/shift(both_capslock), creating unwanted behaviour. // This is a quirk, to circumvent the problem. interpret Shift_L { action = SetMods(modifiers = Shift); }; }; iso9995000064400000003154152527764030005637 0ustar00// Fairly complete set of symbol interpretations // to provide reasonable default behavior. default partial xkb_compatibility "default" { virtual_modifiers LevelThree,AltGr; interpret.repeat= False; setMods.clearLocks= True; latchMods.clearLocks= True; latchMods.latchToLock= True; interpret ISO_Level2_Latch+Shift { useModMapMods= level1; action= LatchMods(modifiers=Shift); }; interpret ISO_Level3_Shift+Any { useModMapMods= level1; virtualModifier= LevelThree; action= SetMods(modifiers=LevelThree); }; interpret ISO_Level3_Shift { action= SetMods(modifiers=LevelThree); }; interpret ISO_Level3_Latch+Any { useModMapMods= level1; virtualModifier= LevelThree; action= LatchMods(modifiers=LevelThree); }; interpret ISO_Level3_Latch { action= LatchMods(modifiers=LevelThree); }; interpret ISO_Level3_Lock+Any { useModMapMods= level1; virtualModifier= LevelThree; action= LockMods(modifiers=LevelThree); }; interpret ISO_Level3_Lock { action= LockMods(modifiers=LevelThree); }; interpret ISO_Group_Latch { useModMapMods= level1; virtualModifier= AltGr; action= LatchGroup(group=2); }; interpret ISO_Next_Group { useModMapMods= level1; virtualModifier= AltGr; action= LockGroup(group=+1); }; interpret ISO_Prev_Group { useModMapMods= level1; virtualModifier= AltGr; action= LockGroup(group=-1); }; interpret ISO_First_Group { action= LockGroup(group=1); }; interpret ISO_Last_Group { action= LockGroup(group=2); }; indicator "Group 2" { !allowExplicit; groups= All-Group1; }; }; ledscroll000064400000000746152527764030006474 0ustar00// Use the Scroll Lock LED to show either // Scroll Lock, Group, or Shift Lock state. default partial xkb_compatibility "scroll_lock" { indicator "Scroll Lock" { allowExplicit; whichModState= Locked; modifiers= ScrollLock; }; }; partial xkb_compatibility "group_lock" { indicator "Scroll Lock" { modifiers= None; groups=All-group1; }; }; partial xkb_compatibility "shift_lock" { indicator "Scroll Lock" { whichModState= Locked; modifiers= Shift; }; }; xfree86000064400000003462152527764030005776 0ustar00// XFree86 special keysyms. default partial xkb_compatibility "basic" { interpret.repeat= True; interpret XF86_Switch_VT_1 { action = SwitchScreen(Screen=1, !SameServer); }; interpret XF86_Switch_VT_2 { action = SwitchScreen(Screen=2, !SameServer); }; interpret XF86_Switch_VT_3 { action = SwitchScreen(Screen=3, !SameServer); }; interpret XF86_Switch_VT_4 { action = SwitchScreen(Screen=4, !SameServer); }; interpret XF86_Switch_VT_5 { action = SwitchScreen(Screen=5, !SameServer); }; interpret XF86_Switch_VT_6 { action = SwitchScreen(Screen=6, !SameServer); }; interpret XF86_Switch_VT_7 { action = SwitchScreen(Screen=7, !SameServer); }; interpret XF86_Switch_VT_8 { action = SwitchScreen(Screen=8, !SameServer); }; interpret XF86_Switch_VT_9 { action = SwitchScreen(Screen=9, !SameServer); }; interpret XF86_Switch_VT_10 { action = SwitchScreen(Screen=10, !SameServer); }; interpret XF86_Switch_VT_11 { action = SwitchScreen(Screen=11, !SameServer); }; interpret XF86_Switch_VT_12 { action = SwitchScreen(Screen=12, !SameServer); }; interpret XF86LogGrabInfo { action = Private(type=0x86, data="PrGrbs"); }; interpret XF86LogWindowTree { action = Private(type=0x86, data="PrWins"); }; interpret XF86_Next_VMode { action = Private(type=0x86, data="+VMode"); }; interpret XF86_Prev_VMode { action = Private(type=0x86, data="-VMode"); }; }; partial xkb_compatibility "grab_break" { interpret XF86_Ungrab { action = Private(type=0x86, data="Ungrab"); }; interpret XF86_ClearGrab { action = Private(type=0x86, data="ClsGrb"); }; }; __pycache__/dictconfig.cpython-36.pyc000064400000032420152531432460013521 0ustar003 Pf8Z @sddlmZddlZddlZddlZddlZddlmZej dej Z ddZ yddlm Z Wnek rzdd Z YnXGd d d eZGd d d eZGdddeZGdddeZGdddeZeZddZdS))absolute_importN)sixz^[a-z_][a-z0-9_]*$cCstj|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERmatch ValueError)smr /usr/lib/python3.6/dictconfig.py valid_ident"s  r ) _checkLevelcCsNt|tr|}n:t||kr>|tjkr2td|tj|}n td||S)NzUnknown level: %rz*Level not an integer or a valid string: %r) isinstanceintstrloggingZ _levelNamesr TypeError)levelrvr r r r .s     r c@s,eZdZdZddZd ddZd ddZdS) ConvertingDictz A converting dictionary wrapper.cCsJtj||}|jj|}||k rF|||<t|tttfkrF||_||_ |S)N) dict __getitem__ configuratorconverttyperConvertingListConvertingTupleparentkey)selfrvalueresultr r r rGs   zConvertingDict.__getitem__NcCsLtj|||}|jj|}||k rH|||<t|tttfkrH||_||_ |S)N) rgetrrrrrrrr)rrdefaultrr r r r r!Ss  zConvertingDict.getcCsDtj|||}|jj|}||k r@t|tttfkr@||_||_ |S)N) rpoprrrrrrrr)rrr"rr r r r r#_s  zConvertingDict.pop)N)N)__name__ __module__ __qualname____doc__rr!r#r r r r rDs rc@s"eZdZdZddZd ddZdS) rzA converting list wrapper.cCsJtj||}|jj|}||k rF|||<t|tttfkrF||_||_ |S)N) listrrrrrrrrr)rrrr r r r rls   zConvertingList.__getitem__cCs<tj||}|jj|}||k r8t|tttfkr8||_|S)N) r(r#rrrrrrr)ridxrr r r r r#xs   zConvertingList.popN)r+)r$r%r&r'rr#r r r r rjs rc@seZdZdZddZdS)rzA converting tuple wrapper.cCsBtj||}|jj|}||k r>t|tttfkr>||_||_ |S)N) tuplerrrrrrrrr)rrrr r r r rs   zConvertingTuple.__getitem__N)r$r%r&r'rr r r r rsrc@seZdZdZejdZejdZejdZejdZ ejdZ ddd Z e Z d d Zd d ZddZddZddZddZddZdS)BaseConfiguratorzI 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)ZextZcfgcCst||_||j_dS)N)rconfigr)rr0r r r __init__s 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)z` Resolve strings to objects using standard import and attribute syntax. .rr)NzCannot resolve %r: %s) splitr#importergetattrAttributeError ImportErrorsysexc_infor __cause__ __traceback__) rrnameZusedfoundZfragetbvr r r resolves"      zBaseConfigurator.resolvecCs |j|S)z*Default converter for the ext:// protocol.)rA)rrr r r r.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_PATTERNrrendr0groups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNrr)rrrestrdr*nr r r r/s2       zBaseConfigurator.cfg_convertcCst|t r&t|tr&t|}||_nt|t rLt|trLt|}||_n~t|t rrt|trrt|}||_nXt|tj r|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. prefixNsuffix)r rrrrr(rr,rZ string_typesCONVERT_PATTERNr groupdictvalue_convertersr!r5)rrrrIrKZ converterrLr r r rs*     zBaseConfigurator.convertcsjd}t|d r8ttdr8t|tjkr8|j|}jdd}tfddD}|f|}|rx |jD]\}}t|||qrW|S)z1Configure an object with a user-supplied factory.z()__call__ ClassTyper2Nc3s"|]}t|r||fVqdS)N)r ).0k)r0r r sz4BaseConfigurator.configure_custom..) r#hasattrtypesrrQrAritemssetattr)rr0cZpropskwargsr r<rr )r0r configure_customs $   z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)r r(r,)rrr r r as_tuples zBaseConfigurator.as_tupleN)r$r%r&r'recompilerMrBrErFrGrO __import__r4r1rAr.r/rr[r\r r r r r-s      "r-c@s^eZdZdZddZddZddZdd Zd d Zd d Z dddZ dddZ dddZ dS)DictConfiguratorz] Configure logging using a dictionary-like object to describe the configuration. cCs|j}d|krtd|ddkr2td|d|jdd}i}tjz||r|jd|}tjdd dkrx|D]}|tjkrtd |qzy4tj|}||}|jd d}|r|j t |Wqzt k r} ztd || fWYdd} ~ XqzXqzW|jd|} xZ| D]R}y|j || |dWn4t k rd} ztd|| fWYdd} ~ XnXqW|jdd} | ry|j | dWn0t k r} ztd| WYdd} ~ XnXn|jdd} tjjtjdd=|jd|} xZ| D]R}y|j| || |<Wn4t k rF} ztd|| fWYdd} ~ XnXqW|jd|}xZ|D]R}y|j||||<Wn4t k r} ztd|| fWYdd} ~ XnXq`W|jd|}xht|D]\}y |j||}||_|||<Wn4t k r$} ztd || fWYdd} ~ XnXqWtj} t| jj}|jg}|jd|} x| D]}||kr|j|}|d}t|}t|}|d}x<||kr||d||kr|j|||d}qW|j|y|j || |Wn4t k r$} ztd|| fWYdd} ~ XnXq\WxF|D]>}| jj|}||krbtj|_g|_ d|_!n | r2d|_"q2W|jdd} | ry|j | Wn0t k r} ztd| WYdd} ~ XnXWdtj#XdS)zDo the configuration.versionz$dictionary doesn't specify a versionr)zUnsupported version: %s incrementalFhandlersNzNo handler found with name %rrz"Unable to configure handler %r: %sloggersTz!Unable to configure logger %r: %srootz#Unable to configure root logger: %sZdisable_existing_loggers formattersz$Unable to configure formatter %r: %sfiltersz!Unable to configure filter %r: %sr2)rdre)$r0rr#rZ _acquireLockr!r8 version_infoZ _handlerssetLevelr StandardErrorconfigure_loggerconfigure_rootclearZ _handlerListconfigure_formatterconfigure_filtersortedconfigure_handlerr<rgr(ZmanagerZ loggerDictsortindexlenappendremoveZNOTSETrrc propagateZdisabledZ _releaseLock)rr0rbZ EMPTY_DICTrcr<ZhandlerZhandler_configrr>rfrgZdisable_existingrhriZexistingZ child_loggersiZprefixedZpflenZ num_existinglogloggerr r r configures        "  $      $  $  $        $     zDictConfigurator.configurecCsd|krr|d}y|j|}Wqtk rn}z4dt|kr>|jd|d<||d<|j|}WYdd}~XqXn$|jdd}|jdd}tj||}|S)z(Configure a formatter from a dictionary.z()z'format'formatfmtNZdatefmt)r[rrr#r!rZ Formatter)rr0factoryr terZdfmtr r r rps    z$DictConfigurator.configure_formattercCs.d|kr|j|}n|jdd}tj|}|S)z%Configure a filter from a dictionary.z()r<)r[r!rFilter)rr0r r<r r r rqs    z!DictConfigurator.configure_filtercCs^xX|D]P}y|j|jd|Wqtk rT}ztd||fWYdd}~XqXqWdS)z/Add filters to a filterer from a list of names.rizUnable to add filter %r: %sN)Z addFilterr0rlr)rZfiltererrifr>r r r add_filterss  zDictConfigurator.add_filtersc -s@jdd}|rVy|jd|}Wn2tk rT}ztd||fWYdd}~XnXjdd}jdd}dkrjd}t|d rttd rt|tjkr|j|}|}n|jjd }t |t j j od kr2y|jd d d <Wn8tk r.}ztd d |fWYdd}~XnXnZt |t j j r`dkr`|jdd<n,t |t j jrdkr|jdd<|}tfddD} y|f| } WnLtk r} z.dt| kr؂| jd| d<|f| } WYdd} ~ XnX|r| j||dk r*| jt||r<|j| || S)z&Configure a handler from a dictionary. formatterNrhzUnable to set formatter %r: %srriz()rPrQclasstargetrcz#Unable to set target handler %r: %sZmailhostZaddressc3s"|]}t|r||fVqdS)N)r )rRrS)r0r r rTsz5DictConfigurator.configure_handler..z'stream'streamZstrm)r#r0rlrrUrVrrQrA issubclassrrcZ MemoryHandlerZ SMTPHandlerr\Z SysLogHandlerrrrZ setFormatterrkr r) rr0rr>rrirYrklassrZr rr )r0r rssX    $  $     z"DictConfigurator.configure_handlercCs^xX|D]P}y|j|jd|Wqtk rT}ztd||fWYdd}~XqXqWdS)z.Add handlers to a logger from a list of names.rczUnable to add handler %r: %sN)Z addHandlerr0rlr)rr|rchr>r r r add_handlers s  zDictConfigurator.add_handlersFcCs|jdd}|dk r"|jt||sx |jddD]}|j|q6W|jdd}|rd|j|||jdd}|r|j||dS)zU Perform configuration which is common to root and non-root loggers. rNrcri)r!rkr rcZ removeHandlerrr)rr|r0rbrrrcrir r r common_logger_configs    z%DictConfigurator.common_logger_configcCs6tj|}|j||||jdd}|dk r2||_dS)z.Configure a non-root logger from a dictionary.ryN)r getLoggerrr!ry)rr<r0rbr|ryr r r rm#s   z!DictConfigurator.configure_loggercCstj}|j|||dS)z*Configure a root logger from a dictionary.N)rrr)rr0rbrgr r r rn+szDictConfigurator.configure_rootN)F)F)F) r$r%r&r'r}rprqrrsrrrmrnr r r r r`s 5  r`cCst|jdS)z%Configure logging using a dictionary.N)dictConfigClassr})r0r r r dictConfig3sr)Z __future__rZlogging.handlersrr]r8rVZ pip._vendorrr^Irr r r7rrr(rr,robjectr-r`rrr r r r s*   & __pycache__/__init__.cpython-36.opt-1.pyc000064400000007541152531432460014114 0ustar003 Pf@0@s dZddlmZmZddlZddlZddlmZyddlm Z Wn e k r`ddl m Z YnXyddl mZWn e k rddlmZYnXy ddlZWnRe k ryddlmZWn,e k rddlZeje_eje_YnXYnXyddlZdd ZWn*e k r2dd lmZd d ZYnXd d ddddddddg Zejd.krjdZddlmZn$ddlZe edZerejZndZejd/krddZ!d0ddZ"nddZ!d1ddZ"d d!Z#d"dZ$d#d$Z%d2Z&ejd3kre&d47Z&ej'j(d*pej'd+koej)d,kZ*d-dZ+dS)5zKStuff that differs in different Python versions and platform distributions.)absolute_importdivisionN) text_type) dictConfig) OrderedDict) ipaddresscCs"tjdtjdg}ttt|S)Nstdlib platstdlib) sysconfigget_pathsetfilterbool)pathsr/usr/lib/python3.6/__init__.py get_stdlib"s r)r cCs(tjddtjdddg}ttt|S)NT) standard_lib)rZ plat_specific)r Zget_python_libr r r)rrrrr+s logging_dictConfigr uses_pycacheconsole_to_str native_str get_path_uid stdlib_pkgsWINDOWSsamefilerT)cache_from_sourcerc Cs.y|jtjjStk r(|jdSXdS)Nutf_8)decodesys __stdout__encodingUnicodeDecodeError)srrrrGsFcCs"t|tr|jd|rdndS|S)Nzutf-8replacestrict) isinstancebytesr )r%r&rrrrMs cCs|S)Nr)r%rrrrSscCst|tr|jdS|S)Nzutf-8)r(rencode)r%r&rrrrVs  cCs<t|dr|jS|j|j|jddd}|dSdS)N total_secondsi i@Bi@B)hasattrr+Z microsecondsZsecondsZdays)Ztdvalrrrr+]s r+cCs`ttdr6tj|tjtjB}tj|j}tj|n&tjj |sPtj |j}n t d||S)a) Return path's uid. Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003 Placed this function in compat due to differences on AIX and Jython, that should eventually go away. :raises OSError: When path is a symlink or can't be read. O_NOFOLLOWz1%s is a symlink; Will not return uid for symlinks) r/osopenO_RDONLYr1fstatst_uidclosepathislinkstatOSError)r8fdZfile_uidrrrres     cCs0tjj|}|jdr,|jdr,|dd}|S)zl Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 z~/z//N)r2r8 expanduser startswith)r8Zexpandedrrrr>s  r>pythonwsgirefargparsewinZclintcCsNttjdrtjj||Stjjtjj|}tjjtjj|}||kSdS)z>Provide an alternative for os.path.samefile on Windows/Python2rN)r/r2r8rnormcaseabspath)Zfile1Zfile2Zpath1Zpath2rrrrs  )rr)r)F)F)r@rA)rBrC)rD),__doc__Z __future__rrr2r!Zpip._vendor.sixrZlogging.configrr ImportErrorZpip.compat.dictconfig collectionsrZpip._vendor.ordereddictrZ pip._vendorZipaddrZ IPAddressZ ip_addressZ IPNetworkZ ip_networkr rZ distutils__all__ version_inforZimportlib.utilrZimpr/rrr+rr>rplatformr?namerrrrrrsh            __pycache__/dictconfig.cpython-36.opt-1.pyc000064400000032420152531432460014460 0ustar003 Pf8Z @sddlmZddlZddlZddlZddlZddlmZej dej Z ddZ yddlm Z Wnek rzdd Z YnXGd d d eZGd d d eZGdddeZGdddeZGdddeZeZddZdS))absolute_importN)sixz^[a-z_][a-z0-9_]*$cCstj|}|std|dS)Nz!Not a valid Python identifier: %rT) IDENTIFIERmatch ValueError)smr /usr/lib/python3.6/dictconfig.py valid_ident"s  r ) _checkLevelcCsNt|tr|}n:t||kr>|tjkr2td|tj|}n td||S)NzUnknown level: %rz*Level not an integer or a valid string: %r) isinstanceintstrloggingZ _levelNamesr TypeError)levelrvr r r r .s     r c@s,eZdZdZddZd ddZd ddZdS) ConvertingDictz A converting dictionary wrapper.cCsJtj||}|jj|}||k rF|||<t|tttfkrF||_||_ |S)N) dict __getitem__ configuratorconverttyperConvertingListConvertingTupleparentkey)selfrvalueresultr r r rGs   zConvertingDict.__getitem__NcCsLtj|||}|jj|}||k rH|||<t|tttfkrH||_||_ |S)N) rgetrrrrrrrr)rrdefaultrr r r r r!Ss  zConvertingDict.getcCsDtj|||}|jj|}||k r@t|tttfkr@||_||_ |S)N) rpoprrrrrrrr)rrr"rr r r r r#_s  zConvertingDict.pop)N)N)__name__ __module__ __qualname____doc__rr!r#r r r r rDs rc@s"eZdZdZddZd ddZdS) rzA converting list wrapper.cCsJtj||}|jj|}||k rF|||<t|tttfkrF||_||_ |S)N) listrrrrrrrrr)rrrr r r r rls   zConvertingList.__getitem__cCs<tj||}|jj|}||k r8t|tttfkr8||_|S)N) r(r#rrrrrrr)ridxrr r r r r#xs   zConvertingList.popN)r+)r$r%r&r'rr#r r r r rjs rc@seZdZdZddZdS)rzA converting tuple wrapper.cCsBtj||}|jj|}||k r>t|tttfkr>||_||_ |S)N) tuplerrrrrrrrr)rrrr r r r rs   zConvertingTuple.__getitem__N)r$r%r&r'rr r r r rsrc@seZdZdZejdZejdZejdZejdZ ejdZ ddd Z e Z d d Zd d ZddZddZddZddZddZdS)BaseConfiguratorzI 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)ZextZcfgcCst||_||j_dS)N)rconfigr)rr0r r r __init__s 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)z` Resolve strings to objects using standard import and attribute syntax. .rr)NzCannot resolve %r: %s) splitr#importergetattrAttributeError ImportErrorsysexc_infor __cause__ __traceback__) rrnameZusedfoundZfragetbvr r r resolves"      zBaseConfigurator.resolvecCs |j|S)z*Default converter for the ext:// protocol.)rA)rrr r r r.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_PATTERNrrendr0groups DOT_PATTERN INDEX_PATTERN DIGIT_PATTERNrr)rrrestrdr*nr r r r/s2       zBaseConfigurator.cfg_convertcCst|t r&t|tr&t|}||_nt|t rLt|trLt|}||_n~t|t rrt|trrt|}||_nXt|tj r|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. prefixNsuffix)r rrrrr(rr,rZ string_typesCONVERT_PATTERNr groupdictvalue_convertersr!r5)rrrrIrKZ converterrLr r r rs*     zBaseConfigurator.convertcsjd}t|d r8ttdr8t|tjkr8|j|}jdd}tfddD}|f|}|rx |jD]\}}t|||qrW|S)z1Configure an object with a user-supplied factory.z()__call__ ClassTyper2Nc3s"|]}t|r||fVqdS)N)r ).0k)r0r r sz4BaseConfigurator.configure_custom..) r#hasattrtypesrrQrAritemssetattr)rr0cZpropskwargsr r<rr )r0r configure_customs $   z!BaseConfigurator.configure_customcCst|trt|}|S)z0Utility function which converts lists to tuples.)r r(r,)rrr r r as_tuples zBaseConfigurator.as_tupleN)r$r%r&r'recompilerMrBrErFrGrO __import__r4r1rAr.r/rr[r\r r r r r-s      "r-c@s^eZdZdZddZddZddZdd Zd d Zd d Z dddZ dddZ dddZ dS)DictConfiguratorz] Configure logging using a dictionary-like object to describe the configuration. cCs|j}d|krtd|ddkr2td|d|jdd}i}tjz||r|jd|}tjdd dkrx|D]}|tjkrtd |qzy4tj|}||}|jd d}|r|j t |Wqzt k r} ztd || fWYdd} ~ XqzXqzW|jd|} xZ| D]R}y|j || |dWn4t k rd} ztd|| fWYdd} ~ XnXqW|jdd} | ry|j | dWn0t k r} ztd| WYdd} ~ XnXn|jdd} tjjtjdd=|jd|} xZ| D]R}y|j| || |<Wn4t k rF} ztd|| fWYdd} ~ XnXqW|jd|}xZ|D]R}y|j||||<Wn4t k r} ztd|| fWYdd} ~ XnXq`W|jd|}xht|D]\}y |j||}||_|||<Wn4t k r$} ztd || fWYdd} ~ XnXqWtj} t| jj}|jg}|jd|} x| D]}||kr|j|}|d}t|}t|}|d}x<||kr||d||kr|j|||d}qW|j|y|j || |Wn4t k r$} ztd|| fWYdd} ~ XnXq\WxF|D]>}| jj|}||krbtj|_g|_ d|_!n | r2d|_"q2W|jdd} | ry|j | Wn0t k r} ztd| WYdd} ~ XnXWdtj#XdS)zDo the configuration.versionz$dictionary doesn't specify a versionr)zUnsupported version: %s incrementalFhandlersNzNo handler found with name %rrz"Unable to configure handler %r: %sloggersTz!Unable to configure logger %r: %srootz#Unable to configure root logger: %sZdisable_existing_loggers formattersz$Unable to configure formatter %r: %sfiltersz!Unable to configure filter %r: %sr2)rdre)$r0rr#rZ _acquireLockr!r8 version_infoZ _handlerssetLevelr StandardErrorconfigure_loggerconfigure_rootclearZ _handlerListconfigure_formatterconfigure_filtersortedconfigure_handlerr<rgr(ZmanagerZ loggerDictsortindexlenappendremoveZNOTSETrrc propagateZdisabledZ _releaseLock)rr0rbZ EMPTY_DICTrcr<ZhandlerZhandler_configrr>rfrgZdisable_existingrhriZexistingZ child_loggersiZprefixedZpflenZ num_existinglogloggerr r r configures        "  $      $  $  $        $     zDictConfigurator.configurecCsd|krr|d}y|j|}Wqtk rn}z4dt|kr>|jd|d<||d<|j|}WYdd}~XqXn$|jdd}|jdd}tj||}|S)z(Configure a formatter from a dictionary.z()z'format'formatfmtNZdatefmt)r[rrr#r!rZ Formatter)rr0factoryr terZdfmtr r r rps    z$DictConfigurator.configure_formattercCs.d|kr|j|}n|jdd}tj|}|S)z%Configure a filter from a dictionary.z()r<)r[r!rFilter)rr0r r<r r r rqs    z!DictConfigurator.configure_filtercCs^xX|D]P}y|j|jd|Wqtk rT}ztd||fWYdd}~XqXqWdS)z/Add filters to a filterer from a list of names.rizUnable to add filter %r: %sN)Z addFilterr0rlr)rZfiltererrifr>r r r add_filterss  zDictConfigurator.add_filtersc -s@jdd}|rVy|jd|}Wn2tk rT}ztd||fWYdd}~XnXjdd}jdd}dkrjd}t|d rttd rt|tjkr|j|}|}n|jjd }t |t j j od kr2y|jd d d <Wn8tk r.}ztd d |fWYdd}~XnXnZt |t j j r`dkr`|jdd<n,t |t j jrdkr|jdd<|}tfddD} y|f| } WnLtk r} z.dt| kr؂| jd| d<|f| } WYdd} ~ XnX|r| j||dk r*| jt||r<|j| || S)z&Configure a handler from a dictionary. formatterNrhzUnable to set formatter %r: %srriz()rPrQclasstargetrcz#Unable to set target handler %r: %sZmailhostZaddressc3s"|]}t|r||fVqdS)N)r )rRrS)r0r r rTsz5DictConfigurator.configure_handler..z'stream'streamZstrm)r#r0rlrrUrVrrQrA issubclassrrcZ MemoryHandlerZ SMTPHandlerr\Z SysLogHandlerrrrZ setFormatterrkr r) rr0rr>rrirYrklassrZr rr )r0r rssX    $  $     z"DictConfigurator.configure_handlercCs^xX|D]P}y|j|jd|Wqtk rT}ztd||fWYdd}~XqXqWdS)z.Add handlers to a logger from a list of names.rczUnable to add handler %r: %sN)Z addHandlerr0rlr)rr|rchr>r r r add_handlers s  zDictConfigurator.add_handlersFcCs|jdd}|dk r"|jt||sx |jddD]}|j|q6W|jdd}|rd|j|||jdd}|r|j||dS)zU Perform configuration which is common to root and non-root loggers. rNrcri)r!rkr rcZ removeHandlerrr)rr|r0rbrrrcrir r r common_logger_configs    z%DictConfigurator.common_logger_configcCs6tj|}|j||||jdd}|dk r2||_dS)z.Configure a non-root logger from a dictionary.ryN)r getLoggerrr!ry)rr<r0rbr|ryr r r rm#s   z!DictConfigurator.configure_loggercCstj}|j|||dS)z*Configure a root logger from a dictionary.N)rrr)rr0rbrgr r r rn+szDictConfigurator.configure_rootN)F)F)F) r$r%r&r'r}rprqrrsrrrmrnr r r r r`s 5  r`cCst|jdS)z%Configure logging using a dictionary.N)dictConfigClassr})r0r r r dictConfig3sr)Z __future__rZlogging.handlersrr]r8rVZ pip._vendorrr^Irr r r7rrr(rr,robjectr-r`rrr r r r s*   & __pycache__/__init__.cpython-36.pyc000064400000007541152531432460013155 0ustar003 Pf@0@s dZddlmZmZddlZddlZddlmZyddlm Z Wn e k r`ddl m Z YnXyddl mZWn e k rddlmZYnXy ddlZWnRe k ryddlmZWn,e k rddlZeje_eje_YnXYnXyddlZdd ZWn*e k r2dd lmZd d ZYnXd d ddddddddg Zejd.krjdZddlmZn$ddlZe edZerejZndZejd/krddZ!d0ddZ"nddZ!d1ddZ"d d!Z#d"dZ$d#d$Z%d2Z&ejd3kre&d47Z&ej'j(d*pej'd+koej)d,kZ*d-dZ+dS)5zKStuff that differs in different Python versions and platform distributions.)absolute_importdivisionN) text_type) dictConfig) OrderedDict) ipaddresscCs"tjdtjdg}ttt|S)Nstdlib platstdlib) sysconfigget_pathsetfilterbool)pathsr/usr/lib/python3.6/__init__.py get_stdlib"s r)r cCs(tjddtjdddg}ttt|S)NT) standard_lib)rZ plat_specific)r Zget_python_libr r r)rrrrr+s logging_dictConfigr uses_pycacheconsole_to_str native_str get_path_uid stdlib_pkgsWINDOWSsamefilerT)cache_from_sourcerc Cs.y|jtjjStk r(|jdSXdS)Nutf_8)decodesys __stdout__encodingUnicodeDecodeError)srrrrGsFcCs"t|tr|jd|rdndS|S)Nzutf-8replacestrict) isinstancebytesr )r%r&rrrrMs cCs|S)Nr)r%rrrrSscCst|tr|jdS|S)Nzutf-8)r(rencode)r%r&rrrrVs  cCs<t|dr|jS|j|j|jddd}|dSdS)N total_secondsi i@Bi@B)hasattrr+Z microsecondsZsecondsZdays)Ztdvalrrrr+]s r+cCs`ttdr6tj|tjtjB}tj|j}tj|n&tjj |sPtj |j}n t d||S)a) Return path's uid. Does not follow symlinks: https://github.com/pypa/pip/pull/935#discussion_r5307003 Placed this function in compat due to differences on AIX and Jython, that should eventually go away. :raises OSError: When path is a symlink or can't be read. O_NOFOLLOWz1%s is a symlink; Will not return uid for symlinks) r/osopenO_RDONLYr1fstatst_uidclosepathislinkstatOSError)r8fdZfile_uidrrrres     cCs0tjj|}|jdr,|jdr,|dd}|S)zl Expand ~ and ~user constructions. Includes a workaround for http://bugs.python.org/issue14768 z~/z//N)r2r8 expanduser startswith)r8Zexpandedrrrr>s  r>pythonwsgirefargparsewinZclintcCsNttjdrtjj||Stjjtjj|}tjjtjj|}||kSdS)z>Provide an alternative for os.path.samefile on Windows/Python2rN)r/r2r8rnormcaseabspath)Zfile1Zfile2Zpath1Zpath2rrrrs  )rr)r)F)F)r@rA)rBrC)rD),__doc__Z __future__rrr2r!Zpip._vendor.sixrZlogging.configrr ImportErrorZpip.compat.dictconfig collectionsrZpip._vendor.ordereddictrZ pip._vendorZipaddrZ IPAddressZ ip_addressZ IPNetworkZ ip_networkr rZ distutils__all__ version_inforZimportlib.utilrZimpr/rrr+rr>rplatformr?namerrrrrrsh