I Did this :

in db.py :

from gluon.contrib.login_methods.dropbox_account import DropboxAccount
auth.settings.actions_disabled=['register','change_password','request_reset_password']
auth.settings.login_form =
DropboxAccount(request,key="........",secret="......",access_type="dropbox",login_url
= "http://localhost:8000/%s/default/user/login"; % request.application)
if auth.user:
    user_dropbox = auth.settings.login_form

in default.py :

def dropbox():
    stream = open('localfile.txt','rb')
    user_dropbox.put('destfile.txt',stream)
    return locals()


but i am getting this error

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 209, in restricted
    exec ccode in environment
  File "C:/web2py/applications/dropbox/controllers/default.py"
<http://localhost:8000/admin/default/edit/dropbox/controllers/default.py>,
line 82, in <module>
  File "C:\web2py\gluon\globals.py", line 187, in <lambda>
    self._caller = lambda f: f()
  File "C:/web2py/applications/dropbox/controllers/default.py"
<http://localhost:8000/admin/default/edit/dropbox/controllers/default.py>,
line 14, in dropbox
    user_dropbox.put('destfile.txt',stream)
  File "C:\web2py\gluon\contrib\login_methods\dropbox_account.py",
line 102, in put
    return json.loads(self.client.put_file(filename,file))['bytes']
AttributeError: 'DropboxAccount' object has no attribute 'client'


regards,



On Mon, Oct 22, 2012 at 5:19 PM, Jonathan Lundell <[email protected]>wrote:

> On 22 Oct 2012, at 4:48 AM, Hassan Alnatour <[email protected]>
> wrote:
>
> I want to make function that makes a csv file from my database and push it
> to a dropbox folder , any ideas on that ?
>
>
> At the very least create the csv file in a tmp directory and then move it
> atomically to your dropbox folder, so Dropbox (and its clients) don't see a
> partial file.
>
> --
>
>
>
>

-- 



Reply via email to