diff --git a/browser/configurator.py b/browser/configurator.py index 5401438..b8ab791 100644 --- a/browser/configurator.py +++ b/browser/configurator.py @@ -136,7 +136,8 @@ class MacroViewProperty(ViewProperty): def setParams(self, params): params = dict(params) - self.name = params.pop('name', '') - self.identifier = params.pop('identifier', name) + self.slot = params.pop('slot', '') + self.name = params.pop('name', None) + self.identifier = params.pop('identifier', self.name) self.template = params.pop('template', None) self.params = params diff --git a/browser/controller.py b/browser/controller.py index 6b54462..d689d1c 100644 --- a/browser/controller.py +++ b/browser/controller.py @@ -63,7 +63,7 @@ class Controller(object): configurator = conf[1] for item in configurator.getActiveViewProperties(): if IMacroViewProperty.providedBy(item): - self.macros.register(item.slot, item.idenitifier, + self.macros.register(item.slot, item.identifier, item.template, item.name, **item.params) else: diff --git a/tracking/README.txt b/tracking/README.txt index 29b9f35..59c1885 100644 --- a/tracking/README.txt +++ b/tracking/README.txt @@ -78,6 +78,10 @@ The tracks of a tracking store may be reindexed: >>> tracks.reindexTracks() + >>> tracks.removeTrack(t4[0]) + >>> tracks.getUserTracks('a001', 0, 'u2') + set([]) + Runs ---- diff --git a/tracking/btree.py b/tracking/btree.py index 8928b93..93af357 100644 --- a/tracking/btree.py +++ b/tracking/btree.py @@ -196,6 +196,14 @@ class TrackingStorage(BTreeContainer): self.indexTrack(trackNum, track) return trackId + def removeTrack(self, track): + trackId = str(track.__name__) + trackNum = int(trackId) + for attr in self.indexAttributes: + self.indexes[attr].unindex_doc(trackNum) + if trackId in self: + del self[trackId] + def indexTrack(self, trackNum, track): ixd = track.indexdata for attr in self.indexAttributes: