Remove all that code that was deprecated by the previous commit

master
sfan5 2014-06-22 12:32:15 +02:00
parent 499177069c
commit 4fb9723396
19 changed files with 134 additions and 277 deletions

View File

@ -34,10 +34,6 @@ for lib in libs:
setattr(env[lib], funcn, getattr(globals()[lib], funcn))
def c(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Nothing to calculate.")
q = input.group(2).encode('ascii', 'ignore')

View File

@ -132,10 +132,6 @@ def devwikipedia(term, language='en', last=False):
return sentence + ' - ' + (devwikiuri % (term))
def devwik(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
origterm = input.groups()[1]
if not origterm:
return phenny.say('Perhaps you meant "!devwik Zen"?')

View File

@ -63,10 +63,6 @@ def formatirc_user_a(arr):
return formartirc_user(arr[0],arr[1],arr[2],arr[3],arr[4],with_userid=True)
def search_forumuser(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
arg = input.group(2)
if not arg:
return phenny.reply("Give me a username")

View File

@ -1,9 +1,5 @@
def help(phenny, input):
"""Help command"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
phenny.say("https://github.com/sfan5/minetestbot-modules/blob/master/COMMANDS.md")
help.commands = ['help']

12
ping.py
View File

@ -8,29 +8,17 @@ About: http://inamidst.com/phenny/
import random
def hello(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
greeting = random.choice(('Hi', 'Hey', 'Hello', 'sup'))
punctuation = random.choice(('', '!', '.'))
phenny.say(greeting + ' ' + input.nick + punctuation)
hello.rule = r'(?i)(hi|hello|hey) $nickname[ \t]*$'
def interjection(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
phenny.say(input.nick + '!')
interjection.rule = r'$nickname!'
interjection.priority = 'high'
def l3(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
phenny.say('<3 ' + input.nick)
l3.rule = r'<3 $nickname'
l3.priority = 'low'

View File

@ -6,7 +6,7 @@ Copyright 2013, sfan5
import random
rainbowcolors = ["4", "7", "8", "3", "12", "6", "13"]
#TODO: make this rainbow better (can't really make it that better because IRC colors suck)
#maybe TODO: make this rainbow better (can't really make it that better because IRC colors suck)
def colorize(text):
out = ""
@ -25,10 +25,6 @@ def colorize(text):
return out
def rainbow(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
arg = input.group(2)
if not arg:
return phenny.say(colorize("Rainbow") + "\x03 What?")

View File

@ -46,6 +46,7 @@ def f_reload(phenny, input):
phenny.bind_commands()
phenny.reply('%r (version: %s)' % (module, modified))
f_reload.name = 'reload'
f_reload.rule = ('$nick', ['reload'], r'(\S+)?')
f_reload.priority = 'low'

View File

@ -122,10 +122,9 @@ def rsscheck(phenny, input):
rssnotify["dont_print_first_message"] = False
print("[RssNotify]: Checked " + str(len(feeds)) + " RSS Feeds in %0.3f seconds" % (end-start))
rsscheck.priority = 'high'
rsscheck.priority = 'medium'
rsscheck.rule = r'.*'
rsscheck.event = '*'
rsscheck.thread = True
if __name__ == '__main__':
print __doc__.strip()

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
rutils.py - Phenny Utility Module
Copyright 2012, Sfan5
Copyright 2012, sfan5
"""
import base64, binascii, re, random, time, multiprocessing, hashlib
@ -10,10 +10,6 @@ def rs(s):
def rev(phenny, input):
"""reverse string"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Nothing to reverse.")
q = input.group(2).encode('utf-8')
@ -28,10 +24,6 @@ rev.priority = 'low'
def b64e(phenny, input):
"""base64 encode"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Nothing to encode.")
q = input.group(2).encode('utf-8')
@ -45,10 +37,6 @@ b64e.priority = 'low'
def b64d(phenny, input):
"""base64 decode"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Nothing to decode.")
q = input.group(2).encode('utf-8')
@ -62,10 +50,6 @@ b64d.priority = 'low'
def b32e(phenny, input):
"""base32 encode"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Nothing to encode.")
q = input.group(2).encode('utf-8')
@ -79,10 +63,6 @@ b32e.priority = 'low'
def b32d(phenny, input):
"""base32 decode"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Nothing to decode.")
q = input.group(2).encode('utf-8')
@ -96,10 +76,6 @@ b32d.priority = 'low'
def b16e(phenny, input):
"""base16 encode"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Nothing to encode.")
q = input.group(2).encode('utf-8')
@ -126,10 +102,6 @@ b16d.priority = 'low'
def crc32(phenny, input):
"""crc32 hash"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Nothing to hash.")
q = input.group(2).encode('utf-8')
@ -140,10 +112,6 @@ crc32.commands = ['crc32']
crc32.priority = 'low'
def hash_(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Usage: hash <hash function> <text> | Get available hash funcs with ?")
hashfuncs = {
@ -167,10 +135,6 @@ hash_.priority = 'low'
def regex(phenny, input):
"""regex"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("Give me a regex and a message seperated by `")
q = input.group(2).encode('utf-8')
@ -204,10 +168,6 @@ regex.thread = True
def rand(phenny, input):
"""Returns a random number"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return
arg = input.group(2)

View File

@ -2,7 +2,7 @@
"""
search.py - Phenny Web Search Module
Copyright 2008-9, Sean B. Palmer, inamidst.com
Modified by Sfan5 2012
Modified by sfan5 2012
Licensed under the Eiffel Forum License 2.
http://inamidst.com/phenny/
@ -10,7 +10,7 @@ http://inamidst.com/phenny/
import web, re
search_badwords = ["porn","p0rn","pr0n","pron","redtube","sex","pussy","hot","weed","smoking","drug","penis","vagina"] #Thank KikaRz, LandMine and RagnarLaud for this
search_badwords = ["porn","p0rn","pr0n","pron","redtube","sex","pussy","weed","smoking","drug","penis","vagina"] # Thank KikaRz, LandMine and RagnarLaud for this
class Grab(web.urllib.URLopener):
def __init__(self, *args):
@ -58,10 +58,6 @@ def formatnumber(n):
def g(phenny, input):
"""Queries Google for the specified input."""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
query = input.group(2)
if not query:
return phenny.reply('.g what?')
@ -82,10 +78,6 @@ g.priority = 'high'
g.example = '.g minetest'
def gc(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
if not input.group(2):
return phenny.reply("No query term.")
query = input.group(2).encode('utf-8')

View File

@ -51,11 +51,7 @@ def pushupdate(sender, time, nick):
update_l.release()
def seen(phenny, input):
""".seen <nick> - Reports when <nick> was last seen."""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
"""seen <nick> - Reports when <nick> was last seen."""
nick = input.group(2)
if not nick:
return phenny.reply("Need a nickname to search for...")

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
"""
server.py - Phenny Minetest Server Module
Copyright 2013, Sfan5
Copyright 2013, sfan5
"""
import web, json, random
@ -174,11 +174,6 @@ def by_port(tbl, arg):
return results
def server(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
arg = input.group(2)
if not arg:
cfuncs = [by_random]

View File

@ -7,10 +7,6 @@ Copyright 2012, sfan5
import socket, time
def serverup(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
arg = input.group(2)
if not arg:
return phenny.reply("Give me a Server Address")

View File

@ -6,10 +6,6 @@ Copyright 2013, sfan5
import urllib
def shorten(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
arg = input.group(2)
if not arg:
arg = "" # Function continues and prints Help Message

View File

@ -15,10 +15,6 @@ import json
def rtfm(phenny, input):
"""Manual reference command"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return
if input.group(2):
u = input.group(2).strip() + ", "
else:
@ -29,10 +25,6 @@ rtfm.commands = ['rtfm']
def questions(phenny, input):
"""Ask smart questions"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return
if input.group(2):
u = input.group(2).strip() + ", "
else:
@ -43,10 +35,6 @@ questions.commands = ['questions']
def next(phenny, input):
"""Next one please"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return
phenny.say("Another satisfied customer. Next!")
next.commands = ['next']
@ -67,10 +55,6 @@ pil.commands = ['pil']
def git(phenny, input):
"""Git Manual link"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return
if input.group(2):
u = input.group(2).strip() + ", "
else:
@ -81,10 +65,6 @@ git.commands = ['git']
def stfu(phenny, input):
"""usage: !stfu [nick]"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return
if input.group(2):
u = input.group(2).strip() + ", "
else:
@ -95,10 +75,6 @@ stfu.commands = ['stfu']
def proc(phenny, input):
"""usage: !proc [nick]"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return
if input.group(2):
u = input.group(2).strip() + ", "
else:
@ -109,10 +85,6 @@ proc.commands = ['proc']
def doge(phenny, input):
"""much wow, very function, such programming"""
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return
if random.randint(0, 1) == 0:
f = urllib2.urlopen('http://pubapi.cryptsy.com/api.php?method=singlemarketdata&marketid=132')
data = f.read()
@ -143,5 +115,3 @@ def btc(phenny, input):
phenny.say('1 BTC = %.4f %s' % (data[currency]['15m'], data[currency]['symbol']))
btc.commands = ['btc']

View File

@ -31,10 +31,6 @@ def tell_diskwr():
tell_pending = []
def tell(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
arg = input.group(2)
if not arg:
return phenny.reply("Need a nickname...")

View File

@ -13,10 +13,6 @@ import re, urllib2, urlparse
r_title = re.compile(r'(?ims)<title[^>]*>(.*?)</title\s*>')
def f_title(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
uri = input.group(2)
uri = (uri or '').encode('utf-8')

View File

@ -2,7 +2,7 @@
"""
twitter.py - Phenny Twitter Module
Copyright 2012, Sean B. Palmer, inamidst.com
Modified by Sfan5 2012
Modified by sfan5 2012
Licensed under the Eiffel Forum License 2.
http://inamidst.com/phenny/
@ -69,10 +69,6 @@ def id_tweet(tid):
return "Sorry, couldn't get a tweet from %s" % link
def twitter(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
arg = input.group(2)
if not arg:
return phenny.reply("Give me a link, a @username, or a tweet id")

View File

@ -2,7 +2,7 @@
"""
wiki.py - Phenny Wiki Module
Copyright 2008-9, Sean B. Palmer, inamidst.com
Modified by Sfan5 2013
Modified by sfan5 2013
Licensed under the Eiffel Forum License 2.
http://inamidst.com/phenny/
@ -132,10 +132,6 @@ def wikipedia(term, language='en', last=False):
return sentence + ' - ' + (wikiuri % (term))
def wik(phenny, input):
for x in phenny.bot.commands["high"].values():
if x[0].__name__ == "aa_hook":
if x[0](phenny, input):
return # Abort function
origterm = input.groups()[1]
if not origterm:
return phenny.say('Perhaps you meant "!wik Zen"?')