Show
Ignore:
Timestamp:
04/04/06 11:16:53 (18 years ago)
Author:
jerome
Message:

Did a pass with pylint.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/bin/cupspykota

    r2803 r2829  
    4747from pykota.accounter import openAccounter 
    4848from pykota.ipp import IPPRequest, IPPError 
    49 from pykota.storage import PyKotaStorageError 
    5049         
    5150class FakeObject :         
     51    """Fake object.""" 
    5252    def __init__(self, name) : 
    5353        """Fake init.""" 
     
    135135                # see if the pid contained in the lock file is still running 
    136136                os.kill(pid, 0) 
    137             except OSError, e :     
    138                 if e.errno != errno.EPERM : 
     137            except OSError, err : 
     138                if err.errno != errno.EPERM : 
    139139                    # process doesn't exist anymore 
    140140                    os.remove(lockfilename) 
     
    318318            self.regainPriv()                          
    319319            inputfile = os.popen(jobticketcommand, "r") 
    320             for line in inputfile.xreadlines() : 
    321                 line = line.strip() 
    322                 if line in ("DENY", "AUTH=NO", "AUTH=IMPOSSIBLE") : 
    323                     self.logdebug("Seen %s command." % line) 
    324                     action = "DENY" 
    325                 elif line == "CANCEL" : 
    326                     self.logdebug("Seen CANCEL command.") 
    327                     action = "CANCEL" 
    328                 elif line.startswith("USERNAME=") :     
    329                     username = line.split("=", 1)[1].strip() 
    330                     self.logdebug("Seen new username [%s]" % username) 
    331                 elif line.startswith("BILLINGCODE=") :     
    332                     billingcode = line.split("=", 1)[1].strip() 
    333                     self.logdebug("Seen new billing code [%s]" % billingcode) 
     320            try : 
     321                for line in inputfile.xreadlines() : 
     322                    line = line.strip() 
     323                    if line in ("DENY", "AUTH=NO", "AUTH=IMPOSSIBLE") : 
     324                        self.logdebug("Seen %s command." % line) 
     325                        action = "DENY" 
     326                    elif line == "CANCEL" : 
     327                        self.logdebug("Seen CANCEL command.") 
     328                        action = "CANCEL" 
     329                    elif line.startswith("USERNAME=") :     
     330                        username = line.split("=", 1)[1].strip() 
     331                        self.logdebug("Seen new username [%s]" % username) 
     332                    elif line.startswith("BILLINGCODE=") :     
     333                        billingcode = line.split("=", 1)[1].strip() 
     334                        self.logdebug("Seen new billing code [%s]" % billingcode) 
     335            except IOError, msg :             
     336                self.logdebug("IOError while reading subprocess' output : %s" % msg) 
    334337            inputfile.close()     
    335338            self.dropPriv() 
     
    452455         
    453456        class DummyClass : 
     457            """Class used to avoid errors.""" 
    454458            operation_attributes = {} 
    455459            job_attributes = {} 
     
    12541258            wrapper.printInfo(_("Job %s interrupted by the administrator !") % wrapper.JobId, "warn") 
    12551259            retcode = 0 
    1256         except SystemExit, e :     
    1257             retcode = e.code 
     1260        except SystemExit, err :     
     1261            retcode = err.code 
    12581262        except :     
    12591263            try :