Changeset 3087
- Timestamp:
- 01/17/08 19:48:46 (10 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
announcerplugin/0.11/announcerplugin/subscribers/watchers.py
r3086 r3087 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 … … 44 44 if self.is_watching(sid, authenticated, realm, resource): 45 45 self.set_unwatch(sid, authenticated, realm, resource) 46 self._schedule_notice(req, 'You are no longer watching this resource for changes.') 47 else: 48 self.set_watch(sid, authenticated, realm, resource) 46 49 self._schedule_notice(req, 'You are now watching this resource for changes.') 47 else:48 self.set_watch(sid, authenticated, realm, resource)49 self._schedule_notice(req, 'You are no longer watching this resource for changes.')50 50 51 51 def _schedule_notice(self, req, message): … … 104 104 """, ( 105 105 sid, authenticated, 106 'watcher', realm, ' changed',106 'watcher', realm, '*', 107 107 resource, 'email' 108 108 ) … … 139 139 for path in self.watchable_paths: 140 140 if re.match(path, req.path_info): 141 realm, _ = self.normalise_resource(req.path_info).split('/', 1) 141 if req.path_info == '/': 142 realm = 'wiki' 143 else: 144 realm, _ = self.normalise_resource(req.path_info).split('/', 1) 145 142 146 if '%s_VIEW' % realm.upper() not in req.perm: 143 147 return handler … … 153 157 # Internal methods 154 158 def render_watcher(self, req): 155 resource = self.normalise_resource(req.path_info) 156 realm, resource = resource.split('/', 1) 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 165 158 166 if self.is_watching(req.session.sid, not req.authname == 'anonymous', realm, resource): … … 230 238 231 239 def get_subscription_categories(self, realm): 232 return ('c hanged', 'attachment added')240 return ('created', 'changed', 'attachment added') 233 241 234 242 def get_subscriptions_for_event(self, event):
