diff options
author | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-01-20 23:10:13 -0500 |
---|---|---|
committer | Siddharth Ravikumar <sravik@bgsu.edu> | 2015-01-20 23:11:23 -0500 |
commit | 4321e9dcadf929b81b6528b7cb3174c80772b5aa (patch) | |
tree | e4cf2327ee08238e5eac016dccfdc33469cf3f4e /combox/events.py | |
parent | 94596f0913cfdc33ffc85aac1005ea745d6559f8 (diff) |
fleshed out the on_modified function in the ComboxEventHandler class + wrote tests for it.
modified: combox/events.py
modified: tests/events_test.py
new file: tests/files/ipsum.txt
new file: tests/files/lorem.txt
Diffstat (limited to 'combox/events.py')
-rw-r--r-- | combox/events.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/combox/events.py b/combox/events.py index d539cbc..e2ebb57 100644 --- a/combox/events.py +++ b/combox/events.py @@ -96,5 +96,13 @@ class ComboxEventHandler(FileSystemEventHandler): def on_modified(self, event): super(ComboxEventHandler, self).on_modified(event) + if event.is_directory: + # do nothing + pass + else: + # file was modified + split_and_encrypt(event.src_path, self.config) + # TODO: code for updating file info in YAML silo. + type_ = 'directory' if event.is_directory else 'file' logging.info("Modified %s: %s", type_, event.src_path) |