ponty / pyscreenshot

Python screenshot library, replacement for the Pillow ImageGrab module on Linux.
BSD 2-Clause "Simplified" License
499 stars 89 forks source link

updated wx plugin to be up-to-date with the latest wx and Pillow #51

Closed yueranyuan closed 6 years ago

yueranyuan commented 6 years ago

updates function names to get rid of 2 deprecation warnings: pyscreenshot/plugins/wxscreen.py:24: wxPyDeprecationWarning: Call to deprecated item EmptyBitmap. Use :class:'wx.Bitmap' instead pyscreenshot/plugins/wxscreen.py:28: wxPyDeprecationWarning: Call to deprecated item ImageFromBitmap. Use bitmap.ConvertToImage instead. myWxImage = wx.ImageFromBitmap(bmp)

wrap input to 1 function to fulfill the latest function argument of frombytes in Pillow==5.2.0 to prevent error: TypeError: argument 1 must be string or read-only buffer, not bytearray

coveralls commented 6 years ago

Coverage Status

Coverage decreased (-0.1%) to 39.44% when pulling 398ee0a0572704d8d00a8410f26ee8701b918268 on yueranyuan:update_wx_plugin into 2730487ebc44282ec78b83532f424368b4ce2fb8 on ponty:master.

ponty commented 6 years ago

Travis CI fails: "TypeError: String or Unicode type required" Ubuntu 18.04 also fails.
Bitmap call is not compatible with wxPython Classic. Please check it!

yueranyuan commented 6 years ago

I think the constructor was changed in wxPython >= 4.0 to allow for wxBitmap(width, height). Defaulting to prior behaviour for wxPython < 4.0

ponty commented 6 years ago

Thanks!