Author: tmckay
Date: 2011-08-02 18:54:59 +0000 (Tue, 02 Aug 2011)
New Revision: 4902
Modified:
trunk/sage/python/sage/wallaby/wallabyoperations.py
Log:
Add create_tag(self, tag) and remove_tag(self, tag)
Modified: trunk/sage/python/sage/wallaby/wallabyoperations.py
===================================================================
--- trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-08-02 15:35:44 UTC (rev
4901)
+++ trunk/sage/python/sage/wallaby/wallabyoperations.py 2011-08-02 18:54:59 UTC (rev
4902)
@@ -380,6 +380,37 @@
self._lock.release()
return names
+ def create_tag(self, name):
+ '''
+ Create a new tag in the Wallaby store.
+
+ Refresh the cached lists of groups and tags.
+ '''
+ try:
+ self._store.addExplicitGroup(name)
+ self.refresh((WBTypes.GROUPS,WBTypes.TAGS))
+ except Exception, e:
+ log.debug("Wallaby: create_tag, exception suppressed, %s" %
str(e))
+ return False
+ return True
+
+ def remove_tag(self, name):
+ '''
+ Remove a tag from the Wallaby store.
+
+ Check the cached list of tags for the
+ tag name first. Refresh cached lists of
+ groups, tags, and nodes.
+ '''
+ if self.get_tag_by_name(name) is not None:
+ try:
+ self._store.removeGroup(name)
+ self.refresh()
+ except Exception, e:
+ log.debug("Wallaby: remove_tag, exception suppressed, %s" %
str(e))
+ return False
+ return True
+
def set_interval(self, which, refresh):
'''
Set an individual refresh interval for a data item.
Show replies by date