/[packages]/cauldron/phatch/current/SOURCES/phatch-deprecated-fromstring-and-tostring-call.patch
ViewVC logotype

Contents of /cauldron/phatch/current/SOURCES/phatch-deprecated-fromstring-and-tostring-call.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1037737 - (show annotations) (download)
Mon Jun 27 11:58:24 2016 UTC (7 years, 9 months ago) by daviddavid
File size: 1326 byte(s)
- add patch to fix two deprecated python calls on fromstring() and tostring()
- revert back python-notify as a Requires
- all docs files should only be in doc subpackage
- doc subpackage should be noarch

1 diff -Nru a/phatch/lib/pyWx/wxPil.py b/phatch/lib/pyWx/wxPil.py
2 --- a/phatch/lib/pyWx/wxPil.py 2016-06-27 13:34:17.013047734 +0200
3 +++ b/phatch/lib/pyWx/wxPil.py 2016-06-27 13:27:50.000000000 +0200
4 @@ -24,14 +24,14 @@
5 image = image.convert('RGBA')
6 if image.mode == 'RGBA':
7 wx_image = wx.EmptyImage(*image.size)
8 - wx_image.SetData(image.convert("RGB").tostring())
9 + wx_image.SetData(image.convert("RGB").tobytes())
10 wx_image.InitAlpha()
11 wx_image.SetAlphaData(
12 - image.convert("RGBA").split()[-1].tostring())
13 + image.convert("RGBA").split()[-1].tobytes())
14 else:
15 wx_image = wx.EmptyImage(*image.size)
16 new_image = image.convert('RGB')
17 - data = new_image.tostring()
18 + data = new_image.tobytes()
19 wx_image.SetData(data)
20 return wx_image
21
22 @@ -43,11 +43,11 @@
23 def wxImage_pil(wx_image):
24 size = wx_image.GetSize()
25 image = Image.new('RGB', size)
26 - image.fromstring(wx_image.GetData())
27 + image.frombytes(wx_image.GetData())
28 if wx_image.HasAlpha():
29 alpha = Image.new('L', size)
30 wx_alpha = wx_image.GetAlphaData()
31 - alpha.fromstring(wx_alpha)
32 + alpha.frombytes(wx_alpha)
33 image = image.convert('RGBA')
34 image.putalpha(alpha)
35 return image

  ViewVC Help
Powered by ViewVC 1.1.30