orca r3558 - in trunk: . src/orca



Author: richb
Date: Mon Feb 11 16:58:18 2008
New Revision: 3558
URL: http://svn.gnome.org/viewvc/orca?rev=3558&view=rev

Log:
        * src/orca/Gecko.py:
          Fixed bug #515652 â Gecko.py script causing Traceback.


Modified:
   trunk/ChangeLog
   trunk/src/orca/Gecko.py

Modified: trunk/src/orca/Gecko.py
==============================================================================
--- trunk/src/orca/Gecko.py	(original)
+++ trunk/src/orca/Gecko.py	Mon Feb 11 16:58:18 2008
@@ -1795,8 +1795,11 @@
         """Returns the URI key for a given page as a URI stripped of 
         parameters?query#fragment as seen in urlparse."""
         uri = self._script.getDocumentFrameURI()
-        parsed_uri = urlparse.urlparse(uri)
-        return ''.join(parsed_uri[0:3])
+        if uri:
+            parsed_uri = urlparse.urlparse(uri)
+            return ''.join(parsed_uri[0:3])
+        else:
+            return None
             
     
 ########################################################################
@@ -5013,14 +5016,12 @@
     
     def getDocumentFrameURI(self):
         """Returns the URI of the document frame that is active."""
-        try:
-            documentFrame = self.getDocumentFrame()
-        except AttributeError:
-            return None
-        attrs = documentFrame.queryDocument().getAttributes()
-        for attr in attrs:
-            if attr.startswith('DocURL'):
-                return attr[7:]
+        documentFrame = self.getDocumentFrame()
+        if documentFrame:
+            attrs = documentFrame.queryDocument().getAttributes()
+            for attr in attrs:
+                if attr.startswith('DocURL'):
+                    return attr[7:]
         return None
 
     def getUnicodeText(self, obj):



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