crossbario/crossbar — pull request #180 by wilbertom (2014-12-09 16:34:34+00:00)
Title: Drop sqlite attempt 2

Drop `sqlite` by making the `PersistentCookieStorage` class save cookies into a file.

This PR is a follow up on #118 to close #64.

This code saves cookies to a `JSON` formatted file. Updates like `setAuth` are lazy in that they only save the to the file if a changed occurred.

@oberstet if you see anything else you want changed let me know. Your last feedback on not doing the `temp` file magic was invaluable. I learned a lot from it. Sorry I took so long to finish this, contracting has been taking a lot of my spare time.

@malinoff thank you for the [comment](https://github.com/crossbario/crossbar/issues/64#issuecomment-64530161). I didn't know about the `shelve` module and it will save me a lot of trouble next time I have to do something similar. If we want to use it I'm up for refactoring for it.

If this gets merged and any bugs arise `@` ping me. I'll take care of it. Along this lines, do we have a unit testing convention in this project? Doing so would make me a lot more confident with the changes.

A side effect of this pull request is that we don't have to check for `_HAS_ADBAPI` when importing the class, it will always be available.

Another note on string formatting. In this little module I used `%` because, the module used it. However I just saw `.format` in another part of the project. If we prefer `.format` I can update the source code for it.