New wftk GUI idea implemented!

Wow. This wasn't something I'd budgeted time for, but it works. I have reimplemented the filetagger app as a single-file definition, including action tags using a very convenient abbreviated notation for wxpywf-relevant Python. For instance, the code to execute a command against the frame is

self.frame.do(context, 'update_list')

in undecorated Python. In the action, it can be just

: update_list

The wxpywf then scans the entire UI definition for action tags; for each, it builds the Python code, wraps the whole thing up as a Python class inheriting from wftk.cli, and returns it to the caller, which can then exec it to define the class.

The error handling leaves much to be desired; in case of a syntax error, it's almost understandable where the error is, but in case of a runtime error, Python's stack trace is essentially useless (file <string> line 90 doesn't help much with invisibly generated code.)

But it is cool, and on-the-fly code generation is always something I wanted to find a legitimate use for. And now I have!

At any rate, I obviously need to get a lot of code uploaded at some point and documentation caught up, but now is not the time. Work beckons, frantically.






Copyright © 1996-2009 Vivtek. All Rights Reserved. Read the disclaimer.
Read our privacy statement, too, if you are concerned.
Problems? Try webmaster@vivtek.com or our answer page.