<s> """<STR_LIT>""" <EOL> __version__ = '<STR_LIT>' <EOL> import platform <EOL> import os <EOL> import subprocess <EOL> from . clipboards import ( init_osx_clipboard , <EOL> init_gtk_clipboard , init_qt_clipboard , <EOL> init_xclip_clipboard , init_xsel_clipboard , <EOL> init_klipper_clipboard , init_no_clipboard ) <EOL> from . windows import init_windows_clipboard <EOL> HAS_DISPLAY = os . getenv ( "<STR_LIT>" , False ) <EOL> CHECK_CMD = "<STR_LIT>" if platform . system ( ) == "<STR_LIT>" else "<STR_LIT>" <EOL> def _executable_exists ( name ) : <EOL> return subprocess . call ( [ CHECK_CMD , name ] , <EOL> stdout = subprocess . PIPE , stderr = subprocess . PIPE ) == <NUM_LIT:0> <EOL> def determine_clipboard ( ) : <EOL> if '<STR_LIT>' in platform . system ( ) . lower ( ) : <EOL> pass <EOL> elif os . name == '<STR_LIT>' or platform . system ( ) == '<STR_LIT>' : <EOL> return init_windows_clipboard ( ) <EOL> if os . name == '<STR_LIT>' or platform . system ( ) == '<STR_LIT>' : <EOL> return init_osx_clipboard ( ) <EOL> if HAS_DISPLAY : <EOL> try : <EOL> import gtk <EOL> except ImportError : <EOL> pass <EOL> else : <EOL> return init_gtk_clipboard ( ) <EOL> try : <EOL> import PyQt4 <EOL> except ImportError : <EOL> pass <EOL> else : <EOL> return init_qt_clipboard ( ) <EOL> if _executable_exists ( "<STR_LIT>" ) : <EOL> return init_xclip_clipboard ( ) <EOL> if _executable_exists ( "<STR_LIT>" ) : <EOL> return init_xsel_clipboard ( ) <EOL> if _executable_exists ( "<STR_LIT>" ) and _executable_exists ( "<STR_LIT>" ) : <EOL> return init_klipper_clipboard ( ) <EOL> return init_no_clipboard ( ) <EOL> def set_clipboard ( clipboard ) : <EOL> global copy , paste <EOL> clipboard_types = { '<STR_LIT>' : init_osx_clipboard , <EOL> '<STR_LIT>' : init_gtk_clipboard , <EOL> '<STR_LIT>' : init_qt_clipboard , <EOL> '<STR_LIT>' : init_xclip_clipboard , <EOL> '<STR_LIT>' : init_xsel_clipboard , <EOL> '<STR_LIT>' : init_klipper_clipboard , <EOL> '<STR_LIT>' : init_windows_clipboard , <EOL> '<STR_LIT>' : init_no_clipboard } <EOL> copy , paste = clipboard_types [ clipboard ] ( ) <EOL> copy , paste = determine_clipboard ( ) <EOL> __all__ = [ "<STR_LIT>" , "<STR_LIT>" ] </s>
