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/hbp.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/>. 
     
    3232    """A parser for HBP documents.""" 
    3333    format = "Brother HBP" 
    34     def isValid(self) :         
     34    def isValid(self) : 
    3535        """Returns True if data is HBP, else False.""" 
    3636        if self.firstblock.find("@PJL ENTER LANGUAGE = HBP\n") != -1 : 
    3737            return True 
    38         else :     
     38        else : 
    3939            return False 
    40              
     40 
    4141    def getJobSize(self) : 
    4242        """Counts pages in a HBP document. 
    43          
     43 
    4444           Algorithm by Jerome Alet. 
    45             
     45 
    4646           The documentation used for this was : 
    47           
     47 
    4848           http://sf.net/projects/hbp-for-brother/ 
    49             
     49 
    5050           IMPORTANT : this may not work since @F should be sufficient, 
    5151           but the documentation really is unclear and I don't know 
     
    5555        minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED) 
    5656        pagecount = 0 
    57          
     57 
    5858        formfeed = "@G" + chr(0) + chr(0) + chr(1) + chr(0xff) + "@F" 
    5959        fflen = len(formfeed) 
     
    6666                        pagecount += 1 
    6767                        pos += fflen 
    68                     else :         
     68                    else : 
    6969                        pos += 1 
    7070            except IndexError : # EOF ? 
    7171                pass 
    72         finally :         
     72        finally : 
    7373            minfile.close() # reached EOF 
    7474        return pagecount