Hacker News new | ask | show | jobs
by krallin 4617 days ago
I wonder whether it's intentional that the tutorial isn't "copy-pastable".

Specifically, it does not spell out any of the imports, and uses very large except clauses.

1 comments

Hi, I wrote the tutorial. :-)

In general, I based the tutorial on the sample app that ships with the SDK. That app uses Flask and presents some actual UI. If you want full working code, I would suggest taking a look at that sample.

The tutorial is basically fragments from that sample that show the basic concepts, but without some boilerplate, the fragments are not themselves runnable.

(BTW, where are the "very large except clauses?")

Ha! Nice to see you here : )

The except clause is in the "dropbox_auth_finish" view. That might be personal paranoia, but I'm sure that every single timeI think "It's OK to put a `except:` here", it eventually comes back to bite me (without exception ;) )!

I do understand the motivation to keep it minimal (and I think the Flask boilerplate is indeed well understood), but putting together the sample without the Dropbox SDK imports (specifically without an IDE) might end up being a bit more bothersome than optimal : )

Just personal opinion, of course!

Oh, I misunderstood "very large." :-) The actual code sample has a more detailed list of exceptions that it handles, but the code was a bit long.