More fixes\!\!
This commit is contained in:
@ -294,7 +294,6 @@ class Bugtracker(callbacks.PluginRegexp):
|
||||
|
||||
# Get tracker name
|
||||
bugids = match.group('bug')
|
||||
print bugids
|
||||
reps = ((' ',''),('#',''),('and',','),('en',','),('et',','),('und',','),('ir',','))
|
||||
for r in reps:
|
||||
bugids = bugids.replace(r[0],r[1])
|
||||
|
@ -35,6 +35,8 @@ conf.registerChannelValue(Encyclopedia, 'searchorder',
|
||||
registry.String('','Distro search order'))
|
||||
|
||||
conf.registerGlobalValue(Encyclopedia, 'datadir',
|
||||
registry.String('', 'Path to dir containing factoid databases'))
|
||||
registry.String('', 'Path to dir containing factoid databases',private=True))
|
||||
conf.registerGlobalValue(Encyclopedia, 'aptdir',
|
||||
registry.String('', 'Path to apt cache directory'))
|
||||
registry.String('', 'Path to apt cache directory',private=True))
|
||||
conf.registerGlobalValue(Encyclopedia, 'alert',
|
||||
registry.String('ops','factoid name used for alerts'))
|
||||
|
@ -303,7 +303,7 @@ class Encyclopedia(callbacks.Plugin):
|
||||
(msg.args[0], msg.nick, msg.args[1])))
|
||||
return
|
||||
ret = self.factoid_edit(text, channel, msg.prefix)
|
||||
elif ' is ' in text and '|' not in text:
|
||||
elif ' is ' in text and '|' not in text and '>' not in text:
|
||||
if not capab(msg.prefix, 'editfactoids'):
|
||||
if len(text[:text.find('is')]) > 15:
|
||||
irc.error("I am only a bot, please don't think I'm intelligent :)")
|
||||
@ -316,6 +316,10 @@ class Encyclopedia(callbacks.Plugin):
|
||||
ret = self.factoid_add(text, channel, msg.prefix)
|
||||
else:
|
||||
text, target, retmsg = self.get_target(msg.nick, orig_text, target)
|
||||
if text.startswith('bug ') and text != ('bug 1'):
|
||||
return
|
||||
if text == self.registryValue('alert') and msg.args[0][0] == '#':
|
||||
msg.tag('alert')
|
||||
ret = self.factoid_lookup(text, channel, display_info)
|
||||
|
||||
# Fall through to package lookup
|
||||
@ -325,10 +329,10 @@ class Encyclopedia(callbacks.Plugin):
|
||||
ret = self.Apt.info(text[5:].strip(),self.registryValue('searchorder', channel).split())
|
||||
elif text.startswith('find '):
|
||||
ret = self.Apt.find(text[5:].strip(),self.registryValue('searchorder', channel).split())
|
||||
else:
|
||||
ret = self.Apt.info(text.strip(),self.registryValue('searchorder', channel).split())
|
||||
if ret.startswith('Package'):
|
||||
ret = None
|
||||
#else:
|
||||
# ret = self.Apt.info(text.strip(),self.registryValue('searchorder', channel).split())
|
||||
# if ret.startswith('Package'):
|
||||
# ret = None
|
||||
|
||||
if not ret:
|
||||
if len(text) > 15:
|
||||
@ -342,6 +346,9 @@ class Encyclopedia(callbacks.Plugin):
|
||||
queue(irc, target, retmsg + ret)
|
||||
else:
|
||||
queue(irc, target, retmsg + ret[0])
|
||||
if msg.tagged('alert'):
|
||||
queue(irc, self.registryValue('relayChannel'), '%s called the ops in %s' % (msg.nick, msg.args[0]))
|
||||
queue(irc, self.registryValue('relayChannel'), retmsg + ret[0])
|
||||
for r in ret[1:]:
|
||||
queue(irc, target, r)
|
||||
|
||||
@ -423,7 +430,6 @@ class Encyclopedia(callbacks.Plugin):
|
||||
ret = self.check_aliases(channel, factoid)
|
||||
if ret:
|
||||
return ret
|
||||
print("UPDATE facts SET value=%s where name=%s", (factoid.value,factoid.name))
|
||||
cs.execute("UPDATE facts SET value=%s where name=%s", (factoid.value,factoid.name))
|
||||
db.commit()
|
||||
return retmsg
|
||||
|
@ -13,6 +13,7 @@ import supybot.ircmsgs as ircmsgs
|
||||
import supybot.callbacks as callbacks
|
||||
import supybot.ircdb as ircdb
|
||||
import supybot.conf as conf
|
||||
import supybot.schedule as schedule
|
||||
import random, os
|
||||
|
||||
class LpLogin(callbacks.Plugin):
|
||||
@ -22,6 +23,14 @@ class LpLogin(callbacks.Plugin):
|
||||
|
||||
def __init__(self, irc):
|
||||
callbacks.Plugin.__init__(self, irc)
|
||||
try:
|
||||
schedule.removeEvent(self.name() + '.nickreload')
|
||||
except:
|
||||
pass
|
||||
# Reload every 6 hours
|
||||
schedule.addPeriodicEvent(lambda: self.reportnewbugs(irc), 60*60*6, name=self.name() + '.nickreload')
|
||||
|
||||
def loadnicks(self):
|
||||
uf = self.registryValue('UserList')
|
||||
if not uf or not os.path.exists(uf):
|
||||
self.log.info('Not loading non-existant userlist')
|
||||
@ -32,7 +41,7 @@ class LpLogin(callbacks.Plugin):
|
||||
knownusers = [x.lower() for x in users.split() if x]
|
||||
self.knownusers = knownusers
|
||||
allusers = [u.name.lower() for u in ircdb.users.itervalues()]
|
||||
print knownusers, allusers
|
||||
#print knownusers, allusers
|
||||
|
||||
if self.registryValue('DeleteUnknowns'):
|
||||
to_delete = [x for x in allusers if x not in knownusers and not
|
||||
|
@ -120,7 +120,7 @@ class Webcal(callbacks.Plugin):
|
||||
if not events:
|
||||
return False
|
||||
ev0 = events[0]
|
||||
print now, ev0.startDate, ev0.endDate
|
||||
#print now, ev0.startDate, ev0.endDate
|
||||
delta = abs(ev0.startDate - now)
|
||||
if ev0.startDate < now and delta.seconds > 10 * 5:
|
||||
return True
|
||||
|
Reference in New Issue
Block a user