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/plain.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/>. 
     
    2929    totiffcommands = [ 'enscript --quiet --portrait --no-header --columns 1 --output - "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -', 
    3030                       'a2ps --borders 0 --quiet --portrait --no-header --columns 1 --output - "%(infname)s" | gs -sDEVICE=tiff24nc -dPARANOIDSAFER -dNOPAUSE -dBATCH -dQUIET -r"%(dpi)i" -sOutputFile="%(outfname)s" -', 
    31                      ]   
     31                     ] 
    3232    required = [ "a2ps | enscript", "gs" ] 
    33     openmode = "rU"                  
     33    openmode = "rU" 
    3434    format = "plain text" 
    35     def isValid(self) :     
     35    def isValid(self) : 
    3636        """Returns True if data is plain text, else False. 
    37          
     37 
    3838           It's hard to detect a plain text file, so we just try to 
    3939           extract lines from the first block (sufficiently large). 
    4040           If it's impossible to find one we consider it's not plain text. 
    41         """    
     41        """ 
    4242        lines = self.firstblock.split("\r\n") 
    4343        if len(lines) == 1 : 
     
    4747        if len(lines) > 1 : 
    4848            return True 
    49         else :     
     49        else : 
    5050            return False 
    51              
     51 
    5252    def getJobSize(self) : 
    5353        """Counts pages in a plain text document.""" 
     
    5858        for line in self.infile : 
    5959            if line.endswith("\n") : 
    60                 linecount += 1     
     60                linecount += 1 
    6161                if (linecount > pagesize) : 
    6262                    pagecount += 1 
    6363                    linecount = 0 
    64                 else :     
     64                else : 
    6565                    cnt = line.count("\f") 
    6666                    if cnt : 
    6767                        pagecount += cnt 
    6868                        linecount = 0 
    69             else :         
     69            else : 
    7070                raise pdlparser.PDLParserError, "Unsupported file format. Please send the file to %s" % version.__authoremail__ 
    7171        return pagecount + 1    # NB : empty files are catched in isValid()