dogtail r398 - in trunk: . dogtail



Author: zcerza
Date: Mon Aug 11 21:18:15 2008
New Revision: 398
URL: http://svn.gnome.org/viewvc/dogtail?rev=398&view=rev

Log:
* dogtail/tree.py: Don't log giant messages to the debug log if we're
setting a Node's text to a very large value. Also, use config.actionDelay for
Node.click().


Modified:
   trunk/ChangeLog
   trunk/dogtail/tree.py

Modified: trunk/dogtail/tree.py
==============================================================================
--- trunk/dogtail/tree.py	(original)
+++ trunk/dogtail/tree.py	Mon Aug 11 21:18:15 2008
@@ -168,7 +168,7 @@
                 logger.log("Warning: " + str(nSE))
         if config.blinkOnActions: self.node.blink()
         result = self.__action.doAction (self.__index)
-        doDelay()
+        doDelay(config.actionDelay)
         return result
         
 
@@ -316,7 +316,12 @@
     def _setText(self, text):
          try:
              if config.debugSearching:
-                 logger.log("Setting text of %s to '%s'"%(self.getLogString(), value)) 
+                 msg = "Setting text of %s to %s"
+                 # Let's not get too crazy if 'text' is really large...
+                 # FIXME: Sometimes the next line screws up Unicode strings.
+                 if len(text) > 140: txt = text[:134] + " [...]"
+                 else: txt = text
+                 logger.log(msg % (self.getLogString(), "'%s'" % txt)) 
              self.queryEditableText().setTextContents(text)
          except NotImplementedError: raise AttributeError, "can't set attribute"
     text = property(_getText, _setText, doc = \
@@ -391,7 +396,6 @@
         if config.debugSearching:
             logger.log("raw click on %s %s at (%s,%s)"%(self.name, self.getLogString(), str(clickX), str(clickY)))
         rawinput.click(clickX, clickY, button)
-        doDelay()
 
     ##
     # RelationSet



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