Foppe Hemminga 6 роки тому
батько
коміт
765cad5e54

+ 17 - 0
another_example.xml

@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='utf-8'?>
+<DealSets>
+    <DealSet ComplexityLevel="1" DealerDefault="South" IBIS-ID="196-Helmer-Wieringa-20180728"
+        VulnerabilityDefault="None">
+        <Parameters/>
+        <Deal Dealer="South" Number="34467" Vulnerability="None">
+            <Hand Clubs="AK74" Diamonds="Q96" Hearts="J9732" Position="West" Spades="T"/>
+            <Hand Clubs="9" Diamonds="J87" Hearts="AKT85" Position="East" Spades="A942"/>
+            <Bidding Bid="2S" Position="South"/>
+        </Deal>
+        <Deal Dealer="South" Number="34468" Vulnerability="None">
+            <Hand Clubs="K87" Diamonds="43" Hearts="432" Position="West" Spades="KJ732"/>
+            <Hand Clubs="AT32" Diamonds="AKQT62" Hearts="AJ" Position="East" Spades="A"/>
+            <Bidding Bid="2H" Position="South"/>
+        </Deal>
+    </DealSet>
+</DealSets>

+ 1 - 1
example.xml

@@ -2,7 +2,7 @@
 <DealSets>
     <DealSet ComplexityLevel="1" DealerDefault="North" IBIS-ID="196-Helmer-Wieringa-20190217" VulnerabilityDefault="None">
         <Parameters />
-        <Deal Dealer="North" Number="34469" Vulnerability="None">
+        <Deal Dealer="North" Number="34466" Vulnerability="None">
             <Hand Clubs="Q9" Diamonds="J3" Hearts="QT9" Position="West" Spades="AKT432" />
             <Hand Clubs="K753" Diamonds="KT8" Hearts="K754" Position="East" Spades="Q7" />
         </Deal>

+ 26 - 26
output.xml

@@ -1,152 +1,152 @@
 <?xml version='1.0' encoding='utf-8'?>
 <DealSets>
-	<DealSet ComplexityLevel="1" IBIS-ID="007-Foppe_Hemminga-20190218" VulnerabilityDefault="None">
+	<DealSet ComplexityLevel="1" IBIS-ID="007-Foppe-Hemminga-20190219" VulnerabilityDefault="None">
 		<Parameters/>
-		<Deal Dealer="West" Vulnerable="None">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="A754" Diamonds="K8" Hearts="JT7543" Position="North" Spades="2"/>
 			<Hand Clubs="JT82" Diamonds="AJ5" Hearts="KQ9" Position="East" Spades="875"/>
 			<Hand Clubs="6" Diamonds="Q9643" Hearts="2" Position="South" Spades="AQJ964"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="NS">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="876" Diamonds="KQ8" Hearts="Q72" Position="North" Spades="A965"/>
 			<Hand Clubs="AJ54" Diamonds="J96" Hearts="KJ3" Position="East" Spades="J72"/>
 			<Hand Clubs="T2" Diamonds="A543" Hearts="T954" Position="South" Spades="Q84"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="EW">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="AJ8" Diamonds="Q964" Hearts="J742" Position="North" Spades="94"/>
 			<Hand Clubs="7654" Diamonds="J83" Hearts="KQ3" Position="East" Spades="A52"/>
 			<Hand Clubs="T2" Diamonds="AK5" Hearts="T95" Position="South" Spades="QJ876"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="All">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="JT5" Diamonds="J54" Hearts="T7543" Position="North" Spades="A5"/>
 			<Hand Clubs="8642" Diamonds="KQ3" Hearts="KQJ" Position="East" Spades="942"/>
 			<Hand Clubs="A7" Diamonds="A986" Hearts="92" Position="South" Spades="QJ876"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="NS">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="874" Diamonds="AQ85" Hearts="K943" Position="North" Spades="Q6"/>
 			<Hand Clubs="AJT5" Diamonds="KJ4" Hearts="QT7" Position="East" Spades="952"/>
 			<Hand Clubs="62" Diamonds="963" Hearts="J52" Position="South" Spades="AJ874"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="EW">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="J6" Diamonds="AK94" Hearts="732" Position="North" Spades="Q976"/>
 			<Hand Clubs="T842" Diamonds="QJ6" Hearts="KT4" Position="East" Spades="AJ4"/>
 			<Hand Clubs="A75" Diamonds="853" Hearts="QJ95" Position="South" Spades="852"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="All">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="J42" Diamonds="J94" Hearts="J95" Position="North" Spades="QJ64"/>
 			<Hand Clubs="8765" Diamonds="AKQ" Hearts="Q73" Position="East" Spades="975"/>
 			<Hand Clubs="AT" Diamonds="8653" Hearts="KT42" Position="South" Spades="A82"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="None">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="754" Diamonds="A964" Hearts="KQ3" Position="North" Spades="Q42"/>
 			<Hand Clubs="AJT8" Diamonds="Q83" Hearts="T72" Position="East" Spades="A95"/>
 			<Hand Clubs="62" Diamonds="KJ5" Hearts="J954" Position="South" Spades="J876"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="EW">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="A85" Diamonds="Q98" Hearts="KT95" Position="North" Spades="542"/>
 			<Hand Clubs="J764" Diamonds="A63" Hearts="J43" Position="East" Spades="A76"/>
 			<Hand Clubs="T2" Diamonds="KJ54" Hearts="Q72" Position="South" Spades="QJ98"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="All">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="J54" Diamonds="KJ85" Hearts="Q72" Position="North" Spades="A84"/>
 			<Hand Clubs="T876" Diamonds="AQ6" Hearts="KT4" Position="East" Spades="Q75"/>
 			<Hand Clubs="A2" Diamonds="943" Hearts="J953" Position="South" Spades="J962"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="None">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="JT6" Diamonds="J65" Hearts="J5" Position="North" Spades="AJ985"/>
 			<Hand Clubs="8754" Diamonds="AQ9" Hearts="KQ3" Position="East" Spades="742"/>
 			<Hand Clubs="A2" Diamonds="K843" Hearts="T9742" Position="South" Spades="Q6"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="NS">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="JT" Diamonds="K863" Hearts="542" Position="North" Spades="Q742"/>
 			<Hand Clubs="A754" Diamonds="A95" Hearts="Q73" Position="East" Spades="986"/>
 			<Hand Clubs="862" Diamonds="QJ4" Hearts="KJT9" Position="South" Spades="AJ5"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="All">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="A6" Diamonds="J953" Hearts="QJ74" Position="North" Spades="Q87"/>
 			<Hand Clubs="JT54" Diamonds="KQ6" Hearts="T53" Position="East" Spades="A54"/>
 			<Hand Clubs="872" Diamonds="A84" Hearts="K92" Position="South" Spades="J962"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="None">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="842" Diamonds="KJ9" Hearts="Q7" Position="North" Spades="AQ986"/>
 			<Hand Clubs="AJ75" Diamonds="A53" Hearts="T94" Position="East" Spades="J54"/>
 			<Hand Clubs="T6" Diamonds="Q864" Hearts="KJ532" Position="South" Spades="72"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="NS">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="754" Diamonds="KJ" Hearts="Q974" Position="North" Spades="AJ94"/>
 			<Hand Clubs="J862" Diamonds="AQ5" Hearts="J53" Position="East" Spades="Q52"/>
 			<Hand Clubs="AT" Diamonds="98643" Hearts="KT2" Position="South" Spades="876"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="EW">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="T6" Diamonds="Q643" Hearts="K973" Position="North" Spades="985"/>
 			<Hand Clubs="A874" Diamonds="AJ8" Hearts="Q42" Position="East" Spades="742"/>
 			<Hand Clubs="J52" Diamonds="K95" Hearts="JT5" Position="South" Spades="AQJ6"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="None">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="J865" Diamonds="J654" Hearts="T74" Position="North" Spades="AQ"/>
 			<Hand Clubs="T742" Diamonds="A83" Hearts="KQ5" Position="East" Spades="J94"/>
 			<Hand Clubs="A" Diamonds="KQ9" Hearts="J932" Position="South" Spades="87652"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="NS">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="A42" Diamonds="983" Hearts="Q52" Position="North" Spades="J862"/>
 			<Hand Clubs="JT86" Diamonds="AJ5" Hearts="J74" Position="East" Spades="A95"/>
 			<Hand Clubs="75" Diamonds="KQ64" Hearts="KT93" Position="South" Spades="Q74"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="EW">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="74" Diamonds="AJ83" Hearts="9543" Position="North" Spades="J97"/>
 			<Hand Clubs="8652" Diamonds="KQ4" Hearts="KT7" Position="East" Spades="Q65"/>
 			<Hand Clubs="AJT" Diamonds="965" Hearts="QJ2" Position="South" Spades="A842"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="All">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="4" Diamonds="K95" Hearts="9732" Position="North" Spades="AJ742"/>
 			<Hand Clubs="J875" Diamonds="QJ8" Hearts="KQ5" Position="East" Spades="Q98"/>
 			<Hand Clubs="AT62" Diamonds="A643" Hearts="JT4" Position="South" Spades="65"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="NS">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="J5" Diamonds="A93" Hearts="QJ2" Position="North" Spades="QJ752"/>
 			<Hand Clubs="8642" Diamonds="KJ6" Hearts="K93" Position="East" Spades="A86"/>
 			<Hand Clubs="AT7" Diamonds="Q854" Hearts="T754" Position="South" Spades="94"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="EW">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="T62" Diamonds="AK953" Hearts="92" Position="North" Spades="754"/>
 			<Hand Clubs="J874" Diamonds="QJ8" Hearts="QT5" Position="East" Spades="A82"/>
 			<Hand Clubs="A5" Diamonds="64" Hearts="KJ743" Position="South" Spades="QJ96"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="All">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="86" Diamonds="A6543" Hearts="KT5" Position="North" Spades="AQ7"/>
 			<Hand Clubs="A754" Diamonds="KJ8" Hearts="Q73" Position="East" Spades="J94"/>
 			<Hand Clubs="JT2" Diamonds="Q9" Hearts="J942" Position="South" Spades="8652"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="None">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="4" Diamonds="853" Hearts="JT7" Position="North" Spades="J98754"/>
 			<Hand Clubs="JT52" Diamonds="A96" Hearts="432" Position="East" Spades="AQ2"/>
 			<Hand Clubs="A876" Diamonds="KQJ4" Hearts="KQ95" Position="South" Spades="6"/>
 			<Hand Clubs="KQ93" Diamonds="T72" Hearts="A86" Position="West" Spades="KT3"/>
 		</Deal>
-		<Deal Dealer="West" Vulnerable="EW">
+		<Deal Dealer="West" Vulnerability="None">
 			<Hand Clubs="7" Diamonds="J854" Hearts="QT72" Position="North" Spades="9842"/>
 			<Hand Clubs="JT85" Diamonds="K96" Hearts="KJ4" Position="East" Spades="Q65"/>
 			<Hand Clubs="A642" Diamonds="AQ3" Hearts="953" Position="South" Spades="AJ7"/>

+ 2 - 2
pbn2xml.py

@@ -36,10 +36,10 @@ def process_pbn(xml_root):
                 xml_deal = SubElement(xml_root, "Deal")
                 assert dealer in ["N", "E", "S", "W", ''], "Unknown Dealer {}".format(dealer)
                 if dealer:
-                    xml_deal.attrib["Dealer"] = dict_of_hands[dealer]
+                    xml_deal.attrib["Dealer"] = "West"  # dict_of_hands[dealer]
                 assert vulnerable in ["NS", "EW", "All", "None", ''], "Unknown vulnerable {}".format(vulnerable)
                 if vulnerable:
-                    xml_deal.attrib['Vulnerable'] = vulnerable
+                    xml_deal.attrib['Vulnerability'] = "None"  # vulnerable
                 i = 0
                 for hand in hands:
                     if '.' in hand:

+ 0 - 0
requirements.txt


+ 0 - 106
venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/chardet/charsetgroupprober.py

@@ -1,106 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-#   Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301  USA
-######################### END LICENSE BLOCK #########################
-
-from .enums import ProbingState
-from .charsetprober import CharSetProber
-
-
-class CharSetGroupProber(CharSetProber):
-    def __init__(self, lang_filter=None):
-        super(CharSetGroupProber, self).__init__(lang_filter=lang_filter)
-        self._active_num = 0
-        self.probers = []
-        self._best_guess_prober = None
-
-    def reset(self):
-        super(CharSetGroupProber, self).reset()
-        self._active_num = 0
-        for prober in self.probers:
-            if prober:
-                prober.reset()
-                prober.active = True
-                self._active_num += 1
-        self._best_guess_prober = None
-
-    @property
-    def charset_name(self):
-        if not self._best_guess_prober:
-            self.get_confidence()
-            if not self._best_guess_prober:
-                return None
-        return self._best_guess_prober.charset_name
-
-    @property
-    def language(self):
-        if not self._best_guess_prober:
-            self.get_confidence()
-            if not self._best_guess_prober:
-                return None
-        return self._best_guess_prober.language
-
-    def feed(self, byte_str):
-        for prober in self.probers:
-            if not prober:
-                continue
-            if not prober.active:
-                continue
-            state = prober.feed(byte_str)
-            if not state:
-                continue
-            if state == ProbingState.FOUND_IT:
-                self._best_guess_prober = prober
-                return self.state
-            elif state == ProbingState.NOT_ME:
-                prober.active = False
-                self._active_num -= 1
-                if self._active_num <= 0:
-                    self._state = ProbingState.NOT_ME
-                    return self.state
-        return self.state
-
-    def get_confidence(self):
-        state = self.state
-        if state == ProbingState.FOUND_IT:
-            return 0.99
-        elif state == ProbingState.NOT_ME:
-            return 0.01
-        best_conf = 0.0
-        self._best_guess_prober = None
-        for prober in self.probers:
-            if not prober:
-                continue
-            if not prober.active:
-                self.logger.debug('%s not active', prober.charset_name)
-                continue
-            conf = prober.get_confidence()
-            self.logger.debug('%s %s confidence = %s', prober.charset_name, prober.language, conf)
-            if best_conf < conf:
-                best_conf = conf
-                self._best_guess_prober = prober
-        if not self._best_guess_prober:
-            return 0.0
-        return best_conf

+ 0 - 417
venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/html5lib/treebuilders/base.py

@@ -1,417 +0,0 @@
-from __future__ import absolute_import, division, unicode_literals
-from pip._vendor.six import text_type
-
-from ..constants import scopingElements, tableInsertModeElements, namespaces
-
-# The scope markers are inserted when entering object elements,
-# marquees, table cells, and table captions, and are used to prevent formatting
-# from "leaking" into tables, object elements, and marquees.
-Marker = None
-
-listElementsMap = {
-    None: (frozenset(scopingElements), False),
-    "button": (frozenset(scopingElements | set([(namespaces["html"], "button")])), False),
-    "list": (frozenset(scopingElements | set([(namespaces["html"], "ol"),
-                                              (namespaces["html"], "ul")])), False),
-    "table": (frozenset([(namespaces["html"], "html"),
-                         (namespaces["html"], "table")]), False),
-    "select": (frozenset([(namespaces["html"], "optgroup"),
-                          (namespaces["html"], "option")]), True)
-}
-
-
-class Node(object):
-    """Represents an item in the tree"""
-    def __init__(self, name):
-        """Creates a Node
-
-        :arg name: The tag name associated with the node
-
-        """
-        # The tag name assocaited with the node
-        self.name = name
-        # The parent of the current node (or None for the document node)
-        self.parent = None
-        # The value of the current node (applies to text nodes and comments)
-        self.value = None
-        # A dict holding name -> value pairs for attributes of the node
-        self.attributes = {}
-        # A list of child nodes of the current node. This must include all
-        # elements but not necessarily other node types.
-        self.childNodes = []
-        # A list of miscellaneous flags that can be set on the node.
-        self._flags = []
-
-    def __str__(self):
-        attributesStr = " ".join(["%s=\"%s\"" % (name, value)
-                                  for name, value in
-                                  self.attributes.items()])
-        if attributesStr:
-            return "<%s %s>" % (self.name, attributesStr)
-        else:
-            return "<%s>" % (self.name)
-
-    def __repr__(self):
-        return "<%s>" % (self.name)
-
-    def appendChild(self, node):
-        """Insert node as a child of the current node
-
-        :arg node: the node to insert
-
-        """
-        raise NotImplementedError
-
-    def insertText(self, data, insertBefore=None):
-        """Insert data as text in the current node, positioned before the
-        start of node insertBefore or to the end of the node's text.
-
-        :arg data: the data to insert
-
-        :arg insertBefore: True if you want to insert the text before the node
-            and False if you want to insert it after the node
-
-        """
-        raise NotImplementedError
-
-    def insertBefore(self, node, refNode):
-        """Insert node as a child of the current node, before refNode in the
-        list of child nodes. Raises ValueError if refNode is not a child of
-        the current node
-
-        :arg node: the node to insert
-
-        :arg refNode: the child node to insert the node before
-
-        """
-        raise NotImplementedError
-
-    def removeChild(self, node):
-        """Remove node from the children of the current node
-
-        :arg node: the child node to remove
-
-        """
-        raise NotImplementedError
-
-    def reparentChildren(self, newParent):
-        """Move all the children of the current node to newParent.
-        This is needed so that trees that don't store text as nodes move the
-        text in the correct way
-
-        :arg newParent: the node to move all this node's children to
-
-        """
-        # XXX - should this method be made more general?
-        for child in self.childNodes:
-            newParent.appendChild(child)
-        self.childNodes = []
-
-    def cloneNode(self):
-        """Return a shallow copy of the current node i.e. a node with the same
-        name and attributes but with no parent or child nodes
-        """
-        raise NotImplementedError
-
-    def hasContent(self):
-        """Return true if the node has children or text, false otherwise
-        """
-        raise NotImplementedError
-
-
-class ActiveFormattingElements(list):
-    def append(self, node):
-        equalCount = 0
-        if node != Marker:
-            for element in self[::-1]:
-                if element == Marker:
-                    break
-                if self.nodesEqual(element, node):
-                    equalCount += 1
-                if equalCount == 3:
-                    self.remove(element)
-                    break
-        list.append(self, node)
-
-    def nodesEqual(self, node1, node2):
-        if not node1.nameTuple == node2.nameTuple:
-            return False
-
-        if not node1.attributes == node2.attributes:
-            return False
-
-        return True
-
-
-class TreeBuilder(object):
-    """Base treebuilder implementation
-
-    * documentClass - the class to use for the bottommost node of a document
-    * elementClass - the class to use for HTML Elements
-    * commentClass - the class to use for comments
-    * doctypeClass - the class to use for doctypes
-
-    """
-    # pylint:disable=not-callable
-
-    # Document class
-    documentClass = None
-
-    # The class to use for creating a node
-    elementClass = None
-
-    # The class to use for creating comments
-    commentClass = None
-
-    # The class to use for creating doctypes
-    doctypeClass = None
-
-    # Fragment class
-    fragmentClass = None
-
-    def __init__(self, namespaceHTMLElements):
-        """Create a TreeBuilder
-
-        :arg namespaceHTMLElements: whether or not to namespace HTML elements
-
-        """
-        if namespaceHTMLElements:
-            self.defaultNamespace = "http://www.w3.org/1999/xhtml"
-        else:
-            self.defaultNamespace = None
-        self.reset()
-
-    def reset(self):
-        self.openElements = []
-        self.activeFormattingElements = ActiveFormattingElements()
-
-        # XXX - rename these to headElement, formElement
-        self.headPointer = None
-        self.formPointer = None
-
-        self.insertFromTable = False
-
-        self.document = self.documentClass()
-
-    def elementInScope(self, target, variant=None):
-
-        # If we pass a node in we match that. if we pass a string
-        # match any node with that name
-        exactNode = hasattr(target, "nameTuple")
-        if not exactNode:
-            if isinstance(target, text_type):
-                target = (namespaces["html"], target)
-            assert isinstance(target, tuple)
-
-        listElements, invert = listElementsMap[variant]
-
-        for node in reversed(self.openElements):
-            if exactNode and node == target:
-                return True
-            elif not exactNode and node.nameTuple == target:
-                return True
-            elif (invert ^ (node.nameTuple in listElements)):
-                return False
-
-        assert False  # We should never reach this point
-
-    def reconstructActiveFormattingElements(self):
-        # Within this algorithm the order of steps described in the
-        # specification is not quite the same as the order of steps in the
-        # code. It should still do the same though.
-
-        # Step 1: stop the algorithm when there's nothing to do.
-        if not self.activeFormattingElements:
-            return
-
-        # Step 2 and step 3: we start with the last element. So i is -1.
-        i = len(self.activeFormattingElements) - 1
-        entry = self.activeFormattingElements[i]
-        if entry == Marker or entry in self.openElements:
-            return
-
-        # Step 6
-        while entry != Marker and entry not in self.openElements:
-            if i == 0:
-                # This will be reset to 0 below
-                i = -1
-                break
-            i -= 1
-            # Step 5: let entry be one earlier in the list.
-            entry = self.activeFormattingElements[i]
-
-        while True:
-            # Step 7
-            i += 1
-
-            # Step 8
-            entry = self.activeFormattingElements[i]
-            clone = entry.cloneNode()  # Mainly to get a new copy of the attributes
-
-            # Step 9
-            element = self.insertElement({"type": "StartTag",
-                                          "name": clone.name,
-                                          "namespace": clone.namespace,
-                                          "data": clone.attributes})
-
-            # Step 10
-            self.activeFormattingElements[i] = element
-
-            # Step 11
-            if element == self.activeFormattingElements[-1]:
-                break
-
-    def clearActiveFormattingElements(self):
-        entry = self.activeFormattingElements.pop()
-        while self.activeFormattingElements and entry != Marker:
-            entry = self.activeFormattingElements.pop()
-
-    def elementInActiveFormattingElements(self, name):
-        """Check if an element exists between the end of the active
-        formatting elements and the last marker. If it does, return it, else
-        return false"""
-
-        for item in self.activeFormattingElements[::-1]:
-            # Check for Marker first because if it's a Marker it doesn't have a
-            # name attribute.
-            if item == Marker:
-                break
-            elif item.name == name:
-                return item
-        return False
-
-    def insertRoot(self, token):
-        element = self.createElement(token)
-        self.openElements.append(element)
-        self.document.appendChild(element)
-
-    def insertDoctype(self, token):
-        name = token["name"]
-        publicId = token["publicId"]
-        systemId = token["systemId"]
-
-        doctype = self.doctypeClass(name, publicId, systemId)
-        self.document.appendChild(doctype)
-
-    def insertComment(self, token, parent=None):
-        if parent is None:
-            parent = self.openElements[-1]
-        parent.appendChild(self.commentClass(token["data"]))
-
-    def createElement(self, token):
-        """Create an element but don't insert it anywhere"""
-        name = token["name"]
-        namespace = token.get("namespace", self.defaultNamespace)
-        element = self.elementClass(name, namespace)
-        element.attributes = token["data"]
-        return element
-
-    def _getInsertFromTable(self):
-        return self._insertFromTable
-
-    def _setInsertFromTable(self, value):
-        """Switch the function used to insert an element from the
-        normal one to the misnested table one and back again"""
-        self._insertFromTable = value
-        if value:
-            self.insertElement = self.insertElementTable
-        else:
-            self.insertElement = self.insertElementNormal
-
-    insertFromTable = property(_getInsertFromTable, _setInsertFromTable)
-
-    def insertElementNormal(self, token):
-        name = token["name"]
-        assert isinstance(name, text_type), "Element %s not unicode" % name
-        namespace = token.get("namespace", self.defaultNamespace)
-        element = self.elementClass(name, namespace)
-        element.attributes = token["data"]
-        self.openElements[-1].appendChild(element)
-        self.openElements.append(element)
-        return element
-
-    def insertElementTable(self, token):
-        """Create an element and insert it into the tree"""
-        element = self.createElement(token)
-        if self.openElements[-1].name not in tableInsertModeElements:
-            return self.insertElementNormal(token)
-        else:
-            # We should be in the InTable mode. This means we want to do
-            # special magic element rearranging
-            parent, insertBefore = self.getTableMisnestedNodePosition()
-            if insertBefore is None:
-                parent.appendChild(element)
-            else:
-                parent.insertBefore(element, insertBefore)
-            self.openElements.append(element)
-        return element
-
-    def insertText(self, data, parent=None):
-        """Insert text data."""
-        if parent is None:
-            parent = self.openElements[-1]
-
-        if (not self.insertFromTable or (self.insertFromTable and
-                                         self.openElements[-1].name
-                                         not in tableInsertModeElements)):
-            parent.insertText(data)
-        else:
-            # We should be in the InTable mode. This means we want to do
-            # special magic element rearranging
-            parent, insertBefore = self.getTableMisnestedNodePosition()
-            parent.insertText(data, insertBefore)
-
-    def getTableMisnestedNodePosition(self):
-        """Get the foster parent element, and sibling to insert before
-        (or None) when inserting a misnested table node"""
-        # The foster parent element is the one which comes before the most
-        # recently opened table element
-        # XXX - this is really inelegant
-        lastTable = None
-        fosterParent = None
-        insertBefore = None
-        for elm in self.openElements[::-1]:
-            if elm.name == "table":
-                lastTable = elm
-                break
-        if lastTable:
-            # XXX - we should really check that this parent is actually a
-            # node here
-            if lastTable.parent:
-                fosterParent = lastTable.parent
-                insertBefore = lastTable
-            else:
-                fosterParent = self.openElements[
-                    self.openElements.index(lastTable) - 1]
-        else:
-            fosterParent = self.openElements[0]
-        return fosterParent, insertBefore
-
-    def generateImpliedEndTags(self, exclude=None):
-        name = self.openElements[-1].name
-        # XXX td, th and tr are not actually needed
-        if (name in frozenset(("dd", "dt", "li", "option", "optgroup", "p", "rp", "rt")) and
-                name != exclude):
-            self.openElements.pop()
-            # XXX This is not entirely what the specification says. We should
-            # investigate it more closely.
-            self.generateImpliedEndTags(exclude)
-
-    def getDocument(self):
-        """Return the final tree"""
-        return self.document
-
-    def getFragment(self):
-        """Return the final fragment"""
-        # assert self.innerHTML
-        fragment = self.fragmentClass()
-        self.openElements[0].reparentChildren(fragment)
-        return fragment
-
-    def testSerializer(self, node):
-        """Serialize the subtree of node in the format required by unit tests
-
-        :arg node: the node from which to start serializing
-
-        """
-        raise NotImplementedError

+ 0 - 19
venv/lib/python3.7/site-packages/pip-10.0.1-py3.7.egg/pip/_vendor/urllib3/packages/ssl_match_hostname/__init__.py

@@ -1,19 +0,0 @@
-import sys
-
-try:
-    # Our match_hostname function is the same as 3.5's, so we only want to
-    # import the match_hostname function if it's at least that good.
-    if sys.version_info < (3, 5):
-        raise ImportError("Fallback to vendored code")
-
-    from ssl import CertificateError, match_hostname
-except ImportError:
-    try:
-        # Backport of the function from a pypi module
-        from backports.ssl_match_hostname import CertificateError, match_hostname
-    except ImportError:
-        # Our vendored copy
-        from ._implementation import CertificateError, match_hostname
-
-# Not needed, but documenting what we provide.
-__all__ = ('CertificateError', 'match_hostname')