""" t3Metaclass.py Provides various classes representing t3 metaclass objects. This code is based on the Tads 3 reference implementation by Michael J. Roberts. """ import struct, cStringIO from t3DataHolder import * from decimal import Decimal class T3Metaclass: def __init__(self, data): self.interpret_data(data) def report(self): return repr(self.to_python_val()) def report_deep(self, image): return self.report() class MetaTadsObject(T3Metaclass): """ Implementation of the t3 tads-object metaclass. """ def interpret_data(self, data): datastream = cStringIO.StringIO(data) mcdata = {} supcnt, pcnt, flgs = struct.unpack("<3H", datastream.read(6)) superclasses = [] for i in xrange(supcnt): objid = int(struct.unpack("