code: def get_selection(self):
          
          Gdk.threads_enter()
          text = self.selection.wait_for_text()
          Gdk.threads_leave()
          if text is not None:
              return text
          else:
              raise Exception("No text found in X selection")
docs: Read text from the X selection
          
          Usage: C{clipboard.get_selection()}
  
          @return: text contents of the mouse selection
          @rtype: C{str}
          @raise Exception: if no text was found in the selection