Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(19)  |  Call(19)  |  Derive(0)  |  Import(0)

src/b/n/bnw-HEAD/bnw/xmpp/stupid_handler.py   bnw(Download)
        message_from = JID(msg['from'])
        message_bare_from = message_from.userhost()
        message_user = (yield objs.User.find_one({'jids': message_bare_from}))
        if not message_user:
            message_user = (yield objs.User.find_one({'jid': message_bare_from}))
def failure(msg):
    _from = JID(msg['from'])
    bare_from = _from.userhost()
    user = (yield objs.User.find_one({'jid': bare_from}))  # only active jid
    if not user:
        iq_from = JID(msg['from'])
        iq_bare_from = iq_from.userhost()
        iq_user = (yield objs.User.find_one({'jids': iq_bare_from}))
        if not iq_user:
            iq_user = (yield objs.User.find_one({'jid': iq_bare_from}))

src/b/n/bnw-HEAD/bnw/handlers/command_jids.py   bnw(Download)
        if (add in request.user['jids']) or (add in request.user['pending_jids']):
            defer.returnValue(dict(ok=False, desc='JID already added.'))
        other_user = yield objs.User.find_one({'jids': add})
        if not other_user:
            other_user = yield objs.User.find_one({'pending_jids': add})
        if not other_user:
            other_user = yield objs.User.find_one({'jid': add})
        defer.returnValue(dict(ok=False, desc='You are already registered.'))
    teh_user = yield objs.User.find_one({'pending_jids': request.jid.userhost(), 'name': code})
    if not teh_user:

src/b/n/bnw-HEAD/bnw/handlers/command_register.py   bnw(Download)
            if not (yield objs.User.find_one({'name': name})):
                _ = yield user.save()

src/b/n/bnw-HEAD/bnw/web/site.py   bnw(Download)
    def respond(self, username, reco=None, tag=None):
        _ = yield self.get_auth_user()
        f = [("date", -1)]
        user = (yield objs.User.find_one({'name': username}))
        page = get_page(self)
    def respond(self, username, tag=None):
        _ = yield self.get_auth_user()
        f = [("date", -1)]
        user = (yield objs.User.find_one({'name': username}))
        page = get_page(self)
    def respond(self, username, thumb=''):
        self.set_header('Cache-Control', 'max-age=3600, public')
        self.set_header('Vary', 'Accept-Encoding')
        user = yield objs.User.find_one({'name': username})
        if not (user and user.get('avatar') and False):

src/b/n/bnw-HEAD/bnw/web/auth.py   bnw(Download)
    def respond(self):
        key = self.get_argument('key', '')
        user = yield objs.User.find_one({'login_key': key})
        if user:
            if self.request.protocol == 'https':
    def get_auth_user(self):
        if not getattr(self, 'user', None):
            key = self.get_cookie('bnw_loginkey', '')
            self.user = yield objs.User.find_one({'login_key': key}) \
                if key else None

src/b/n/bnw-HEAD/bnw/web/api.py   bnw(Download)
    def respond_post(self, cmd_name):
        stime = time.time()
        user = yield objs.User.find_one(
            {'login_key': self.get_argument('login', '')})
        self.set_header('Content-Type', 'application/json; charset=utf-8')

src/b/n/bnw-HEAD/bnw/handlers/command_userinfo.py   bnw(Download)
def cmd_userinfo(request, user=''):
    # DB interactions
    if not user:
        defer.returnValue(dict(ok=False, desc='Username required.'))
    user_obj = yield objs.User.find_one({'name': user})

src/b/n/bnw-HEAD/bnw/handlers/command_pm.py   bnw(Download)
    if len(text) > 2048:
        defer.returnValue(dict(ok=False, desc='Too long.'))
    target_user = yield objs.User.find_one({'name': user})
    if not target_user:
        defer.returnValue(dict(ok=False, desc='No such user.'))

src/b/n/bnw-HEAD/bnw/handlers/command_login.py   bnw(Download)
def cmd_passlogin(request, user=None, password=None):
    """ Логин паролем """
    if not (user and password):
        defer.returnValue(dict(ok=False, desc='Credentials cannot be empty.'))
    u = yield objs.User.find_one({'name': user, 'settings.password': password})