Show
Ignore:
Timestamp:
10/06/08 00:22:07 (16 years ago)
Author:
jerome
Message:

Removed spaces at EOL.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/pkpgpdls/spl1.py

    r3410 r3436  
    88# the Free Software Foundation, either version 3 of the License, or 
    99# (at your option) any later version. 
    10 #  
     10# 
    1111# This program is distributed in the hope that it will be useful, 
    1212# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1313# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1414# GNU General Public License for more details. 
    15 #  
     15# 
    1616# You should have received a copy of the GNU General Public License 
    1717# along with this program.  If not, see <http://www.gnu.org/licenses/>. 
     
    3434    """A parser for SPL1 documents.""" 
    3535    format = "SPL1 (aka GDI)" 
    36     def isValid(self) :     
     36    def isValid(self) : 
    3737        """Returns True if data is SPL1, else False.""" 
    3838        if ((self.firstblock[:128].find("\033%-12345X") != -1) and \ 
     
    4141              (self.firstblock.find("LANGUAGE = SMART") != -1))) : 
    4242            return True 
    43         else :     
     43        else : 
    4444            return False 
    45              
     45 
    4646    def littleEndian(self) : 
    4747        """Toggles to little endianness.""" 
     
    5151        # self.logdebug("Little Endian") 
    5252        return 0 
    53          
     53 
    5454    def bigEndian(self) : 
    5555        """Toggles to big endianness.""" 
     
    5959        # self.logdebug("Big Endian") 
    6060        return 0 
    61      
    62     def escape(self, nextpos) :     
     61 
     62    def escape(self, nextpos) : 
    6363        """Handles the ESC code.""" 
    6464        self.isbitmap = False 
     
    6767        if minfile[pos : pos+8] == r"%-12345X" : 
    6868            endpos = pos + 9 
    69         elif minfile[pos-1] in ESCAPECHARS :     
     69        elif minfile[pos-1] in ESCAPECHARS : 
    7070            endpos = pos 
    71         else :     
     71        else : 
    7272            return 0 
    7373        endmark = (chr(0x1b), chr(0x00)) 
     
    7979                quotes += 1 
    8080            endpos += 1 
    81              
    82         # Store this in a per page mapping.     
     81 
     82        # Store this in a per page mapping. 
    8383        # NB : First time will be at page 0 (i.e. **before** page 1) ! 
    8484        stuff = self.escapedStuff.setdefault(self.pagecount, []) 
     
    9090        self.logdebug("Escaped datas : [%s]" % repr(datas)) 
    9191        return endpos - pos + 1 
    92          
     92 
    9393    def getJobSize(self) : 
    9494        """Counts pages in an SPL1 document. 
    95          
     95 
    9696           Algorithm by Jerome Alet. 
    9797        """ 
     
    110110                    if tag in ESCAPECHARS : 
    111111                        pos += self.escape(pos+1) 
    112                     else :     
     112                    else : 
    113113                        if not self.isbitmap : 
    114114                            raise pdlparser.PDLParserError, "Unfortunately SPL1 is incompletely recognized. Parsing aborted. Please report the problem to %s" % version.__authoremail__ 
     
    116116                         seqnum) = unpack(">IH", minfile[pos:pos+6]) 
    117117                        # self.logdebug("Offset : %i      Sequence Number : %i" % (offset, seqnum)) 
    118                         if not seqnum :  
     118                        if not seqnum : 
    119119                            # Sequence number resets to 0 for each new page. 
    120120                            self.pagecount += 1 
    121121                        pos += 4 + offset 
    122             except struct.error, msg :      
     122            except struct.error, msg : 
    123123                raise pdlparser.PDLParserError, "Unfortunately SPL1 is incompletely recognized (%s). Parsing aborted. Please report the problem to %s" % (msg, version.__authoremail__) 
    124             except IndexError : # EOF ?             
     124            except IndexError : # EOF ? 
    125125                pass 
    126126        finally :