mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-08 04:50:07 +01:00
Phoenix:
- Add the 2 snippets of code related to `FileType`. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
|
||||
# provide the message parameters for the MIME type manager
|
||||
class MailMessageParameters(wx.FileType.MessageParameters):
|
||||
|
||||
def __init__(self, filename, mimetype):
|
||||
|
||||
wx.FileType.MessageParameters.__init__(self, filename, mimetype)
|
||||
|
||||
|
||||
def GetParamValue(self, name):
|
||||
|
||||
# parameter names are not case-sensitive
|
||||
if name.lower() == "charset":
|
||||
return "US-ASCII"
|
||||
else:
|
||||
return wx.FileType.MessageParameters.GetParamValue(name)
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
|
||||
if filetype.GetOpenCommand(MailMessageParameters("foo.txt", "text/plain")):
|
||||
|
||||
# the full command for opening the text documents is in 'command'
|
||||
# (it might be "notepad foo.txt" under Windows or "cat foo.txt" under Unix)
|
||||
HandleCommand()
|
||||
|
||||
else:
|
||||
|
||||
# we don't know how to handle such files...
|
||||
pass
|
||||
Reference in New Issue
Block a user