示例#1
0
 def rpc_get_xfers(self, username):
     xfers = []
     for xfer in bank_client.get_log(username):
         xfers.append({ 'sender': xfer['sender'],
                        'recipient': xfer['recipient'],
                        'amount': xfer['amount'],
                        'time': xfer['time'],
                      })
     return xfers
 def rpc_get_xfers(self, username):
     xfers = []
     for xfer in bank.get_log(username):
         #print("[get_xfers] UID: ", os.getresuid(), "GID: ", os.getresgid())
         xfers.append({
             'sender': xfer.sender,
             'recipient': xfer.recipient,
             'amount': xfer.amount,
             'time': xfer.time,
         })
     return xfers
示例#3
0
def users():
    args = {}
    args['req_user'] = Markup(request.args.get('user', ''))
    if 'user' in request.values:
        persondb = person_setup()
        user = persondb.query(Person).get(request.values['user'])
        if user:
            p = user.profile
            if p.startswith("#!python"):
                p = run_profile(user)

            p_markup = Markup("<b>%s</b>" % p)
            args['profile'] = p_markup

            args['user'] = user
            args['user_zoobars'] = bank_client.balance(user.username)
            args['transfers'] = bank_client.get_log(user.username)
        else:
            args['warning'] = "Cannot find that user."
    return render_template('users.html', **args)
示例#4
0
def users():
    args = {}
    args['req_user'] = Markup(request.args.get('user', ''))
    if 'user' in request.values:
        persondb = person_setup()
        user = persondb.query(Person).get(request.values['user'])
        if user:
            p = user.profile
            if p.startswith("#!python"):
                p = run_profile(user)

            p_markup = Markup("<b>%s</b>" % p)
            args['profile'] = p_markup

            args['user'] = user
            args['user_zoobars'] = bank_client.balance(user.username)
            args['transfers'] = bank_client.get_log(user.username)
        else:
            args['warning'] = "Cannot find that user."
    return render_template('users.html', **args)
示例#5
0
 def rpc_get_xfers(self, username):
     return bank_client.get_log(username)