home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- import wx
-
- def CopyToClipboard(s):
- if not s:
- return None
-
- if not isinstance(s, basestring):
- raise TypeError
-
- clip = wx.TheClipboard
- if clip.Open():
-
- try:
- clip.SetData(wx.TextDataObject(s))
- return True
- finally:
- clip.Close()
-
-
- return False
-
- copy = CopyToClipboard
- _clipboard_types = {
- wx.DF_BITMAP: (wx.BitmapDataObject, 'Bitmap'),
- wx.DF_TEXT: (wx.TextDataObject, 'Text') }
-
- def clipboard_get(df_type):
- df = wx.DataFormat(df_type)
- clip = wx.TheClipboard
- if clip.Open():
-
- try:
- if clip.IsSupported(df):
- (obj_type, obj_attr) = _clipboard_types[df_type]
- obj = obj_type()
- clip.GetData(obj)
- return getattr(obj, obj_attr)
- finally:
- clip.Close()
-
-
-
-
- def get_bitmap():
- return clipboard_get(wx.DF_BITMAP)
-
-
- def get_text():
- return clipboard_get(wx.DF_TEXT)
-
-