[web2py] Re: dropbox python api
Joseph your code for dropbox is no longer there. Is there any chance of you putting it up again? Thanks Peter On Thursday, 5 January 2012 17:28:41 UTC, Joseph Jude wrote: If anyone is interested, you can look into the code for dropbox connection here: http://goo.gl/QYT2y This is my default.py. Look at dropbox_connect and process_dropbox. Question: How can I automate this with cron? When I do it, it stops with the redirect. Thank you, Joseph --
[web2py] Re: dropbox python api
Massimo I am testing this def test_dropbox(): from dropbox_account import DropboxAccount dropbox=DropboxAccount(request,key=XXX,secret=XXX) dropbox.login_form() return dict() I tried the above I get TRACEBACK 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File C:\Users\Peter\web2pyn\gluon\main.py, line 528, in wsgibase session._try_store_on_disk(request, response) File C:\Users\Peter\web2pyn\gluon\globals.py, line 594, in _try_store_on_disk cPickle.dump(dict(self), response.session_file) File C:\Python26\lib\copy_reg.py, line 77, in _reduce_ex raise TypeError(a class that defines __slots__ without TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled On tracing the code it executes def login_form(self): token = self.sess.obtain_request_token() current.session.dropbox_token = token dropbox_url = self.sess.build_authorize_url(token,self.login_url) and blows out on redirect(dropbox_url) dropbox_url is contains the correct url Peter On Monday, 9 April 2012 22:34:31 UTC+1, Massimo Di Pierro wrote: Perhaps this can be useful: https://github.com/web2py/web2py/blob/master/gluon/contrib/login_methods/dropbox_account.py#L90 has been there for a while but I am not sure anybody has tested it very well. massimo On Monday, 9 April 2012 09:14:56 UTC-5, Paul Gerrard wrote: Hi, I got distracted by other things and only just came back to this. The problem I was having was in my code was the token was 'disabled or invalid'. I'm sure this is resolved by using the callback in the redirect back from the Dropbox site. I commented out the code that's not relevant for me in your code and it works fine now. As for using cron - I expect you could skip the redirect and go from line 191 directly to 204. Presumably you need a try/except around 204? Paul. On Thursday, 5 January 2012 17:28:41 UTC, Joseph Jude wrote: If anyone is interested, you can look into the code for dropbox connection here: http://goo.gl/QYT2y This is my default.py. Look at dropbox_connect and process_dropbox. Question: How can I automate this with cron? When I do it, it stops with the redirect. Thank you, Joseph --
[web2py] Re: dropbox python api
Please open a ticket on googlecode. On Monday, 10 September 2012 07:31:04 UTC-5, peter wrote: Massimo I am testing this def test_dropbox(): from dropbox_account import DropboxAccount dropbox=DropboxAccount(request,key=XXX,secret=XXX) dropbox.login_form() return dict() I tried the above I get TRACEBACK 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File C:\Users\Peter\web2pyn\gluon\main.py, line 528, in wsgibase session._try_store_on_disk(request, response) File C:\Users\Peter\web2pyn\gluon\globals.py, line 594, in _try_store_on_disk cPickle.dump(dict(self), response.session_file) File C:\Python26\lib\copy_reg.py, line 77, in _reduce_ex raise TypeError(a class that defines __slots__ without TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled On tracing the code it executes def login_form(self): token = self.sess.obtain_request_token() current.session.dropbox_token = token dropbox_url = self.sess.build_authorize_url(token,self.login_url) and blows out on redirect(dropbox_url) dropbox_url is contains the correct url Peter On Monday, 9 April 2012 22:34:31 UTC+1, Massimo Di Pierro wrote: Perhaps this can be useful: https://github.com/web2py/web2py/blob/master/gluon/contrib/login_methods/dropbox_account.py#L90 has been there for a while but I am not sure anybody has tested it very well. massimo On Monday, 9 April 2012 09:14:56 UTC-5, Paul Gerrard wrote: Hi, I got distracted by other things and only just came back to this. The problem I was having was in my code was the token was 'disabled or invalid'. I'm sure this is resolved by using the callback in the redirect back from the Dropbox site. I commented out the code that's not relevant for me in your code and it works fine now. As for using cron - I expect you could skip the redirect and go from line 191 directly to 204. Presumably you need a try/except around 204? Paul. On Thursday, 5 January 2012 17:28:41 UTC, Joseph Jude wrote: If anyone is interested, you can look into the code for dropbox connection here: http://goo.gl/QYT2y This is my default.py. Look at dropbox_connect and process_dropbox. Question: How can I automate this with cron? When I do it, it stops with the redirect. Thank you, Joseph --
[web2py] Re: dropbox python api
Problem sorted by Massimo in under 12 hours. Amazing responsiveness Peter --
[web2py] Re: dropbox python api
Hi, I got distracted by other things and only just came back to this. The problem I was having was in my code was the token was 'disabled or invalid'. I'm sure this is resolved by using the callback in the redirect back from the Dropbox site. I commented out the code that's not relevant for me in your code and it works fine now. As for using cron - I expect you could skip the redirect and go from line 191 directly to 204. Presumably you need a try/except around 204? Paul. On Thursday, 5 January 2012 17:28:41 UTC, Joseph Jude wrote: If anyone is interested, you can look into the code for dropbox connection here: http://goo.gl/QYT2y This is my default.py. Look at dropbox_connect and process_dropbox. Question: How can I automate this with cron? When I do it, it stops with the redirect. Thank you, Joseph
[web2py] Re: dropbox python api
Perhaps this can be useful: https://github.com/web2py/web2py/blob/master/gluon/contrib/login_methods/dropbox_account.py#L90 has been there for a while but I am not sure anybody has tested it very well. massimo On Monday, 9 April 2012 09:14:56 UTC-5, Paul Gerrard wrote: Hi, I got distracted by other things and only just came back to this. The problem I was having was in my code was the token was 'disabled or invalid'. I'm sure this is resolved by using the callback in the redirect back from the Dropbox site. I commented out the code that's not relevant for me in your code and it works fine now. As for using cron - I expect you could skip the redirect and go from line 191 directly to 204. Presumably you need a try/except around 204? Paul. On Thursday, 5 January 2012 17:28:41 UTC, Joseph Jude wrote: If anyone is interested, you can look into the code for dropbox connection here: http://goo.gl/QYT2y This is my default.py. Look at dropbox_connect and process_dropbox. Question: How can I automate this with cron? When I do it, it stops with the redirect. Thank you, Joseph
[web2py] Re: dropbox python api
If anyone is interested, you can look into the code for dropbox connection here: http://goo.gl/QYT2y This is my default.py. Look at dropbox_connect and process_dropbox. Question: How can I automate this with cron? When I do it, it stops with the redirect. Thank you, Joseph
[web2py] Re: dropbox python api
I just started looking at Dropbox yesterday. I've created some code that works in the python interpreter just fine, but when I paste to a web2py controller it fails. I suspect it's because the Dropbox module uses a variable calls 'session' that actually uses the Web2py session variable. Is there an easy way around this (e.g. do I need to put the Dropbox code into a model?) or do I need to use your code mentioned above? Did you get feedback on the code - is it reliable? Thanks, as always, Paul. On Jan 3, 3:38 am, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Only dropbox On Jan 2, 7:38 pm, Joseph Jude ceph...@gmail.com wrote: To use this do you need APIs both from dropbox janrain? Thank you, Joseph
[web2py] Re: dropbox python api
Paul, What kind of error are you getting? I'm also starting to play with dropbox. Got two functions in default controller (one is a callback function) but it works. BTW, I'm storing the dropbox session as current.session.dsession Joseph http://www.jjude.biz
[web2py] Re: dropbox python api
To use this do you need APIs both from dropbox janrain? Thank you, Joseph
[web2py] Re: dropbox python api
Only dropbox On Jan 2, 7:38 pm, Joseph Jude ceph...@gmail.com wrote: To use this do you need APIs both from dropbox janrain? Thank you, Joseph
[web2py] Re: dropbox python api
I added some dropbox support (needs improvement) in your model from gluon.contrib.login_methods.dropbox_account import use_dropbox use_dropbox(auth,filename='private/dropbox.key') and private/dropbox.key shoud contain: key:secret:access_type After connection the client object is in auth.settings.login_form.client Let me know if you dive it a try. On Nov 13, 5:40 pm, Massimo Di Pierro massimo.dipie...@gmail.com wrote: Has anybody integrated dropbox login with web2py? If so, would you share the code? It could go in the book v4.