summaryrefslogtreecommitdiffstats
path: root/combox/silo.py
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-04-29 13:43:17 -0400
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-04-29 13:43:17 -0400
commitbcf127e0472aec90a1569c4bfd9f1c86db88283e (patch)
tree2b27850b55c4eaca87862969c5dac2375231de07 /combox/silo.py
parentf1f8a81ae6f7719bfbe943b2460f91b7f2b2bca0 (diff)
combox.silo.ComboxSilo.node_set: added an optional parameter called `num'.
- Updated tests as usual. modified: combox/silo.py modified: tests/silo_test.py
Diffstat (limited to 'combox/silo.py')
-rw-r--r--combox/silo.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/combox/silo.py b/combox/silo.py
index ed2210c..1b3eeac 100644
--- a/combox/silo.py
+++ b/combox/silo.py
@@ -143,16 +143,20 @@ class ComboxSilo(object):
return self.node_dicts
- def node_set(self, type_, file_):
+ def node_set(self, type_, file_, num=-1):
"""
Update information about the shard of `file_'.
type_: 'file_created', 'file_modified', 'file_moved', 'file_deleted'
file_: path of the file_ in combox directory.
+ num: (optional) integer associated with the `file_'.
"""
self.reload()
with self.lock:
+ if num != -1:
+ self.db.dadd(type_, (file_, num))
+ return
try:
num = self.db.dget(type_, file_)
num += 1