gui/clipboard.py
def get_data():
    "Read from the clipboard content, return a suitable object (string or bitmap)"
    data = None
    try:
        if wx.TheClipboard.Open():
            if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)):
                do = wx.TextDataObject()
                wx.TheClipboard.GetData(do)
                data = do.GetText()
            elif wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_BITMAP)):
                do = wx.BitmapDataObject()
                wx.TheClipboard.GetData(do)
                data = do.GetBitmap()
            wx.TheClipboard.Close()
    except:
        data = None
    return data
def get_data():
    "Read from the clipboard content, return a suitable object (string or bitmap)"
    data = None
    try:
        if wx.TheClipboard.Open():
            if wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_TEXT)):
                do = wx.TextDataObject()
                wx.TheClipboard.GetData(do)
                data = do.GetText()
            elif wx.TheClipboard.IsSupported(wx.DataFormat(wx.DF_BITMAP)):
                do = wx.BitmapDataObject()
                wx.TheClipboard.GetData(do)
                data = do.GetBitmap()
            wx.TheClipboard.Close()
    except:
        data = None
    return data
def get_data ( ) : data = None try : if wx . TheClipboard . Open ( ) : if wx . TheClipboard . IsSupported ( wx . DataFormat ( wx . DF_TEXT ) ) : do = wx . TextDataObject ( ) wx . TheClipboard . GetData ( do ) data = do . GetText ( ) elif wx . TheClipboard . IsSupported ( wx . DataFormat ( wx . DF_BITMAP ) ) : do = wx . BitmapDataObject ( ) wx . TheClipboard . GetData ( do ) data = do . GetBitmap ( ) wx . TheClipboard . Close ( ) except : data = None return data
Read from the clipboard content, return a suitable object (string or bitmap)
Read from the clipboard content return a suitable object ( string or bitmap )