View | Details | Raw Unified | Return to bug 632144
Collapse All | Expand All

(-)a/strongwind/accessibles.py (-4 / +7 lines)
Lines 752-763 class Frame(Accessible): Link Here
752
    def assertClosed(self):
752
    def assertClosed(self):
753
        'Raise an exception if the window is still open'
753
        'Raise an exception if the window is still open'
754
754
755
        procedurelogger.expectedResult('The %s disappears.' % self)
755
        try:
756
            procedurelogger.expectedResult('The %s disappears.' % self)
757
        except errors.IPCError:
758
            procedurelogger.expectedResult('The frame disappears.')
756
759
757
        def closed():
760
        def closed():
758
            try:
761
            try:
759
                return not self.showing
762
                return not self.showing
760
            except (LookupError, KeyError, pyatspi.ORBit.CORBA.COMM_FAILURE):
763
            except (LookupError, KeyError, errors.IPCError):
761
                return True
764
                return True
762
765
763
        assert utils.retryUntilTrue(closed)
766
        assert utils.retryUntilTrue(closed)
Lines 810-816 class Dialog(Accessible): Link Here
810
        def closed():
813
        def closed():
811
            try:
814
            try:
812
                return not self.showing
815
                return not self.showing
813
            except (LookupError, KeyError, pyatspi.ORBit.CORBA.COMM_FAILURE):
816
            except (LookupError, KeyError, errors.IPCError):
814
                return True
817
                return True
815
818
816
        assert utils.retryUntilTrue(closed)
819
        assert utils.retryUntilTrue(closed)
Lines 865-871 class Alert(Accessible): Link Here
865
        def closed():
868
        def closed():
866
            try:
869
            try:
867
                return not self.showing
870
                return not self.showing
868
            except (LookupError, KeyError, pyatspi.ORBit.CORBA.COMM_FAILURE):
871
            except (LookupError, KeyError, errors.IPCError):
869
                return True
872
                return True
870
873
871
        assert utils.retryUntilTrue(closed)
874
        assert utils.retryUntilTrue(closed)
(-)a/strongwind/cache.py (-3 / +3 lines)
Lines 141-147 def getApplicationById(id): Link Here
141
        try:
141
        try:
142
            # poke the application first to make sure it's not stale
142
            # poke the application first to make sure it's not stale
143
            _applications[id]._accessible.id
143
            _applications[id]._accessible.id
144
        except (LookupError, pyatspi.ORBit.CORBA.COMM_FAILURE):
144
        except (LookupError, errors.IPCError):
145
            del _applications[id]
145
            del _applications[id]
146
146
147
    return _applications[id]
147
    return _applications[id]
Lines 159-165 def getApplicationsList(): Link Here
159
        try:
159
        try:
160
            # poke each application in the cache and remove stale applications
160
            # poke each application in the cache and remove stale applications
161
            v._accessible.id
161
            v._accessible.id
162
        except (LookupError, pyatspi.ORBit.CORBA.COMM_FAILURE):
162
        except (LookupError, errors.IPCError):
163
            del _applications[k]
163
            del _applications[k]
164
164
165
    return _applications.values()
165
    return _applications.values()
Lines 269-275 def launchApplication(args=[], name=None, find=None, cwd=None, env=None, wait=co Link Here
269
            try:
269
            try:
270
                if existingApp is None or existingApp.id < app.id:
270
                if existingApp is None or existingApp.id < app.id:
271
                    return app
271
                    return app
272
            except (LookupError, pyatspi.ORBit.CORBA.COMM_FAILURE):
272
            except (LookupError, errors.IPCError):
273
                return app
273
                return app
274
            sleep(config.RETRY_INTERVAL)
274
            sleep(config.RETRY_INTERVAL)
275
275
(-)a/strongwind/errors.py (+5 lines)
Lines 27-29 class NotSensitiveError(Exception): Link Here
27
    'Raised when an action cannot be performed because the widget is insensitive'
27
    'Raised when an action cannot be performed because the widget is insensitive'
28
    pass
28
    pass
29
29
30
try:
31
    IPCError = pyatspi.ORBit.CORBA.COMM_FAILURE
32
except:
33
    import dbus
34
    IPCError = dbus.exceptions.DBusException
(-)a/strongwind/procedurelogger.py (-2 / +3 lines)
Lines 67-72 import pyatspi Link Here
67
67
68
import config
68
import config
69
import cache
69
import cache
70
import errors
70
import utils
71
import utils
71
import watchdog
72
import watchdog
72
73
Lines 158-164 def action(action, child=None): Link Here
158
                                return False
159
                                return False
159
                        else:
160
                        else:
160
                            return False
161
                            return False
161
            except (LookupError, KeyError, pyatspi.ORBit.CORBA.COMM_FAILURE):
162
            except (LookupError, KeyError, errors.IPCError):
162
                pass
163
                pass
163
            return True
164
            return True
164
165
Lines 174-180 def action(action, child=None): Link Here
174
            try:
175
            try:
175
                if old.id != new.id:
176
                if old.id != new.id:
176
                    application = cache.getApplicationById(new.id)
177
                    application = cache.getApplicationById(new.id)
177
            except (LookupError, KeyError, pyatspi.ORBit.CORBA.COMM_FAILURE):
178
            except (LookupError, KeyError, errors.IPCError):
178
                application = cache.getApplicationById(new.id)
179
                application = cache.getApplicationById(new.id)
179
180
180
        #container
181
        #container

Return to bug 632144