diff options
author | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2009-07-02 20:07:56 +0000 |
---|---|---|
committer | yvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd> | 2009-07-02 20:07:56 +0000 |
commit | 55ff032856b22aa5e91a3416b83f69f577f732d3 (patch) | |
tree | ebd3e1d8f8116e29eecf59901a3e87fb21318a2c /omegle.py | |
parent | 082ff2e370ad174c326e0d8417d5dc4928b206ab (diff) | |
download | omegle-55ff032856b22aa5e91a3416b83f69f577f732d3.tar.gz omegle-55ff032856b22aa5e91a3416b83f69f577f732d3.zip |
yhia
git-svn-id: http://xapek.org/svn/common/omegle@1174 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'omegle.py')
-rw-r--r-- | omegle.py | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -34,6 +34,7 @@ class Timer(Thread): self.logger.debug("self.running == False") def stop(self): + """ XXX break func() ? """ self.running = False self.event.set() @@ -65,9 +66,10 @@ class RESTClient(object): class OmegleChat(RESTClient): def __init__(self,poll_interval=0.5,name="",host="omegle.com"): self.name = name + self.poll_interval=poll_interval RESTClient.__init__(self,host) - self.timer = Timer(self._events, poll_interval) + self.timer = Timer(self._events, poll_interval) self.logger = logging.getLogger(__name__ + "." + self.__class__.__name__ + name) self.is_confirmed = False #after getting a connection confirm self.is_connected = False #after having self.id @@ -86,8 +88,9 @@ class OmegleChat(RESTClient): self.id = id[1] self.logger.info("Connected id=%s" % self.id) #start /events polling - self.timer.start() self.is_connected = True + self.timer = Timer(self._events, self.poll_interval) + self.timer.start() else: self.logger.error("Bad response: %s" % body) raise Exception("Bad response: %s" % body) |