

@tornado.gen.coroutine
def external_portal_description(self, portid, done=False):
    'Load up enough information about an external portal\n        to display it.\n        Returns an object with world, location, creator, portaldesc,\n        and done fields. (The done argument is just passed along.\n        This indicates whether the "put into your list" action is complete\n        or not.)\n        Raises an exception if anything goes wrong.\n        '
    portal = (yield world.check_external_portal(portid))
    world = (yield motor.Op(self.application.mongodb.worlds.find_one, {
        '_id': portal['wid'],
    }, {
        'name': 1,
        'creator': 1,
    }))
    location = (yield motor.Op(self.application.mongodb.locations.find_one, {
        '_id': portal['locid'],
    }, {
        'name': 1,
    }))
    creator = (yield motor.Op(self.application.mongodb.players.find_one, {
        '_id': world['creator'],
    }, {
        'name': 1,
    }))
    portaldesc = (yield motor.Op(self.application.mongodb.worldprop.find_one, {
        'wid': portal['wid'],
        'locid': portal['locid'],
        'key': 'portaldesc',
    }))
    if (not portaldesc):
        portaldesc = (yield motor.Op(self.application.mongodb.worldprop.find_one, {
            'wid': portal['wid'],
            'locid': None,
            'key': 'portaldesc',
        }))
    if (not portaldesc):
        portaldesc = {
            'val': self.application.twlocalize('message.no_portaldesc'),
        }
    portaldesc = portaldesc['val']
    if (isinstance(portaldesc, dict) and (portaldesc.get('type', None) == 'text')):
        portaldesc = portaldesc.get('text', '???')
    return types.SimpleNamespace(world=world['name'], location=location['name'], creator=creator['name'], portaldesc=portaldesc, done=done)

dataset/ETHPy150Open erkyrath/tworld/lib/tweblib/handlers.py MyHandlerMixin.external_portal_description/VarMisuse@29/155 `self`->`world`