Re: Orca What happened to the Acroread script?



Hi All:

StarOffice script. I was just copying you!" In that case, those routines
are used in the subclassed SpeechGenerator and BrailleGenerator
class, and the only way to solve this (when I initially wrote that script)
was to put them outside the Script class. Now that we have
orca_state.activeScript, those too should probably be moved down to
the Script class. (What do you think on the last part Will).

Referring to orca_state.activeScript from within a script is not really a good thing to do -- the methods in a script instance can be called when the script is not the activeScript. For example, the clock in gnome-panel issues events that are handled by its script instance even if the clock doesn't have focus.

For the cases in question (i.e., a script module has global functions in it), I think the functions should be moved into the Script subclass in the script module. In addition, they should refer to "self" (not orca_state.activeScript). Finally, since the speech and braille generators have knowledge of the script that owns them, they should refer to self._script and not orca_state.activeScript. Some of the current state of affairs, by the way, is the result of some things not being in place at the time the script was written. The biggest thing being what Rich mentions above: the speech and braille generators didn't have knowledge of the script that owned them. A refactor happened, however, and things can now be shuffled around to make them a little cleaner.

Once we get this all resolved, very few things should refer to orca_state.active_script. The biggest remaining offender is the where_am_i.py module. It probably should have knowledge of the script that is using it. We can get away with the way it refers to orca_state.active_script for now, however, because where_am_i is meant to operate on the application with focus.

Thanks!

Will




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]