diff --git a/Bantracker/bans.cgi b/Bantracker/bans.cgi index 5984436..14fdbc6 100755 --- a/Bantracker/bans.cgi +++ b/Bantracker/bans.cgi @@ -59,22 +59,26 @@ if form.has_key('lpuser') and form.has_key('lpmail'): for i in xrange(8): password += chars[random.randint(0,len(chars)-1)] salt += chars[random.randint(0,len(chars)-1)] - os.system('gpg --homedir /tmp --keyserver hkp://subkeys.pgp.net --recv-keys %s' % newperson.key) - (infd, outfd) = os.popen2('gpg --homedir /tmp --encrypt --armor --trust-model always --recipient %s' + try: + os.system('gpg --homedir /tmp --keyserver hkp://subkeys.pgp.net --recv-keys %s 2>/dev/null' % newperson.key) + (infd, outfd) = os.popen2('gpg --homedir /tmp --encrypt --armor --trust-model always --recipient %s 2>/dev/null' % newperson.key) - infd.write(password) - infd.close() - gpg = outfd.read() - outfd.close() - fd = os.popen('mail -a "From: Ubugtu " -s "Your bantracker account" %s' - % form['lpmail'].value.replace('ubuntu@sourceguru.net','mezzle@gmail.com'), 'w') - fd.write(gpg) - fd.close() - error = "Your password has been sent (encrypted) to your e-mail address" - cur.execute("""INSERT INTO users (username, salt, password) VALUES (%s, %s, %s)""", - (form['lpuser'].value, salt, - sha.new(salt + sha.new(password + salt).hexdigest().lower()).hexdigest().lower())) - con.commit() + infd.write(password) + infd.close() + gpg = outfd.read() + outfd.close() + except: + error = "A gpg error occured. Please check your key on launchpad" + else: + fd = os.popen('mail -a "From: Ubugtu " -s "Your bantracker account" %s' + % form['lpmail'].value.replace('ubuntu@sourceguru.net','mezzle@gmail.com'), 'w') + fd.write(gpg) + fd.close() + error = "Your password has been sent (encrypted) to your e-mail address" + cur.execute("""INSERT INTO users (username, salt, password) VALUES (%s, %s, %s)""", + (form['lpuser'].value, salt, + sha.new(salt + sha.new(password + salt).hexdigest().lower()).hexdigest().lower())) + con.commit() else: error = """Username and mailaddress don't match. Username is the $someone in http://launchpad.net/people/$someone that is your diff --git a/Bugtracker/plugin.py b/Bugtracker/plugin.py index 6088211..ea82841 100644 --- a/Bugtracker/plugin.py +++ b/Bugtracker/plugin.py @@ -96,6 +96,7 @@ class Bugtracker(callbacks.PluginRegexp): pass schedule.addPeriodicEvent(lambda: self.reportnewbugs(irc), 60, name=self.name()) self.shown = {} + self.nomailtime = 0 def is_ok(self, channel, tracker, bug): now = time.time() @@ -121,6 +122,15 @@ class Bugtracker(callbacks.PluginRegexp): if dir not in bugs: #print "Reloading info from %s" % dir bugs[dir] = {} + if dir.endswith('bugmail'): + if len(os.listdir(os.path.join(dir,'Maildir','new'))) == 0: + self.nomailtime += 1 + if self.nomailtime == 30: + irc.queueMsg(ircmsgs.privmsg(c,'WARNING: No bugmail received in 30 minutes. Please poke Seveas.')) + self.nomailtime = 0 + else: + #irc.queueMsg(ircmsgs.privmsg('#ubuntu-bots','Seveas: your lucky number is %d' % self.nomailtime)) + self.nomailtime = 0 for file in os.listdir(os.path.join(dir,'Maildir','new')): #print "Checking %s" % file fd = open(os.path.join(dir,'Maildir','new',file)) diff --git a/Encyclopedia/plugin_ng.py b/Encyclopedia/plugin_ng.py index c9fbfbc..afaa74f 100644 --- a/Encyclopedia/plugin_ng.py +++ b/Encyclopedia/plugin_ng.py @@ -395,10 +395,10 @@ aptcommand = """apt-cache\\ %%s %%s""" % tuple([aptdir]*4) aptfilecommand = """apt-file -s %s/%%s.list -c %s/apt-file/%%s -l -F search %%s""" % tuple([aptdir]*2) def findpkg(pkg,checkdists,filelookup=True): - _pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum or x in '.-']) + _pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum or x in '.-_']) distro = checkdists[0] if len(pkg.strip().split()) > 1: - distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum or x in '.-']) + distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum or x in '.-_']) if distro not in distros: distro = checkdists[0] pkg = _pkg @@ -420,10 +420,10 @@ def findpkg(pkg,checkdists,filelookup=True): return "Found: %s" % ', '.join(pkgs[:5]) def pkginfo(pkg,checkdists): - _pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum() or x in '.-']) + _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: - distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum() or x in '-.']) + distro = ''.join([x for x in pkg.strip().split(None,2)[1] if x.isalnum() or x in '-._']) if distro: if distro not in distros: checkdists = [checkdists[0]] diff --git a/TODO b/TODO index eedff84..0e9e646 100644 --- a/TODO +++ b/TODO @@ -3,6 +3,3 @@ Bantracker: Bugtracker: - Make sure to use reply.whenAddressedBy - -Encyclopedia: - - The list of search repos/default repo must be configurable per channel diff --git a/index.html b/index.html index d22245e..f77c2dd 100644 --- a/index.html +++ b/index.html @@ -26,6 +26,10 @@

Timezones

The bantracker

Factoid database

+

Raw data

+

Ubuntu database

+

gNewSense database

+

A collection of larts

©2006 Dennis Kaarsemaker