Closed fosstrack closed 10 years ago
As a workaround, you could always call get / put / post using keyword arguments:
result = f.get('/pins/3', name=None, connection=None, params={'print': 'pretty'}, headers={'X_FANCY_HEADER': 'VERY FANCY'})
this is not working, how did you patch the decorator ?
It's been fixed by https://github.com/ozgur/python-firebase/pull/25. Closing this one.
Hi @ozgur! I still have the same issue:
#!/usr/local/bin/python3
from firebase import firebase
authentication = firebase.FirebaseAuthentication('password', 'username@domain.com')
myFirebase = firebase.FirebaseApplication('https://myproject.firebaseio.com',authentication)
result = myFirebase.get('/link', None, {'print': 'pretty'})
print (result)
bash-3.2$ ./1.py
Traceback (most recent call last):
File "./1.py", line 11, in
I've got the same error:
Traceback (most recent call last): File "firebaseconnect.py", line 12, in
result = firebase.get('/users', None, {'print': 'pretty'}) File "/usr/local/lib/python2.7/dist-packages/firebase/decorators.py", line 19, in wrapped return f(_args, *_kwargs) TypeError: get() got multiple values for keyword argument 'connection'
Im using this code:
from firebase import firebase
from firebase.firebase import FirebaseApplication, FirebaseAuthentication
authentication = firebase.FirebaseAuthentication('pass123', 'info@santiapps.com', extra={'id': 123})
firebase = firebase.FirebaseApplication('https://mystorage.firebaseio.com', authentication)
firebase.authentication = authentication
print authentication.extra
user = authentication.get_user()
print user.firebase_auth_token
result = firebase.get('/users', None, {'print': 'pretty'})
print result
Please help?
I tried same code sample of quique123 and received same error.
My code:
from firebase import firebase
from firebase.firebase import FirebaseApplication, FirebaseAuthentication
authentication = firebase.FirebaseAuthentication('passcode', 'dummyacct@dummy.com')
firebase = firebase.FirebaseApplication('https://myapp.firebaseio.com', authentication)
firebase.authentication = authentication
print (authentication.extra)
user = authentication.get_user()
print (user.firebase_auth_token)
result = firebase.get('/users', None, {'print': 'pretty'})
print (result)
Error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-21-974ae75a3869> in <module>
9 print (user.firebase_auth_token)
10
---> 11 result = firebase.get('/users', None, {'print': 'pretty'})
12 print (result)
13
/anaconda3/envs/py36/lib/python3.6/site-packages/firebase/decorators.py in wrapped(*args, **kwargs)
17 connection.timeout = timeout
18 connection.headers.update({'Content-type': 'application/json'})
---> 19 return f(*args, **kwargs)
20 return wraps(f)(wrapped)
21 return wrapper
TypeError: get() got multiple values for argument 'connection'
I'm running this code on Python 3.6.8 :: Anaconda, Inc.
Please help.
firebase.get('/users', None, {'print': 'pretty'})
Try this istead: firebase.get('/users', None, connection=None, params={'print': 'pretty'})
Following the get examples in the documentation, here's my ipython session. Using python 2.7.3.
In [1]: from firebase import firebase In [2]: f = firebase.FirebaseApplication('https://.firebaseio.com')
In [3]: result = f.get('/pins/3', None, None, {'print': 'pretty'}, {'X_FANCY_HEADER': 'VERY FANCY'})
TypeError Traceback (most recent call last)