예제 #1
0
파일: data.py 프로젝트: shiwano/cwpy
    def __init__(self, fpath="", element=None):
        if not element:
            element = xml2element(fpath)

        ElementTree.__init__(self, element=element)
        self.fpath = element.fpath if hasattr(element, "fpath") else ""
        self.is_edited = False
예제 #2
0
    def __init__(self,root_tag='JaliInput',code_name=None):
        ElementTree.__init__(self)

        # Define the root element
        root = Element(root_tag)
        if code_name != None:
            root.set('code_name',code_name)

        self._setroot(root)
        self.root = root
예제 #3
0
    def __init__(self, name=None, file=None):

        # Throw an error if name or file is not defined
        if name is None and file is None:
            raise ValueError('creating ParameterList instance requires a name' \
                              + ' or file')

        if name is not None:
            root = ParameterListRoot(name)
            ElementTree.__init__(self, element=root, file=None)
        else:
            ElementTree.__init__(self, element=None, file=file)
예제 #4
0
 def __init__(self, fname, athlete):
     ElementTree.__init__(self)
     self.root = self.__initialize__(fname)
     self.activity = self.root.findall('.//Activity')
     self.activitytype = []
     self.id = []
     self.laps = []
     self.athlete = athlete
     for act in self.activity:
         self.activitytype.append(act.attrib)
         self.id.append(act.find('Id').text)
         for lap in range(1,len(act)-1):
             self.laps.append(act[lap])
예제 #5
0
    def __init__(self, root: Form) -> None:
        root.set("relation", "root")

        ElementTree.__init__(self, root)
 def __init__ (self, name):
     ElementTree.__init__(self)
     self.parse(name)