def kill(self): from Hellanzb.Log import debug, error if isWindows(): warn('Left running process: %s' % self.prettyCmd) return if self.isRunning: try: os.kill(self.getPid(), signal.SIGKILL) except OSError, ose: error('Unexpected problem while kill -9ing pid: ' + str(self.getPid()) + \ ' process: ' + self.prettyCmd, ose) except Exception, e: debug('could not kill process: ' + self.prettyCmd + ': ' + str(e))
def validNZB(nzbfilename): """ Return true if the specified filename is a valid NZB """ from Hellanzb.Log import error if nzbfilename == None or not os.path.isfile(nzbfilename): error('Invalid NZB file: %s' % nzbfilename) return False elif not os.access(nzbfilename, os.R_OK): error('Unable to read NZB file: %s' % nzbfilename) return False elif archiveName(nzbfilename) == '': error('Invalid NZB file (No archive name): %s' % nzbfilename) return False return True