diff options
Diffstat (limited to 'proxy.py')
-rw-r--r-- | proxy.py | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -11,14 +11,17 @@ class OmegleProxyChat(OmegleChat): OmegleChat.__init__(self) self.name = name self.color = color - def c(self,str): - return "\033[%sm\033[1m%s\033[0m\033[0m" %(self.color, str) + def c(self,str,bold=False): + if bold: + return "\033[1m\033[%sm%s\033[0m\033[0m" %(self.color, str) + else: + return "\033[%sm%s\033[0m" %(self.color, str) def set_partner(self,partner): self.partner = partner def on_message(self,message): - print self.c("[MSG] %s: %s" %(self.name, message)) + print self.c("[MSG] %s: %s" %(self.name, message),bold=True) self.partner.send(message) def on_connect(self): print self.c("[EVT] %s Connection confirmed" % self.name) @@ -44,7 +47,10 @@ A.start() B.start() print "press enter to abort" -sys.stdin.readline() +try: + sys.stdin.readline() +except KeyboardInterrupt: + pass A.disconnect() B.disconnect() |