X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e9159fe8e8f1b3653c506805cbb79280aa2a0f38..faeb124b61f0bcf5c1b3bad809bca1ba27b42519:/wxPython/src/filesys.i diff --git a/wxPython/src/filesys.i b/wxPython/src/filesys.i index 0f3b1371bd..2367cb82ce 100644 --- a/wxPython/src/filesys.i +++ b/wxPython/src/filesys.i @@ -33,7 +33,6 @@ %import streams.i %pragma(python) code = "import wx" -%pragma(python) code = "import string" //--------------------------------------------------------------------------- @@ -141,8 +140,24 @@ public: static void AddHandler(wxFileSystemHandler *handler); static void CleanUpHandlers(); + + // Returns the file URL for a native path + static wxString FileNameToURL(const wxString& filename); + + // Returns the native path for a file URL + //static wxFileName URLToFileName(const wxString& url); *** See below }; + +// Returns the native path for a file URL +wxString wxFileSystem_URLToFileName(const wxString& url); +%{ + wxString wxFileSystem_URLToFileName(const wxString& url) { + wxFileName fname = wxFileSystem::URLToFileName(url); + return fname.GetFullPath(); + } +%} + //--------------------------------------------------------------------------- class wxInternetFSHandler : public wxFileSystemHandler { @@ -209,9 +224,9 @@ void __wxMemoryFSHandler_AddFile_Data(const wxString& filename, %pragma(python) code = " import types def wxMemoryFSHandler_AddFile(filename, a, b=''): - if isinstance(a, wxImage): + if wx.wxPy_isinstance(a, (wxImage, wxImagePtr)): __wxMemoryFSHandler_AddFile_wxImage(filename, a, b) - elif isinstance(a, wxBitmap): + elif wx.wxPy_isinstance(a, (wxBitmap, wxBitmapPtr)): __wxMemoryFSHandler_AddFile_wxBitmap(filename, a, b) elif type(a) == types.StringType: #__wxMemoryFSHandler_AddFile_wxString(filename, a)