Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(1)  |  Call(1)  |  Derive(0)  |  Import(0)

        def bfs(urlQuence, urlSync, deepth, mutex):
    current = urlQuence.getLayerunVisited() #??????????
    while current is not None and current < deepth+1 :
        #?????????????
        #print "bfs-mutex.acquire()..."
        mutex.acquire()
        #print "bfs-mutex.acquire() OK"
        visitUrl = urlQuence.unVisitedUrlDeQuence(current)
        mutex.release()
        #print "bfs-mutex.release() OK"
        print "?%d???????? \"%s\" "%(current, visitUrl)
        if visitUrl is None or visitUrl=="":
            break
        #?????,set()
        links = utils.geturls(visitUrl)
        #?url??????url?
        urlQuence.addVisitedUrl(visitUrl)
        #????url??
        #print "bfs-2-mutex.acquire()..."
        mutex.acquire()
        #print "bfs-2-mutex.acquire() OK"
        urlQuence.addUnvisitedUrl(links, current+1)
        urlSync.addUnvisitedUrl(links)
        mutex.release()
        #print "bfs-2-mutex.release() OK"
        current = urlQuence.getLayerunVisited()
        


src/p/y/pylinktester-0.1/threads/spliderThread.py   pylinktester(Download)
	def run(self):
		core.bfs(self.urlQuence, self.urlSync, self.deepth, self.mutex)