@classmethod
    def fromXML(cls, element, parent):
        '''Create the object from the XML element and attach it to the parent.
        '''
        kw = loadxml.parseAttributes(element)
        text = xml.sax.saxutils.unescape(element.text)

        t = kw.get('type')
        if t == 'integer':
            value = int(text)
        elif t == 'time':
            if ':' in text:
                # (h:)m:s value
                value = map(int, text.split(':'))
                if len(value) == 2: m, s = value[0], value[1]
                else: h, m, s = value[0], value[1], value[2]
            else:
                # seconds value
                value = int(text)
                s = value % 60
                m = (value / 60) % 60
                h = value / 360
            value = datetime.time(h, m, s)
        else:
            value = text

        obj = cls(parent, value, **kw)

        #for child in element.getchildren():
        #    loadxml.getConstructor(element.tag)(child, obj)
        return obj
dataset/ETHPy150Open ardekantur/pyglet/contrib/wydget/wydget/widgets/table.py/Cell.fromXML/original