[orca-devel] A Couple of Ideas




Hi,
After reading the refactor page, I have a couple of ideas/suggestions.  I am not sure that these will be any use what so ever, but here they are just the same. :)
"Only do the work that is needed
Right now, Orca always computes braille, speech, and magnification. It should only do the work that is necessary. For example, if braille is not used, don't compute the braille line."
I think that after the first initial setup, if Braille isn't selected as a method of output, it shouldn't even be included when Orca starts.  The same would go for magnification.  I am still just learning, but this should be a pretty easy change.  Unless, of course, Braill and Magnification and speech components have other crutial code for Orca to work.  As an example:
#sudo code
read orca-settings.ini into array

if settings[braille] == true:
    import braille
if settings[speech] == true:
  import speech
if settings[magnification] == true:
  import magnification
#end sudo code
Orca could also be use this to output in the chosen format for scripts.  As an example, in the scripts I have been doing, there is a line for speaking and for Brailling.  I assume this is because the script needs to cover both Braille users as well a speech users.  It would simplify things a lot though if it was just one line.  Something like:
orca.display("some message here")
Selectively importing code should cut down on the time it takes Python to execute everything, and this should cause Orca to run faster?
My next idea is a plugins directory for Orca.  This directory would replace the current orca-customizations.py file.  This would also be in addition to the current orca-scripts directory.  So, orca scripts could be written as plugins for orca.  As an example, I will show what the time script would look like with this kind of setup.  This is just theoretical, so will use sudo code again:
#sudo code
import orca
#set script name and keybinding
orca.Plugin("showTime", "orca-t")
#perhapse make it so it understands something like "ctrl-orca-t"
def showTime
  import time
timeString = # time info here
  orca.Display("timeString")
The keybinding set here should from then on be shown and changable in the key bindings gui.
The final idea I have at the moment may be even trickery but I think it would pay off in the end if it's even possible.  I read somewhere that Python interacts rather nicely with C++.  Could some of the code that doesn't change much be changed over to c++?  Because it is a compiled language, it would in theory run faster than Python code.  Even small functions would show some improvement?
Well, that's it for now.  I hope something useful comes from all of this.
Thanks for reading :)
Storm

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