-def MemoryFSHandler_AddFile(filename, a, b=''):
- if isinstance(a, wx.Image):
- __wxMemoryFSHandler_AddFile_wxImage(filename, a, b)
- elif isinstance(a, wx.Bitmap):
- __wxMemoryFSHandler_AddFile_wxBitmap(filename, a, b)
- elif type(a) == str:
- __wxMemoryFSHandler_AddFile_Data(filename, a)
- else: raise TypeError, 'wx.Image, wx.Bitmap or string expected'
+def MemoryFSHandler_AddFile(filename, dataItem, imgType=-1):
+ """
+ Add 'file' to the memory filesystem. The dataItem parameter can
+ either be a `wx.Bitmap`, `wx.Image` or a string that can contain
+ arbitrary data. If a bitmap or image is used then the imgType
+ parameter should specify what kind of image file it should be
+ written as, wx.BITMAP_TYPE_PNG, etc.
+ """
+ if isinstance(dataItem, wx.Image):
+ __wxMemoryFSHandler_AddFile_wxImage(filename, dataItem, imgType)
+ elif isinstance(dataItem, wx.Bitmap):
+ __wxMemoryFSHandler_AddFile_wxBitmap(filename, dataItem, imgType)
+ elif type(dataItem) == str:
+ __wxMemoryFSHandler_AddFile_Data(filename, dataItem)
+ else:
+ raise TypeError, 'wx.Image, wx.Bitmap or string expected'