Skip to content

Commit

Permalink
Clean up code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
dwighthubbard committed Mar 10, 2015
1 parent 41da584 commit 8ea158c
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,6 @@ Here we open a python shell and set a key in our embedded redis db

.. code-block:: python
$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from redislite import Redis
>>> redis_connection = Redis('/tmp/redis.db')
>>> redis_connection.keys()
Expand All @@ -81,47 +77,31 @@ Here we open a python shell and set a key in our embedded redis db
True
>>> redis_connection.get('key')
'value'
>>> quit()
$
Here we open the same redis db and access the key we created during the last run

.. code-block:: python
(testvenv)redislite dhubbard$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from redislite import Redis
>>> redis_connection = Redis('/tmp/redis.db')
>>> redis_connection.keys()
['key']
>>> redis_connection.get('key')
'value'
>>> quit()
$
It's also possible to MonkeyPatch the normal redis classes to allow modules
that use redis to use the redislite classes. Here we patch redis and use the
redis_collections module.

.. code-block:: python
(py27)redislite dhubbard$ python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import redislite.patch
>>> redislite.patch.patch_redis()
>>> import redis_collections
>>> td = redis_collections.Dict()
>>> td['foo']='bar'
>>> td.keys()
['foo']
>>> quit()
$
More Information
================
Expand Down

0 comments on commit 8ea158c

Please sign in to comment.