Loading

Paste #pkba8rj3l

  1. diff --git a/pixa/__init__.py b/pixa/__init__.py
  2. --- a/pixa/__init__.py
  3. +++ b/pixa/__init__.py
  4. @@ -1,1 +1,1 @@
  5. -from pixa import *
  6. +from .pixa import *
  7. diff --git a/pixa/pixa.py b/pixa/pixa.py
  8. --- a/pixa/pixa.py
  9. +++ b/pixa/pixa.py
  10. @@ -1,13 +1,10 @@
  11. -import Image
  12. -import ImageDraw
  13. -import ImagePalette
  14. -import codecs #used for writing files - more unicode friendly than standard open() module
  15. +from PIL import Image, ImageDraw
  16.  from copy import deepcopy
  17.  import os.path
  18.  currentdir = os.curdir
  19.  
  20.  
  21. -class _Point(object):
  22. +class _Point:
  23.      """ simple class to hold the definition of a pixel that should be drawn """
  24.      def __init__(self, dx, dy, colour):
  25.          self.dx = dx
  26. @@ -27,7 +24,7 @@ class _Point(object):
  27.              return self._colour
  28.  
  29.  
  30. -class _PixaSpotColour(object):
  31. +class _PixaSpotColour:
  32.      def __init__(self, shift, parent):
  33.          self.shift = shift
  34.          self.parent = parent
  35. @@ -37,7 +34,7 @@ class _PixaSpotColour(object):
  36.          return result + self.shift
  37.  
  38.  
  39. -class PixaColour(object):
  40. +class PixaColour:
  41.      """
  42.      small factory-like class
  43.      holds a variable for a colour index, for use in sequences
  44. @@ -51,7 +48,7 @@ class PixaColour(object):
  45.          return _PixaSpotColour(shift, self)
  46.  
  47.  
  48. -class PixaSequence(object):
  49. +class PixaSequence:
  50.      def __init__(self, points = None, transforms = None):
  51.          """
  52.          pass an optional sequence, in format [(dx, dy, colour)...]
  53. @@ -109,7 +106,7 @@ class PixaSequence(object):
  54.              yield (x + p.dx, y + p.dy, p.colour())
  55.  
  56.  
  57. -class PixaSequenceCollection(object):
  58. +class PixaSequenceCollection:
  59.      def __init__(self, sequences):
  60.          self.sequences = sequences
  61.  
  62. @@ -117,7 +114,7 @@ class PixaSequenceCollection(object):
  63.          return self.sequences.get(colour)
  64.  
  65.  
  66. -class PixaMixer(object):
  67. +class PixaMixer:
  68.      """
  69.      Empty base class for modifying a sequence.
  70.      """
  71. @@ -187,7 +184,7 @@ def PixaShiftDY(dy):
  72.      """
  73.      return PixaShiftXY(0, dy)
  74.  
  75. -class Spritesheet(object):
  76. +class Spritesheet:
  77.      """
  78.      Class holding the sprite sheet.
  79.  
  80. @@ -224,7 +221,7 @@ class Spritesheet(object):
  81.          self.sprites.save(output_path, optimize=True)
  82.  
  83.  
  84. -class PixaImageLoader(object):
  85. +class PixaImageLoader:
  86.      """
  87.      Loads images from disk and does various useful things with them.
  88.      An instance of this class can store defaults for crops, masks, etcetera, useful for working with imported sprite sheets.

Comments