def get_clipboard(selection=False):
 global fake_clipboard
 if (selection and (not supports_selection())):
  raise SelectionUnsupportedError
 if (fake_clipboard is not None):
  data = fake_clipboard
  fake_clipboard = None
 else:
  mode = (QClipboard.Selection if selection else QClipboard.Clipboard)
  data = QApplication.clipboard().text(mode=mode)
 target = ('Primary selection' if selection else 'Clipboard')
 if (not data.strip()):
  raise ClipboardEmptyError('{} is empty.'.format(target))
 log.misc.debug('{} contained: {!r}'.format(target, data))
 return data

def get_clipboard ( selection = False ) : global fake_clipboard if ( selection and ( not supports_selection ( ) ) ) : raise SelectionUnsupportedError if ( fake_clipboard is not None ) : data = fake_clipboard fake_clipboard = None else : mode = ( QClipboard . Selection if selection else QClipboard . Clipboard ) data = QApplication . clipboard ( ) . text ( mode = mode ) target = ( 'Primary selection' if selection else 'Clipboard' ) if ( not data . strip ( ) ) : raise ClipboardEmptyError ( '{} is empty.' . format ( target ) ) log . misc . debug ( '{} contained: {!r}' . format ( target , data ) ) return data
get data from the clipboard .