|
|
@@ -9,6 +9,8 @@ import xml.dom.minidom
|
|
|
def process_pbn(xml_root):
|
|
|
order_of_suits = ["Spades", "Hearts", "Diamonds", "Clubs"]
|
|
|
dict_of_hands = {"N": "North", "E": "East", "S": "South", "W": "West"}
|
|
|
+ dealer = ''
|
|
|
+ vulnerable = ''
|
|
|
with open('hands.pbn', 'r') as f_pbn:
|
|
|
for line in f_pbn:
|
|
|
if not line.strip():
|
|
|
@@ -17,7 +19,7 @@ def process_pbn(xml_root):
|
|
|
if '[Dealer' in line:
|
|
|
dealer = line[9]
|
|
|
if '[Vulnerable' in line:
|
|
|
- reg = m = re.search('NS|EW|All|None', line)
|
|
|
+ reg = re.search('NS|EW|All|None', line)
|
|
|
vulnerable = reg.group(0)
|
|
|
if '[Deal ' in line:
|
|
|
# print('{}'.format(line))
|
|
|
@@ -58,7 +60,7 @@ if __name__ == '__main__':
|
|
|
xml_dealsets = Element("DealSets")
|
|
|
xml_dealset = SubElement(xml_dealsets, "DealSet")
|
|
|
xml_dealset.attrib["ComplexityLevel"] = "1"
|
|
|
- xml_dealset.attrib["IBIS-ID"] = "007-Foppe_Hemminga-{}".format(date.today().strftime('%Y%m%d'))
|
|
|
+ xml_dealset.attrib["IBIS-ID"] = "007-Foppe-Hemminga-{}".format(date.today().strftime('%Y%m%d'))
|
|
|
xml_dealset.attrib["VulnerabilityDefault"] = "None"
|
|
|
SubElement(xml_dealset, "Parameters")
|
|
|
process_pbn(xml_dealset)
|