Skip to content

Commit

Permalink
Change default timestamp folder (and add option)
Browse files Browse the repository at this point in the history
  • Loading branch information
Roberto Reale committed Sep 2, 2018
1 parent a66455a commit 35c3416
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
History
=======

0.1.2 (2018-09-02)
------------------

* Change default timestamp folder (and add option).

0.1.1 (2018-08-21)
------------------

Expand Down
9 changes: 4 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ Usage

TimestamPy is based on the `OpenTimestamps`_ project and on the ``inotify`` Linux kernel facility.

Install the relevant prerequisites as follows::
Install the package as follows:

$ pip3 install inotify
$ pip3 install opentimestamps-client
$ pip3 install timestampy

Then run
Then run:

$ timestampy

By default, TimestamPy will watch the ``/tmp`` folder; each time a file is created and/or moved into it, a timestamp will be created on the Bitcoin blockchain.
By default, TimestamPy will watch the ``~/timestampy`` folder; each time a file is created and/or moved into it, a timestamp will be created on the Bitcoin blockchain.

.. _OpenTimestamps: https://opentimestamps.org/
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
with open('HISTORY.rst') as history_file:
history = history_file.read()

requirements = ['Click>=6.0', ]
requirements = ['Click>=6.0', 'inotify', 'opentimestamps-client', ]

setup_requirements = ['pytest-runner', ]

Expand Down Expand Up @@ -49,7 +49,7 @@
setup_requires=setup_requirements,
test_suite='tests',
tests_require=test_requirements,
url='https://github.com/robertoreale/timestampy',
version='0.1.1',
url='https://github.com/reale/timestampy',
version='0.1.2',
zip_safe=False,
)
10 changes: 7 additions & 3 deletions timestampy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@
import os

@click.command()
def main(args=None):
i = inotify.adapters.Inotify()
@click.option('--f', default='~/timestampy')
def main(f):
f = os.path.expanduser(f)

i.add_watch('/tmp', mask = IN_CREATE | IN_MODIFY | IN_MOVED_TO)
i = inotify.adapters.Inotify()
i.add_watch(f, mask = IN_CREATE | IN_MODIFY | IN_MOVED_TO)

for event in i.event_gen(yield_nones=False):
(_, type_names, path, filename) = event
Expand All @@ -33,3 +35,5 @@ def main(args=None):

if __name__ == "__main__":
sys.exit(main()) # pragma: no cover

#vim: ai ts=4 sts=4 et sw=4 ft=python

0 comments on commit 35c3416

Please sign in to comment.