#138 [Python] Wrong imports for custom classes

open
nobody
5
2012-10-24
2009-01-26
Carsten Grohmann
No

The Python code generator (py_codegen.py) generates wrong imports for
custom classes.

Steps to reproduce:
 1. open a new project
 2. Put a new widget in a sizer ...
 3. Change the "Class" to "my.klass"
 4. Select multiple files and generate python code
 5. View the generated code:

Generated:

begin wxGlade: dependencies

from my.klass import klass

end wxGlade

Expected:

begin wxGlade: dependencies

from my import klass

end wxGlade

Effected Version:
- current official release
- hg code repository

Buggy source py_codegen.py line 569:
key = 'from %s import %s\n' % (sub_obj.klass, without_package(sub_obj.klass))

Fix:
Patch is attached :-)

Regards,
Carsten

Discussion

  • Patch

     
    Attachments