[Nvda-dev] commit r1925 - in trunk/source: . NVDAObjects appModules synthDrivers virtualBuffers_old

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Nvda-dev] commit r1925 - in trunk/source: . NVDAObjects appModules synthDrivers virtualBuffers_old

NVDA Subversion
Author: mdcurran
Date: Sun Apr 20 03:54:55 2008
New Revision: 1925

Log:
Make sure that class names start with an uppercase letter (found by pyLint): changed baseObject.AutoPropertyObject, baseObject.ScriptableObject,  appModuleHandler.AppModule, textBuffer.TextBufferObject

Modified:
   trunk/source/NVDAObjects/__init__.py
   trunk/source/_synthSettingsRing.py
   trunk/source/appModuleHandler.py
   trunk/source/appModules/_default.py
   trunk/source/appModules/audacity.py
   trunk/source/appModules/calc.py
   trunk/source/appModules/firefox.py
   trunk/source/appModules/miranda32.py
   trunk/source/appModules/mplayerc.py
   trunk/source/appModules/msimn.py
   trunk/source/appModules/msnmsgr.py
   trunk/source/appModules/nvda.py
   trunk/source/appModules/outlook.py
   trunk/source/appModules/skype.py
   trunk/source/appModules/soffice.py
   trunk/source/appModules/winamp.py
   trunk/source/baseObject.py
   trunk/source/cursorManager.py
   trunk/source/pythonConsole.py
   trunk/source/synthDrivers/silence.py
   trunk/source/textBuffer.py
   trunk/source/textHandler.py
   trunk/source/virtualBuffers_old/__init__.py

Modified: trunk/source/NVDAObjects/__init__.py
==============================================================================
--- trunk/source/NVDAObjects/__init__.py (original)
+++ trunk/source/NVDAObjects/__init__.py Sun Apr 20 03:54:55 2008
@@ -319,7 +319,7 @@
  def _get_bookmark(self):
  return textHandler.Bookmark(self.__class__,(self._startOffset,self._endOffset))
 
-class NVDAObject(baseObject.scriptableObject):
+class NVDAObject(baseObject.ScriptableObject):
  """
 The baseType NVDA object. All other NVDA objects are based on this one.
 @ivar _hashLimit: The limit in size for a hash of this object

Modified: trunk/source/_synthSettingsRing.py
==============================================================================
--- trunk/source/_synthSettingsRing.py (original)
+++ trunk/source/_synthSettingsRing.py Sun Apr 20 03:54:55 2008
@@ -3,7 +3,7 @@
 import config
 import itertools
 
-class SynthSetting(baseObject.autoPropertyObject):
+class SynthSetting(baseObject.AutoPropertyObject):
  """ a synth setting. Has functions to set, get, increase and decrease its value """
  def __init__(self,name,min=0,max=100,step=1):
  self.name=name
@@ -75,7 +75,7 @@
  def _get_valueName(self):
  return synthDriverHandler.getSynth().getVariantName(self.value)
 
-class SynthSettingsRing(baseObject.autoPropertyObject):
+class SynthSettingsRing(baseObject.AutoPropertyObject):
  """
  A synth settings ring which enables the user to change to the next and previous settings and ajust the selected one
  It was written to facilitate the implementation of a way to change the settings resembling the window-eyes way.

Modified: trunk/source/appModuleHandler.py
==============================================================================
--- trunk/source/appModuleHandler.py (original)
+++ trunk/source/appModuleHandler.py Sun Apr 20 03:54:55 2008
@@ -150,7 +150,7 @@
  """
  global activeModule
  for w in [x for x in runningTable if not winUser.isWindow(x)]:
- if isinstance(activeModule,appModule) and w==activeModule.appWindow:
+ if isinstance(activeModule,AppModule) and w==activeModule.appWindow:
  if hasattr(activeModule,"event_appLooseFocus"):
  globalVars.log.debug("calling appLoseFocus event on appModule %s"%activeModule)
  activeModule.event_appLooseFocus()
@@ -171,12 +171,12 @@
  mod=fetchModule(appName)
  if mod:
  mod=mod(appName,appWindow)
- if mod.__class__!=appModule:
+ if mod.__class__!=AppModule:
  globalVars.log.info("Loaded appModule %s, %s"%(mod.appName,mod))
  loadKeyMap(appName,mod)
  runningTable[appWindow]=mod
  activeAppWindow=winUser.getAncestor(winUser.getForegroundWindow(),winUser.GA_ROOTOWNER)
- if isinstance(activeModule,appModule) and activeAppWindow!=activeModule.appWindow:
+ if isinstance(activeModule,AppModule) and activeAppWindow!=activeModule.appWindow:
  globalVars.log.info("appModule %s lost focus"%activeModule)
  if hasattr(activeModule,"event_appLooseFocus"):
  activeModule.event_appLooseFocus()
@@ -228,7 +228,7 @@
  speech.speakMessage(_("Error in appModule %s")%appName)
  raise RuntimeError
  if mod is None:
- return appModule
+ return AppModule
  return mod
 
 def initialize():
@@ -250,7 +250,7 @@
  raise RuntimeError("appModuleHandler.initialize: could not load default module ")
 
 #base class for appModules
-class appModule(baseObject.scriptableObject):
+class AppModule(baseObject.ScriptableObject):
  """AppModule base class
  @var appName: the application name
  @type appName: str

Modified: trunk/source/appModules/_default.py
==============================================================================
--- trunk/source/appModules/_default.py (original)
+++ trunk/source/appModules/_default.py Sun Apr 20 03:54:55 2008
@@ -30,7 +30,7 @@
 from gui import mainFrame
 import virtualBufferHandler
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_switchStart(self,obj,nextHandler):
  speech.cancelSpeech()

Modified: trunk/source/appModules/audacity.py
==============================================================================
--- trunk/source/appModules/audacity.py (original)
+++ trunk/source/appModules/audacity.py Sun Apr 20 03:54:55 2008
@@ -7,7 +7,7 @@
 import appModuleHandler
 import winUser
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self,obj):
  if obj.windowClassName=="Button":

Modified: trunk/source/appModules/calc.py
==============================================================================
--- trunk/source/appModules/calc.py (original)
+++ trunk/source/appModules/calc.py Sun Apr 20 03:54:55 2008
@@ -1,10 +1,10 @@
 import appModuleHandler
 import speech
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def __init__(self,*args):
- appModuleHandler.appModule.__init__(self,*args)
+ appModuleHandler.AppModule.__init__(self,*args)
  self._lastValue=None
 
  def event_NVDAObject_init(self,obj):

Modified: trunk/source/appModules/firefox.py
==============================================================================
--- trunk/source/appModules/firefox.py (original)
+++ trunk/source/appModules/firefox.py Sun Apr 20 03:54:55 2008
@@ -1,24 +1,24 @@
-#appModules/firefox.py
-#A part of NonVisual Desktop Access (NVDA)
-#Copyright (C) 2006-2008 NVDA Contributors <http://www.nvda-project.org/>
-#This file is covered by the GNU General Public License.
-#See the file COPYING for more details.
-
-import appModuleHandler
-import controlTypes
-import api
-import speech
-import winUser
-
-class appModule(appModuleHandler.appModule):
-
- def event_stateChange(self, obj, nextHandler):
- if obj.role == controlTypes.ROLE_DOCUMENT and controlTypes.STATE_BUSY in obj.states and winUser.isWindowVisible(obj.windowHandle):
- statusBar = api.getStatusBar()
- if statusBar:
- statusText = api.getStatusBarText(statusBar)
- speech.cancelSpeech()
- speech.speakMessage(statusText)
- nextHandler()
-
- event_gainFocus = event_stateChange
+#appModules/firefox.py
+#A part of NonVisual Desktop Access (NVDA)
+#Copyright (C) 2006-2008 NVDA Contributors <http://www.nvda-project.org/>
+#This file is covered by the GNU General Public License.
+#See the file COPYING for more details.
+
+import appModuleHandler
+import controlTypes
+import api
+import speech
+import winUser
+
+class appModule(appModuleHandler.AppModule):
+
+ def event_stateChange(self, obj, nextHandler):
+ if obj.role == controlTypes.ROLE_DOCUMENT and controlTypes.STATE_BUSY in obj.states and winUser.isWindowVisible(obj.windowHandle):
+ statusBar = api.getStatusBar()
+ if statusBar:
+ statusText = api.getStatusBarText(statusBar)
+ speech.cancelSpeech()
+ speech.speakMessage(statusText)
+ nextHandler()
+
+ event_gainFocus = event_stateChange

Modified: trunk/source/appModules/miranda32.py
==============================================================================
--- trunk/source/appModules/miranda32.py (original)
+++ trunk/source/appModules/miranda32.py Sun Apr 20 03:54:55 2008
@@ -71,7 +71,7 @@
 #other constants
 ANSILOGS=(1001,1006)
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self,obj):
  if obj.windowClassName=="CListControl":

Modified: trunk/source/appModules/mplayerc.py
==============================================================================
--- trunk/source/appModules/mplayerc.py (original)
+++ trunk/source/appModules/mplayerc.py Sun Apr 20 03:54:55 2008
@@ -7,7 +7,7 @@
 import appModuleHandler
 import controlTypes
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self,obj):
  if obj.windowClassName=="#32770" and obj.windowControlID==10021:

Modified: trunk/source/appModules/msimn.py
==============================================================================
--- trunk/source/appModules/msimn.py (original)
+++ trunk/source/appModules/msimn.py Sun Apr 20 03:54:55 2008
@@ -32,7 +32,7 @@
  1037:_("From:"),
 }
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self,obj):
  controlID=obj.windowControlID

Modified: trunk/source/appModules/msnmsgr.py
==============================================================================
--- trunk/source/appModules/msnmsgr.py (original)
+++ trunk/source/appModules/msnmsgr.py Sun Apr 20 03:54:55 2008
@@ -30,7 +30,7 @@
 u'Historik',
 ])
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self,obj):
  if obj.windowClassName=="DirectUIHWND" and obj.role==controlTypes.ROLE_EDITABLETEXT and obj.name in possibleHistoryWindowNames:

Modified: trunk/source/appModules/nvda.py
==============================================================================
--- trunk/source/appModules/nvda.py (original)
+++ trunk/source/appModules/nvda.py Sun Apr 20 03:54:55 2008
@@ -2,7 +2,7 @@
 import controlTypes
 import gui
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self, obj):
  # It seems that context menus always get the name "context" and this cannot be overridden.

Modified: trunk/source/appModules/outlook.py
==============================================================================
--- trunk/source/appModules/outlook.py (original)
+++ trunk/source/appModules/outlook.py Sun Apr 20 03:54:55 2008
@@ -44,7 +44,7 @@
  nameList.append(_("sent: %s")%obj.sentOn)
  return ", ".join(nameList)
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self,obj):
  role=obj.role

Modified: trunk/source/appModules/skype.py
==============================================================================
--- trunk/source/appModules/skype.py (original)
+++ trunk/source/appModules/skype.py Sun Apr 20 03:54:55 2008
@@ -7,7 +7,7 @@
 import appModuleHandler
 from NVDAObjects.IAccessible import IAccessible
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self,obj):
  if (obj.windowClassName=="TMainUserList") or (obj.windowClassName=="TPanel" and obj.windowControlID==13698186):

Modified: trunk/source/appModules/soffice.py
==============================================================================
--- trunk/source/appModules/soffice.py (original)
+++ trunk/source/appModules/soffice.py Sun Apr 20 03:54:55 2008
@@ -11,7 +11,7 @@
 
 inDocument=False
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_gainFocus(self,obj,nextHandler):
  global inDocument

Modified: trunk/source/appModules/winamp.py
==============================================================================
--- trunk/source/appModules/winamp.py (original)
+++ trunk/source/appModules/winamp.py Sun Apr 20 03:54:55 2008
@@ -39,7 +39,7 @@
 
 hwndWinamp=0
 
-class appModule(appModuleHandler.appModule):
+class appModule(appModuleHandler.AppModule):
 
  def event_NVDAObject_init(self,obj):
  global hwndWinamp

Modified: trunk/source/baseObject.py
==============================================================================
--- trunk/source/baseObject.py (original)
+++ trunk/source/baseObject.py Sun Apr 20 03:54:55 2008
@@ -7,7 +7,7 @@
 from new import instancemethod
 from keyUtils import key
 
-class autoPropertyObject(object):
+class AutoPropertyObject(object):
 
  def __getattr__(self,name):
  if not name.startswith('_get_') and hasattr(self,'_get_%s'%name):
@@ -20,9 +20,9 @@
  if not name.startswith('_set_') and hasattr(self,'_set_%s'%name):
  getattr(self,'_set_%s'%name)(value)
  else:
- super(autoPropertyObject,self).__setattr__(name,value)
+ super(AutoPropertyObject,self).__setattr__(name,value)
 
-class scriptableObject(autoPropertyObject):
+class ScriptableObject(AutoPropertyObject):
 
  @classmethod
  def bindKey(cls,keyName,scriptName):

Modified: trunk/source/cursorManager.py
==============================================================================
--- trunk/source/cursorManager.py (original)
+++ trunk/source/cursorManager.py Sun Apr 20 03:54:55 2008
@@ -16,13 +16,13 @@
 import speech
 import config
 
-class CursorManager(baseObject.scriptableObject):
+class CursorManager(baseObject.ScriptableObject):
  """
  A mix-in providing caret navigation and selection commands for the object's virtual text range.
  This is required where a text range is not linked to a physical control and thus does not provide commands to move the cursor, select and copy text, etc.
  This base cursor manager requires that the text range being used stores its own caret and selection information.
 
- This is a mix-in class; i.e. it should be inherited alongside another L{baseObject.scriptableObject}.
+ This is a mix-in class; i.e. it should be inherited alongside another L{baseObject.ScriptableObject}.
  The class into which it is inherited must provide a C{makeTextInfo(position)} method.
 
  @ivar selection: The current caret/selection range.

Modified: trunk/source/pythonConsole.py
==============================================================================
--- trunk/source/pythonConsole.py (original)
+++ trunk/source/pythonConsole.py Sun Apr 20 03:54:55 2008
@@ -1,148 +1,148 @@
-"""Provides an interactive Python console which can be run from within NVDA.
-To use, call L{initialize} to create a singleton instance of the console GUI. This can then be accessed externally as L{consoleUI}.
-"""
-
-import __builtin__
-import code
-import sys
-import wx
-from baseObject import autoPropertyObject
-import speech
-import queueHandler
-import api
-import gui
-
-#: The singleton Python console UI instance.
-consoleUI = None
-
-class PythonConsole(code.InteractiveConsole, autoPropertyObject):
- """An interactive Python console which directs output to supplied functions.
- This is necessary for a Python console facilitated by a GUI.
- Input is always received via the L{push} method.
- This console also handles redirection of stdout and stderr and prevents clobbering of the gettext "_" builtin.
- """
-
- def __init__(self, outputFunc, echoFunc, setPromptFunc, **kwargs):
- # Can't use super here because stupid code.InteractiveConsole doesn't sub-class object. Grrr!
- code.InteractiveConsole.__init__(self, **kwargs)
- self._output = outputFunc
- self._echo = echoFunc
- self._setPrompt = setPromptFunc
- self.prompt = ">>>"
-
- def _set_prompt(self, prompt):
- self._prompt = prompt
- self._setPrompt(prompt)
-
- def _get_prompt(self):
- return self._prompt
-
- def write(self, data):
- self._output(data)
-
- def push(self, line):
- self._echo("%s %s\n" % (self.prompt, line))
- # Capture stdout/stderr output as well as code interaction.
- stdout, stderr = sys.stdout, sys.stderr
- sys.stdout = sys.stderr = self
- # Prevent this from messing with the gettext "_" builtin.
- saved_ = __builtin__._
- more = code.InteractiveConsole.push(self, line)
- sys.stdout, sys.stderr = stdout, stderr
- __builtin__._ = saved_
- self.prompt = "..." if more else ">>>"
- return more
-
-class ConsoleUI(wx.Frame):
- """The NVDA Python console GUI.
- """
-
- def __init__(self):
- super(ConsoleUI, self).__init__(None, wx.ID_ANY, _("NVDA Python Console"))
- self.Bind(wx.EVT_CLOSE, self.onClose)
- mainSizer = wx.BoxSizer(wx.VERTICAL)
- self.outputCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(500, 500), style=wx.TE_MULTILINE | wx.TE_READONLY)
- mainSizer.Add(self.outputCtrl, proportion=2, flag=wx.EXPAND)
- inputSizer = wx.BoxSizer(wx.HORIZONTAL)
- self.promptLabel = wx.StaticText(self, wx.ID_ANY)
- inputSizer.Add(self.promptLabel, flag=wx.EXPAND)
- self.inputCtrl = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_DONTWRAP | wx.TE_PROCESS_TAB)
- self.inputCtrl.Bind(wx.EVT_CHAR, self.onInputChar)
- inputSizer.Add(self.inputCtrl, proportion=1, flag=wx.EXPAND)
- mainSizer.Add(inputSizer, proportion=1, flag=wx.EXPAND)
- self.SetSizer(mainSizer)
- mainSizer.Fit(self)
-
- #: The namespace available to the console. This can be updated externally.
- #: @type: dict
- self.namespace = {}
- self.console = PythonConsole(outputFunc=self.output, echoFunc=self.echo, setPromptFunc=self.setPrompt, locals=self.namespace)
- self.inputHistory = []
- self.inputHistoryPos = 0
-
- self.inputCtrl.SetFocus()
-
- def onClose(self, evt):
- self.Hide()
-
- def output(self, data):
- self.outputCtrl.write(data)
- if data and not data.isspace():
- queueHandler.queueFunction(queueHandler.eventQueue, speech.speakText, data)
-
- def echo(self, data):
- self.outputCtrl.write(data)
-
- def setPrompt(self, prompt):
- self.promptLabel.SetLabel(prompt)
- queueHandler.queueFunction(queueHandler.eventQueue, speech.speakText, prompt)
-
- def execute(self):
- data = self.inputCtrl.GetValue()
- self.console.push(data)
- self.inputHistory.append(data)
- self.inputHistoryPos = len(self.inputHistory)
- self.inputCtrl.ChangeValue("")
-
- def historyMove(self, movement):
- newIndex = self.inputHistoryPos + movement
- historyLen = len(self.inputHistory)
- if 0 <= newIndex < historyLen:
- self.inputCtrl.ChangeValue(self.inputHistory[newIndex])
- elif newIndex == len(self.inputHistory):
- self.inputCtrl.ChangeValue("")
- else:
- return False
- self.inputHistoryPos = newIndex
- self.inputCtrl.SetInsertionPointEnd()
- return True
-
- def onInputChar(self, evt):
- key = evt.GetKeyCode()
- if key == wx.WXK_RETURN:
- self.execute()
- return
- elif key in (wx.WXK_UP, wx.WXK_DOWN):
- if self.historyMove(-1 if key == wx.WXK_UP else 1):
- return
- evt.Skip()
-
- def updateNamespaceSnapshotVars(self):
- """Update the console namespace with a snapshot of NVDA's current state.
- This creates/updates variables for the current focus, navigator object, etc.
- """
- self.namespace.update({
- "focus": api.getFocusObject(),
- "focusAnc": api.getFocusAncestors(),
- "fg": api.getForegroundObject(),
- "nav": api.getNavigatorObject(),
- "mouse": api.getMouseObject(),
- })
-
-def initialize():
- """Initialize the NVDA Python console GUI.
- This creates a singleton instance of the console GUI. This is accessible as L{consoleUI}. This can and should be manipulated externally.
- """
- global consoleUI
- consoleUI = ConsoleUI()
- gui.topLevelWindows.append(consoleUI)
+"""Provides an interactive Python console which can be run from within NVDA.
+To use, call L{initialize} to create a singleton instance of the console GUI. This can then be accessed externally as L{consoleUI}.
+"""
+
+import __builtin__
+import code
+import sys
+import wx
+from baseObject import AutoPropertyObject
+import speech
+import queueHandler
+import api
+import gui
+
+#: The singleton Python console UI instance.
+consoleUI = None
+
+class PythonConsole(code.InteractiveConsole, AutoPropertyObject):
+ """An interactive Python console which directs output to supplied functions.
+ This is necessary for a Python console facilitated by a GUI.
+ Input is always received via the L{push} method.
+ This console also handles redirection of stdout and stderr and prevents clobbering of the gettext "_" builtin.
+ """
+
+ def __init__(self, outputFunc, echoFunc, setPromptFunc, **kwargs):
+ # Can't use super here because stupid code.InteractiveConsole doesn't sub-class object. Grrr!
+ code.InteractiveConsole.__init__(self, **kwargs)
+ self._output = outputFunc
+ self._echo = echoFunc
+ self._setPrompt = setPromptFunc
+ self.prompt = ">>>"
+
+ def _set_prompt(self, prompt):
+ self._prompt = prompt
+ self._setPrompt(prompt)
+
+ def _get_prompt(self):
+ return self._prompt
+
+ def write(self, data):
+ self._output(data)
+
+ def push(self, line):
+ self._echo("%s %s\n" % (self.prompt, line))
+ # Capture stdout/stderr output as well as code interaction.
+ stdout, stderr = sys.stdout, sys.stderr
+ sys.stdout = sys.stderr = self
+ # Prevent this from messing with the gettext "_" builtin.
+ saved_ = __builtin__._
+ more = code.InteractiveConsole.push(self, line)
+ sys.stdout, sys.stderr = stdout, stderr
+ __builtin__._ = saved_
+ self.prompt = "..." if more else ">>>"
+ return more
+
+class ConsoleUI(wx.Frame):
+ """The NVDA Python console GUI.
+ """
+
+ def __init__(self):
+ super(ConsoleUI, self).__init__(None, wx.ID_ANY, _("NVDA Python Console"))
+ self.Bind(wx.EVT_CLOSE, self.onClose)
+ mainSizer = wx.BoxSizer(wx.VERTICAL)
+ self.outputCtrl = wx.TextCtrl(self, wx.ID_ANY, size=(500, 500), style=wx.TE_MULTILINE | wx.TE_READONLY)
+ mainSizer.Add(self.outputCtrl, proportion=2, flag=wx.EXPAND)
+ inputSizer = wx.BoxSizer(wx.HORIZONTAL)
+ self.promptLabel = wx.StaticText(self, wx.ID_ANY)
+ inputSizer.Add(self.promptLabel, flag=wx.EXPAND)
+ self.inputCtrl = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_DONTWRAP | wx.TE_PROCESS_TAB)
+ self.inputCtrl.Bind(wx.EVT_CHAR, self.onInputChar)
+ inputSizer.Add(self.inputCtrl, proportion=1, flag=wx.EXPAND)
+ mainSizer.Add(inputSizer, proportion=1, flag=wx.EXPAND)
+ self.SetSizer(mainSizer)
+ mainSizer.Fit(self)
+
+ #: The namespace available to the console. This can be updated externally.
+ #: @type: dict
+ self.namespace = {}
+ self.console = PythonConsole(outputFunc=self.output, echoFunc=self.echo, setPromptFunc=self.setPrompt, locals=self.namespace)
+ self.inputHistory = []
+ self.inputHistoryPos = 0
+
+ self.inputCtrl.SetFocus()
+
+ def onClose(self, evt):
+ self.Hide()
+
+ def output(self, data):
+ self.outputCtrl.write(data)
+ if data and not data.isspace():
+ queueHandler.queueFunction(queueHandler.eventQueue, speech.speakText, data)
+
+ def echo(self, data):
+ self.outputCtrl.write(data)
+
+ def setPrompt(self, prompt):
+ self.promptLabel.SetLabel(prompt)
+ queueHandler.queueFunction(queueHandler.eventQueue, speech.speakText, prompt)
+
+ def execute(self):
+ data = self.inputCtrl.GetValue()
+ self.console.push(data)
+ self.inputHistory.append(data)
+ self.inputHistoryPos = len(self.inputHistory)
+ self.inputCtrl.ChangeValue("")
+
+ def historyMove(self, movement):
+ newIndex = self.inputHistoryPos + movement
+ historyLen = len(self.inputHistory)
+ if 0 <= newIndex < historyLen:
+ self.inputCtrl.ChangeValue(self.inputHistory[newIndex])
+ elif newIndex == len(self.inputHistory):
+ self.inputCtrl.ChangeValue("")
+ else:
+ return False
+ self.inputHistoryPos = newIndex
+ self.inputCtrl.SetInsertionPointEnd()
+ return True
+
+ def onInputChar(self, evt):
+ key = evt.GetKeyCode()
+ if key == wx.WXK_RETURN:
+ self.execute()
+ return
+ elif key in (wx.WXK_UP, wx.WXK_DOWN):
+ if self.historyMove(-1 if key == wx.WXK_UP else 1):
+ return
+ evt.Skip()
+
+ def updateNamespaceSnapshotVars(self):
+ """Update the console namespace with a snapshot of NVDA's current state.
+ This creates/updates variables for the current focus, navigator object, etc.
+ """
+ self.namespace.update({
+ "focus": api.getFocusObject(),
+ "focusAnc": api.getFocusAncestors(),
+ "fg": api.getForegroundObject(),
+ "nav": api.getNavigatorObject(),
+ "mouse": api.getMouseObject(),
+ })
+
+def initialize():
+ """Initialize the NVDA Python console GUI.
+ This creates a singleton instance of the console GUI. This is accessible as L{consoleUI}. This can and should be manipulated externally.
+ """
+ global consoleUI
+ consoleUI = ConsoleUI()
+ gui.topLevelWindows.append(consoleUI)

Modified: trunk/source/synthDrivers/silence.py
==============================================================================
--- trunk/source/synthDrivers/silence.py (original)
+++ trunk/source/synthDrivers/silence.py Sun Apr 20 03:54:55 2008
@@ -7,7 +7,7 @@
 
 #Each synth driver is its own python module containing a 'SynthDriver' class.
 
-class SynthDriver(baseObject.autoPropertyObject):
+class SynthDriver(baseObject.AutoPropertyObject):
 
  hasVoice=False
  hasPitch=False

Modified: trunk/source/textBuffer.py
==============================================================================
--- trunk/source/textBuffer.py (original)
+++ trunk/source/textBuffer.py Sun Apr 20 03:54:55 2008
@@ -6,7 +6,7 @@
 from scriptHandler import isScriptWaiting
 import api
 
-class textBufferObject(baseObject.scriptableObject):
+class TextBufferObject(baseObject.ScriptableObject):
 
  def __init__(self):
  self._reviewPosition=0

Modified: trunk/source/textHandler.py
==============================================================================
--- trunk/source/textHandler.py (original)
+++ trunk/source/textHandler.py Sun Apr 20 03:54:55 2008
@@ -86,7 +86,7 @@
 POSITION_SELECTION="selection"
 POSITION_ALL="all"
 
-class Bookmark(baseObject.autoPropertyObject):
+class Bookmark(baseObject.AutoPropertyObject):
  """The type for representing a static absolute position from a L{TextInfo} object
 @ivar infoClass: the class of the TextInfo object
 @type infoClass: type
@@ -125,7 +125,7 @@
 UNIT_STORY="story"
 UNIT_READINGCHUNK="readingChunck"
 
-class TextInfo(baseObject.autoPropertyObject):
+class TextInfo(baseObject.AutoPropertyObject):
  """Contains information about the text at the given position or unit
 @ivar position: the position (offset or point) this object was based on. Can also be one of the position constants to be caret or selection etc
 @type position: int, tuple or string

Modified: trunk/source/virtualBuffers_old/__init__.py
==============================================================================
--- trunk/source/virtualBuffers_old/__init__.py (original)
+++ trunk/source/virtualBuffers_old/__init__.py Sun Apr 20 03:54:55 2008
@@ -16,7 +16,7 @@
 import controlTypes
 import NVDAObjects
 
-class virtualBuffer(textBuffer.textBufferObject):
+class virtualBuffer(textBuffer.TextBufferObject):
 
  def isNVDAObjectInVirtualBuffer(self,obj):
  pass
@@ -41,7 +41,7 @@
 }
 
  def __init__(self,NVDAObject):
- textBuffer.textBufferObject.__init__(self)
+ textBuffer.TextBufferObject.__init__(self)
  self.needsLoad=True
  self.rootNVDAObject=NVDAObject
  self._IDs={}