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)
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)
def reset(self, qName): ''' reset a HTTPSQSQueue ''' HTTPSQSQueue.reset(qName) print HTTPSQSQueue.status(qName)