Skip to content

Commit

Permalink
update code example w/ config object for bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradrf committed Dec 28, 2016
1 parent bc00a81 commit dff9121
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ It's safe to rerun s3tail sessions when working with piped commands searching fo
always read and display from the cache before downloading from S3. This is done in a best-effort
background thread to avoid impacting performance. The file cache is stored in the user's ``HOME``
directory, in an ``.s3tailcache`` subdirectory, where the file names are the S3 keys hashed with
SHA-256. These can be listed by through the use of the ``--cache-lookup`` option:
SHA-256. These can be listed through the use of the ``--cache-lookup`` option:

.. code-block:: console
Expand Down
8 changes: 6 additions & 2 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,18 @@ Basic Console Example
Coding Example
--------------

To use the :class:`.s3tail.S3Tail` class in a project::
To use the :class:`.s3tail.S3Tail` class in a project:

.. code-block:: python
from s3tail import S3Tail
from configparser import ConfigParser
def process_line(num, line):
print '%d: %s' % (num, line)
tail = S3Tail('my-logs', 'production-s3-access-2016-08-04', process_line)
config = ConfigParser() # stores the bookmarks
tail = S3Tail(config, 'my-logs', 'production-s3-access-2016-08-04', process_line)
tail.watch()
tail.cleanup()
Expand Down

0 comments on commit dff9121

Please sign in to comment.