<s> '''<STR_LIT>''' <EOL> __all__ = ( '<STR_LIT>' , ) <EOL> from kivy . utils import platform <EOL> from kivy . support import install_gobject_iteration <EOL> from kivy . core . clipboard import ClipboardBase <EOL> if platform != '<STR_LIT>' : <EOL> raise SystemError ( '<STR_LIT>' ) <EOL> from gi . repository import Gtk , Gdk <EOL> clipboard = Gtk . Clipboard . get ( Gdk . SELECTION_CLIPBOARD ) <EOL> class ClipboardGtk3 ( ClipboardBase ) : <EOL> _is_init = False <EOL> def init ( self ) : <EOL> if self . _is_init : <EOL> return <EOL> install_gobject_iteration ( ) <EOL> self . _is_init = True <EOL> def get ( self , mimetype = '<STR_LIT>' ) : <EOL> self . init ( ) <EOL> if mimetype == '<STR_LIT>' : <EOL> contents = clipboard . wait_for_text ( ) <EOL> if contents : <EOL> return contents <EOL> return '<STR_LIT>' <EOL> def put ( self , data , mimetype = '<STR_LIT>' ) : <EOL> self . init ( ) <EOL> if mimetype == '<STR_LIT>' : <EOL> text = data . decode ( self . _encoding ) <EOL> clipboard . set_text ( text , - <NUM_LIT:1> ) <EOL> clipboard . store ( ) <EOL> def get_types ( self ) : <EOL> self . init ( ) <EOL> return [ '<STR_LIT>' ] </s>
