After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 484318 - External tools do not load their properties
External tools do not load their properties
Status: RESOLVED FIXED
Product: gedit-plugins
Classification: Other
Component: General
git master
Other Linux
: Normal normal
: ---
Assigned To: Curtis Hovey
Gedit maintainers
Depends on:
Blocks:
 
 
Reported: 2007-10-07 04:29 UTC by Curtis Hovey
Modified: 2019-03-23 20:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix Tools._load (719 bytes, patch)
2007-10-07 04:36 UTC, Curtis Hovey
accepted-commit_now Details | Review

Description Curtis Hovey 2007-10-07 04:29:57 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
Comment 1 Curtis Hovey 2007-10-07 04:36:15 UTC
Created attachment 96796 [details] [review]
patch to fix Tools._load
Comment 2 Paolo Borelli 2007-10-07 09:13:34 UTC
damn, my fault :/

please commit, thanks for tracking this down.