orca r4209 - branches/phase2/src/orca



Author: wwalker
Date: Sun Sep 14 01:38:31 2008
New Revision: 4209
URL: http://svn.gnome.org/viewvc/orca?rev=4209&view=rev

Log:
Limit some debug logging and also resolve some syntax issues.


Modified:
   branches/phase2/src/orca/default.py
   branches/phase2/src/orca/input_bindings.py
   branches/phase2/src/orca/script.py
   branches/phase2/src/orca/script_manager.py

Modified: branches/phase2/src/orca/default.py
==============================================================================
--- branches/phase2/src/orca/default.py	(original)
+++ branches/phase2/src/orca/default.py	Sun Sep 14 01:38:31 2008
@@ -875,78 +875,79 @@
     def _onFocus(self, event):
         """Called on AT-SPI focus events.
         """
-        log.debug("_onFocus: %s" % event)
+        log.debug("_onFocus: %s" % str(event).replace("\n", " "))
 
     def _onActiveDescendantChanged(self, event):
         """Called on AT-SPI object:active-descendant-changed events.
         """
-        log.debug("_onActiveDescendantChanged: %s" % event)
+        log.debug("_onActiveDescendantChanged: %s" \
+                  % str(event).replace("\n", " "))
 
     def _onMouseButton(self, event):
         """Called on AT-SPI mouse:button events.
         """
-        log.debug("_onMouseButton: %s" % event)
+        log.debug("_onMouseButton: %s" % str(event).replace("\n", " "))
 
     def _onNameChanged(self, event):
         """Called on AT-SPI object:property-change:accessible-name events.
         """
-        log.debug("_onNameChanged: %s" % event)
+        log.debug("_onNameChanged: %s" % str(event).replace("\n", " "))
 
     def _onCaretMoved(self, event):
         """Called on AT-SPI object:text-caret-moved events.
         """
-        log.debug("_onCaretMoved: %s" % event)
+        log.debug("_onCaretMoved: %s" % str(event).replace("\n", " "))
 
     def _onTextDeleted(self, event):
         """Called on AT-SPI object:text-changed:delete events.
         """
-        log.debug("_onTextDeleted: %s" % event)
+        log.debug("_onTextDeleted: %s" % str(event).replace("\n", " "))
 
     def _onTextInserted(self, event):
         """Called on AT-SPI object:text-changed:insert events.
         """
-        log.debug("_onTextInserted: %s" % event)
+        log.debug("_onTextInserted: %s" % str(event).replace("\n", " "))
 
     def _onTextSelectionChanged(self, event):
         """Called on AT-SPI object:text-selection-changed events.
         """
-        log.debug("_onTextSelectionChanged: %s" % event)
+        log.debug("_onTextSelectionChanged: %s" % str(event).replace("\n", " "))
 
     def _onSelectionChanged(self, event):
         """Called on AT-SPI object:selection-changed events.
         """
-        log.debug("_onSelectionChanged: %s" % event)
+        log.debug("_onSelectionChanged: %s" % str(event).replace("\n", " "))
 
     def _onLinkSelected(self, event):
         """Called on AT-SPI object:link-selected events.
         """
-        log.debug("_onLinkSelected: %s" % event)
+        log.debug("_onLinkSelected: %s" % str(event).replace("\n", " "))
 
     def _onStateChanged(self, event):
         """Called on AT-SPI object:state-changed events.
         """
-        log.debug("_onStateChanged: %s" % event)
+        log.debug("_onStateChanged: %s" % str(event).replace("\n", " "))
 
     def _onValueChanged(self, event):
         """Called on AT-SPI object:value-changed and
            object:property-change:accessible-value events.
         """
-        log.debug("_onValueChanged: %s" % event)
+        log.debug("_onValueChanged: %s" % str(event).replace("\n", " "))
 
     def _onWindowActivated(self, event):
         """Called on AT-SPI window:activate events.
         """
-        log.debug("_onWindowActivated: %s" % event)
+        log.debug("_onWindowActivated: %s" % str(event).replace("\n", " "))
 
     def _onWindowDeactivated(self, event):
         """Called on AT-SPI window:deactivate events.
         """
-        log.debug("_onWindowDeactivated: %s" % event)
+        log.debug("_onWindowDeactivated: %s" % str(event).replace("\n", " "))
 
     def _noOp(self, event):
         """Just here to capture events.
         """
-        log.debug("_noOp: %s" % event)
+        log.debug("_noOp: %s" % str(event).replace("\n", " "))
 
     ####################################################################
     #                                                                  #

Modified: branches/phase2/src/orca/input_bindings.py
==============================================================================
--- branches/phase2/src/orca/input_bindings.py	(original)
+++ branches/phase2/src/orca/input_bindings.py	Sun Sep 14 01:38:31 2008
@@ -196,7 +196,6 @@
                       to this Handler instance.
         - modifiers:  any modifiers associated with the event
         """
-        log.debug("process %s for %s" % (inputEvent, script))
         self.function(script, inputEvent, modifiers)
 
 class Binding:
@@ -366,12 +365,12 @@
                            modifiers, 
                            process=True):
         """Processes the given input event.  Returns True if a handler
-        was found and the event was actually processed.
+        was found.
         """
         handler = self.getHandler(commandCode,
                                   modifiers,
                                   script.getClickCount())
-        if handler:
+        if handler and process:
             handler.processInputEvent(script,
                                       inputEvent,
                                       modifiers)

Modified: branches/phase2/src/orca/script.py
==============================================================================
--- branches/phase2/src/orca/script.py	(original)
+++ branches/phase2/src/orca/script.py	Sun Sep 14 01:38:31 2008
@@ -77,7 +77,7 @@
             self._createBrailleBindings(self._inputEventHandlers)
         
         self._name = None
-        self._application = application
+        self.application = application
         self._focus = None
         self._pointOfReference = {}
         self._completeInit(application)
@@ -86,7 +86,7 @@
         """Completes the __init__ step.
         """
         if application:
-            self._name = self._application.name
+            self._name = self.application.name
         else:
             self._name = "default"
         self._name += " (module=" + self.__module__ + ")"
@@ -97,7 +97,7 @@
         """
         if not self._name:
             if application:
-                self._name = self._application.name
+                self._name = self.application.name
             else:
                 self._name = "default"
             self._name += " (module=" + self.__module__ + ")"
@@ -183,7 +183,6 @@
         and we have an interest in it.
         """
         # TODO: add support for user-settings.py keyBindingsMap
-        log.debug("processKeyboardEvent %s" % keyboardEvent)
 
         # We'll annotate the event with a reference to this script.
         # This will allow external scripts to muck with the script

Modified: branches/phase2/src/orca/script_manager.py
==============================================================================
--- branches/phase2/src/orca/script_manager.py	(original)
+++ branches/phase2/src/orca/script_manager.py	Sun Sep 14 01:38:31 2008
@@ -487,7 +487,7 @@
                             setNewActiveScript = \
                                 self._activeScript \
                                 and event.host_application \
-                                and (self._activeScript.app \
+                                and (self._activeScript.application \
                                      != event.host_application)
 
                     if not reason and setNewActiveScript:



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