Changeset 3089
- Timestamp:
- 01/17/08 20:29:13 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
announcerplugin/0.11/announcerplugin/subscribers/watchers.py
r3088 r3089 16 16 ITicketChangeListener, IWikiChangeListener) 17 17 18 watchable_paths = ListOption('announcer', 'watchable_paths', ' /,/wiki*,/ticket*',18 watchable_paths = ListOption('announcer', 'watchable_paths', 'wiki/*,ticket/*', 19 19 doc='List of URL paths to allow voting on. Globs are supported.') 20 20 … … 137 137 138 138 if req.authname != "anonymous": 139 for path in self.watchable_paths: 140 if re.match(path, req.path_info): 141 if req.path_info == '/': 142 realm = 'wiki' 143 else: 144 realm, _ = self.normalise_resource(req.path_info).split('/', 1) 139 for pattern in self.watchable_paths: 140 path = self.normalise_resource(req.path_info) 141 if re.match(pattern, path): 142 realm, _ = path.split('/', 1) 145 143 146 144 if '%s_VIEW' % realm.upper() not in req.perm: … … 157 155 # Internal methods 158 156 def render_watcher(self, req): 159 if req.path_info == '/': 160 resource = 'WikiStart' 161 realm = 'wiki' 162 else: 163 resource = self.normalise_resource(req.path_info) 164 realm, resource = resource.split('/', 1) 157 resource = self.normalise_resource(req.path_info) 158 realm, resource = resource.split('/', 1) 165 159 166 160 if self.is_watching(req.session.sid, not req.authname == 'anonymous', realm, resource): … … 179 173 resource = resource.strip('/') 180 174 # Special-case start page 181 if resource == 'wiki': 175 if not resource: 176 resource = "wiki/WikiStart" 177 elif resource == 'wiki': 182 178 resource += '/WikiStart' 183 179 return resource
