summaryrefslogtreecommitdiff
path: root/proxy.py
diff options
context:
space:
mode:
authoryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-05-28 08:19:11 +0000
committeryvesf <yvesf@d0e8fea9-7529-0410-93fb-d39fd5b9c1dd>2009-05-28 08:19:11 +0000
commit148facadf4b6ca036f1f4d52ed82108a665550b4 (patch)
tree9f5124885bae8fc2ee7baae6de72d2b08f10b9fe /proxy.py
parent423fe90162a1c097b02bb8add604cdb9d95a04d0 (diff)
downloadomegle-148facadf4b6ca036f1f4d52ed82108a665550b4.tar.gz
omegle-148facadf4b6ca036f1f4d52ed82108a665550b4.zip
blah
git-svn-id: http://xapek.org/svn/common/omegle@1022 d0e8fea9-7529-0410-93fb-d39fd5b9c1dd
Diffstat (limited to 'proxy.py')
-rw-r--r--proxy.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/proxy.py b/proxy.py
index 28d7d16..39c3fff 100644
--- a/proxy.py
+++ b/proxy.py
@@ -1,5 +1,5 @@
from omegle import OmegleChat
-import sys, logging
+import sys, logging, time
colors = {"default":0, "black":30, "red":31, "green":32, "yellow":33,
"blue":34,"magenta":35, "cyan":36, "white":37, "black":38,
@@ -21,19 +21,18 @@ class OmegleProxyChat(OmegleChat):
self.partner = partner
def on_message(self,message):
- print self.c("[MSG] %s: %s" %(self.name, message),bold=True)
+ print self.c("%s [MSG] %s: %s" %(time.strftime("%H:%M:%S"), self.name, message),bold=True)
self.partner.send(message)
def on_connect(self):
- print self.c("[EVT] %s Connection confirmed" % self.name)
+ print self.c("%s [EVT] %s Connection confirmed" % (time.strftime("%H:%M:%S"), self.name))
def on_typing(self):
- print self.c("[EVT] %s is typing" % self.name)
+ print self.c("%s [EVT] %s is typing" % (time.strftime("%H:%M:%S"), self.name))
self.partner.typing()
def on_stopped_typing(self):
- print self.c("[EVT] %s stopped typing" % self.name)
+ print self.c("%s [EVT] %s stopped typing" % (time.strftime("%H:%M:%S"), self.name))
self.partner.stopped_typing()
def on_disconnect(self):
- print self.c("[EVT] %s disconnect" % self.name)
- self.partner.disconnect()
+ print self.c("%s [EVT] %s disconnect" % (time.strftime("%H:%M:%S"), self.name))
logging.basicConfig(level=logging.DEBUG)
@@ -52,8 +51,8 @@ try:
except KeyboardInterrupt:
pass
-A.disconnect()
-B.disconnect()
+if A.is_connected: A.disconnect()
+if B.is_connected: B.disconnect()