Popular recipes tagged "meta:requires=shelve"http://code.activestate.com/recipes/tags/meta:requires=shelve/2008-12-21T05:50:07-08:00ActiveState Code RecipesSimple shelve with Linux file locking (Python)
2008-12-21T05:50:07-08:00Michael Ihdehttp://code.activestate.com/recipes/users/4168518/http://code.activestate.com/recipes/576591-simple-shelve-with-linux-file-locking/
<p style="color: grey">
Python
recipe 576591
by <a href="/recipes/users/4168518/">Michael Ihde</a>
(<a href="/recipes/tags/dynamic_method/">dynamic_method</a>, <a href="/recipes/tags/locking/">locking</a>, <a href="/recipes/tags/shelve/">shelve</a>).
</p>
<p>The shelve module is a easy way to add persistence to your application via a DBM database. However, if you have multiple reader/writer combination you need to lock the file to prevent corruption. The shelve module itself does not provide locking because it is platform specific. If you only need Linux, this simple module provide an easy way to support locking using dynamically added methods.</p>
xmlrpc server/client which does cookie handling and supports basic authentication (Python)
2007-01-23T10:51:39-08:00Vaibhav Bhatiahttp://code.activestate.com/recipes/users/4007166/http://code.activestate.com/recipes/501148-xmlrpc-serverclient-which-does-cookie-handling-and/
<p style="color: grey">
Python
recipe 501148
by <a href="/recipes/users/4007166/">Vaibhav Bhatia</a>
(<a href="/recipes/tags/web/">web</a>).
</p>
<p>xmlrpc server client which do the following:
* client sends a request with basic authentication
* server on successful authentication sends response back and also sends cookies with authentication id
* these cookies are saved by client and then used for authentication on any subsequent requests</p>
Persistently monitored collection class (Python)
2005-09-21T20:45:19-07:00Robert McDermotthttp://code.activestate.com/recipes/users/786815/http://code.activestate.com/recipes/440504-persistently-monitored-collection-class/
<p style="color: grey">
Python
recipe 440504
by <a href="/recipes/users/786815/">Robert McDermott</a>
.
Revision 2.
</p>
<p>The collection class allows you to persistently monitor a collection of items. It reports on which items are new to the collection, which items have left the collection and the age in seconds of each item in the collection.</p>
Cricket GUI (Python)
2004-11-08T07:43:56-08:00David Hollandhttp://code.activestate.com/recipes/users/2142861/http://code.activestate.com/recipes/334728-cricket-gui/
<p style="color: grey">
Python
recipe 334728
by <a href="/recipes/users/2142861/">David Holland</a>
.
</p>
<p>In the UK, Indian subcontinent, South Africa, Australia, West Indies and New Zealand, cricket is widely played. This is a GUI to calculate the estimated final score for a fixed overs inninings. It does also show a Duckworth Lewis score for 50 over games.</p>
Indexing into XML (Python)
2002-10-08T05:38:27-07:00Dave Pawsonhttp://code.activestate.com/recipes/users/127209/http://code.activestate.com/recipes/155582-indexing-into-xml/
<p style="color: grey">
Python
recipe 155582
by <a href="/recipes/users/127209/">Dave Pawson</a>
.
</p>
<p>Build an index into a directory of xml files.
Search the index. Based around the indexing code
from Alex Martelli, linux magazine, July 2002.</p>
Dictionary Mixin / Framework (Python)
2002-03-31T15:26:44-08:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/117236-dictionary-mixin-framework/
<p style="color: grey">
Python
recipe 117236
by <a href="/recipes/users/178123/">Raymond Hettinger</a>
(<a href="/recipes/tags/oop/">oop</a>).
Revision 2.
</p>
<p>This mixin makes it easy to provide a full dictionary interface to a class defining only a few mapping methods for getting, setting, deleting, and listing keys. Also, a function is provided to incorporate the mixin at runtime so that code for existing modules need not be modified.</p>