Beispiel #1
0
def get_bitcoin_account(address_key=None, address=None):
    if address:
        address_key = KEY_BITCOIN_ACCOUNT + address

    data = db.hgetall(address_key)
    try:
        data['balance'] = int(data['balance'])
    except KeyError:
        data['balance'] = -1
    return data
Beispiel #2
0
def get_bitcoin_account(address_key=None, address=None):
    if address:
        address_key=KEY_BITCOIN_ACCOUNT+address

    data = db.hgetall(address_key)
    try:
        data['balance'] = int(data['balance'])
    except KeyError:
        data['balance'] = -1
    return data
Beispiel #3
0
def get_linkedin_account(username_key=None, username=None):
    if username:
        username_key = KEY_LINKEDIN_ACCOUNT + username

    data = db.hgetall(username_key)
    try:
        data['count'] = int(data['count'])
    except KeyError:
        data['count'] = -1
    return data
Beispiel #4
0
def get_linkedin_account(username_key=None, username=None):
    if username:
        username_key=KEY_LINKEDIN_ACCOUNT+username

    data = db.hgetall(username_key)
    try:
        data['count'] = int(data['count'])
    except KeyError:
        data['count'] = -1
    return data
Beispiel #5
0
def load_user(username):
    """Return a User object.
       Arguments:
       username -- A username.
    """
    account_key = KEY_USER_ACCOUNT+username
    if not db.exists(account_key):
        return None

    from users import User
    return User(db.hgetall(account_key))
Beispiel #6
0
def load_user(username):
    """Return a User object.

       Arguments:

       username -- A username.
    """
    account_key = KEY_USER_ACCOUNT+username
    if not db.exists(account_key):
        return None

    return User(db.hgetall(account_key))
Beispiel #7
0
def get_all_imgur_tokens():
    all_imgur_tokens = []
    for key in db.smembers(KEY_IMGUR_TOKENS):
        all_imgur_tokens.append(db.hgetall(key))
        all_imgur_tokens[-1]['count'] = int(all_imgur_tokens[-1]['count'])
    return all_imgur_tokens
Beispiel #8
0
def get_canarydrop(canarytoken=None):
    canarydrop = db.hgetall(KEY_CANARYDROP + canarytoken)
    if 'triggered_list' in canarydrop.keys():
        canarydrop['triggered_list'] = simplejson.loads(
            canarydrop['triggered_list'])
    return canarydrop
Beispiel #9
0
def get_canarydrop(canarytoken=None):
    return db.hgetall(KEY_CANARYDROP+canarytoken)
Beispiel #10
0
def get_all_imgur_tokens():
    all_imgur_tokens = []
    for key in db.smembers(KEY_IMGUR_TOKENS):
        all_imgur_tokens.append(db.hgetall(key))
        all_imgur_tokens[-1]['count'] = int(all_imgur_tokens[-1]['count'])
    return all_imgur_tokens
Beispiel #11
0
def get_kc_hits(key):
    return (db.hgetall("{}{}".format(KEY_KUBECONFIG_HITS, key)),
            db.pttl("{}{}".format(KEY_KUBECONFIG_HITS, key)))
Beispiel #12
0
def get_certificate(key, _type=None):
    certificate = db.hgetall("{}{}".format(KEY_KUBECONFIG_CERTS, key))
    if certificate is not None and _type is not None:
        return certificate.get(_type, None)

    return certificate
Beispiel #13
0
def get_canarydrop(canarytoken=None):
    return db.hgetall(KEY_CANARYDROP + canarytoken)
Beispiel #14
0
def get_canarydrop(canarytoken=None):
    canarydrop = db.hgetall(KEY_CANARYDROP+canarytoken)
    if 'triggered_list' in canarydrop.keys():
        canarydrop['triggered_list'] = simplejson.loads(canarydrop['triggered_list'])
    return canarydrop