From eca2d8db9fa967b4cad39611fe229e2f9421c9fe Mon Sep 17 00:00:00 2001 From: Patrick Maia and Victor Shyba Date: Sun, 7 Sep 2014 23:02:26 +0000 Subject: #51 - adds TagIndex.remove method --- service/pixelated/adapter/tag_index.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'service/pixelated') diff --git a/service/pixelated/adapter/tag_index.py b/service/pixelated/adapter/tag_index.py index bac3c6a6..743c74e1 100644 --- a/service/pixelated/adapter/tag_index.py +++ b/service/pixelated/adapter/tag_index.py @@ -44,6 +44,10 @@ class TagIndex: else: return None + def remove(self, tag_name): + if tag_name in self.db: + del self.db[tag_name] + def empty(self): return len(self.db.keys()) == 0 -- cgit v1.2.3