Hello community,

here is the log from the commit of package ldtp for openSUSE:Factory checked in 
at 2012-02-27 18:34:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ldtp (Old)
 and      /work/SRC/openSUSE:Factory/.ldtp.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ldtp", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/ldtp/ldtp.changes        2012-02-20 
16:14:02.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ldtp.new/ldtp.changes   2012-02-27 
18:35:41.000000000 +0100
@@ -1,0 +2,15 @@
+Sun Feb 26 15:53:16 UTC 2012 - [email protected]
+
+- Update to version 2.3.1:
+  + Added twisted gtk3reactor
+  + Operate on window name using index, will be helpful with i18n,
+    l10n testing
+  + at-spi2 related fixes to improve test execution time
+- If GTK+ 3 is preferred (on 12.1 and later), move to the
+  introspection-based bindings:
+  + Add a gobject-introspection BuildRequires to have automatic
+    introspection-based Requires.
+  + Remove gnome-python-desktop/python-wnck and python-gtk
+    Requires.
+
+-------------------------------------------------------------------

Old:
----
  ldtp-2.3.0.tar.gz

New:
----
  ldtp-2.3.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ldtp.spec ++++++
--- /var/tmp/diff_new_pack.bNDvx4/_old  2012-02-27 18:35:42.000000000 +0100
+++ /var/tmp/diff_new_pack.bNDvx4/_new  2012-02-27 18:35:42.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           ldtp
-Version:        2.3.0
+Version:        2.3.1
 Release:        0
 Summary:        Linux Desktop Testing Project (LDTP)
 License:        GPL-2.0+ ; LGPL-2.1+
@@ -25,15 +25,20 @@
 Url:            http://ldtp.freedesktop.org
 Source:         
http://download.freedesktop.org/ldtp/2.x/2.3.x/%{name}-%{version}.tar.gz
 BuildRequires:  fdupes
+%if !(0%{?favor_gtk2})
+BuildRequires:  gobject-introspection
+%endif
 BuildRequires:  python
 # pyatspi is a virtual name that is provided by the default at-spi stack
 Requires:       pyatspi
+%if 0%{?favor_gtk2}
 %if 0%{?suse_version} <= 1130
 Requires:       gnome-python-desktop
 %else
 Requires:       python-wnck
 %endif
 Requires:       python-gtk
+%endif
 Requires:       python-twisted-web
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 %if 0%{suse_version} > 1110

++++++ ldtp-2.3.0.tar.gz -> ldtp-2.3.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/Doxyfile new/ldtp-2.3.1/Doxyfile
--- old/ldtp-2.3.0/Doxyfile     2012-02-16 20:54:52.000000000 +0100
+++ new/ldtp-2.3.1/Doxyfile     2012-02-26 03:48:43.000000000 +0100
@@ -4,7 +4,7 @@
 # Project related configuration options
 #---------------------------------------------------------------------------
 PROJECT_NAME           = LDTP
-PROJECT_NUMBER         = 2.3
+PROJECT_NUMBER         = 2.3.1
 OUTPUT_DIRECTORY       = doc
 CREATE_SUBDIRS         = YES
 OUTPUT_LANGUAGE        = English
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/PKG-INFO new/ldtp-2.3.1/PKG-INFO
--- old/ldtp-2.3.0/PKG-INFO     2012-02-16 20:56:16.000000000 +0100
+++ new/ldtp-2.3.1/PKG-INFO     2012-02-26 03:56:29.000000000 +0100
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: ldtp
-Version: 2.3.0
+Version: 2.3.1
 Summary: Linux Desktop Testing Project Version 2
 Home-page: http://ldtp.freesktop.org
 Author: Nagappan Alagappan
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/ldtp/__init__.py 
new/ldtp-2.3.1/ldtp/__init__.py
--- old/ldtp-2.3.0/ldtp/__init__.py     2012-01-14 04:25:58.000000000 +0100
+++ new/ldtp-2.3.1/ldtp/__init__.py     2012-02-17 04:07:08.000000000 +0100
@@ -394,6 +394,10 @@
         return _remote_enterstring(window_name, object_name, data)
     def setvalue(window_name, object_name = '', data = ''):
         return _remote_setvalue(window_name, object_name, float(data))
+    def grabfocus(window_name, object_name = ''):
+        # On Linux just with window name, grab focus doesn't work
+        # So, we can't make this call generic
+        return _remote_grabfocus(window_name, object_name)
 ### WINDOWS
 
 def onwindowcreate(window_name, fn_name, *args):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/ldtp/client.py 
new/ldtp-2.3.1/ldtp/client.py
--- old/ldtp-2.3.0/ldtp/client.py       2012-01-14 00:32:19.000000000 +0100
+++ new/ldtp-2.3.1/ldtp/client.py       2012-02-25 01:05:21.000000000 +0100
@@ -40,6 +40,10 @@
     _ldtp_debug = os.environ['LDTP_DEBUG']
 else:
     _ldtp_debug = None
+if 'LDTP_XML_DEBUG' in os.environ:
+    verbose = 1
+else:
+    verbose = 0
 if 'LDTP_SERVER_ADDR' in os.environ:
     _ldtp_server_addr = os.environ['LDTP_SERVER_ADDR']
 else:
@@ -213,4 +217,5 @@
     def setHost(self, host):
         setattr(self, '_ServerProxy__host', host)
 
-_client = LdtpClient('http://%s:%s' % (_ldtp_server_addr, _ldtp_server_port))
+_client = LdtpClient('http://%s:%s' % (_ldtp_server_addr, _ldtp_server_port),
+                     verbose = verbose)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/ldtpd/__init__.py 
new/ldtp-2.3.1/ldtpd/__init__.py
--- old/ldtp-2.3.0/ldtpd/__init__.py    2012-01-14 00:37:01.000000000 +0100
+++ new/ldtp-2.3.1/ldtpd/__init__.py    2012-02-25 04:47:39.000000000 +0100
@@ -51,6 +51,14 @@
        # works with gtk2, which fails with gtk3
        from twisted.internet import glib2reactor
        glib2reactor.install()
+    elif gtkVersion >= '3.0':
+        try:
+            # Exist in Ubuntu 12.04, but not on
+            # Ubuntu 11.10 / Fedora 16
+            from twisted.internet import gtk3reactor
+            gtk3reactor.install()
+        except:
+            pass
     from twisted.internet import reactor
     from twisted.web import server, xmlrpc
     from xmlrpc_daemon import XMLRPCLdtpd
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/ldtpd/core.py new/ldtp-2.3.1/ldtpd/core.py
--- old/ldtp-2.3.0/ldtpd/core.py        2012-01-14 00:34:30.000000000 +0100
+++ new/ldtp-2.3.1/ldtpd/core.py        2012-02-25 05:05:29.000000000 +0100
@@ -79,19 +79,27 @@
     def __del__(self):
         if '_events' in dir(self):
             # De-register all registered events
+          try:
             pyatspi.Registry.deregisterEventListener(self._event_cb, 
*self._events)
             pyatspi.Registry.deregisterEventListener(self._registered_event_cb,
                                                      *self._registered_events)
+          except AttributeError:
+            # Handle exception during cleanup
+            pass
         for key in self._process_stats.keys():
             # Stop all process monitoring instances
             self._process_stats[key].stop()
 
     def _registered_event_cb(self, event):
+      try:
         if event and event.source and event.type:
             abbrev_role, abbrev_name, label_by = self._ldtpize_accessible( \
                 event.source)
             window_name = u'%s%s' % (abbrev_role, abbrev_name)
             self._callback_event.append(u"%s-%s" % (event.type, window_name))
+      except:
+        if self._ldtp_debug:
+          print traceback.format_exc()
 
     def _registered_kb_event_cb(self, event):
         if not event:
@@ -110,6 +118,7 @@
                                                             event.modifiers))
 
     def _event_cb(self, event):
+      try:
         if event and event.type == "window:create" and event.source:
             for window in self._callback:
                 if window and self._match_name_to_acc(window, event.source):
@@ -126,6 +135,9 @@
             if win_name in self._window_uptime:
                 self._window_uptime[win_name].append( \
                     time.strftime("%Y %m %d %H %M %S"))
+      except:
+        if self._ldtp_debug:
+          print traceback.format_exc()
 
     def getapplist(self):
         """
@@ -179,9 +191,11 @@
 
     def handletablecell(self):
         self._handle_table_cell = True
+        return 1
 
     def unhandletablecell(self):
         self._handle_table_cell = False
+        return 1
 
     def delaycmdexec(self, delay = None):
         """
@@ -740,7 +754,8 @@
                 ObjectExistsWaiter(window_name, object_name, guiTimeOut, state)
             return int(waiter.run())
         except:
-            pass
+          if self._ldtp_debug:
+            print traceback.format_exc()
         return 0
 
     def grabfocus(self, window_name, object_name):
@@ -856,22 +871,6 @@
     def verifytoggled(self, window_name, object_name):
         """
         Verify toggle item toggled.
-        
-        @param window_name: Window name to look for, either full name,
-        LDTP's name convention, or a Unix glob.
-        @type window_name: string
-        @param object_name: Object name to look for, either full name,
-        LDTP's name convention, or a Unix glob. 
-        @type object_name: string
-
-        @return: 1 on success 0 on failure.
-        @rtype: integer
-        """
-        return self.verifycheck(window_name, object_name)
-
-    def verifytoggled(self, window_name, object_name):
-        """
-        Verify toggle item toggled.
         
         @param window_name: Window name to look for, either full name,
         LDTP's name convention, or a Unix glob.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/ldtpd/utils.py 
new/ldtp-2.3.1/ldtpd/utils.py
--- old/ldtp-2.3.0/ldtpd/utils.py       2012-01-14 17:16:47.000000000 +0100
+++ new/ldtp-2.3.1/ldtpd/utils.py       2012-02-26 00:53:01.000000000 +0100
@@ -186,6 +186,8 @@
         self._custom_logger = _custom_logger
         self._desktop = pyatspi.Registry.getDesktop(0)
         self._ldtp_debug = os.environ.get('LDTP_DEBUG', None)
+        # Initialize atspi2 version to False
+        self._atspi2_ver = False
         if Utils.cached_apps is None:
             pyatspi.Registry.registerEventListener(
                 self._on_window_event, 'window')
@@ -195,10 +197,12 @@
                 self._on_window_event, 'window:destroy')
             # Notify on any changes in all windows, based on this info,
             # its decided, whether force_remap is required or not
-            pyatspi.Registry.registerEventListener(self._obj_changed, 
-                                                   'object:children-changed')
-            pyatspi.Registry.registerEventListener(
-                self._obj_changed, 'object:property-change:accessible-name')
+            # Commenting the following lines of code
+            # as it sucks the execution time in at-spi2
+            #pyatspi.Registry.registerEventListener(self._obj_changed, 
+            #                                       'object:children-changed')
+            #pyatspi.Registry.registerEventListener(
+            #    self._obj_changed, 'object:property-change:accessible-name')
 
             Utils.cached_apps = list()
             if lazy_load:
@@ -235,7 +239,12 @@
         as the children have changed
         """
         if self._ldtp_debug:
-            print event, event.type, event.source, event.source.parent
+            try:
+                print event, event.type, event.source, event.source.parent
+            except:
+                # With at-spi2, sometimes noticed exception
+                # ignore exception, as we just use them for debugging
+                pass
         if not self.cached_apps:
             # If not initialized as list, don't process further
             return
@@ -258,57 +267,69 @@
 
     def _on_window_event(self, event):
         if self._ldtp_debug:
-            print event, event.type, event.source, event.source.parent
-        # Proceed only for window destry and deactivate event
-        if event and (event.type == "window:destroy" or \
-                          event.type == "window:deactivate") and \
-                          event.source:
-            abbrev_role, abbrev_name, label_by = self._ldtpize_accessible( \
-                event.source)
-            # LDTPized name
-            win_name = u'%s%s' % (abbrev_role, abbrev_name)
-            # Window title is empty
-            if abbrev_name == '':
-                for win_name in self._appmap.keys():
-                    # When window doesn't have a title, destroy all the
-                    # window info from appmap, which doesn't haven't title
-                    if re.search('%s\d*$' % abbrev_role, win_name, re.M | 
re.U):
-                        del self._appmap[win_name]
-            else:
-                for name in self._appmap.keys():
-                    # When multiple window have same title, destroy all the
-                    # window info from appmap, which have same title
-                    if re.search('%s%s\d*$' % (abbrev_role, abbrev_name),
-                                 win_name, re.M | re.U) or \
-                                 re.search('%s%s*$' % (abbrev_role, 
abbrev_name),
-                                           win_name, re.M | re.U):
-                        del self._appmap[name]
-            return
-        cache = True
-        if not self.cached_apps:
-            # If not initialized as list, don't process further
-            return
-        for app in self.cached_apps:
-            if event.host_application == app[0]:
-                # Application already in cached list
-                cache = False
-                # Force remap for this application, as some object is
-                # either added / removed / changed
-                index = self.cached_apps.index(app)
-                self.cached_apps[index][1] = True
-                break
-        if cache:
-            # If app doesn't exist in cached apps, then add it
-            # adding app and True flag as list - This flag indicates that the
-            # object in application either got added / removed
-            # so remap should be forced
-            self.cached_apps.append([event.host_application, True])
+            try:
+                print event, event.type, event.source, event.source.parent
+            except:
+                # With at-spi2, sometimes noticed exception
+                # ignore exception, as we just use them for debugging
+                pass
+        try:
+            # Proceed only for window destry and deactivate event
+            if event and (event.type == "window:destroy" or \
+                              event.type == "window:deactivate") and \
+                              event.source:
+                abbrev_role, abbrev_name, label_by = self._ldtpize_accessible( 
\
+                    event.source)
+                # LDTPized name
+                win_name = u'%s%s' % (abbrev_role, abbrev_name)
+                # Window title is empty
+                if abbrev_name == '':
+                    for win_name in self._appmap.keys():
+                        # When window doesn't have a title, destroy all the
+                        # window info from appmap, which doesn't haven't title
+                        if re.search('%s\d*$' % abbrev_role, win_name, re.M | 
re.U):
+                            del self._appmap[win_name]
+                else:
+                    for name in self._appmap.keys():
+                        # When multiple window have same title, destroy all the
+                        # window info from appmap, which have same title
+                        if re.search('%s%s\d*$' % (abbrev_role, abbrev_name),
+                                     win_name, re.M | re.U) or \
+                                     re.search('%s%s*$' % (abbrev_role, 
abbrev_name),
+                                               win_name, re.M | re.U):
+                                     del self._appmap[name]
+                return
+            cache = True
+            if not self.cached_apps:
+                # If not initialized as list, don't process further
+                return
+            for app in self.cached_apps:
+                if event.host_application == app[0]:
+                    # Application already in cached list
+                    cache = False
+                    # Force remap for this application, as some object is
+                    # either added / removed / changed
+                    index = self.cached_apps.index(app)
+                    self.cached_apps[index][1] = True
+                    if hasattr(app, 'setCacheMask'):
+                        app.setCacheMask(pyatspi.cache.ALL)
+                    break
+            if cache:
+                # If app doesn't exist in cached apps, then add it
+                # adding app and True flag as list - This flag indicates that 
the
+                # object in application either got added / removed
+                # so remap should be forced
+                self.cached_apps.append([event.host_application, True])
+        except:
+            if self._ldtp_debug:
+                print traceback.format_exc()
 
     def _atspi2_workaround(self):
         if not hasattr(pyatspi, 'Accessible'):
             # This exist only in pyatspi2
             # Don't do the work around
             return
+        self._atspi2_ver = True
         for app in self._desktop:
             # Work around for at-spi2
             if not app: continue
@@ -317,6 +338,8 @@
                 if app == tmpapp[0]:
                     flag = True
                     break
+            if hasattr(app, 'setCacheMask'):
+                app.setCacheMask(pyatspi.cache.ALL)
             # App already in list, don't add again
             if flag: continue
             self.cached_apps.append([app, True])
@@ -362,7 +385,7 @@
         try:
             # Get accessible relation set
             rel_set = acc.getRelationSet()
-        except LookupError:
+        except:
             rel_set = None
         if rel_set:
             for i, rel in enumerate(rel_set):
@@ -385,7 +408,11 @@
                         if self._ldtp_debug:
                             print traceback.format_exc()
                         continue
-        role = acc.getRole()
+        try:
+            role = acc.getRole()
+        except:
+            # with at-spi2 noticed gi._glib.GError exception
+            role = None
         if role == pyatspi.ROLE_FRAME or role == pyatspi.ROLE_DIALOG or \
                 role == pyatspi.ROLE_WINDOW or \
                 role == pyatspi.ROLE_FONT_CHOOSER or \
@@ -399,14 +426,17 @@
             # all other object types
             strip = '( |:|\.|_|\n)'
         if label_acc:
-            # Priority to associated label
-            label_by = label_acc.name
+            try:
+                # Priority to associated label
+                label_by = label_acc.name
+            except:
+                label_by = ''
         # Return the role type (if, not in the know list of roles,
         # return ukn - unknown), strip the above characters from name
         # also return labely_by string
         try:
             label = re.sub(strip, '', (label_acc or acc).name)
-        except LookupError:
+        except:
             label = ''
         return abbreviated_roles.get(role, 'ukn'), \
             label, \
@@ -437,22 +467,26 @@
         """
         if not acc or not name:
             return 0
-        if classType:
-            # Accessibility role type returns space, when multiple
-            # words exist in object type. ex: 'push button'
-            # User might mistype with multiple space, to avoid
-            # any confusion, using _. So, user will be inputing
-            # push_button
-            roleName = acc.getRoleName().replace(' ', '_')
-        else:
-            roleName = None
-        if roleName != classType:
-            # If type doesn't match, don't proceed further
+        try:
+            if classType:
+                # Accessibility role type returns space, when multiple
+                # words exist in object type. ex: 'push button'
+                # User might mistype with multiple space, to avoid
+                # any confusion, using _. So, user will be inputing
+                # push_button
+                roleName = acc.getRoleName().replace(' ', '_')
+            else:
+                roleName = None
+            if roleName != classType:
+                # If type doesn't match, don't proceed further
+                return 0
+            if acc.name and re.match(fnmatch.translate(name), acc.name, re.M | 
re.U):
+                # Since, type already matched and now the given name
+                # and accessibile name matched, mission accomplished
+                return 1
+        except:
+            # In at-spi2 gi._glib.GError exception is thrown
             return 0
-        if acc.name and re.match(fnmatch.translate(name), acc.name, re.M | 
re.U):
-            # Since, type already matched and now the given name
-            # and accessibile name matched, mission accomplished
-            return 1
         # Get LDTP format accessibile name
         _ldtpize_accessible_name = self._ldtpize_accessible(acc)
         # Concat object type and object name
@@ -464,21 +498,18 @@
         except UnicodeDecodeError:
            _object_name = u'%s%s' % (_ldtpize_accessible_name[0],
                                      
_ldtpize_accessible_name[1].decode('utf-8'))
-        try:
-            if re.match(name, _object_name, re.M | re.U):
-                # If given name equal LDTPized name format
-                return 1
-        except:
-            # Noticed invalid regular expression, if XChat was running
-            if self._ldtp_debug:
-                print traceback.format_exc()
-        if self._glob_match(fnmatch.translate(name), acc.name):
+        if self._glob_match(name, acc.name):
             # If given name match object name with regexp
             return 1
         if self._glob_match(name, _object_name):
             # If given name match LDTPized name format with regexp
             return 1
-        role = acc.getRole()
+        try:
+            role = acc.getRole()
+        except:
+            # In at-spi2 acc doesn't exist
+            # which raises exception gi._glib.GError
+            return 0
         if role == pyatspi.ROLE_FRAME or role == pyatspi.ROLE_DIALOG or \
                 role == pyatspi.ROLE_WINDOW or \
                 role == pyatspi.ROLE_FONT_CHOOSER or \
@@ -624,14 +655,24 @@
                     break
         except NotImplementedError:
             pass
-        
+        role = obj.getRole()
+        if role == pyatspi.ROLE_FRAME or role == pyatspi.ROLE_DIALOG or \
+                role == pyatspi.ROLE_WINDOW or \
+                role == pyatspi.ROLE_FONT_CHOOSER or \
+                role == pyatspi.ROLE_FILE_CHOOSER or \
+                role == pyatspi.ROLE_ALERT or \
+                role == pyatspi.ROLE_COLOR_CHOOSER:
+            obj_index = '%s#%d' % (obj.getApplication().name,
+                                   obj.getIndexInParent())
+        else:
+            obj_index = '%s#%d' % (abbrev_role,
+                                   self.ldtpized_obj_index[abbrev_role])
         self.ldtpized_list[ldtpized_name] = {'key' : ldtpized_name,
                                              'parent' : parent,
                                              'class' : 
obj.getRoleName().replace(' ', '_'),
                                              'child_index' : child_index,
                                              'children' : '',
-                                             'obj_index' : '%s#%d' % 
(abbrev_role,
-                                                                      
self.ldtpized_obj_index[abbrev_role]),
+                                             'obj_index' : obj_index,
                                              'label' : obj.name,
                                              'label_by' : label_by,
                                              'description' : obj.description,
@@ -803,12 +844,27 @@
                 return gui, name
 
             # Search with LDTP appmap format
+            if window_name.find('#') != -1:
+                obj_index = '%s#%d' % (gui.getApplication().name,
+                                       gui.getIndexInParent())
+                if self._ldtp_debug:
+                    print 'Window name has #', window_name, obj_index
+                if window_name == obj_index:
+                    if self._ldtp_debug:
+                        print 'Window found', gui, name
+                    return gui, name
             if window_name == name:
+                if self._ldtp_debug:
+                    print 'Window found', gui, name
                 return gui, name
             if self._glob_match(window_name, name):
+                if self._ldtp_debug:
+                    print 'Window found', gui, name
                 return gui, name
             if self._glob_match(re.sub(' ', '', window_name),
                                 re.sub(' ', '', name)):
+                if self._ldtp_debug:
+                    print 'Window found', gui, name
                 return gui, name
         return None, None
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/ldtpd/waiters.py 
new/ldtp-2.3.1/ldtpd/waiters.py
--- old/ldtp-2.3.0/ldtpd/waiters.py     2012-01-14 00:35:50.000000000 +0100
+++ new/ldtp-2.3.1/ldtpd/waiters.py     2012-02-26 00:40:44.000000000 +0100
@@ -50,6 +50,7 @@
     events = []
     def __init__(self, timeout):
         Utils.__init__(self)
+        self.timer = None
         self.timeout = timeout
         self.timeout_seconds = 1
 
@@ -58,43 +59,60 @@
         self._timeout_count = 1
 
         try:
-            self.poll()
+          self.poll()
         except:
-            pass
+          pass
 
         if self.success or self.timeout == 0:
-            return self.success
+          # Return the current state on success
+          # or timeout is 0
+          return self.success
 
-        gobject.timeout_add_seconds(self.timeout_seconds, self._timeout_cb)
-        if self.events:
+        try:
+          gobject.timeout_add_seconds(self.timeout_seconds,
+                                      self._timeout_cb)
+          if self.events:
             pyatspi.Registry.registerEventListener(
-                self._event_cb, *self.events)
-        if _main_loop:
+              self._event_cb, *self.events)
+          if _main_loop:
             _main_loop.run()
-        else:
+          else:
             gtk.main()
-        if self.events:
+          if self.events:
             pyatspi.Registry.deregisterEventListener(
-                self._event_cb, *self.events)
+              self._event_cb, *self.events)
+        except:
+          if self._ldtp_debug:
+            print traceback.format_exc()
         return self.success
 
+    def _timeout_thread_cb(self, params):
+      # Thread callback takes params argument
+      # but gobject.timeout_add_seconds doesn't
+      self._timeout_cb()
+
     def _timeout_cb(self):
         if self.success: # dispose of previous waiters.
             return False
         self._timeout_count += 1
-        self.poll()
+        try:
+          self.poll()
+        except:
+          if self._ldtp_debug:
+            print traceback.format_exc()
         if self._timeout_count * self.timeout_seconds > self.timeout or \
                self.success:
             try:
-                if _main_loop:
-                    _main_loop.quit()
-                else:
-                    if gtk.main_level():
-                        gtk.main_quit()
+              # Required for wnck functions
+              if _main_loop:
+                _main_loop.quit()
+              else:
+                if gtk.main_level():
+                  gtk.main_quit()
             except RuntimeError:
-                # In Mandriva RuntimeError exception is thrown
-                # If, gtk.main was already quit
-                pass
+              # In Mandriva RuntimeError exception is thrown
+              # If, gtk.main was already quit
+              pass
             return False
         return True
     
@@ -102,18 +120,23 @@
         pass
 
     def _event_cb(self, event):
+      try:
         self.event_cb(event)
-        if self.success:
-            try:
-                if _main_loop:
-                    _main_loop.quit()
-                else:
-                    if gtk.main_level():
-                        gtk.main_quit()
-            except RuntimeError:
-                # In Mandriva RuntimeError exception is thrown
-                # If, gtk.main was already quit
-                pass
+      except:
+        if self._ldtp_debug:
+          print traceback.format_exc()
+      if self.success:
+        try:
+          # Required for wnck functions
+          if _main_loop:
+            _main_loop.quit()
+          else:
+            if gtk.main_level():
+              gtk.main_quit()
+        except RuntimeError:
+          # In Mandriva RuntimeError exception is thrown
+          # If, gtk.main was already quit
+          pass
 
     def event_cb(self, event):
         pass
@@ -129,7 +152,7 @@
 
 class MaximizeWindow(Waiter):
     def __init__(self, frame_name):
-      Waiter.__init__(self, timeout = 0)
+      Waiter.__init__(self, 0)
       self._frame_name = frame_name
 
     def poll(self):
@@ -162,7 +185,7 @@
 
 class MinimizeWindow(Waiter):
     def __init__(self, frame_name):
-        Waiter.__init__(self, timeout = 0)
+        Waiter.__init__(self, 0)
         self._frame_name = frame_name
 
     def poll(self):
@@ -195,7 +218,7 @@
 
 class UnmaximizeWindow(Waiter):
     def __init__(self, frame_name):
-        Waiter.__init__(self, timeout = 0)
+        Waiter.__init__(self, 0)
         self._frame_name = frame_name
 
     def poll(self):
@@ -228,7 +251,7 @@
 
 class UnminimizeWindow(Waiter):
     def __init__(self, frame_name):
-        Waiter.__init__(self, timeout = 0)
+        Waiter.__init__(self, 0)
         self._frame_name = frame_name
 
     def poll(self):
@@ -261,7 +284,7 @@
 
 class ActivateWindow(Waiter):
     def __init__(self, frame_name):
-        Waiter.__init__(self, timeout = 0)
+        Waiter.__init__(self, 0)
         self._frame_name = frame_name
 
     def poll(self):
@@ -292,7 +315,7 @@
 
 class CloseWindow(Waiter):
     def __init__(self, frame_name):
-        Waiter.__init__(self, timeout = 0)
+        Waiter.__init__(self, 0)
         self._frame_name = frame_name
 
     def poll(self):
@@ -337,9 +360,13 @@
         self.success = bool(gui)
 
     def event_cb(self, event):
+      try:
         if self._match_name_to_acc(self._frame_name, event.source):
             self.top_level = event.source
             self.success = True
+      except:
+        if self._ldtp_debug:
+          print traceback.format_exc()
 
 class GuiNotExistsWaiter(Waiter):
     events = ["window:destroy"]
@@ -353,39 +380,44 @@
         self.success = not bool(gui)
 
     def event_cb(self, event):
+      try:
         if self._match_name_to_acc(self._frame_name, event.source):
             self.success = True
+      except:
+        if self._ldtp_debug:
+          print traceback.format_exc()
 
 class ObjectExistsWaiter(GuiExistsWaiter):
     def __init__(self, frame_name, obj_name, timeout, state = ''):
-        GuiExistsWaiter.__init__(self, frame_name, timeout)
-        self.timeout_seconds = 2
-        self._obj_name = obj_name
-        self._state = state
+      GuiExistsWaiter.__init__(self, frame_name, timeout)
+      self.timeout_seconds = 2
+      self._obj_name = obj_name
+      self._state = state
 
     def poll(self):
         try:
-            if re.search(';', self._obj_name):
-                obj = self._get_menu_hierarchy(self._frame_name, 
self._obj_name)
-            else:
-                obj = self._get_object(self._frame_name, self._obj_name)
-            if self._state:
-                _state_inst = obj.getState()
-                _obj_state = _state_inst.getStates()
-                state = 'STATE_%s' % self._state.upper()
-                if (state in self._states and \
-                    self._states[state] in _obj_state) or \
-                       (state in self._states_old and \
-                        self._states_old[state] in _obj_state):
-                    self.success = True
-            else:
-                self.success = True
+          if re.search(';', self._obj_name):
+            obj = self._get_menu_hierarchy(self._frame_name, self._obj_name)
+          else:
+            obj = self._get_object(self._frame_name, self._obj_name)
+          if self._state:
+            _state_inst = obj.getState()
+            _obj_state = _state_inst.getStates()
+            state = 'STATE_%s' % self._state.upper()
+            if (state in self._states and \
+                  self._states[state] in _obj_state) or \
+                  (state in self._states_old and \
+                     self._states_old[state] in _obj_state):
+              self.success = True
+          else:
+            self.success = True
         except:
-            pass
+            if self._ldtp_debug:
+              print traceback.format_exc()
 
     def event_cb(self, event):
-        GuiExistsWaiter.event_cb(self, event)
-        self.success = False
+      GuiExistsWaiter.event_cb(self, event)
+      self.success = False
 
 class ObjectNotExistsWaiter(GuiNotExistsWaiter):
     def __init__(self, frame_name, obj_name, timeout):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/ldtpd/xmlrpc_daemon.py 
new/ldtp-2.3.1/ldtpd/xmlrpc_daemon.py
--- old/ldtp-2.3.0/ldtpd/xmlrpc_daemon.py       2012-01-14 00:36:47.000000000 
+0100
+++ new/ldtp-2.3.1/ldtpd/xmlrpc_daemon.py       2012-02-26 01:00:13.000000000 
+0100
@@ -19,7 +19,10 @@
 Headers in this file shall remain intact.
 """
 
-import os, re, time
+import os
+import re
+import time
+import core
 from core import Ldtpd
 from twisted.web import xmlrpc
 import xmlrpclib
@@ -76,10 +79,13 @@
         try:
             args, functionPath = xmlrpclib.loads(request.content.read())
             if args and isinstance(args[-1], dict):
+                # Passing args and kwargs to _ldtp_callback
+                # fail, so using self, kind of work around !
                 kwargs = args[-1]
                 args = args[:-1]
                 if delay or self._delaycmdexec:
-                    pattern = 
'(wait|exist|has|get|verify|enabled|launch|image)'
+                    pattern = '(wait|exist|has|get|verify|enabled|'
+                    pattern += 'launch|image|system)'
                     p = re.compile(pattern)
                     if not p.search(functionPath):
                         # Sleep for 1 second, else the at-spi-registryd dies,
@@ -108,12 +114,16 @@
                 self._cbRender(f, request)
             else:
                 if _ldtp_debug:
-                    logger.debug('%s(%s)' % \
-                                     (functionPath,
-                                      ', '.join(map(repr, args) + \
-                                                    ['%s=%s' % (k, repr(v)) \
-                                                         for k, v in 
kwargs.items()])))
-                xmlrpc.defer.maybeDeferred(function, *args, **kwargs).\
-                    addErrback(self._ebRender).\
-                    addCallback(self._cbRender, request)
+                    debug_st = u'%s(%s)' % \
+                        (functionPath,
+                         ', '.join(map(repr, args) + \
+                                       ['%s=%s' % (k, repr(v)) \
+                                            for k, v in kwargs.items()]))
+                    print debug_st
+                    logger.debug(debug_st)
+                xmlrpc.defer.maybeDeferred(function, *args,
+                                           **kwargs).\
+                                           addErrback(self._ebRender).\
+                                           addCallback(self._cbRender,
+                                                       request)
         return xmlrpc.server.NOT_DONE_YET
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/scripts/ldtp new/ldtp-2.3.1/scripts/ldtp
--- old/ldtp-2.3.0/scripts/ldtp 2012-01-14 17:31:14.000000000 +0100
+++ new/ldtp-2.3.1/scripts/ldtp 2012-02-26 03:48:59.000000000 +0100
@@ -36,7 +36,7 @@
    (options, args) = parser.parse_args()
    if options.version:
       # Print version info and exit
-      print 'ldtp-2.3.0'
+      print 'ldtp-2.3.1'
       sys.exit(0)
    if options.verbose:
       # Set verbose flag
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ldtp-2.3.0/setup.py new/ldtp-2.3.1/setup.py
--- old/ldtp-2.3.0/setup.py     2012-01-14 17:30:56.000000000 +0100
+++ new/ldtp-2.3.1/setup.py     2012-02-26 03:48:20.000000000 +0100
@@ -23,7 +23,7 @@
 from distutils.core import setup
 
 setup(name="ldtp",
-      version="2.3.0",
+      version="2.3.1",
       description="Linux Desktop Testing Project Version 2",
       maintainer="Nagappan Alagappan",
       maintainer_email="[email protected]",

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to