Page 1 of 1

Guillermo's Dropbox lib

Posted: Sat Jun 17, 2017 1:38 pm
by Zood
Hello,

Whilst using Guillermo's Dropbox library i came upon a probem.
I have called this function:

Code: Select all

on SendToCloud
put url ("file:" & specialfolderpath("desktop") & "/test.csv") into myData
phx_DropboxWriteFile("dropbox","/test.csv","application/octet-stream",true,myData)
end SendToCloud
and another button to call this function:

Code: Select all

on mouseUp
SendToCloud
end mouseUp
I am getting an error: "Handler: Can't find handler" on line 2 of the "SendToCloud"-function.

any ideas on how to fix this?
the phx_dropboxReadFile-function works like a charm!

Thanks in advance,
Zood

Re: Guillermo's Dropbox lib

Posted: Sat Jun 17, 2017 2:17 pm
by Mikey
Zood,
A couple of things:
1) inheritance in LC - put the first handler in the card or stack script so the second will find it
2) Gugliermo has abandoned the phx_dropbox library. I have been maintaining it as needed. I have the latest version on my github repo, BUT
3) Dropbox has deprecated v1 of the API. It is scheduled to be turned off at the end of the month. You can get an extension if you ask, but it will be deactivated this year. I was trying to decide whether to fix phx_dropboxlib or not but for a variety of reasons I have decided not to, mainly because
4) LC now has its own built-in Dropbox library. It supports both synchronous and asynchronous calls. You can fetch it from the LC github repo or if you load 9.0dp7 it is included in there. I have found it to be pretty easy to use, so, rather than fixing phx_dropboxLib I'm moving to the LC lib.
5) Gerard also has a v2 library (that LC used as a starting point for their library), so you could also use that (but Monte did a lot of nice work with the LC lib, so I would recommend the LC version). I also have his library on my github account, if you wish to fetch it from there.

Email me off-list if you can't figure out how to fetch LC's v2 lib. You can use it with LC 8 or 9. I think maybe I'll fork LC's lib and put that on my github, too, for easy fetching.

Re: Guillermo's Dropbox lib

Posted: Sun Jun 18, 2017 4:49 am
by Mikey
OK, Zood, here are the repos:
1) LC's new dropbox library: https://github.com/macMikey/LCDropboxLibrary
2) Gerard's dropbox v2 library: https://github.com/macMikey/dropboxapi_v2
3) The current version of phx_dropboxlib: https://github.com/macMikey/phxDropboxLib

For documentation of LC's library, I would suggest downloading LC9 DP7 and opening the dictionary, then using the popup menu in the top-left to choose "dropbox". Gerard's library/stack might be helpful for playing with the new API, and trying things out, since LC"s library is based on (but the syntax is very different from) Gerard's library.

Re: Guillermo's Dropbox lib

Posted: Sun Jun 18, 2017 11:09 am
by Zood
Hey Mikey,

thanks for the fast answer!
I did not know Guillermo's library was about to be discontinued, such a shame!
With a little practice, I hope LC's version will do the same trick.
Was playing around with LC's own version of the new Dropbox library and it keeps returning me the same error: Can't find handler
I have simplified it to one button: "Button1" with the following lines:

Code: Select all

put "Hola senorita" into myData
dropboxUpload "MyAuth2Code" , "/test.csv", Overwrite, false, true, myData, false
it keeps giving me the error at line 2 of the code: "DropboxUpload ........"
Any ideas?

thanks!

Re: Guillermo's Dropbox lib

Posted: Sun Jun 18, 2017 1:52 pm
by Mikey
myauth2code, if it's a container, should not be quoted.
How are you including LC's library?

Re: Guillermo's Dropbox lib

Posted: Mon Jun 19, 2017 1:11 pm
by Zood
Hey Mikey,

What do you mean by including LC's library?

Re: Guillermo's Dropbox lib

Posted: Mon Jun 19, 2017 1:35 pm
by Mikey
What is the structure of your project? Is LC's library set as a substack? Did you "start using stack", etc? The "Can't find handler" message suggests that the library isn't in the message path.

Re: Guillermo's Dropbox lib

Posted: Wed Jun 21, 2017 9:38 pm
by simon.schvartzman
Mickey, where can I download LC9 DP7 from?

As per your suggestion I've downloaded the new LC Dropbox library and now need to have access to the documentation.

FYI I intend to use the library with LC8 for which I own an indy license.

Many thanks for your support

Re: Guillermo's Dropbox lib

Posted: Wed Jun 21, 2017 9:59 pm
by Mikey
Downloads.livecode.com