-import pprint, string
+import pprint, string, os
from wxPython.wx import *
from mimetypes_wdr import *
+from Main import opj
#----------------------------------------------------------------------------
EVT_LISTBOX(self, ID_LISTBOX, self.OnListbox)
EVT_BUTTON(self, ID_LOOKUP_BTN, self.OnLookup)
- self.GetInputText().SetValue("html")
+ self.GetInputText().SetValue("wav")
self.OnLookup()
mimetypes = wxTheMimeTypesManager.EnumAllFileTypes()
self.GetExtensionsTxt().SetValue(str(ft.GetExtensions()))
self.GetDescriptionTxt().SetValue(str(ft.GetDescription()))
- ext = 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("SPAM" + ext, mime)
+ cmd = ft.GetOpenCommand(filename, mime)
self.GetOpenCmdTxt().SetValue(str(cmd))
- cmd = ft.GetPrintCommand("SPAM" + ext, mime)
+ cmd = ft.GetPrintCommand(filename, mime)
self.GetPrintCmdTxt().SetValue(str(cmd))
- all = ft.GetAllCommands("SPAM" + ext, mime)
+ all = ft.GetAllCommands(filename, mime)
if all is None:
self.GetAllCmdsTxt().SetValue("")
else:
import mimetypes_wdr
+import images
def MyBitmapsFunc( index ):
- return wxImage( "bitmaps/noicon.png", wxBITMAP_TYPE_PNG ).ConvertToBitmap()
+ return images.getNoIconBitmap()
mimetypes_wdr.MyBitmapsFunc = MyBitmapsFunc