summaryrefslogtreecommitdiffstats
path: root/combox/events.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-03-13 12:03:20 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-03-13 12:03:20 -0400
commit1f91f748cb2ff193011aaab714442298a231aa10 (patch)
treea17f5adcaafc18e5fdf5a3f5f954ca34e4141015 /combox/events.py
parent27acc86045b457bd800b5203d97218c0197bfeea (diff)
Added `shardp' method to combox.events.NodeDirMonitor + test for it.
modified: combox/events.py modified: tests/events_test.py
Diffstat (limited to 'combox/events.py')
-rw-r--r--combox/events.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/combox/events.py b/combox/events.py
index 71431c6..973a79d 100644
--- a/combox/events.py
+++ b/combox/events.py
@@ -202,6 +202,17 @@ class NodeDirMonitor(LoggingEventHandler):
self.silo = ComboxSilo(self.config)
+ def shardp(self, path):
+ """Returns True if `path' is a shard
+
+ Shards end with `.shardN' where `N' is a natural number.
+ """
+ if path[:-1].endswith('.shard'):
+ return True
+ else:
+ return False
+
+
def housekeep(self):
"""Recursively traverses node directory, discovers changes and updates silo and combox directory.