diff --git a/ASCII/DejaVu.ttf b/IRCArt/DejaVu.ttf similarity index 100% rename from ASCII/DejaVu.ttf rename to IRCArt/DejaVu.ttf diff --git a/ASCII/README.md b/IRCArt/README.md similarity index 100% rename from ASCII/README.md rename to IRCArt/README.md diff --git a/ASCII/__init__.py b/IRCArt/__init__.py similarity index 92% rename from ASCII/__init__.py rename to IRCArt/__init__.py index 9bd20a2..1386956 100644 --- a/ASCII/__init__.py +++ b/IRCArt/__init__.py @@ -6,7 +6,7 @@ ### """ -ASCII: Uses API to retrieve information +IRCArt: Make IRC Art """ import supybot diff --git a/ASCII/config.py b/IRCArt/config.py similarity index 73% rename from ASCII/config.py rename to IRCArt/config.py index 76eb737..1e7a080 100644 --- a/ASCII/config.py +++ b/IRCArt/config.py @@ -9,7 +9,7 @@ import supybot.conf as conf import supybot.registry as registry try: from supybot.i18n import PluginInternationalization - _ = PluginInternationalization('ASCII') + _ = PluginInternationalization('IRCArt') except: # Placeholder that allows to run the plugin on a bot # without the i18n module @@ -22,45 +22,45 @@ def configure(advanced): # user or not. You should effect your configuration by manipulating the # registry as appropriate. from supybot.questions import expect, anything, something, yn - conf.registerPlugin('ASCII', True) + conf.registerPlugin('IRCArt', True) -ASCII = conf.registerPlugin('ASCII') +IRCArt = conf.registerPlugin('IRCArt') -conf.registerGlobalValue(ASCII, 'pasteAPI', +conf.registerGlobalValue(IRCArt, 'pasteAPI', registry.String('', _("""Paste.ee API Key"""))) -conf.registerGlobalValue(ASCII, 'imgurAPI', +conf.registerGlobalValue(IRCArt, 'imgurAPI', registry.String('', _("""Imgur Client ID"""))) -conf.registerChannelValue(ASCII, 'pasteEnable', +conf.registerChannelValue(IRCArt, 'pasteEnable', registry.Boolean(False, _("""Turns on and off paste.ee support"""))) -conf.registerChannelValue(ASCII, 'delay', +conf.registerChannelValue(IRCArt, 'delay', registry.Float(1.0, _("""Set the time delay betwen lines. Not currently implemented."""))) -conf.registerChannelValue(ASCII, 'quantize', +conf.registerChannelValue(IRCArt, 'quantize', registry.Boolean(False, _("""Enable quantizing to 256 colors before rendering. Results in much faster rendering at a slight decrease in quality. Default: False"""))) -conf.registerChannelValue(ASCII, 'resize', +conf.registerChannelValue(IRCArt, 'resize', registry.Integer(3, _("""Set the resize algorithm. 0 = nearest, 1 = lanczos, 2 = bilinear, 3 = bicubic, 4 = box, 5 = hamming"""))) -conf.registerChannelValue(ASCII, 'speed', +conf.registerChannelValue(IRCArt, 'speed', registry.String('Slow', _("""Set the speed of the color rendering. 'Slow' (default) to use CIEDE2000 color difference. 'Fast' to use Euclidean color difference."""))) -conf.registerChannelValue(ASCII, 'imgDefault', +conf.registerChannelValue(IRCArt, 'imgDefault', registry.String('1/2', _("""Set the default art type for the img command. Options are 'ascii', '1/2' (default), '1/4', 'block', and 'no-color'"""))) -conf.registerChannelValue(ASCII, 'asciiWidth', +conf.registerChannelValue(IRCArt, 'asciiWidth', registry.Integer(100, _("""Set the default column width for ascii art images"""))) -conf.registerChannelValue(ASCII, 'blockWidth', +conf.registerChannelValue(IRCArt, 'blockWidth', registry.Integer(80, _("""Set the default column width for 1/2 and 1/4 block art images"""))) -conf.registerChannelValue(ASCII, 'colors', +conf.registerChannelValue(IRCArt, 'colors', registry.Integer(99, _("""Set the default number of colors to use. Options are 16 for colors 0-15 only, 83 for colors 16-98 only, and 99 (default) to use all available colors"""))) -conf.registerChannelValue(ASCII, 'fg', +conf.registerChannelValue(IRCArt, 'fg', registry.Integer(99, _("""Set the default foreground color for ascii art images. 0-98. 99 is disabled (default)"""))) -conf.registerChannelValue(ASCII, 'bg', +conf.registerChannelValue(IRCArt, 'bg', registry.Integer(99, _("""Set the default background color for ascii art images. 0-98. 99 is disabled (default)"""))) diff --git a/ASCII/plugin.py b/IRCArt/plugin.py similarity index 96% rename from ASCII/plugin.py rename to IRCArt/plugin.py index 2158b51..b583467 100644 --- a/ASCII/plugin.py +++ b/IRCArt/plugin.py @@ -28,18 +28,18 @@ from bs4 import BeautifulSoup try: from supybot.i18n import PluginInternationalization - _ = PluginInternationalization('Weed') + _ = PluginInternationalization('IRCArt') except ImportError: # Placeholder that allows to run the plugin on a bot # without the i18n module _ = lambda x: x -class ASCII(callbacks.Plugin): - """Uses API to retrieve information""" +class IRCArt(callbacks.Plugin): + """IRCArt: Make IRC Art""" threaded = True def __init__(self, irc): - self.__parent = super(ASCII, self) + self.__parent = super(IRCArt, self) self.__parent.__init__(irc) self.colors = 99 self.stopped = {} @@ -711,9 +711,9 @@ class ASCII(callbacks.Plugin): irc.reply(uploaded_image.link, noLengthCheck=True, private=False, notice=False) png = wrap(png, [getopts({'bg':'int', 'fg':'int'}), ('text')]) - def ascii(self, irc, msg, args, channel, optlist, text): + def artii(self, irc, msg, args, channel, optlist, text): """[] [--font ] [--color ] [] - Text to ASCII art + Text to ASCII figlet fonts using the artii API """ if not channel: channel = msg.args[0] @@ -765,11 +765,11 @@ class ASCII(callbacks.Plugin): if line.strip(): irc.reply(ircutils.mircColor(line, color1, color2), prefixNick=False, private=False, notice=False, to=channel) - ascii = wrap(ascii, [optional('channel'), getopts({'font':'text', 'color':'text'}), ('text')]) + artii = wrap(artii, [optional('channel'), getopts({'font':'text', 'color':'text'}), ('text')]) def fontlist(self, irc, msg, args): """ - get list of fonts for text-to-ascii-art + Get list of artii figlet fonts. """ fontlist = requests.get("https://artii.herokuapp.com/fonts_list") response = sorted(fontlist.text.split('\n')) @@ -778,7 +778,7 @@ class ASCII(callbacks.Plugin): def img(self, irc, msg, args, channel, optlist, url): """[<#channel>] [--delay #.#] [--w <###>] [--s <#.#] [--16] [--99] [--83] [--ascii] [--block] [--1/2] [--chars ] [--ramp ] [--bg <0-98>] [--fg <0-98>] [--no-color] [--invert] - Image to ASCII Art. + Image to IRC art. --w columns. --s saturation (1.0). --16 colors 0-15. @@ -1112,7 +1112,7 @@ class ASCII(callbacks.Plugin): def scroll(self, irc, msg, args, channel, optlist, url): """[] [--delay] - Play ASCII/ANSI art text files from web links. + Play IRC art files from web links. """ if not channel: channel = msg.args[0] @@ -1364,7 +1364,7 @@ class ASCII(callbacks.Plugin): def toilet(self, irc, msg, args, channel, optlist, text): """[] [--f fontname] [--F filter1,filter2,etc.] [--w] [--delay] - Toilet. -f to select font. -F to select filters. Separate multiple filters with a comma. + Text to toilet figlets. -f to select font. -F to select filters. Separate multiple filters with a comma. """ if not channel: channel = msg.args[0] @@ -1449,7 +1449,7 @@ class ASCII(callbacks.Plugin): def wttr(self, irc, msg, args, channel, optlist, location): """[] [--16] [--99] - ASCII weather report from wttr.in for . + IRC art weather report from wttr.in for . --16 for 16 colors (default). --99 for 99 colors. Get moon phase with 'wttr moon'. @@ -1592,7 +1592,7 @@ class ASCII(callbacks.Plugin): def fortune(self, irc, msg, args, channel, optlist): """[] - Returns a random ASCII from http://www.asciiartfarts.com/fortune.txt + Returns random art fortune from http://www.asciiartfarts.com/fortune.txt """ if not channel: channel = msg.args[0] @@ -1658,4 +1658,4 @@ class ASCII(callbacks.Plugin): irc.reply("Stopping.") cq = wrap(cq) -Class = ASCII +Class = IRCArt diff --git a/ASCII/requirements.txt b/IRCArt/requirements.txt similarity index 100% rename from ASCII/requirements.txt rename to IRCArt/requirements.txt diff --git a/ASCII/test.py b/IRCArt/test.py similarity index 62% rename from ASCII/test.py rename to IRCArt/test.py index b545906..5cb33d4 100644 --- a/ASCII/test.py +++ b/IRCArt/test.py @@ -11,7 +11,7 @@ from supybot.test import * class AdviceTestCase(PluginTestCase): - plugins = ('ASCII',) + plugins = ('IRCArt',) # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: \ No newline at end of file diff --git a/ASCII/tmp/.gitignore b/IRCArt/tmp/.gitignore similarity index 100% rename from ASCII/tmp/.gitignore rename to IRCArt/tmp/.gitignore