summaryrefslogtreecommitdiff
path: root/omegle.py
diff options
context:
space:
mode:
authoryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-07-02 20:07:56 +0000
committeryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-07-02 20:07:56 +0000
commit55ff032856b22aa5e91a3416b83f69f577f732d3 (patch)
treeebd3e1d8f8116e29eecf59901a3e87fb21318a2c /omegle.py
parent082ff2e370ad174c326e0d8417d5dc4928b206ab (diff)
downloadomegle-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.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/omegle.py b/omegle.py
index 62a3892..2a8eae2 100644
--- a/omegle.py
+++ b/omegle.py
@@ -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)