Python plugin loads invalid class name

Bug #135743 reported by Charles Edward Pax
2
Affects Status Importance Assigned to Milestone
Gladex
Fix Released
Medium
Christopher Pax

Bug Description

1) Drag a file named "Unsaved 1.glade" into the Glade file selector.
2) Select the Python Code Generator.
3) Observe the name of the class as "Unsaved 1Class".
4) Click Execute
5) Observe the status bar read "there is an invalid character in the class name".

Both the space and the number must be removed before Gladex will generate code.Gladex should strip out characters from a field that it knows to be invalid. It should also know what characters really are invalid. Maybe this can be defined in the plugin's info secction.

Charles Edward Pax (pax)
Changed in gladex:
assignee: nobody → gladex
Revision history for this message
Christopher Pax (paxmanchris) wrote :

In 0.2 i had a valid string which I used to check the class name in python. For 0.4, I wonder if we should halt execution of the plugin and send a error to the user. or replace all non-valid characters with a Q(or any other letter), and send a warning to the user.

Changed in gladex:
assignee: gladex → paxmanchris
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Charles Edward Pax (pax) wrote :

I think we should replace invalid characters with nothing; just remove them. If we replace them, the user will most definitely edit the class name. If we just remove the invalid characters, the user may be given a class name they are happy with. Since the user is probably more likely to be happy with the results of removal than with replacement, we should just remove them. We should also say something like "Stripping invalid characters from: Class Name" in the status bar.

Revision history for this message
Christopher Pax (paxmanchris) wrote :

I fixed the python plugin to only work with valid characters. My next step to to also eliminate them when loaded.

Revision history for this message
Christopher Pax (paxmanchris) wrote :

All plugins now have this fix.

Changed in gladex:
status: Confirmed → Fix Committed
Changed in gladex:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.