Created
July 16, 2012 12:27
-
-
Save y-li/3122425 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import Queue | |
import fluct_web_api | |
class Fluct_Procedure(Queue.Queue): | |
def __init__(self): | |
Queue.Queue.__init__(self) | |
def __del__(self): | |
pass | |
class Fluct_Scraper(object): | |
web_api = None | |
data = None | |
procedure = None | |
def __init__(self): | |
self.web_api = fluct_web_api.Fluct_Web_API() | |
self.data = dict() | |
self.procedure = Fluct_Procedure() | |
def __del__(self): | |
del self.web_api | |
def register_task(self, name, func): | |
self.procedure.put((name, func)) | |
def run(self): | |
while self.procedure.empty() != True: | |
move = self.procedure.get() | |
move[1](move[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment