Skip to content

Commit

Permalink
Change imports to support both PIL and PILwoTk.
Browse files Browse the repository at this point in the history
Add a missing import and remove some unused ones.
  • Loading branch information
menesis committed Apr 19, 2011
1 parent f82531d commit d6a3b89
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/z3c/rml/attr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import zope.interface
import zope.schema
from lxml import etree
from xml.sax import saxutils

from z3c.rml import interfaces

Expand Down
1 change: 1 addition & 0 deletions src/z3c/rml/platypus.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
__docformat__ = "reStructuredText"
import reportlab.platypus.flowables
import reportlab.rl_config
from reportlab.rl_config import overlapAttachedSpace
import zope.interface

from z3c.rml import interfaces
Expand Down
9 changes: 6 additions & 3 deletions src/z3c/rml/tests/test_rml.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
$Id$
"""
import os
import PIL
import subprocess
import unittest
import sys
import z3c.rml.tests
from z3c.rml import rml2pdf, attr

try:
import Image
except ImportError:
from PIL import Image

def gs_command(path):
return ('gs', '-q', '-sNOPAUSE', '-sDEVICE=png256',
Expand Down Expand Up @@ -72,8 +75,8 @@ def __init__(self, basePath, testPath):
unittest.TestCase.__init__(self)

def assertSameImage(self, baseImage, testImage):
base = PIL.Image.open(baseImage).getdata()
test = PIL.Image.open(testImage).getdata()
base = Image.open(baseImage).getdata()
test = Image.open(testImage).getdata()
for i in range(len(base)):
if (base[i] - test[i]) != 0:
self.fail('Image is not the same.')
Expand Down
4 changes: 0 additions & 4 deletions src/z3c/rml/tests/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@
$Id: test_rml.py 74170 2007-04-16 08:42:13Z srichter $
"""
import os
import PIL
import popen2
import unittest
import sys
import z3c.rml.tests
from z3c.rml import rml2pdfscript
from z3c.rml import attr
from z3c.rml.tests.test_rml import ComparePDFTestCase
from z3c.rml.tests.test_rml import RMLRenderingTestCase

Expand Down

0 comments on commit d6a3b89

Please sign in to comment.