Filewatcher File Search File Search
Content Search
» » » » » python-silc_0.5-1_kfreebsd-amd64.deb » Content »
pkg://python-silc_0.5-1_kfreebsd-amd64.deb:39942/usr/share/doc/python-silc/  info  control  downloads

python-silc - Python bindings for SILC…  more info»


PySilc - Python Bindings for SILC Toolkit

PySilc is a near-complete set of Python bindings for creating SILC
clients using the silc-toolkit[1]. It allows developers to write
simple bots and clients for connecting to SILC servers.

Also included is a simple test client bot in 'examples/' and a
experimental SILC driver for Supybot[2].

Building and Installing

* python build
* python install (as root)

Authors and License

Copyright (c) 2006. Alastair Tse <>
Copyright (c) 2007. Martynas Venckus <>
Licensed under the BSD License. See COPYING for details.

Usage Overview

All the classes are documented using Python Docstrings. You can see
descriptions of classes and modules by simply using pydoc or help()
in the python console.

All the functionality is contained within the module 'silc'.

The main classes are as follows:

SilcClient  - This is the main class that represents a SILC client. You
              must subclass SilcClient and override some key callback

SilcKeys    - Represents a pair of public and private keys that
              can be generated using 'silc.load_key_pair()' and

SilcUser    - Represents a user on a SILC server. You will not create
              these automatically but will be able to access them by
              listing users in a channel or when they send a channel
              message or private message. Also, you can get a reference
              to your own SilcUser object by using SilcClient.user()

SilcChannel - Represents a channel on the SILC server.

Callbacks Overview

The majority of the work will be to write callbacks that react to
messages the server sends to the client. These can be either
asynchronous events such as channel messages, or responses to commands
that are sent by the client.

Callbacks are callable members of the SilcClient class (or subclass)
and their signature is on the SilcClient docstring. An example
implementation would look like this:


import silc

class EchoClient(silc.SilcClient):

      def channel_message(self, sender, channel, flags, message):
          print message
          self.send_channel_message(channel, message)

      def private_message(self, sender, flags, message):
          print message
          self.send_private_message(sender, message)

      def running(self):

      def connected(self):
          print "* Connected"
          self.command_call("JOIN crazybotchannel")

      def disconnected(self):
          print "* Disconnected"

      def failure(self):
          print "* Connection failure"

      # catch responses to commands

      def command_reply_join(self, channel, name, topic, hmac, x, y,

          print "* Joined channel %s" % name
          self.send_channel_message(channel, "Hello!")

      # catch async notifications from the server

      def notify_join(self, user, channel):
          print "* A user named %s has joined the channel %s" % \
                (user.username, channel.channel_name)
          self.send_channel_message(channel, "Hello, %s" %

if __name__ == "__main__":
   keys = silc.create_key_pair("", "silc.prv")
   client = EchoClient(keys, "echobot", "echobot", "Echo Bot")

   while True:
         except KeyboardInterrupt:


Results 1 - 1 of 1
Help - FTP Sites List - Software Dir.
Search over 15 billion files
© 1997-2017