]> git.saurik.com Git - wxWidgets.git/blame - wxPython/tests/test_filesys.py
added missing button state
[wxWidgets.git] / wxPython / tests / test_filesys.py
CommitLineData
405be713
RD
1import wx
2from cStringIO import StringIO
3
4
5class MyFileSystemHandler(wx.FileSystemHandler):
6 def CanOpen(self, location):
7 print 'CanOpen: ', self.this
8 print ' location:', repr(location)
9 print ' protocol:', repr(self.GetProtocol(location))
10 print ' left: ', repr(self.GetLeftLocation(location))
11 print ' anchor: ', repr(self.GetAnchor(location))
12 print ' right: ', repr(self.GetRightLocation(location))
13 print ' mimetype:', repr(self.GetMimeTypeFromExt(location))
14 return False
15
16 def OpenFile(self, fs, location):
17 print 'OpenFile:', self, fs, location
18 fsfile = wx.FSFile(StringIO('the file data'),
19 location, 'text/plain', '', wx.DateTime.Now())
20 return fsfile
21
22wx.FileSystem.AddHandler(MyFileSystemHandler())
23
24app = wx.App(False)
25
26fs = wx.FileSystem()
27fsf = fs.OpenFile('myprot://myfilename.txt')
28