Pysilc 0.0.1 review
DownloadPysilc is a python binding for the SILC toolkit
|
|
Pysilc is a python binding for the SILC toolkit. Right now just a percentage of the SilcClient part of the toolkit is covered.
The main goal is not to wrap the whole toolkit, but only the necessary parts to write simple bots.
Using SILC in python is quite simple:
import os, silc, silc.client
def cb_connected(msg):
print "CONNECTED : ", msg
s.command("JOIN bottest")
def cb_disconnected(a, b):
print "DISCONNECTED"
sys.exit(0)
def cb_channel_message(sender, msg):
print "MSG : < %s > %s" % (sender, msg)
callbacks = {
"connected": cb_connected,
"disconnected": cb_disconnected,
"channel_message": cb_channel_message
}
s = silc.client.Client()
s.username = "pybot"
s.realname = "i am the pybot"
s.hostname = "localhost"
s.setcallbacks(callbacks)
s.createkeys("test.pub", "test.prv", "foobar")
s.connect("localhost", 706)
while 1:
try:
s.runone()
except silclient.error:
traceback.print_exc()
break
time.sleep(0.5)
Pysilc is in its infancy, hence it is rather buggy. Let me know of the various issues you stumble upon. (API related ones as well).
Usage and Configuration:
Make sure you have the Silc toolkit and the Python development packages installed. (Check your distro packages for more info).
./configure --prefix=
make
make install
Pysilc 0.0.1 keywords