File: test.py

package info (click to toggle)
xchat 1.8.9-0woody3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 6,220 kB
  • ctags: 3,296
  • sloc: ansic: 37,535; sh: 2,672; perl: 578; makefile: 387; asm: 387; sed: 93; python: 76
file content (13 lines) | stat: -rw-r--r-- 376 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
import sys
import XChat

def signalhandler(name, flags, args):
          session = args[0].get_session()
  	  server = args[1].get_server()
  	  message = args[2].get_string()

	  print "Message to " + session.info()['channel'] + " from " + server.info()['hostname'] + ": " + message

i = XChat.XChat ()
i.register ("test", "test")
i.hook_signal ("XP_INBOUND", signalhandler)