openbsd-ports/devel/py-silc/patches/patch-examples_demo_py
fgsch 629c8da8bf fix crash when obtaining the number of users. ok from martynas@ some time ago.
while i'm here remove some unneeded printf's and fix the reply users
callback.  bump package.
2008-03-23 05:46:29 +00:00

35 lines
1.2 KiB
Plaintext

$OpenBSD: patch-examples_demo_py,v 1.4 2008/03/23 05:46:29 fgsch Exp $
--- examples/demo.py.orig Mon Jul 10 00:57:15 2006
+++ examples/demo.py Sun Mar 23 05:36:57 2008
@@ -29,6 +29,10 @@ class SupySilcClient(silc.SilcClient):
def _cache_channel(self, channel):
self.channels[channel.channel_name] = channel
+ def running(self):
+ print 'SILC: Running.'
+ self.connect_to_server(sys.argv[1], 706)
+
def connected(self):
print 'SILC: Connected to server.'
self.isconnected = True
@@ -195,8 +199,9 @@ class SupySilcClient(silc.SilcClient):
print 'SILC: Reply (Leave):', channel
def command_reply_users(self, channel, users):
- self._cache_user(user)
- print 'SILC: Reply (Users):', type, user
+ for user in users:
+ self._cache_user(user)
+ print 'SILC: Reply (Users):', channel, users
def command_reply_service(self, *args):
pass # not implemented
@@ -209,7 +214,6 @@ class SupySilcClient(silc.SilcClient):
if __name__ == "__main__":
import sys
c = SupySilcClient()
- c.connect_to_server(sys.argv[1], 706)
try:
while True:
c.run_one()