wxFormBuilder

Welcome to wxFormBuilder’s issue tracking system! We hope that wxFormBuilder provides you with many hours of increased productivity.

Please feel free to post bug reports and feature requests here. You can feel free to discuss an issue or feature on the forum but if you decide it needs to be looked at you need to post it here. If a feature request or bug report is not on this site there is a good chance it won’t be worked on. So, as a rule, post them here.

Thanks for your cooperation,
The wxFormBuilder Team

| Tasklist |

FS#429 - Python code styling isssues

Attached to Project: wxFormBuilder
Opened by Simone Ramacci (Simosito) - Tuesday, 30 June 2009, 12:22 GMT+2
Task Type Todo
Category Backend / Core → Python Code Generation
Status Unconfirmed
Assigned To No-one
Operating System All
Severity Medium
Priority Normal
Reported Version 3.0
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No

Details

When generating Python code with the 3.1.61 beta, there are some code styling error:

  1. If “id” is not specified, is possible to omit it, instead of using wx.ID_ANY.
  2. Same applies to an empty title (why use wx.EMPTY_STRING?) and the default position and/or style.
  3. It would be better to always use keyword arguments, also in the controls code.
  4. As with XRC the first sizer is not necessary and can be skipped.
  5. There are empty spaces that should be removed (see attached file).
  6. Size can be specified without wx.Size(), just use a tuple!.

I attach a file with both the generated code and how it should be.

This task depends upon

Comment by Mike Bryce (allaboutmike) - Wednesday, 26 August 2009, 07:00 GMT+2

Questions...

IS there such a thing as a code styling error? Surely this is a preference. Functional correctness of the generated code is what really matters. Things like white space, wx.EMPTY_STRING and wx.ID_ANY can not be called errors as they have no impact on the program. I imagine they are used because it is simpler to generate them in their respective positions, than to work out when it is safe to leave parameters out altogether. As for 5 in particular, what spaces have you removed? Also the wxPython Coding Guidelines at http://www.wxpython.org/codeguidelines.php under Whitespace suggest liberal use of whitespace is good practice.

Why does anyone even read the generated code? I did the first couple of times for my own education. Now I use wxFormBuilder created forms without ever opening the generated code files. Always seems to work the way I expect it to.

How does this rate as Medium Severity? It works! The code produces what you design. The developers should be spending time fixing actual problems.

Loading...