コード例 #1
0
 def feed(self, qName, cFile):
     '''
     Feed HTTPSQSQueue with domains from cached file
     '''
     if not os.path.exists(cFile):
         print 'File does not exists!'
         return
     f     = open(cFile)
     lines = f.readlines()
     count = 0
     for line in lines:
         HTTPSQSQueue.put(qName,line.strip())
         count = count + 1
     f.close()
     print HTTPSQSQueue.status(qName)
コード例 #2
0
 def getQueueUnRead(self, qName):
     qStatus = HTTPSQSQueue.status(qName).replace('\n', '')
     UnRead  = 0
     try:
         UnRead = int(json.loads(qStatus).pop('unread'))
     except Exception, e:
         C.Info(str(e), C.ERROR)
コード例 #3
0
 def reset(self, qName):
     '''
     reset a HTTPSQSQueue
     '''
     HTTPSQSQueue.reset(qName)
     print HTTPSQSQueue.status(qName)