Changeset 1220
- Timestamp:
- 08/31/06 18:55:04 (2 years ago)
- Files:
-
- screenshotsplugin/setup.py (modified) (1 diff)
- screenshotsplugin/tracscreenshots/core.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
screenshotsplugin/setup.py
r1218 r1220 13 13 'TracScreenshots.tags = tracscreenshots.tags', 14 14 'TracScreenshots.wiki = tracscreenshots.wiki']}, 15 # If next line is not commented environment upgrade won't work on Trac 0.9. 16 # If it is commented TracTags won't work. 15 17 #install_requires = ['TracTags'], 16 18 keywords = 'trac screenshots', screenshotsplugin/tracscreenshots/core.py
r1210 r1220 85 85 else: 86 86 component = self._get_component_by_name(components, self.component) 87 if not component and components: 88 component = components[0] 89 else: 90 raise TracError('Screenshots plugin can\'t work when there is' 91 ' no components.') 87 if not component: 88 if components: 89 component = components[0] 90 else: 91 raise TracError('Screenshots plugin can\'t work when there' 92 ' are no components.') 92 93 versions = self.api.get_versions(cursor) 93 94 version_id = int(req.args.get('version') or 0) … … 96 97 else: 97 98 version = self._get_version_by_name(versions, self.version) 98 if not version and versions: 99 version = versions[0] 100 else: 101 raise TracError('Screenshots plugin can\'t work when there is' 102 ' no versions.') 99 if not version: 100 if versions: 101 version = versions[0] 102 else: 103 raise TracError('Screenshots plugin can\'t work when there' 104 ' is no versions.') 103 105 104 106 self.log.debug('component_id: %s' % (component_id,)) … … 229 231 if screenshot['tags']: 230 232 tag_names.extend(screenshot['tags'].split(' ')) 231 tags. add_tags(req, screenshot['id'], tag_names)233 tags.replace_tags(req, screenshot['id'], tag_names) 232 234 233 235 # Prepare file paths
