示例#1
0
文件: Util.py 项目: ShaneMcC/hellanzb
 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))
示例#2
0
 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))
示例#3
0
文件: Util.py 项目: ShaneMcC/hellanzb
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
示例#4
0
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