- it includes the patch for classic submitted on 23.3.
- make it run under Phoenix patch from earlier today
- update the documentation strings to Phoenix format
- replaced wx.EmptyBitmap with wx.Bitmap to remove deprecation warning
The documentation strings need further work, I plan on reviewing them again after this has been applied and documentation has been rebuild.
Currently there are some tests in wx.lib.pfdviewer.vec2d, I assume they should move to the test folder?
Will work on the test stuff, but no promise that I'll figure it out.
- test_lib_pdfviewer_vec2d - is what was in the wx.lib.pdfviewer.vec2d
- test_lib.pdfviewer_pdfviewer, checks that the button panel and viewer can be created and that a sample pdf file can be loaded
For the last test it assumes that a "sample.pdf" file is present in a folder "unittests/data".
- it includes the patch for classic submitted on 23.3.
- make it run under Phoenix patch from earlier today
- update the documentation strings to Phoenix format
- replaced wx.EmptyBitmap with wx.Bitmap to remove deprecation warning
- test_lib_pdfviewer_vec2d - is what was in the wx.lib.pdfviewer.vec2d
- test_lib.pdfviewer_pdfviewer, checks that the button panel and viewer
can be created and that a sample pdf file can be loaded
For the last test it assumes that a "sample.pdf" file is present in a
folder "unittests/data".
Since pdfviewer requires one of the 3rd-party pypdf modules then we should probably not consider the unitests as failed if pydf is not installed. I added a decorator from the unitest module to skip the tests if there was an ImportError.
BTW, I'm getting the following error on Mac:
···
======================================================================
ERROR: test_lib_pdfviewer_loadFile (__main__.lib_pdfviewer_pdfviewer_Tests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "unittests/test_lib_pdfviewer_pdfviewer.py", line 48, in test_lib_pdfviewer_loadFile
self.viewer.LoadFile(samplePdf)
File "/Users/robind/projects/wx/2.9/Phoenix/wx/lib/pdfviewer/viewer.py", line 212, in LoadFile
self.CalculateDimensions(True) # to get initial visible page range
File "/Users/robind/projects/wx/2.9/Phoenix/wx/lib/pdfviewer/viewer.py", line 339, in CalculateDimensions
self.frompage = min(self.y0/self.Ypagepixels, self.numpages-1)
ZeroDivisionError: integer division or modulo by zero
Traceback (most recent call last):
File “unittests/test_lib_pdfviewer_pdfviewer.py”, line 48, in
test_lib_pdfviewer_loadFile
self.viewer.LoadFile(samplePdf)
File
“/Users/robind/projects/wx/2.9/Phoenix/wx/lib/pdfviewer/viewer.py”, line
212, in LoadFile
self.CalculateDimensions(True) # to get initial visible page range
File
“/Users/robind/projects/wx/2.9/Phoenix/wx/lib/pdfviewer/viewer.py”, line
339, in CalculateDimensions
self.frompage = min(self.y0/self.Ypagepixels, self.numpages-1)
ZeroDivisionError: integer division or modulo by zero
David came up with a fix for this.
I attach two patches to correct above, one for classic and one for Phoenix.