~ubuntu-branches/ubuntu/saucy/python-imaging/saucy-proposed

« back to all changes in this revision

Viewing changes to PIL/DcxImagePlugin.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (27.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130131204920-b5zshy6vgfvdionl
Tags: 1.1.7+1.7.8-1ubuntu1
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
__version__ = "0.2"
25
25
 
26
 
import Image
 
26
from . import Image, _binary
27
27
 
28
 
from PcxImagePlugin import PcxImageFile
 
28
from .PcxImagePlugin import PcxImageFile
29
29
 
30
30
MAGIC = 0x3ADE68B1 # QUIZ: what's this value, then?
31
31
 
32
 
def i32(c):
33
 
    return ord(c[0]) + (ord(c[1])<<8) + (ord(c[2])<<16) + (ord(c[3])<<24)
 
32
i32 = _binary.i32le
34
33
 
35
34
def _accept(prefix):
36
35
    return i32(prefix) == MAGIC
48
47
        # Header
49
48
        s = self.fp.read(4)
50
49
        if i32(s) != MAGIC:
51
 
            raise SyntaxError, "not a DCX file"
 
50
            raise SyntaxError("not a DCX file")
52
51
 
53
52
        # Component directory
54
53
        self._offset = []