Changeset 3409 for pkpgcounter/trunk/pkpgpdls/pclxl.py
- Timestamp:
- 09/14/08 17:22:43 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/pclxl.py
r564 r3409 1 # -*- coding: UTF-8 -*-1 # -*- coding: utf-8 -*- 2 2 # 3 3 # pkpgcounter : a generic Page Description Language parser … … 83 83 84 84 def isValid(self) : 85 """Returns True if data is PCLXL aka PCL6, else False."""85 """Returns True if data is HP PCLXL aka PCL6, or Brother's' XL2HB, else False.""" 86 86 if (((self.firstblock[:128].find("\033%-12345X") != -1) and \ 87 87 (self.firstblock.find(" HP-PCL XL;") != -1) and \ … … 89 89 (self.firstblock.find("LANGUAGE = PCLXL") != -1)))) \ 90 90 or ((self.firstblock.startswith(chr(0xcd)+chr(0xca)) and (self.firstblock.find(" HP-PCL XL;") != -1))) : 91 return True 92 elif (self.firstblock[:128].find("\033%-12345X") != -1) \ 93 and (self.firstblock.find("BROTHER XL2HB;") != -1) : 94 self.format = "XL2HB" 91 95 return True 92 96 else : … … 255 259 """Skip the 'HP-PCL XL' statement if needed.""" 256 260 minfile = self.minfile 257 if nextpos and (minfile[nextpos:nextpos+11] == " HP-PCL XL;") : 261 if nextpos \ 262 and ((minfile[nextpos:nextpos+11] == " HP-PCL XL;") \ 263 or (minfile[nextpos:nextpos+14] == " BROTHER XLHB;")) : 258 264 pos = nextpos 259 265 while minfile[pos] != '\n' : … … 378 384 if not line : 379 385 break 380 pos = line.find(" HP-PCL XL;") 386 pos = line.find(" HP-PCL XL;") 387 if pos == -1 : 388 pos = line.find(" BROTHER XL2HB;") 381 389 if pos != -1 : 382 390 found = True