X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ee707cb73a4d69d45181e29d94095bbeb3340018..40e7f56c7160b996f8eb0fcb0ee72ca8f683732c:/wxPython/demo/wxMimeTypesManager.py diff --git a/wxPython/demo/wxMimeTypesManager.py b/wxPython/demo/wxMimeTypesManager.py index 9a9c8d8ece..0ad99a74c3 100644 --- a/wxPython/demo/wxMimeTypesManager.py +++ b/wxPython/demo/wxMimeTypesManager.py @@ -2,6 +2,7 @@ import pprint, string, os from wxPython.wx import * from mimetypes_wdr import * +from Main import opj #---------------------------------------------------------------------------- @@ -75,7 +76,13 @@ class MimeTypesTestPanel(wxPanel): self.GetExtensionsTxt().SetValue(str(ft.GetExtensions())) self.GetDescriptionTxt().SetValue(str(ft.GetDescription())) - filename = os.path.join("SPAM", ft.GetExtensions()[0]) + extList = ft.GetExtensions() + if extList: + ext = extList[0] + if ext[0] == ".": ext = ext[1:] + else: + ext = "" + filename = "SPAM" + "." + ext mime = ft.GetMimeType() or "" cmd = ft.GetOpenCommand(filename, mime) self.GetOpenCmdTxt().SetValue(str(cmd)) @@ -160,7 +167,7 @@ overview = """\ import mimetypes_wdr def MyBitmapsFunc( index ): - return wxImage( "bitmaps/noicon.png", wxBITMAP_TYPE_PNG ).ConvertToBitmap() + return wxImage( opj("bitmaps/noicon.png"), wxBITMAP_TYPE_PNG ).ConvertToBitmap() mimetypes_wdr.MyBitmapsFunc = MyBitmapsFunc