[orca/orca-gnome3: 59/87] Temporary fix for the problem with script loading of version 2 and 3 of Yelp.
- From: Alejandro Leiva <aleiva src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca/orca-gnome3: 59/87] Temporary fix for the problem with script loading of version 2 and 3 of Yelp.
- Date: Fri, 1 Apr 2011 11:17:45 +0000 (UTC)
commit 5c874e5889999daa9b51b87cb09c14414cb86892
Author: Alejandro Leiva <aleiva emergya es>
Date: Tue Mar 22 01:07:03 2011 +0100
Temporary fix for the problem with script loading of version 2 and 3 of Yelp.
src/orca/scripts/apps/yelp/__init__.py | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
---
diff --git a/src/orca/scripts/apps/yelp/__init__.py b/src/orca/scripts/apps/yelp/__init__.py
index aacda7d..6370bdc 100644
--- a/src/orca/scripts/apps/yelp/__init__.py
+++ b/src/orca/scripts/apps/yelp/__init__.py
@@ -25,19 +25,30 @@ __date__ = "$Date$"
__copyright__ = "Copyright (c) 2011 The Orca Team."
__license__ = "LGPL"
+import sys
+
import pyatspi
from orca.script_utilities import Utilities
+def unloadYelpScript(version):
+ if 'orca.scripts.apps.yelp.yelp_' + version in sys.modules:
+ del(sys.modules['orca.scripts.apps.yelp.yelp_' + version])
+
+
def getScript(app):
"""Returns the correct version of the Yelp script based on toolkit."""
docFrames = Utilities.descendantsWithRole(app, pyatspi.ROLE_DOCUMENT_FRAME)
- print docFrames
+ toolkit = ""
if docFrames:
attrs = dict([a.split(':', 1) for a in docFrames[0].getAttributes()])
toolkit = attrs.get('toolkit', '')
- if toolkit == 'WebKitGtk':
- from yelp_v3 import script
- return script.Script(app)
- from yelp_v2 import script
- return script.Script(app)
+ if toolkit == 'WebKitGtk':
+ unloadYelpScript('v2')
+ from yelp_v3 import script
+ print sys.modules
+ return script.Script(app)
+ else:
+ from yelp_v2 import script
+ print sys.modules
+ return script.Script(app)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]