Blablabla

This commit is contained in:
Dennis Kaarsemaker 2006-11-21 00:23:53 +01:00
parent 19d13cc640
commit ead8584fcc
3 changed files with 31 additions and 18 deletions

View File

@ -109,7 +109,7 @@ class Bugtracker(callbacks.PluginRegexp):
def reportnewbugs(self,irc):
# Compile list of bugs
print "Reporting new bugs"
#print "Reporting new bugs"
tracker = self.db['malone']
bugs = {}
fixed = {}
@ -117,12 +117,12 @@ class Bugtracker(callbacks.PluginRegexp):
dir = self.registryValue('bugReporter', channel=c)
if not dir:
continue
print "Reporting in %s (%s)" % (c, dir)
#print "Reporting in %s (%s)" % (c, dir)
if dir not in bugs:
print "Reloading info from %s" % dir
#print "Reloading info from %s" % dir
bugs[dir] = {}
for file in os.listdir(os.path.join(dir,'Maildir','new')):
print "Checking %s" % file
#print "Checking %s" % file
fd = open(os.path.join(dir,'Maildir','new',file))
_data = fd.readlines()
fd.close()
@ -142,7 +142,7 @@ class Bugtracker(callbacks.PluginRegexp):
if component == 'None':
component = ''
if line.startswith('Reply-To:'):
print line
#print line
try:
bug = int(line.split()[2])
try:
@ -150,7 +150,7 @@ class Bugtracker(callbacks.PluginRegexp):
except:
pass
if bug > 58184 and not os.path.exists(os.path.join(dir,str(int(bug/1000)),str(bug))):
print "New bug: %d" % bug
#print "New bug: %d" % bug
fd2 = open(os.path.join(dir,str(int(bug/1000)),str(bug)),'w')
fd2.close()
if bug not in bugs[dir]:
@ -160,12 +160,12 @@ class Bugtracker(callbacks.PluginRegexp):
else:
bugs[dir][bug] = self.get_bug(tracker, bug)
except:
print "Unable to get bug %d" % b
#print "Unable to get bug %d" % b
except:
#raise
pass # Ignore errors. Iz wrong mail
break
print "New bugs in %s (%s): %s" % (c, dir, str(bugs[dir].keys()))
#print "New bugs in %s (%s): %s" % (c, dir, str(bugs[dir].keys()))
# Now show them
for b in sorted(bugs[dir].keys()):
irc.queueMsg(ircmsgs.privmsg(c,'New bug: #%s' % bugs[dir][b][bugs[dir][b].find('bug ')+4:]))
@ -613,7 +613,7 @@ class WikiForms(IBugtracker):
return s
url = "%s/%05d" % (self.url, id)
print url
#print url
try:
bugdata = utils.web.getUrl(url)
except Exception, e:

View File

@ -36,7 +36,6 @@ class FactoidSet:
msgcache = {}
def queue(irc, to, msg):
print "Message to %s: %s" % (to, msg)
now = time.time()
for m in msgcache.keys():
if msgcache[m] < now - 30:
@ -84,7 +83,6 @@ class Encyclopedia(callbacks.Plugin):
def _checkdists(self, channel):
cd = self.registryValue('searchorder', channel=channel)
print cd
return cd.split()
def moderators(self, irc, msg, args):
@ -408,7 +406,6 @@ def findpkg(pkg,checkdists,filelookup=True):
data = commands.getoutput(aptcommand % (distro, distro, distro, 'search -n', pkg))
if not data:
if filelookup:
#print aptfilecommand % (distro, distro, pkg)
data = commands.getoutput(aptfilecommand % (distro, distro, pkg)).split()
if data:
if len(data) > 5:
@ -423,7 +420,6 @@ def findpkg(pkg,checkdists,filelookup=True):
return "Found: %s" % ', '.join(pkgs[:5])
def pkginfo(pkg,checkdists):
print pkg, checkdists
_pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum() or x in '.-'])
distro = None
if len(pkg.strip().split()) > 1:
@ -434,7 +430,6 @@ def pkginfo(pkg,checkdists):
else:
checkdists = [distro]
pkg = _pkg
print pkg, checkdists
for distro in checkdists:
data = commands.getoutput(aptcommand % (distro, distro, distro, 'show', pkg))
@ -449,7 +444,6 @@ def pkginfo(pkg,checkdists):
parser = FeedParser.FeedParser()
parser.feed(p)
p = parser.close()
print p, p['Version']
if apt_pkg.VersionCompare(maxp['Version'], p['Version']) < 0:
maxp = p
del parser

View File

@ -12,6 +12,8 @@ _42file = '/home/dennis/ubugtu/plugins/Mess/42.txt'
_42data = [x.strip() for x in open(_42file).readlines()]
_ballfile = '/home/dennis/ubugtu/plugins/Mess/ball.txt'
_balldata = [x.strip() for x in open(_ballfile).readlines()]
_ferengifile = '/home/dennis/ubugtu/plugins/Mess/ferengi.txt'
_ferengidata = [x.rstrip() for x in open(_ferengifile).readlines()]
class Mess(callbacks.PluginRegexp):
"""Random Mess plugin"""
@ -195,6 +197,15 @@ class Mess(callbacks.PluginRegexp):
#else:
i = random.randint(0,len(_42data)-1)
irc.reply(_42data[i])
def ferengi(self, irc, msg, match):
if not self.ok(msg.args[0]): return
#if num and num >= 1 and num <= len(_bofhdata):
# i = num
#else:
i = random.randint(0,len(_ferengidata)-1)
irc.reply("Ferengi rule of acquisition" + _ferengidata[i])
ferengi = wrap(ferengi)
def ball(self, irc, msg, match):
"""^magic 8ball.*\?$"""
@ -249,9 +260,19 @@ class Mess(callbacks.PluginRegexp):
data = data[data.find('<font'):data.find('</font')]
while '<' in data:
data = data[:data.find('<')] + data[data.find('>')+1:]
irc.reply(data.replace("\n",''))
irc.reply(data.replace("\r\n",' ').replace("\r",' ').replace("\n",' '))
bush = wrap(bush)
def southpark(self, irc, msg, args):
"""TIMMEHH!!"""
if not self.ok(msg.args[0], True): return
data = utils.web.getUrl('http://www.southparkquotes.com/random.php?num=1')
data = data[data.find('<p>')+3:data.find('</p>')]
while '<' in data:
data = data[:data.find('<')] + data[data.find('>')+1:]
irc.reply(data.replace("\r\n",' ').replace("\r",' ').replace("\n",' '))
southpark = wrap(southpark)
def _bauer(self,count=0):
# if self.i % 2 == 0:
# (url, re) = self.jre1
@ -291,7 +312,6 @@ class Mess(callbacks.PluginRegexp):
val = re.sub(r'\s+', ' ', val).strip()
while self.entre.search(val):
entity = self.entre.search(val).group(1)
print entity
if entity in entities:
val = self.entre.sub(entities[entity], val)
else:
@ -316,7 +336,6 @@ class Mess(callbacks.PluginRegexp):
val = re.sub(r'\s+', ' ', val).strip()
while self.entre.search(val):
entity = self.entre.search(val).group(1)
print entity
if entity in entities:
val = self.entre.sub(entities[entity], val)
else: