From 24af73ca1f4ce8b11046157b1d531dab2a16cdf4 Mon Sep 17 00:00:00 2001 From: helmutm Date: Thu, 13 Mar 2008 17:40:57 +0000 Subject: [PATCH] fixes on view configurator (used for setting up portlets) git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2451 fd906abe-77d9-0310-91a1-e0d9ade77398 --- browser/configurator.py | 5 +++-- browser/controller.py | 2 +- tracking/README.txt | 4 ++++ tracking/btree.py | 8 ++++++++ 4 files changed, 16 insertions(+), 3 deletions(-) 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: