Issues and To Do list for PythonCard release 0.8
Contents
PythonCard Changes : 0.7.3.x -> 0.8
Release 0.8 is the first step towards making a 1.0 release. It is the release where we will do the most cleanup of old code that is no longer relevant and add the items that we must have for 1.0.
assert added to model.py
assert added to model.py
Please do not use abbreviations in module, class or method names. Fix all occurrences that exist now.
All singletons ( log.Log, config.Configuration, etc. ) must inherit from singleton.Singleton. This will require changing all usage of the singletons throughout the code.
PythonCard should contain no module functions. Module functions, such as those currently found in log.py and config.py should be removed and all usage should be via the Singleton package.
Create a script, PythonCard/docs/make.py, that will generate the api documentation for the PythonCard package and all subpackages/modules in PythonCard/docs/api.
from PythonCardPrototype import
tofrom PythonCard import
Changeimport PythonCardPrototype
toimport PythonCard
Change towxPython events. No need to have an EventBinding subclass since we're not going to support multiple gui toolkits - it's wxPython or nothing.
What is the purpose of SystemEvent? Why is it special? * It's not special - replaced with direct use of wx.PyCommandEvent.Refactor DispatchEvent to EventAdapter.
In PythonCardApp.init, get rid of temporary configuration option variables. - Assign self._config = config.Configuration.getInstance() - Use self._config.get<OptionName> to access configuration options.
Need to decide if Window is the right name, is Frame, Form or Panel better?
Don't forget to update all the .rsrc.py files, resourceEditor, and documentation once this change is in place. Need to discuss name change on the mailing list since this impacts a lot of stuff.
In the rsrc.py files, maybe just remove it entirely or rename it to 'base' or something like that. We still need an overall container to hold the backgrounds (windows) list or do we just reduce that to a single background? There is also the list of strings.
See above. We could turn .rsrc.py into a normal Python module that we import rather than doing an eval. The module would have a variable = {...} format. We would have to drop the .rsrc.py form
= Rewrite configuration.Configuration as a true Singleton =
using the new-style 'class' methods, provide a Configuration.getInstance() method. Static method example:>>> class A:
***replaced with array
Unit tests fall into three categories:
GUI Toolkit Tests - Using some (probably platform-specific) tool, test wxPython to ensure that wxWindows on platform X performs as expected.
Framework Unit Tests - use 'unittest' to test the various classes and subsystems of the PythonCard framework - mostly non-gui stuff.
Sample Tests - Use some combination of unittest and GUI test tools to ensure that the samples are well-behaved and perform as expected.
Come up with a series of tests to verify everything is still working as expected as we make changes. This might be as simple as running a few specific samples and tools, but it would be great if we could implement unit tests for some types of tests. Use 'unittest' framework to write unit tests for every framework module/class that it is possible to test. GUI testing, especially across platforms is going to be hard. Whattools can we use? X11Test (GTK/Linux)?, what about Windows, OSX?
Introduce ComponentLoader that can load a component from PythonCard.components,
Make Panel the basis for building custom, compound components.
Wrap wxTimer as Timer class so we can be consistent with PythonCard naming conventions
Idle in wxWidgets is poorly named and quite misleading. It is the event that occurs when the event queue empties and has nothing to do with whether the machine is "idle". One typical place you will see a flurry of idle events is while moving the mouse and then beware if you have a long-running task called on idle. <wink> If a TextCtrl has focus then you will see idle events as the cursor blinks, but if the focus is on a control such as a Button you will only see one idle when the event queue empties and then no more until the user does something like move the mouse.
If you are using wx.WakeUpIdle() then you will still want to use an idle event handler, but depending on the situation there might be better alternatives such as wx.CallAfter() or using a timer. A number of samples and tools use idle handlers and these should be reevaluated.
I think that perhaps we should have a renamed method for WakeUpIdle or a special function to do CallAfter on whatever we rename idle too. I guess the event could be called eventQueueEmpty but I'm wary of using an event name with "Queue" in it since that is easy to misspell.
most of the remaining CamelCase methods in the samples and tools are for CodeEditor/wxSTC or unwrapped wxPython classes
make sure all API changes like this are explicitly called out in the changelog.txt file
we should adapt this document for a user migration.html guide. check that one into docs\html. The migration guide has to cover each change that will require users changing their code or environment to run PythonCard 0.8.
decide whether to use class method aliases, instance var aliases, or wrap of CamelCase with mixedCase
add doc strings to methods
add document string to spec items, so attributes are documented
look at getattr and setattr in widget.py and decide if needed
started for Background and CustomDialog in model.py - KEA 2004-04-13
add MultipleSelectionList for List components that supports multi-selection?!
thoroughly comment as RDS or KEA as we make changes
standardize on use of whitespace around () [] <- we can argue about it
the revised documentation is live on the main site and checked into PythonCardPrototype cvs, but not all the docs have been revised or checked into the PythonCard branch of cvs
Change "from wxPython import wx" to "import wx" once we are on the 2.5.x track This should probably not be done as a global replace, but rather done file by file. see the wxPython migration guide. This is probably the single biggest amount of work that we will have to do. Most places will be a simple replace of "wx.wx" with "wx." and it will work with the new namespace. However certain files like turtle.py and bitmapcanvas.py or anything using DC methods has to go through the laborious change of x, y parameters to tuples (x, y). In fact, that is one of the API changes we have to decide to follow or not, but we probably will. I'm not positive, but some constants, most likely wxEVT kind of constants may still keep their wx prefix. Anyway, that's why we do this file by file, I suspect it will be difficult to track what we broke otherwise.
Remove samples that we no longer want to highlight from the distribution, but leave them in cvs (proof?)
add windows sub-package to PythonCard for standard "backgrounds" that people might want to import? same thing for common CustomDialogs
this might be better to name templates with a sud-directory for windows and dialogs ? - KEA 2004-04-13
Rewrite the samples using the component model and composite components.
Rewrite the tools using the component model and composite components.
It looks like we can still only play sound files in .wav format. sound.py only supports playing sound from a file, so we might want to expand its capabilities.
should the turtle.py module and sample use tuples like BitmapCanvas or keep logo-style x, y parameters? Right now I'm inclined to leave them as x, y to make it more like Logo turtle graphics, but it means when BitmapCanvas drawing is combined with turtle drawing calls it could get confusing, so maybe it would be better to always use tuples?
I've added a deactivate event. I was going to add events for when a window is restored from a minimize and reduced from a maximize but all I'm seeing are move and size events. I don't know if that is a wxWidgets bug or a problem with the PythonCard framework, so I'll have to make a minimal wxPython sample to test before proceeding further.
http://wiki.wxpython.org/index.cgi/PythonCardToDoList
Many try/except blocks in the framework just call pass in the except block and errors need better handling.
We have a error.py module with some custom exceptions, but in some cases these aren't needed and it would be better to use Python built-in exceptions instead.
See wxPython version info. We could use a tuple for major and minor versions in addition or instead of a plain string.
also added createStatusBar method to Background and CustomDialog to enable applications to create their own more complex StatusBars
created new about.py module, so the dialog doesn't rely on debug.py and can be easily used by any PythonCard application.
the dialog can be made more complex, providing more debug info, hyperlinks, etc., and bug reporting submission button, etc. without impacting any code that uses the dialog. Maybe we should have a contest for people to submit designs?
Perhaps we should even have a separate debug info tool that would list other useful info such the users PYTHONPATH, environment variables, and other system info that could provide clues.
Thorougly test to make sure no functionality was lost.
I'm seeing this type of message way too often in the shell while using the codeEditor. Is it in PyCrust or something in PythonCard/debug.py?! It is getting triggered during the autoComplete list display, so you can just type os.getcwd() and after that sequence 2 debug messages will show up.
13:19:49: Debug: ..\..\src\msw\clipbrd.cpp(561): 'OleFlushClipboard' failed with
We have the 'command' event type bound to all components, but command doesn't work for components that don't have some form of wxPython Command event like mouseClick or select. mouse event are a bit tricky with these types of controls so that on GTK you might not even receive a mouse down if the underlying control isn't native. In that case, say Linux/GTK the mouse event will be seen by the underlying panel.
I suppose we might be able to bind the panel events and then manually hook them up to the right component, but that still won't give us command events for those controls. I suppose we could use the mouseUp for command as long as we the mouse event binding right.
I left the on_mouseClick handler in CustomDialog which automatically calls skip just in case there is more to the issue
util.py should contain the standard runScript used by the samples launcher, codeEditor, resourceEditor, findfiles, etc. Need to get the quoting right on all platforms.
add a TwistedApplication subclass of Application
raw wxPython minimal samples to show particular bugs that impact PythonCard. Provide links to relevant bug reports and mailing list messages and remove bug sample once the issue is fixed.
Need to make sure a handler is bound to the right components after it is added. Maybe addMethod will take a list of objects to call _bindEvents on. See longer comment in addMethod source in model.py
PythonCard08 (last edited 2008-03-11 10:50:22 by localhost)