Skip to content
This repository has been archived by the owner on Dec 30, 2019. It is now read-only.

bgilmore/python.mod

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python.mod

    NOTE: This project has gone largely unmaintained since 2011. I ran into
          event model issues I had ideas about fixing, but frankly this
          project just isn't a priority right now.
          
          Feel free to fork and adapt as you see fit, but be aware that the
          module is mostly non-functional.

Tcl is awful. Seriously, awful. This module allows you to write Eggdrop scripts in Python instead.

This module is still very young, immature, and untested. Still, beats writing Tcl.

Installation

  1. Extract the python.mod directory into your Eggdrop source tree under src/mod
  2. Edit src/mod/python.mod/Makefile to point to the proper include/lib paths for Python
  3. From the root of the source tree, run make iconfig and enable the module
  4. Build using make and/or make install
  5. In eggdrop.conf use loadmodule python to enable the loadpython directive
  6. Use loadpython to load and instantiate Python modules

Example Usage

in eggdrop.conf

loadmodule python      # load python.mod
set python-isolate 1   # use interpreter isolation? (0/1)
loadpython splat       # load splat.py

in splat.py

import eggdrop

def ctcp_splat(nick, mask, handle, dest, keyword, text):
    eggdrop.putlog("Got splat'd by %s (%s)!" % (nick, mask))
    eggdrop.putserv("PRIVMSG %s :it's not nice to throw things" % nick)

eggdrop.bind('ctcp', '-', 'splat', ctcp_splat)
eggdrop.putlog("*** splat module loaded")

Releases

No releases published

Packages

No packages published

Languages