def __init__(self, vfile): size = unpack('I', vfile.read(4))[0] data = vfile.read(size) if len(data) > 1: Variant.__init__(self, str(data)) else: Variant.__init__(self, None)
def __init__(self, vfile): data = unpack('Q', vfile.read(8))[0] #MS didn't differentiate absolute and relative time (time/datetime) #so use ugly trick heare if data >= 116444736000000000: #a date time should be superior than the lep between unix & ms epoch vt = vtime(data, TIME_MS_64) vt.thisown = False Variant.__init__(self, vt) else: Variant.__init__(self, data)
def __init__(self, vfile): Variant.__init__(self, unpack('H', vfile.read(2))[0])
def __init__(self, vfile): size = unpack('I', vfile.read(4))[0] data = vfile.read(size) data = unicode(data, 'UTF-16').encode('UTF-8') Variant.__init__(self, data)