iivvoo/SilverSync — pull request #1 by eternaleye (2012-02-25 08:25:29+00:00)
Title: Fixes, functionality, and refactoring

Hey, here's a patch series that implements some things I wanted from this library.

47107c2 removes the encoding of usernames, since a.) the API docs on http://docs.services.mozilla.com say to just use the username straight and b.) it only worked for me after removing that. It also switches from .read() to .text on the Response object, because that actually existed on my install.

60225dd introduces the ability to prompt the user for their credentials, rather than hardcoding them into the demo main().

0742f99 creates classes for each engine type in standard Firefox, as well as a generic fallback engine for unknown collections. It also extends the demo main() to use them, meaning that it now dumps every collection that is on the server. I also made it so that while the demo uses the ?full=1 mode for performance, the user can use an iterator-based mode to retrieve WBOs one-by-one if they so wish.

9f9835e switches from pprint.pprint to json.dumps because the latter is much more useful for feeding into other programs which may not be written in Python (such as KWallet for passwords or Nepomuk for history)

2c6556e adds several new classes of exception and uses them in a new error-handling function that is called by get_node() and get(), as well as handling the X-Weave-Backoff header the server sends when it's overloaded.

e2395e7 simply switches the prompts introduced in 60225dd to stderr so that the user doesn't have to modify the source if he wants to redirect the JSON to a file or a pipe.