def get_selection(self):
Gdk.threads_enter()<EOL>text = self.selection.wait_for_text()<EOL>Gdk.threads_leave()<EOL>if text is not None:<EOL><INDENT>return text<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>
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