mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
Merge pull request #2220 from jdufresne/image-draw-dep
Remove long deprecated ImageDraw methods
This commit is contained in:
commit
a4ef743b0f
|
@ -31,7 +31,6 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
import numbers
|
import numbers
|
||||||
import warnings
|
|
||||||
|
|
||||||
from . import Image, ImageColor
|
from . import Image, ImageColor
|
||||||
from ._util import isStringType
|
from ._util import isStringType
|
||||||
|
@ -87,20 +86,6 @@ class ImageDraw(object):
|
||||||
self.fill = 0
|
self.fill = 0
|
||||||
self.font = None
|
self.font = None
|
||||||
|
|
||||||
def setink(self, ink):
|
|
||||||
raise NotImplementedError("setink() has been removed. " +
|
|
||||||
"Please use keyword arguments instead.")
|
|
||||||
|
|
||||||
def setfill(self, onoff):
|
|
||||||
raise NotImplementedError("setfill() has been removed. " +
|
|
||||||
"Please use keyword arguments instead.")
|
|
||||||
|
|
||||||
def setfont(self, font):
|
|
||||||
warnings.warn("setfont() is deprecated. " +
|
|
||||||
"Please set the attribute directly instead.")
|
|
||||||
# compatibility
|
|
||||||
self.font = font
|
|
||||||
|
|
||||||
def getfont(self):
|
def getfont(self):
|
||||||
"""Get the current default font."""
|
"""Get the current default font."""
|
||||||
if not self.font:
|
if not self.font:
|
||||||
|
|
|
@ -44,14 +44,6 @@ class TestImageDraw(PillowTestCase):
|
||||||
draw.polygon(list(range(100)))
|
draw.polygon(list(range(100)))
|
||||||
draw.rectangle(list(range(4)))
|
draw.rectangle(list(range(4)))
|
||||||
|
|
||||||
def test_removed_methods(self):
|
|
||||||
im = hopper()
|
|
||||||
|
|
||||||
draw = ImageDraw.Draw(im)
|
|
||||||
|
|
||||||
self.assertRaises(Exception, lambda: draw.setink(0))
|
|
||||||
self.assertRaises(Exception, lambda: draw.setfill(0))
|
|
||||||
|
|
||||||
def test_valueerror(self):
|
def test_valueerror(self):
|
||||||
im = Image.open("Tests/images/chi.gif")
|
im = Image.open("Tests/images/chi.gif")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user