gui/clipboard.py
def set_data(data):
    "Write content to the clipboard, data can be either a string or a bitmap" 
    try:
        if wx.TheClipboard.Open():
            if isinstance(data, (str, unicode)):
                do = wx.TextDataObject()
                do.SetText(data)
                wx.TheClipboard.SetData(do)
            elif isinstance(data, wx.Bitmap):
                do = wx.BitmapDataObject()
                do.SetBitmap(data)
                wx.TheClipboard.SetData(do)
            wx.TheClipboard.Close()
    except:
        pass
def set_data(data):
    "Write content to the clipboard, data can be either a string or a bitmap" 
    try:
        if wx.TheClipboard.Open():
            if isinstance(data, (str, unicode)):
                do = wx.TextDataObject()
                do.SetText(data)
                wx.TheClipboard.SetData(do)
            elif isinstance(data, wx.Bitmap):
                do = wx.BitmapDataObject()
                do.SetBitmap(data)
                wx.TheClipboard.SetData(do)
            wx.TheClipboard.Close()
    except:
        pass
Write content to the clipboard, data can be either a string or a bitmap