コード例 #1
0
 def do_crawler(self, para):
     print "do_crawler"
     #create crawler engin
     crawler_engine = Engine()
     #start engine
     crawler_engine.start()
     #stop engin
     crawler_engine.stop()
コード例 #2
0
ファイル: controler.py プロジェクト: derrick0714/mas
	def do_crawler(self,para):
		print "do_crawler"
		#create crawler engin
		crawler_engine = Engine()
		#start engine 
		crawler_engine.start( )
		#stop engin 
		crawler_engine.stop()
コード例 #3
0
ファイル: crawler.py プロジェクト: Adam57/Crawler
def main():

	try:	
		#create crawler engin
		crawler_engine = Engine()


		#start engine 
		crawler_engine.start( )

		#hold the main thread here, wait for any input to finish
		raw_input("")
		#stop engin 
		crawler_engine.stop()

	except (Exception) as e:  
		#Log().debug(e)
		sys.exit(0)
コード例 #4
0
class Crawler():
    def __init__(self):
        os.chdir('./global_vars')
        from core.engine import Engine
        os.chdir('..')
        self.engine = Engine()

    def _start_engine(self):
        self.engine.start()

    def _stop_engine(self):
        self.engine.stop()

    def crawl(self):  # entrance method
        self._start_engine()

    def stop(self):
        self._stop_engine()
コード例 #5
0
def main():
	manager, port, downloaders  = parseCommandLineArgs()
	engine = Engine(downloaders, manager, port)
	engine.start()
	raw_input("press any key to stop....\n")
	engine.stop()
コード例 #6
0
def main():
    manager, port, downloaders = parseCommandLineArgs()
    engine = Engine(downloaders, manager, port)
    engine.start()
    raw_input("press any key to stop....\n")
    engine.stop()