Browse Source

Gave up Travis. Gave up on PIL

James Bowman 2 years ago
parent
commit
a10f072cf7
7 changed files with 10 additions and 29 deletions
  1. 0 6
      .travis.yml
  2. 1 1
      gameduino2/convert.py
  3. 1 1
      gameduino2/prep.py
  4. 1 1
      gameduino2/psdparser.py
  5. 1 1
      gameduino2/remote.py
  6. 0 15
      travistests
  7. 6 4
      unit.py

+ 0 - 6
.travis.yml

@@ -1,6 +0,0 @@
-language: python
-python:
-  - "2.6"
-  - "2.7"
-script: ./travistests
-sudo: required

+ 1 - 1
gameduino2/convert.py

@@ -1,7 +1,7 @@
 import array
 import random
 
-from PIL import Image
+import Image
 
 from gameduino2.registers import *
 from gameduino2.imbytes import imbytes

+ 1 - 1
gameduino2/prep.py

@@ -7,7 +7,7 @@ import textwrap
 import wave
 import audioop
 
-from PIL import Image, ImageFont, ImageDraw, ImageChops
+import Image, ImageFont, ImageDraw, ImageChops
 
 import gameduino2 as gd2
 import gameduino2.convert

+ 1 - 1
gameduino2/psdparser.py

@@ -18,7 +18,7 @@
 import logging
 import sys
 from struct import unpack, calcsize
-from PIL import Image
+import Image
 
 logger = logging.getLogger(__name__)
 

+ 1 - 1
gameduino2/remote.py

@@ -4,7 +4,7 @@ import zlib
 import struct
 import time
 
-from PIL import Image
+import Image
 import convert
 
 def pad4(s):

+ 0 - 15
travistests

@@ -1,15 +0,0 @@
-#!/bin/sh
-
-set -e
-set -x
-
-sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev \
-  libfreetype6-dev liblcms2-dev libwebp-dev libharfbuzz-dev libfribidi-dev \
-  tcl8.6-dev tk8.6-dev python-tk \
-  python-dev python-setuptools
-
-sudo pip install Pillow
-ls -ltr /usr/local/lib/python2.7/dist-packages/
-python setup.py build_ext
-sudo python setup.py install
-python unit.py

+ 6 - 4
unit.py

@@ -1,10 +1,12 @@
-import sys
-print(sys.version)
 import unittest
-from PIL import Image
+import Image
+import ImageChops
 
 import gameduino2 as gd2
 
+def imsame(a, b):
+    return ImageChops.difference(a, b).getbbox() is None
+
 class TestPreptools(unittest.TestCase):
     def test_tile_magicland(self):
         class Tiledemo(gd2.prep.AssetBin):
@@ -23,7 +25,7 @@ class TestPreptools(unittest.TestCase):
         p = td.preview
         self.assertEqual(p.mode, "RGB")
         self.assertEqual(p.size, (7360, 1200))
-        self.assert_(p.tostring() == Image.open("testdata/golden-tiledemo.png").tostring())
+        self.assert_(imsame(p, Image.open("testdata/golden-tiledemo.png")))
 
 if __name__ == '__main__':
     unittest.main()