mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 04:20:07 +01:00
Merge branch 'fix_fshandler_subclasses' of https://github.com/swt2c/Phoenix into swt2c-fix_fshandler_subclasses
# Conflicts: # unittests/test_filesys.py
This commit is contained in:
@@ -54,30 +54,31 @@ def run():
|
||||
klass.addItem(etgtools.WigCode("""\
|
||||
virtual bool CanOpen(const wxString& location);
|
||||
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location);
|
||||
virtual wxString FindFirst(const wxString& spec, int flags = 0);
|
||||
virtual wxString FindNext();
|
||||
"""))
|
||||
|
||||
|
||||
c = module.find('wxArchiveFSHandler')
|
||||
_fixHandlerClass(c)
|
||||
c.addPrivateCopyCtor()
|
||||
module.addPyCode('ZipFSHandler = wx.deprecated(ArchiveFSHandler, "Use ArchiveFSHandler instead.")')
|
||||
_fixHandlerClass(c)
|
||||
|
||||
c = module.find('wxFSFile')
|
||||
c.addPrivateCopyCtor()
|
||||
_fixHandlerClass(c)
|
||||
|
||||
c = module.find('wxFilterFSHandler')
|
||||
c.addPrivateCopyCtor()
|
||||
_fixHandlerClass(c)
|
||||
c.addPrivateCopyCtor()
|
||||
|
||||
c = module.find('wxInternetFSHandler')
|
||||
c.addPrivateCopyCtor()
|
||||
_fixHandlerClass(c)
|
||||
c.addPrivateCopyCtor()
|
||||
|
||||
|
||||
c = module.find('wxMemoryFSHandler')
|
||||
c.addPrivateCopyCtor()
|
||||
_fixHandlerClass(c)
|
||||
c.addPrivateCopyCtor()
|
||||
|
||||
# Make some more python-friendly versions of the AddFile methods accepting raw data
|
||||
c.find('AddFile').findOverload('binarydata').ignore()
|
||||
|
||||
@@ -9,7 +9,7 @@ import os
|
||||
class filesys_Tests(wtc.WidgetTestCase):
|
||||
|
||||
def test_filesysClasses(self):
|
||||
# For now just test that the expected classes exist.
|
||||
# For now just test that the expected classes exist.
|
||||
wx.FileSystem
|
||||
wx.FSFile
|
||||
wx.FileSystemHandler
|
||||
@@ -21,16 +21,20 @@ class filesys_Tests(wtc.WidgetTestCase):
|
||||
|
||||
def test_filesys02(self):
|
||||
wx.FileSystem.AddHandler(wx.ArchiveFSHandler())
|
||||
|
||||
|
||||
def test_filesys03(self):
|
||||
wx.FileSystem.AddHandler(wx.InternetFSHandler())
|
||||
|
||||
def test_filesys04(self):
|
||||
wx.FileSystem.AddHandler(wx.MemoryFSHandler())
|
||||
|
||||
def test_filesysMemoryFSHandler(self):
|
||||
memoryFS = wx.MemoryFSHandler()
|
||||
memoryFS.AddFile('test.txt', 'This is a test')
|
||||
self.assertTrue(memoryFS.FindFirst('test.txt') == 'test.txt')
|
||||
|
||||
# TODO: Add more tests.
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user