'''
Clipboard SDL2: an implementation of the Clipboard using sdl2.
'''

__all__ = ('ClipboardSDL2', )

from kivy.utils import platform
from kivy.compat import PY2
from kivy.core.clipboard import ClipboardBase

if platform() not in ('win', 'linux', 'macosx', 'android', 'ios'):
    raise SystemError('unsupported platform for pygame clipboard')

try:
    from _clipboard_sdl2 import _get_text, _has_text, _set_text
except ImportError:
    raise SystemError('extension not copiled??')


class ClipboardSDL2(ClipboardBase):

    def paste(self):
        return _get_text() if _has_text() else ''

    def copy(self, data=''):
        if PY2:
            data = data.encode('utf-8')
        _set_text(data)

    def get_types(self):
        return 'text/plain'

@@ -132,36 +132,8 @@
 orm%0A
-from kivy.compat import PY2%0A
 from
@@ -324,16 +324,36 @@
    from 
+kivy.core.clipboard.
 _clipboa
@@ -612,28 +612,8 @@
 '):%0A
-        if PY2:%0A    
     

clipboard:sdl2 Convert to unicode for both py2/3