def __init__(self, blueprint, memo=None): if type(blueprint) is type(()): self.a1 = blueprint[0] self.a2 = blueprint[1] else: self.a1 = Database.instantiate(blueprint.a1, memo) self.a2 = Database.instantiate(blueprint.a2, memo) if Utility.uniqueID(self.a2) < Utility.uniqueID(self.a1): self.a1, self.a2 = self.a2, self.a1 Utility.uniqueID.registerObject(self)
def __init__(self, blueprint, memo = None): if type(blueprint) is type(()): self.a1 = blueprint[0] self.a2 = blueprint[1] else: self.a1 = Database.instantiate(blueprint.a1, memo) self.a2 = Database.instantiate(blueprint.a2, memo) if Utility.uniqueID(self.a2) < Utility.uniqueID(self.a1): self.a1, self.a2 = self.a2, self.a1 Utility.uniqueID.registerObject(self)
def __init__(self, blueprint, memo): if isinstance(blueprint, basestring): blueprint = self.blueprintclass(blueprint) self.type = blueprint.type if hasattr(blueprint, 'name'): self.name = blueprint.name if memo is None: memo = {} memo[id(blueprint)] = self for attr in blueprint.instance: setattr(self, attr, Database.instantiate(getattr(blueprint, attr), memo))
def __init__(self, blueprint, memo): if isinstance(blueprint, basestring): blueprint = self.blueprintclass(blueprint) self.type = blueprint.type if hasattr(blueprint, 'name'): self.name = blueprint.name if memo is None: memo = {} memo[id(blueprint)] = self for attr in blueprint.instance: setattr(self, attr, Database.instantiate(getattr(blueprint, attr), memo))