Ticket #6702 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

allow empty argument list for screenshots:additional_tags

Reported by: hoff.st@web.de Assigned to: Blackhex
Priority: normal Component: ScreenshotsPlugin
Severity: minor Keywords: patch
Cc: Trac Release: 0.11

Description

I'd prefer to stick with no additional_tags at all when using the TracTags-Plugin with latest ScreenshotsPlugin. However an empty list is impossible (raises Python error) without explicitly initializing the tags variable as a list variable inside tags.py. A patch to fix this is attached as comment.

valid for:

TracScreenshots? 0.7 (r7486)
TracTags 0.6

test system
Trac 0.12dev-r9115
Python 2.5.2 (r252:60911, Jan 24 2010, 14:53:14) [GCC 4.3.2] - stock Debian package
setuptools 0.6c8 - stock Debian package
pytz 2008c - stock Debian package
SQLite 3.5.9 - stock Debian package
pysqlite 2.4.1 - stock Debian package Genshi 0.6dev-r1092
Babel 1.0dev-r482
Pygments 0.10 - stock Debian package
jQuery: 1.3.2

Attachments

Change History

02/22/10 22:43:08 changed by hoff.st@web.de

diff -Nur /screenshots_trunk/tracscreenshots/tags.py_orig /screenshots_trunk/tracscreenshots/tags.py
--- /screenshots_trunk/tracscreenshots/tags.py_orig	2010-02-18 00:39:59.000000000 +0100
+++ /data/screenshots_trunk/tracscreenshots/tags.py	2010-02-18 01:40:50.000000000 +0100
@@ -82,8 +82,9 @@
     def _get_tags(self, screenshot):
         # Prepare tag names.
         self.log.debug("additional_tags: %s" % (self.additional_tags,))
+        tags = list()
         if 'author' in self.additional_tags:
-           tags = [screenshot['author']]
+            tags += [screenshot['author']]
         if 'components' in self.additional_tags and screenshot['components']:
             tags += [component for component in screenshot['components']]
         if 'versions' in self.additional_tags and screenshot['versions']:

This was tested on two systems with different versions of Trac v0.12dev and works flawlessly, should work with Trac v0.11 too.

02/23/10 09:47:21 changed by anonymous

  • status changed from new to closed.
  • resolution set to fixed.

Sorry for that, fixed in SVN. Thank you for noticing and reporting.


Add/Change #6702 (allow empty argument list for screenshots:additional_tags)




Change Properties
Action