GNOME Bugzilla – Bug 484318
External tools do not load their properties
Last modified: 2019-03-23 20:33:23 UTC
Tool properties like Shortcut, Input, and Output are not loaded when the script is scanned. You can set the properties using the GUI, and the tool will behave fine until Gedit is restarted. Because the properties are not loaded, tool properties are lost if the user views the external tool's configuration--since the values values were not laoded, the default values are written into the file. To reproduce: Activate the plugin external tools from Preferences. Open the external tools manager from the Tools menu. Modify a tool by changing the shortcut, input, and output. Close the tools manager window and open the tools menu. Verify the Tools menu displays the accelerator. Verify the input and output changes if needed. Quit Gedit, then start Gedit. Verify the Tools menu DOES NOT display the accelerator. The Tool._load broke on 2007-09-24. The test to add the property if it is not in the dict was revised to pythonic form, but the 'not' was lost. svn diff -r {2007-09-23}:{2007-10-01} library.py --- library.py (revision 5927) +++ library.py (revision 5943) @@ -212,7 +212,7 @@ (key, value) = [i.strip() for i in line[2:].split('=', 1)] m = self.RE_KEY.match(key) if m.group(3) is None: - if not self._properties.has_key(m.group(0)): + if m.group(0) in self._properties: self._properties[m.group(1)] = value elif lang is not None and lang.startswith(m.group(3)): self._properties[m.group(1)] = value
Created attachment 96796 [details] [review] patch to fix Tools._load
damn, my fault :/ please commit, thanks for tracking this down.