Blablabla
This commit is contained in:
parent
19d13cc640
commit
ead8584fcc
|
@ -109,7 +109,7 @@ class Bugtracker(callbacks.PluginRegexp):
|
||||||
|
|
||||||
def reportnewbugs(self,irc):
|
def reportnewbugs(self,irc):
|
||||||
# Compile list of bugs
|
# Compile list of bugs
|
||||||
print "Reporting new bugs"
|
#print "Reporting new bugs"
|
||||||
tracker = self.db['malone']
|
tracker = self.db['malone']
|
||||||
bugs = {}
|
bugs = {}
|
||||||
fixed = {}
|
fixed = {}
|
||||||
|
@ -117,12 +117,12 @@ class Bugtracker(callbacks.PluginRegexp):
|
||||||
dir = self.registryValue('bugReporter', channel=c)
|
dir = self.registryValue('bugReporter', channel=c)
|
||||||
if not dir:
|
if not dir:
|
||||||
continue
|
continue
|
||||||
print "Reporting in %s (%s)" % (c, dir)
|
#print "Reporting in %s (%s)" % (c, dir)
|
||||||
if dir not in bugs:
|
if dir not in bugs:
|
||||||
print "Reloading info from %s" % dir
|
#print "Reloading info from %s" % dir
|
||||||
bugs[dir] = {}
|
bugs[dir] = {}
|
||||||
for file in os.listdir(os.path.join(dir,'Maildir','new')):
|
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))
|
fd = open(os.path.join(dir,'Maildir','new',file))
|
||||||
_data = fd.readlines()
|
_data = fd.readlines()
|
||||||
fd.close()
|
fd.close()
|
||||||
|
@ -142,7 +142,7 @@ class Bugtracker(callbacks.PluginRegexp):
|
||||||
if component == 'None':
|
if component == 'None':
|
||||||
component = ''
|
component = ''
|
||||||
if line.startswith('Reply-To:'):
|
if line.startswith('Reply-To:'):
|
||||||
print line
|
#print line
|
||||||
try:
|
try:
|
||||||
bug = int(line.split()[2])
|
bug = int(line.split()[2])
|
||||||
try:
|
try:
|
||||||
|
@ -150,7 +150,7 @@ class Bugtracker(callbacks.PluginRegexp):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
if bug > 58184 and not os.path.exists(os.path.join(dir,str(int(bug/1000)),str(bug))):
|
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 = open(os.path.join(dir,str(int(bug/1000)),str(bug)),'w')
|
||||||
fd2.close()
|
fd2.close()
|
||||||
if bug not in bugs[dir]:
|
if bug not in bugs[dir]:
|
||||||
|
@ -160,12 +160,12 @@ class Bugtracker(callbacks.PluginRegexp):
|
||||||
else:
|
else:
|
||||||
bugs[dir][bug] = self.get_bug(tracker, bug)
|
bugs[dir][bug] = self.get_bug(tracker, bug)
|
||||||
except:
|
except:
|
||||||
print "Unable to get bug %d" % b
|
#print "Unable to get bug %d" % b
|
||||||
except:
|
except:
|
||||||
#raise
|
#raise
|
||||||
pass # Ignore errors. Iz wrong mail
|
pass # Ignore errors. Iz wrong mail
|
||||||
break
|
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
|
# Now show them
|
||||||
for b in sorted(bugs[dir].keys()):
|
for b in sorted(bugs[dir].keys()):
|
||||||
irc.queueMsg(ircmsgs.privmsg(c,'New bug: #%s' % bugs[dir][b][bugs[dir][b].find('bug ')+4:]))
|
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
|
return s
|
||||||
|
|
||||||
url = "%s/%05d" % (self.url, id)
|
url = "%s/%05d" % (self.url, id)
|
||||||
print url
|
#print url
|
||||||
try:
|
try:
|
||||||
bugdata = utils.web.getUrl(url)
|
bugdata = utils.web.getUrl(url)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
|
@ -36,7 +36,6 @@ class FactoidSet:
|
||||||
|
|
||||||
msgcache = {}
|
msgcache = {}
|
||||||
def queue(irc, to, msg):
|
def queue(irc, to, msg):
|
||||||
print "Message to %s: %s" % (to, msg)
|
|
||||||
now = time.time()
|
now = time.time()
|
||||||
for m in msgcache.keys():
|
for m in msgcache.keys():
|
||||||
if msgcache[m] < now - 30:
|
if msgcache[m] < now - 30:
|
||||||
|
@ -84,7 +83,6 @@ class Encyclopedia(callbacks.Plugin):
|
||||||
|
|
||||||
def _checkdists(self, channel):
|
def _checkdists(self, channel):
|
||||||
cd = self.registryValue('searchorder', channel=channel)
|
cd = self.registryValue('searchorder', channel=channel)
|
||||||
print cd
|
|
||||||
return cd.split()
|
return cd.split()
|
||||||
|
|
||||||
def moderators(self, irc, msg, args):
|
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))
|
data = commands.getoutput(aptcommand % (distro, distro, distro, 'search -n', pkg))
|
||||||
if not data:
|
if not data:
|
||||||
if filelookup:
|
if filelookup:
|
||||||
#print aptfilecommand % (distro, distro, pkg)
|
|
||||||
data = commands.getoutput(aptfilecommand % (distro, distro, pkg)).split()
|
data = commands.getoutput(aptfilecommand % (distro, distro, pkg)).split()
|
||||||
if data:
|
if data:
|
||||||
if len(data) > 5:
|
if len(data) > 5:
|
||||||
|
@ -423,7 +420,6 @@ def findpkg(pkg,checkdists,filelookup=True):
|
||||||
return "Found: %s" % ', '.join(pkgs[:5])
|
return "Found: %s" % ', '.join(pkgs[:5])
|
||||||
|
|
||||||
def pkginfo(pkg,checkdists):
|
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 '.-'])
|
_pkg = ''.join([x for x in pkg.strip().split(None,1)[0] if x.isalnum() or x in '.-'])
|
||||||
distro = None
|
distro = None
|
||||||
if len(pkg.strip().split()) > 1:
|
if len(pkg.strip().split()) > 1:
|
||||||
|
@ -434,7 +430,6 @@ def pkginfo(pkg,checkdists):
|
||||||
else:
|
else:
|
||||||
checkdists = [distro]
|
checkdists = [distro]
|
||||||
pkg = _pkg
|
pkg = _pkg
|
||||||
print pkg, checkdists
|
|
||||||
|
|
||||||
for distro in checkdists:
|
for distro in checkdists:
|
||||||
data = commands.getoutput(aptcommand % (distro, distro, distro, 'show', pkg))
|
data = commands.getoutput(aptcommand % (distro, distro, distro, 'show', pkg))
|
||||||
|
@ -449,7 +444,6 @@ def pkginfo(pkg,checkdists):
|
||||||
parser = FeedParser.FeedParser()
|
parser = FeedParser.FeedParser()
|
||||||
parser.feed(p)
|
parser.feed(p)
|
||||||
p = parser.close()
|
p = parser.close()
|
||||||
print p, p['Version']
|
|
||||||
if apt_pkg.VersionCompare(maxp['Version'], p['Version']) < 0:
|
if apt_pkg.VersionCompare(maxp['Version'], p['Version']) < 0:
|
||||||
maxp = p
|
maxp = p
|
||||||
del parser
|
del parser
|
||||||
|
|
|
@ -12,6 +12,8 @@ _42file = '/home/dennis/ubugtu/plugins/Mess/42.txt'
|
||||||
_42data = [x.strip() for x in open(_42file).readlines()]
|
_42data = [x.strip() for x in open(_42file).readlines()]
|
||||||
_ballfile = '/home/dennis/ubugtu/plugins/Mess/ball.txt'
|
_ballfile = '/home/dennis/ubugtu/plugins/Mess/ball.txt'
|
||||||
_balldata = [x.strip() for x in open(_ballfile).readlines()]
|
_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):
|
class Mess(callbacks.PluginRegexp):
|
||||||
"""Random Mess plugin"""
|
"""Random Mess plugin"""
|
||||||
|
@ -195,6 +197,15 @@ class Mess(callbacks.PluginRegexp):
|
||||||
#else:
|
#else:
|
||||||
i = random.randint(0,len(_42data)-1)
|
i = random.randint(0,len(_42data)-1)
|
||||||
irc.reply(_42data[i])
|
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):
|
def ball(self, irc, msg, match):
|
||||||
"""^magic 8ball.*\?$"""
|
"""^magic 8ball.*\?$"""
|
||||||
|
@ -249,9 +260,19 @@ class Mess(callbacks.PluginRegexp):
|
||||||
data = data[data.find('<font'):data.find('</font')]
|
data = data[data.find('<font'):data.find('</font')]
|
||||||
while '<' in data:
|
while '<' in data:
|
||||||
data = data[:data.find('<')] + data[data.find('>')+1:]
|
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)
|
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):
|
def _bauer(self,count=0):
|
||||||
# if self.i % 2 == 0:
|
# if self.i % 2 == 0:
|
||||||
# (url, re) = self.jre1
|
# (url, re) = self.jre1
|
||||||
|
@ -291,7 +312,6 @@ class Mess(callbacks.PluginRegexp):
|
||||||
val = re.sub(r'\s+', ' ', val).strip()
|
val = re.sub(r'\s+', ' ', val).strip()
|
||||||
while self.entre.search(val):
|
while self.entre.search(val):
|
||||||
entity = self.entre.search(val).group(1)
|
entity = self.entre.search(val).group(1)
|
||||||
print entity
|
|
||||||
if entity in entities:
|
if entity in entities:
|
||||||
val = self.entre.sub(entities[entity], val)
|
val = self.entre.sub(entities[entity], val)
|
||||||
else:
|
else:
|
||||||
|
@ -316,7 +336,6 @@ class Mess(callbacks.PluginRegexp):
|
||||||
val = re.sub(r'\s+', ' ', val).strip()
|
val = re.sub(r'\s+', ' ', val).strip()
|
||||||
while self.entre.search(val):
|
while self.entre.search(val):
|
||||||
entity = self.entre.search(val).group(1)
|
entity = self.entre.search(val).group(1)
|
||||||
print entity
|
|
||||||
if entity in entities:
|
if entity in entities:
|
||||||
val = self.entre.sub(entities[entity], val)
|
val = self.entre.sub(entities[entity], val)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue