~ubuntu-branches/ubuntu/hardy/gnome-orca/hardy

« back to all changes in this revision

Viewing changes to src/orca/where_am_I.py

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2007-07-10 21:54:54 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20070710215454-trky3o11pcc78qg4
Tags: 2.19.5-0ubuntu1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
"""Speaks information about the current object of interest."""
21
21
 
22
 
__id__        = "$Id: where_am_I.py 2475 2007-06-15 14:25:41Z shaeger $"
23
 
__version__   = "$Revision: 2475 $"
24
 
__date__      = "$Date: 2007-06-15 10:25:41 -0400 (Fri, 15 Jun 2007) $"
 
22
__id__        = "$Id: where_am_I.py 2514 2007-07-03 13:15:24Z shaeger $"
 
23
__version__   = "$Revision: 2514 $"
 
24
__date__      = "$Date: 2007-07-03 09:15:24 -0400 (Tue, 03 Jul 2007) $"
25
25
__copyright__ = "Copyright (c) 2005-2007 Sun Microsystems Inc."
26
26
__license__   = "LGPL"
27
27
 
640
640
            return
641
641
      
642
642
        # Try to get the URI of the active document and parse it
643
 
        doc_uri = self.__getDocumentFrameURI(obj)
 
643
        doc_uri = self._script.getDocumentFrameURI()
644
644
        if doc_uri:
645
645
            doc_uri_info = urlparse.urlparse(doc_uri)
646
646
        else:
719
719
            # Translators: This is the size of a file in megabytes
720
720
            #
721
721
            return _('%.2f megabytes') % (float(size) * .000001) 
722
 
        
723
 
    def __getDocumentFrameURI(self, obj):
724
 
        '''
725
 
        Returns the URI of the document frame that is active
726
 
        '''
727
 
        try:
728
 
            documentFrame = self._script.getDocumentFrame()
729
 
        except AttributeError:
730
 
            return None
731
 
        attrs = documentFrame.document.getAttributes()
732
 
        for attr in attrs:
733
 
            if attr.startswith('DocURL'):
734
 
                return attr[7:]
735
 
        return None
736
722
 
737
723
    def _speakGenericObject(self, obj, doubleClick):
738
724
        """Speak a generic object; one not specifically handled by