Opened 7 years ago

Closed 7 years ago

#6702 closed enhancement (fixed)

allow empty argument list for screenshots:additional_tags

Reported by: hasienda Owned by: Blackhex
Priority: normal Component: ScreenshotsPlugin
Severity: minor Keywords: patch
Cc: Trac Release: 0.11


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 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 (0)

Change History (2)

comment:1 Changed 7 years ago by hasienda

diff -Nur /screenshots_trunk/tracscreenshots/tags.py_orig /screenshots_trunk/tracscreenshots/
--- /screenshots_trunk/tracscreenshots/tags.py_orig	2010-02-18 00:39:59.000000000 +0100
+++ /data/screenshots_trunk/tracscreenshots/	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.

comment:2 Changed 7 years ago by anonymous

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

as closed The owner will remain Blackhex.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.