コード例 #1
0
ファイル: manager.py プロジェクト: jwang-share/said
 def __init__(self):
     threading.Thread.__init__(self)
     self.bf = bloomfilter().getinstance()
     self.mdb = memdb()
     self.taskname = self.get_task_name()
     self.workername = self.get_worker_name()
     pass
コード例 #2
0
	def __init__(self):
		threading.Thread.__init__(self)
		self.bf = bloomfilter().getinstance()
		self.mdb = memdb()
		self.taskname = self.get_task_name()
		self.workername = self.get_worker_name()
		pass
コード例 #3
0
ファイル: worker.py プロジェクト: jwang-share/said
	def __init__(self,openers,task_dispatcher,result_handler=None):
		self.task_dispatcher = task_dispatcher
		self.result_handler = result_handler
		self.openers = openers
		self.mdb = memdb()
		self.worker_name = self.get_worker_name()
		self.mdb.dict_update(self.worker_name,'IDLE')
		self.canrun = True
		pass
コード例 #4
0
ファイル: messager.py プロジェクト: jundong/theysay
def start_weibo_work(task):
	mdb = memdb()
	docname = 'weibo_'+task
	tasks = request.forms.get("tasks")
	mdb.push(docname,tasks)
	worker_status = mdb.dict_show('weibo')
	if worker_status != "BUSY":
		mdb.cleandoc(docname)
		if task == "followers":			
			wf = weibofollowmanager().start()
			pass
		elif task == "miniblog":
			wm = weibominiblogmanager().start()
			pass
	pass
コード例 #5
0
#!/usr/bin/env python
#coding=utf-8

import sys
sys.path.append('../')

from factory.supports.memdb import memdb
from factory.managers.weibomanager import weibominiblogmanager
if sys.getdefaultencoding() != "utf-8":
    reload(sys)
    sys.setdefaultencoding('utf-8')


if __name__ == "__main__":
	task = 'miniblogs'
	mdb = memdb()
	docname = 'weibo_'+task+'!TASK'
	print docname
	#tasks = ['3310333102']
	tasks = [('2482256271','0')]
	mdb.push(docname,tasks)
	worker_status = mdb.dict_show('weibo')
	if worker_status != "BUSY":
		if task == "followers":			
			wf = weibofollowmanager().start()
			pass
		elif task == "miniblogs":
			wm = weibominiblogmanager().start()
			pass
	print "---------------"
コード例 #6
0
	def __init__(self):
		self.result = RESULT_URL_PREFIX
		self.mdb = memdb()
		pass
コード例 #7
0
#!/usr/bin/env python
#coding=utf-8

import sys
sys.path.append('../')

from factory.supports.memdb import memdb
from factory.managers.weibomanager import weibominiblogmanager
if sys.getdefaultencoding() != "utf-8":
    reload(sys)
    sys.setdefaultencoding('utf-8')

if __name__ == "__main__":
    task = 'miniblogs'
    mdb = memdb()
    docname = 'weibo_' + task + '!TASK'
    print docname
    #tasks = ['3310333102']
    tasks = [('2482256271', '0')]
    mdb.push(docname, tasks)
    worker_status = mdb.dict_show('weibo')
    if worker_status != "BUSY":
        if task == "followers":
            wf = weibofollowmanager().start()
            pass
        elif task == "miniblogs":
            wm = weibominiblogmanager().start()
            pass
    print "---------------"
コード例 #8
0
ファイル: test.py プロジェクト: chu888chu888/crawler-theysay
#!/usr/bin/env python
#coding=utf-8

import sys
sys.path.append('../')

from factory.supports.memdb import memdb
from factory.managers.weibomanager import weibofollowmanager


if __name__ == "__main__":
	task = 'followers'
	mdb = memdb()
	docname = 'weibo_'+task+'!TASK'
	print docname
	#tasks = ['3310333102']
	tasks = ['2482256271']
	mdb.push(docname,tasks)
	mdb1 = memdb()
	worker_status = mdb.dict_show('weibo')
	if worker_status != "BUSY":
		if task == "followers":			
			wf = weibofollowmanager().start()
			pass
		elif task == "miniblog":
			wm = weibominiblogmanager().start()
			pass
	print "---------------"
コード例 #9
0
#!/usr/bin/env python
#coding=utf-8

import sys

sys.path.append('../')

from factory.supports.memdb import memdb
from factory.managers.weibomanager import weibofollowmanager

if __name__ == "__main__":
    task = 'followers'
    mdb = memdb()
    docname = 'weibo_' + task + '!TASK'
    print docname
    #tasks = ['3310333102']
    tasks = ['2482256271']
    mdb.push(docname, tasks)
    mdb1 = memdb()
    worker_status = mdb.dict_show('weibo')
    if worker_status != "BUSY":
        if task == "followers":
            wf = weibofollowmanager().start()
            pass
        elif task == "miniblog":
            wm = weibominiblogmanager().start()
            pass
    print "---------------"