From f64e56864dcd316ab1e74b2f5b2ec9462cd1e368 Mon Sep 17 00:00:00 2001 From: Siddharth Ravikumar Date: Wed, 8 Apr 2015 16:50:50 -0400 Subject: new method combox.silo.ComboxSilo.node_rem The method removes information about a file in the category `type_' where `type_' can be 'file_created', 'file_modified', 'file_removed', 'file_moved'. Also wrote tests for it :~( modified: combox/silo.py modified: tests/silo_test.py --- combox/silo.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'combox') diff --git a/combox/silo.py b/combox/silo.py index 38de523..0968d12 100644 --- a/combox/silo.py +++ b/combox/silo.py @@ -176,3 +176,21 @@ class ComboxSilo(object): except KeyError, e: # file_ info not there under type_ dict. return None + + + def node_rem(self, type_, file_): + """ + Removes information about the shard of `file_'. + + type_: 'file_created', 'file_modified', 'file_moved', 'file_deleted' + file_: path of the file_ in combox directory. + """ + + self.reload() + with self.lock: + try: + return self.db.dpop(type_, file_) + except KeyError, e: + # means file_'s info was already removed. + # do nothing + pass -- cgit v1.2.3