projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added missing headers to fix compilation without PCH
[wxWidgets.git]
/
wxPython
/
demo
/
wxMimeTypesManager.py
diff --git
a/wxPython/demo/wxMimeTypesManager.py
b/wxPython/demo/wxMimeTypesManager.py
index 9400a5c2d570e4f8666874920e514ac56e239633..5768ba2592de3cb32bf1a437407aea955ce68760 100644
(file)
--- a/
wxPython/demo/wxMimeTypesManager.py
+++ b/
wxPython/demo/wxMimeTypesManager.py
@@
-1,7
+1,8
@@
-import pprint, string
+import pprint, string
, os
from wxPython.wx import *
from mimetypes_wdr import *
from wxPython.wx import *
from mimetypes_wdr import *
+from Main import opj
#----------------------------------------------------------------------------
#----------------------------------------------------------------------------
@@
-19,7
+20,7
@@
class MimeTypesTestPanel(wxPanel):
EVT_LISTBOX(self, ID_LISTBOX, self.OnListbox)
EVT_BUTTON(self, ID_LOOKUP_BTN, self.OnLookup)
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.OnLookup()
mimetypes = wxTheMimeTypesManager.EnumAllFileTypes()
@@
-75,15
+76,21
@@
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]
+ extList = ft.GetExtensions()
+ if extList:
+ ext = extList[0]
+ if ext[0] == ".": ext = ext[1:]
+ else:
+ ext = ""
+ filename = "SPAM" + "." + ext
mime = ft.GetMimeType() or ""
mime = ft.GetMimeType() or ""
- cmd = ft.GetOpenCommand(
"SPAM" + ext
, mime)
+ cmd = ft.GetOpenCommand(
filename
, mime)
self.GetOpenCmdTxt().SetValue(str(cmd))
self.GetOpenCmdTxt().SetValue(str(cmd))
- cmd = ft.GetPrintCommand(
"SPAM" + ext
, mime)
+ cmd = ft.GetPrintCommand(
filename
, mime)
self.GetPrintCmdTxt().SetValue(str(cmd))
self.GetPrintCmdTxt().SetValue(str(cmd))
- all = ft.GetAllCommands(
"SPAM" + ext
, mime)
+ all = ft.GetAllCommands(
filename
, mime)
if all is None:
self.GetAllCmdsTxt().SetValue("")
else:
if all is None:
self.GetAllCmdsTxt().SetValue("")
else:
@@
-158,9
+165,10
@@
overview = """\
import mimetypes_wdr
import mimetypes_wdr
+import images
def MyBitmapsFunc( index ):
def MyBitmapsFunc( index ):
- return
wxImage( "bitmaps/noicon.png", wxBITMAP_TYPE_PNG ).ConvertTo
Bitmap()
+ return
images.getNoIcon
Bitmap()
mimetypes_wdr.MyBitmapsFunc = MyBitmapsFunc
mimetypes_wdr.MyBitmapsFunc = MyBitmapsFunc