Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
infothrill committed Oct 28, 2013
1 parent 7887350 commit 0a0ac9c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,22 @@ Usage
if fk("43DBF6EBC059CD97ACAE7CAF308A0E050A7EC51A") == fakeskan.VERIFIED:
print("This torrent is verified!")
# since bitsnoop.com implements some form of rate limiting on queries,
# we provide a minimal caching interface:
from bitsnoop import fakeskan
Since bitsnoop.com implements some form of rate limiting on queries,
we provide a minimal caching interface:

.. code-block:: python
cache = {}
fk = fakeskan.FakeskanCached(cache=cache)
if fk("43DBF6EBC059CD97ACAE7CAF308A0E050A7EC51A") == fakeskan.VERIFIED:
print("This torrent is verified!")
# Alternatively, the cache can be a shelve object for example:
import shelve
cache = shelve.open("fakeskan")
fk = fakeskan.FakeskanCached(cache=cache)
if fk("43DBF6EBC059CD97ACAE7CAF308A0E050A7EC51A") == fakeskan.VERIFIED:
print("This torrent is verified!")
# beware of thread-seafety with the cache object. shelve is a toy!
The cache object is treated like a dictionary and can thus also be an object
that implements persistency (like shelve).


Contribute
Expand Down

0 comments on commit 0a0ac9c

Please sign in to comment.