Software Freedom Law Center

Changeset 152

Show
Ignore:
Timestamp:
06/11/08 19:13:51 (6 months ago)
Author:
landon
Message:

Deleted unnecessary contents of gozerdata, upgraded to latest version of
gozerbot

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/antimatter/luke/gozerbot/bot.py

    r143 r152  
    1010 
    1111from gozerbot.generic import rlog, handle_exception, getlistensocket, \ 
    12 stripident, checkchan, waitforqueue, uniqlist, strippedtxt 
     12stripident, checkchan, waitforqueue, uniqlist, strippedtxt, makeargrest 
    1313from gozerbot.commands import cmnds 
    1414from gozerbot.callbacks import callbacks 
     
    1919from gozerbot.monitor import outmonitor 
    2020from gozerbot.irc import Irc 
    21 from gozerbot.ircevent import Ircevent, makeargrest 
     21from gozerbot.ircevent import Ircevent 
    2222from gozerbot.channels import Channels 
    2323from gozerbot.config import config 
  • trunk/antimatter/luke/gozerbot/callbacks.py

    r130 r152  
    77__copyright__ = 'this file is in the public domain' 
    88 
    9 from gozerbot.generic import rlog, handle_exception, calledfrom 
    10 from gozerbot.ircevent import makeargrest 
     9from gozerbot.generic import rlog, handle_exception, calledfrom, makeargrest 
    1110from gozerbot.dol import Dol 
    1211from gozerbot.thr import start_new_thread 
  • trunk/antimatter/luke/gozerbot/config.py

    r130 r152  
    1212 
    1313# version string 
    14 ver = 'GOZERBOT 0.8.1
     14ver = 'GOZERBOT 0.8.2 DEV
    1515 
    1616def diffdict(dictfrom, dictto): 
  • trunk/antimatter/luke/gozerbot/generic.py

    r138 r152  
    8282        ievent.options = o 
    8383        ievent.txt = args[0] + ' ' + ' '.join(rest) 
     84        makeargrest(ievent) 
    8485    except getopt.GetoptError, ex: 
    8586        ievent.reply(str(ex)) 
     
    8990        return 0 
    9091    return 1 
     92 
     93def makeargrest(ievent): 
     94    """ create ievent.args and ievent.rest .. this is needed because \ 
     95         ircevents might be created outside the parse() function """ 
     96    try: 
     97        ievent.args = ievent.txt.split()[1:] 
     98    except ValueError: 
     99        ievent.args = []    
     100    try: 
     101        cmnd, ievent.rest = ievent.txt.split(' ', 1) 
     102    except ValueError:    
     103        ievent.rest = ""    
     104    ievent.command = ievent.txt.split(' ')[0] 
    91105 
    92106def enable_logging(): 
  • trunk/antimatter/luke/gozerbot/jabberbot.py

    r130 r152  
    407407        self.send(message) 
    408408         
    409     def say(self, printto, txt, fromm=None, groupchat=True, speed=5): 
     409    def say(self, printto, txt, fromm=None, groupchat=True, speed=5, \ 
     410type="normal"): 
    410411        """ say txt to printto """ 
    411412        txt = jabberstrip(txt) 
     
    415416            message = xmpp.Message(to=printto, body=txt, typ='groupchat') 
    416417        else: 
    417             message = xmpp.Message(to=printto, body=txt, typ='chat'
     418            message = xmpp.Message(to=printto, body=txt, typ=type
    418419        if fromm: 
    419420            message.setFrom(fromm) 
    420421        self.send(message) 
    421422 
    422     def saynocb(self, printto, txt, fromm=None, groupchat=True, speed=5): 
     423    def saynocb(self, printto, txt, fromm=None, groupchat=True, speed=5, \ 
     424type="normal"): 
    423425        """ say txt to printto """ 
    424426        txt = jabberstrip(txt) 
     
    428430            message = xmpp.Message(to=printto, body=txt, typ='groupchat') 
    429431        else: 
    430             message = xmpp.Message(to=printto, body=txt, typ='chat'
     432            message = xmpp.Message(to=printto, body=txt, typ=type
    431433        self.sendnocb(message) 
    432434 
  • trunk/antimatter/luke/gozerbot/jabbermsg.py

    r130 r152  
    33# 
    44 
    5 """ jabber message definition """ 
     5""" jabber message definition .. types can be normal, chat, groupchat,  
     6    headline or  error 
     7""" 
    68 
    79__copyright__ = 'this file is in the public domain' 
    810 
    9 from gozerbot.generic import rlog, toenc, fromenc, jabberstrip 
    10 from gozerbot.ircevent import makeargrest 
     11from gozerbot.generic import rlog, toenc, fromenc, jabberstrip, makeargrest 
    1112import xmpp, types, time 
    1213 
     
    2425        self.bot = None 
    2526        self.botoutput = False 
     27        self.type = self.getType() 
    2628        rlog(2, 'jabbermsg', str(self)) 
    2729 
     
    119121            else: 
    120122                repl.setTo(self.channel) 
    121             repl.setType('groupchat') 
    122123        if self.bot.google: 
    123124            repl.setFrom(self.bot.me) 
    124125        repl.setID(self.id) 
     126        repl.setType(self.type) 
    125127        self.bot.send(repl) 
    126128 
     
    176178    def copyin(self, jmsg): 
    177179        """ copy in another jabber message object """ 
     180        self.type = unicode(self.type) 
    178181        self.jidchange = bool(jmsg.jidchange) 
    179182        self.cmnd = unicode(jmsg.cmnd) 
     
    220223        """ return a ircevent repr compatible string """ 
    221224        return "cmnd=%s printto=%s arguments=%s nick=%s user=%s \ 
    222 userhost=%s channel=%s txt=%s args=%s rest=%s speed=%s" % (self.cmnd, \ 
     225userhost=%s channel=%s txt=%s args=%s rest=%s speed=%s type=%s" % (self.cmnd, \ 
    223226self.printto, self.arguments, self.nick, self.user, \ 
    224 self.userhost, self.channel, self.txt, self.args, self.rest, self.speed) 
     227self.userhost, self.channel, self.txt, self.args, self.rest, self.speed, \ 
     228self.type) 
    225229 
    226230    def missing(self, txt): 
  • trunk/antimatter/luke/gozerbot/plugins.py

    r143 r152  
    1212from gozerbot.monitor import outmonitor, saymonitor, jabbermonitor 
    1313from gozerbot.generic import rlog, handle_exception, checkchan, lockdec, \ 
    14 plugnames, waitforqueue, uniqlist, makeoptions 
     14plugnames, waitforqueue, uniqlist, makeoptions, makeargrest 
    1515from gozerbot.myimport import my_import 
    1616from gozerbot.persist import Persist 
     
    2020from gozerbot.callbacks import callbacks, jcallbacks 
    2121from gozerbot.redispatcher import rebefore, reafter 
    22 from gozerbot.ircevent import makeargrest, Ircevent 
     22from gozerbot.ircevent import Ircevent 
    2323from gozerbot.aliases import aliascheck 
    2424from gozerbot.ignore import shouldignore 
     
    202202        if os.path.isdir('myplugs'): 
    203203            self.regdir('myplugs') 
     204            for i in os.listdir('myplugs'): 
     205                if os.path.isdir('myplugs' + os.sep + i): 
     206                    self.regdir('myplugs' + os.sep + i) 
    204207        start_new_thread(self.showregistered, ()) 
    205208        self.overload() 

SFLC Main Page

[frdm] Support SFLC