|
From: Kevin A. <al...@se...> - 2001-12-12 00:00:24
|
I finally got everything working correctly after some major modifications. Of course, there are probably still bugs, but I think I managed the first step of modularizing widgets.py without breaking all the samples. This version doesn't support a widgets/components path, it always expects to find components in the new components directory, but it should be relatively easy to add support for additional directories. I expect to refactor the code to be cleaner, since this version still uses spec.py for all the non-widget classes like Stack and Background. Basically, I needed to check what I have right now into cvs, so Rowland, Jeff, and anyone else that wants to help with the modularization and components transition can start providing input. Adding a new widget should be as simple as creating a new module with the spec, class, and event bindings and dropping it into the components directory. I also took this opportunity to bump up the requirements to wxPython 2.3.2 and I cleaned up all the from wxPython.wx import * import statements, which impacted almost every framework file and many of the samples. Now it is easy to know whether something comes from wxPython, because it will always have a "wx." in front of a class, method, or constant. The list of changes is below. ka --- *** wxPython 2.3.2 or later is now required to use PythonCard *** added assert wxc.__version__ >= "2.3.2" to model.py changed wxPython imports from from wxPython.wx import * to the more explicit from wxPython import wx added missing imports such as 'import types' where needed replaced occurances of wx.true and wx.false with 1 and 0 added a components directory merged wxPython_binding.py into binding.py and moved widget-specific bindings to individual module files moved spec.py descriptions for each widget to its respective widget module split widget.py so each widget is in its own file in the components directory all widgets (components) are now self-contained modules in the components directory. each module includes the spec, event bindings, and attribute descriptions (formerly in spec.py) in addition to the widget class. when the module is imported it "registers" itself, so that the class is available for applications. added drawPointList and drawLineList (2.3.2 feature) to the BitmapCanvas widget, switched to drawPointList in hopalong sample for a roughly 4x speed improvement updated the setup.py script for minimal.py and provided some basic instructions in the readme.txt. It is necessary to uncomment the import in minimal.py prior to using py2exe due to how the dynamic imports are done for components |