Commit c61b15db authored by yannk's avatar yannk
Browse files

Added reading of typ type of GS - Change __init__ method for read one

parent 31d25e06
......@@ -33,7 +33,9 @@ class Georges():
"""
Class to manipulate georges sheets
"""
def __init__(self, path, dfn_path):
def read(self, path, dfn_path):
"""
Parse the given XML file
Initiate Class attributes
......@@ -59,7 +61,24 @@ class Georges():
elif self.type == 'DFN':
pass
elif self.type == 'TYPE':
pass
# The .typ file returns a dict
# Key is name
# value is a list with :
# 1. List of typ attributes (a dict)
# 2. List of possibles Values/Labels (a list)
# 3. Possible comments & Logs (a list)
self.content = {}
value = self.root.attrib
content = []
varia = []
for element in self.root:
if element.tag =='DEFINITION':
content.append(element.attrib)
else:
varia.append((element.tag, element.text))
self.content[self.name]=[value, content, varia]
return self.content
else:
print('Unknown type : {}. Pass.'.format(self.type))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment