예제 #1
0
def profile(request):
    id_ = request.matchdict['id']
    if id_ == 'test':
        data = {
            'name':
            'Ronan Amicel',
            'email': [
                '*****@*****.**',
                '*****@*****.**',
            ],
            'bitcoin': [
                '1NnZFxcyFoM8MBiNckhXh3jDRrjz3n43ZU',
                '1NnZFxcyFoM8MBiNckhXh3jDRrjz3n43ZU',
            ],
            'namecoin': [
                'MyRZ5YHpqGiS288smQfpXtN62W9a3ZoDEg',
                'MyRZ5YHpqGiS288smQfpXtN62W9a3ZoDEg',
            ],
            'photo_url':
            "http://www.gravatar.com/avatar/b06b5d4777e2734feb91298062539ec8?s=256",
        }
    else:
        proxy = NamecoinProxy()
        try:
            response = proxy.name_show('id/{}'.format(request.matchdict['id']))
        except KeyError:
            raise NotFound
        pprint(response)
        value = response.get('value')
        try:
            data = json.loads(value)
        except ValueError:
            raise NotFound
    return data
예제 #2
0
def info(request):
    proxy = NamecoinProxy()
    return proxy.getinfo()