예제 #1
0
def fetch_profile_db(username):

    profile = profiles.find_one({"username": username})["profile"]

    return profile


def fetch_profile_mem(username):

    profile = mc.get("profile_" + str(username))

    if profile is None:
        return username

    return profile


# -----------------------------------
if __name__ == "__main__":

    namespace = namespaces.find_one({"blocks": 36000})

    usernames = namespace["namespace"]

    for username in usernames:
        print fetch_profile_namecoind(username)

    # pool = Pool(100)

    # pool.map(fetch_profile_mem, usernames)
예제 #2
0
proxy = AuthServiceProxy('http://*****:*****@localhost:8080')

# hack around absolute paths
current_dir = os.path.abspath(os.path.dirname(__file__))
parent_dir = os.path.abspath(current_dir + "/../")

sys.path.insert(0, parent_dir)

from server.resolver import namespaces


def get_profile(username):
    return proxy.get_profile(username)


def get_namespace():
    return proxy.get_namespace()


# -----------------------------------
if __name__ == '__main__':

    namespace = namespaces.find_one({"blocks": 36000})

    usernames = namespace['namespace']

    #for username in usernames:
    #    print get_profile(username)

    print get_namespace()
예제 #3
0
def get_namespace():

    namespace = namespaces.find_one({"blocks": VALID_BLOCKS})

    return namespace['profiles']
def get_namespace():

    namespace = namespaces.find_one({"blocks": VALID_BLOCKS})

    return namespace['profiles']