]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/demo/wxMimeTypesManager.py
more MSLU fixes and moved MSLU stuff into separate file
[wxWidgets.git] / wxPython / demo / wxMimeTypesManager.py
index 4a830181b61f853a2c515fb2325d1c94efca90f7..0ad99a74c35085cf0f9d11c825e5e2350d551ac4 100644 (file)
@@ -2,6 +2,7 @@
 import pprint, string, os
 from wxPython.wx import *
 from mimetypes_wdr import *
 import pprint, string, os
 from wxPython.wx import *
 from mimetypes_wdr import *
+from Main import opj
 
 #----------------------------------------------------------------------------
 
 
 #----------------------------------------------------------------------------
 
@@ -75,8 +76,12 @@ class MimeTypesTestPanel(wxPanel):
         self.GetExtensionsTxt().SetValue(str(ft.GetExtensions()))
         self.GetDescriptionTxt().SetValue(str(ft.GetDescription()))
 
         self.GetExtensionsTxt().SetValue(str(ft.GetExtensions()))
         self.GetDescriptionTxt().SetValue(str(ft.GetDescription()))
 
-        ext = ft.GetExtensions()[0]
-        if ext[0] == ".": ext = ext[1:]
+        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)
         filename = "SPAM" + "." + ext
         mime = ft.GetMimeType() or ""
         cmd = ft.GetOpenCommand(filename, mime)
@@ -162,7 +167,7 @@ overview = """\
 import mimetypes_wdr
 
 def MyBitmapsFunc( index ):
 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
 
 
 mimetypes_wdr.MyBitmapsFunc = MyBitmapsFunc