Esempio n. 1
0
def upgrade(from_version, to_version):
    from share import upgrade
    if from_version==1 and to_version==2:
        import rooms
        for room in rooms.ls():
            cls = class_as_string(room)
            if cls == 'TeleTrap':
                print 'upgrading', room, cls
                updated = upgrade(room)

        commit()
Esempio n. 2
0
def upgrade(from_version, to_version):
    from share import upgrade
    if from_version==0 and to_version==1:
        from db import TZDict
        dbroot['exits'] = TZDict()
        commit()

        all_exits = []
        import rooms
        for room in rooms.ls():
            all_exits.extend(room.exits())

        for x in all_exits:
            print 'upgrading', x
            updated = upgrade(x, Exit)
            updated.destination = rooms.get(updated._destid)
            add(updated)

        commit()