Yes, more features!

This commit is contained in:
Dennis Kaarsemaker 2006-10-19 16:39:11 +02:00
parent 45c337e8e1
commit 74af0c989f
17 changed files with 159 additions and 35 deletions

View File

@ -1,6 +1,19 @@
"""
This plugin can store all kick/ban/remove/mute actions
"""
###
# Copyright (c) 2005,2006 Dennis Kaarsemaker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
###
import supybot
import supybot.world as world

View File

@ -1,4 +1,18 @@
#!/usr/bin/python
###
# Copyright (c) 2005,2006 Dennis Kaarsemaker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
###
import sys
sys.path.append('/home/dennis/public_html')
from commoncgi import *

View File

@ -1,3 +1,17 @@
###
# Copyright (c) 2006 Dennis Kaarsemaker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
###
import supybot.conf as conf
import supybot.registry as registry

View File

@ -1,8 +1,17 @@
#!/usr/bin/python
#
# Simple authentication against launchpad and group membership checking.
# Feel free to use, modify and distribute as you see fit.
# (c) 2006 Dennis Kaarsemaker <dennis@kaarsemaker.net>
# Copyright (c) 2005,2006 Dennis Kaarsemaker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
###
import urllib,urllib2
import xml.dom.minidom as dom

View File

@ -1,4 +1,47 @@
# Based on the standard log plugin
###
# Copyright (c) 2006 Dennis Kaarsemaker
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
###
#
# Based on the standard supybot logging plugin, which has the following
# copyright:
#
# Copyright (c) 2002-2004, Jeremiah Fincher
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions, and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions, and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# * Neither the name of the author of this software nor the name of
# contributors to this software may be used to endorse or promote products
# derived from this software without specific prior written consent.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
###
import supybot.utils as utils
from supybot.commands import *

View File

@ -27,8 +27,6 @@ import xml.dom.minidom as minidom
from htmlentitydefs import entitydefs as entities
import email.FeedParser
#datadir = '/home/dennis/ubugtu/data/bugmail'
def registerBugtracker(name, url='', description='', trackertype=''):
conf.supybot.plugins.Bugtracker.bugtrackers().add(name)
group = conf.registerGroup(conf.supybot.plugins.Bugtracker.bugtrackers, name)
@ -298,6 +296,9 @@ class Bugtracker(callbacks.PluginRegexp):
try:
report = self.get_bug(tracker,bugid)
except BugtrackerError, e:
if 'private' in str(e):
irc.reply("Bug %d on http://launchpad.net/bugs/%d is private" % (bugid, bugid))
return
if not sure_bug and bugid < 30:
return
irc.error(str(e))
@ -330,6 +331,9 @@ class Bugtracker(callbacks.PluginRegexp):
irc.reply("https://devpad.canonical.com/~jamesh/oops.cgi/%s" % oopsid, prefixNick=False)
def get_tracker(self,snarfurl,sfdata):
snarfhost = snarfurl.replace('http://','').replace('https://','')
if '/' in snarfurl:
snarfhost = snarfhost[:snarfhost.index('/')]
for t in self.db.keys():
tracker = self.db[t]
url = tracker.url.replace('http://','').replace('https://','')
@ -339,7 +343,7 @@ class Bugtracker(callbacks.PluginRegexp):
return tracker
if '/' in url:
url = url[:url.index('/')]
if url in snarfurl:
if url in snarfhost:
return tracker
if 'sourceforge.net' in snarfurl:
return self.db['sourceforge']
@ -456,8 +460,8 @@ class Malone(IBugtracker):
def _sort(self, task1, task2):
# Status sort:
try:
statuses = ['Rejected', 'Fix Committed', 'Fix Released', 'Confirmed', 'In Progress', 'Needs Info', 'Unconfirmed']
severities = ['Untriaged', 'Wishlist', 'Minor', 'Low', 'Normal', 'Medium', 'Major', 'High', 'Critical']
statuses = ['Rejected', 'Fix Released', 'Fix Committed', 'Unconfirmed', 'Needs Info', 'In Progress', 'Confirmed']
severities = ['Undecided', 'Wishlist', 'Minor', 'Low', 'Normal', 'Medium', 'Major', 'High', 'Critical']
if task1['status'] not in statuses and task2['status'] in statuses: return 1
if task1['status'] in statuses and task2['status'] not in statuses: return -1
if task1['importance'] not in severities and task2['importance'] in severities: return 1

9
Encyclopedia/editlogs.cgi Executable file
View File

@ -0,0 +1,9 @@
#!/usr/bin/python
import sys
sys.path.append('/home/dennis/public_html')
from commoncgi import *
for file in sorted(os.listdir('/home/dennis/public_html/botlogs'),reverse=True)[1:101]:
print '<a href="/botlogs/%s">%s</a><br/>' % (file, file)
send_page('plain.tmpl')

View File

@ -20,7 +20,7 @@ apt_pkg.init()
datadir = '/home/dennis/ubugtu/data/facts'
aptdir = '/home/dennis/ubugtu/data/apt'
distros = ('dapper','breezy','edgy','hoary','warty','dapper-commercial','dapper-seveas','breezy-seveas','dapper-imbrandon','edgy-imbrandon')
distros = ('dapper','breezy','edgy','hoary','warty','dapper-commercial','dapper-seveas','breezy-seveas','dapper-imbrandon','edgy-imbrandon', 'dapper-backports')
defaultdistro = 'dapper'
# Keep 'searchistros' in search order!
searchdistros = ('dapper','dapper-commercial','dapper-seveas','dapper-imbrandon')
@ -309,10 +309,10 @@ class Encyclopedia(callbacks.Plugin):
db.commit()
if factoid.value.startswith('<reply>'):
#irc.queueMsg(ircmsgs.privmsg(target, '%s%s' % (retmsg, factoid.value[7:].strip())))
queue(irc, target, '%s%s' % (retmsg, factoid.value[7:].strip()))
queue(irc, target, '%s%s' % (retmsg, factoid.value[7:].strip().replace('$chan',channel)))
else:
#irc.queueMsg(ircmsgs.privmsg(target, '%s%s is %s' % (retmsg, factoid.name, factoid.value.strip())))
queue(irc, target, '%s%s is %s' % (retmsg, factoid.name, factoid.value.strip()))
queue(irc, target, '%s%s is %s' % (retmsg, factoid.name, factoid.value.strip().replace('$chan',channel)))
if not display_info:
break
else:
@ -389,7 +389,7 @@ def findpkg(pkg,filelookup=True):
data = commands.getoutput(aptcommand % (distro, distro, distro, 'search -n', pkg))
if not data:
if filelookup:
print aptfilecommand % (distro, distro, pkg)
#print aptfilecommand % (distro, distro, pkg)
data = commands.getoutput(aptfilecommand % (distro, distro, pkg)).split()
if data:
if len(data) > 5:
@ -468,7 +468,6 @@ def real_get_factoid(cur,name,deleted=False):
return Factoid(f[0],f[1],f[2],f[3],f[4])
def get_factoids(db, name, channel, resolve = True, info = False):
print resolve
cur = db.cursor()
factoids = FactoidSet()
factoids.global_primary = real_get_factoid(cur, name)

View File

@ -1,5 +1,6 @@
###
# Copyright (c) 2005, Daniel DiPaolo
# 2006, Dennis Kaarsemaker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without

View File

@ -1,5 +1,6 @@
###
# Copyright (c) 2005, Daniel DiPaolo
# (c) 2006, Dennis Kaarsemaker
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without

View File

@ -1,9 +0,0 @@
ALL=$(shell find . -name '???*' -maxdepth 1 -type d -printf '%p.tar.gz\n')
default: $(ALL)
%.tar.gz: %
tar zcf $@ $<
clean:
rm -f $(ALL)

View File

@ -29,7 +29,7 @@ CPU radiator broken
It works the way the Wang did, what's the problem
positron router malfunction
cellular telephone interference
techtonic stress
tectonic stress
piezo-electric interference
(l)user error
working as designed
@ -75,7 +75,7 @@ You're out of memory
There isn't any problem
Unoptimized hard drive
Typo in the code
Yes, yes, its called a design limitation
Yes, yes, it's called a design limitation
Look, buddy: Windows 3.1 IS A General Protection Fault.
That's a great computer you have there; have you considered how it would work as a BSD machine?
Please excuse me, I have to circuit an AC line through my head to get this database working.
@ -101,7 +101,7 @@ IRQ dropout
Collapsed Backbone
Power company testing new voltage spike (creation) equipment
operators on strike due to broken coffee machine
backup tape overwritten with copy of system manager's favourite CD
backup tape overwritten with copy of system manager's favorite CD
UPS interrupted the server's power
The electrician didn't know what the yellow cable was so he yanked the ethernet out.
The keyboard isn't plugged in
@ -148,7 +148,7 @@ Party-bug in the Aloha protocol.
Insert coin for new game
Dew on the telephone lines.
Arcserve crashed the server again.
Some one needed the powerstrip, so they pulled the switch plug.
Someone needed the powerstrip, so they pulled the switch plug.
My pony-tail hit the on/off switch on the power strip.
Big to little endian conversion error
You can tune a file system, but you can't tune a fish

View File

@ -7,10 +7,10 @@ def configure(advanced):
Mess = conf.registerPlugin('Mess')
conf.registerChannelValue(conf.supybot.plugins.Mess, 'enabled',
registry.Boolean(False,"""Enable all mess that Ubugtu can spit out in the
registry.Boolean(False,"""Enable the non-offensive mess that ubugtu can spit out in the
channel"""))
conf.registerChannelValue(conf.supybot.plugins.Mess, 'offensive',
registry.Boolean(False,"""Enable all possibly offensive mess that Ubugtu can spit out in the
registry.Boolean(False,"""Enable all possibly offensive mess that the bot can spit out in the
channel"""))
conf.registerChannelValue(conf.supybot.plugins.Mess, 'delay',
registry.Integer(10,""" Minimum number of seconds between mess """))

8
TODO Normal file
View File

@ -0,0 +1,8 @@
Bantracker:
- Documentation
Bugtracker:
- Make sure to use reply.whenAddressedBy
Encyclopedia:
- The list of search repos/default repo must be configurable per channel

View File

@ -21,7 +21,8 @@ import supybot.schedule as schedule
import supybot.ircmsgs as ircmsgs
import pytz
import ical
import datetime
import datetime, shelve, re
import cPickle as pickle
reload(ical)
def _event_to_string(event, timezone):
@ -56,11 +57,13 @@ class Webcal(callbacks.Plugin):
schedule.addPeriodicEvent(self._refresh_cache, 60 * 20, name=self.name())
schedule.addPeriodicEvent(self._autotopics, 60, name=self.name() + 'b')
self.cache = {}
self.subs = shelve.open('/home/dennis/ubugtu/data/subscriptions.db')
def die(self):
schedule.removeEvent(self.name())
schedule.removeEvent(self.name() + 'b')
self.cache.clear()
self.subs.close()
def reset(self):
self.cache.clear()
@ -207,9 +210,24 @@ class Webcal(callbacks.Plugin):
now = wrap(now, [additional('text')])
time = now
def subscribe(self, irc, msg, args, meeting):
print meeting
def subscribe(self, irc, msg, args, regex):
try:
rx = re.compile(regex)
except:
irc.error("Invalid reguar expression")
return
self.subs[msg.nick.lower()] = (regex, rx)
self.subs.sync()
irc.reply("Subscription succesful")
subscribe = wrap(subscribe, ['text'])
def subscription(self, irc, msg, args):
n = msg.nick.lower()
if n in self.subs:
irc.reply("Your subscription: %s" % self.subs[n][0])
else:
irc.reply("You haven't subscribed yet")
subscription = wrap(subscription)
# Warn people that you manage the topic
def doTopic(self, irc, msg):

View File

@ -14,9 +14,9 @@
</p>
<h1>Plugins</h1>
<p>
The plugins used by these bots can be found in the bzr branch located at
https://bots.ubuntulinux.nl - Tarballs of the plugins can be found in <a
href="/tarballs">the tarballs folder</a>
The home grown plugins used by these bots can be found in the bzr branch
located at <a
href="http://bots.ubuntulinux.nl/code/">http://bots.ubuntulinux.nl/code/</a>
</p>
<p>
Bugs and feature requests can be filed at <a