mirror of
https://github.com/oddluck/limnoria-plugins.git
synced 2025-04-25 12:31:07 -05:00
IRCArt -> TextArt
This commit is contained in:
parent
b896f2672e
commit
1cf52fd379
@ -1,17 +0,0 @@
|
||||
|
||||
17 lines (10 sloc) 216 Bytes
|
||||
###
|
||||
# Copyright (c) 2019, oddluck
|
||||
# All rights reserved.
|
||||
#
|
||||
#
|
||||
###
|
||||
|
||||
from supybot.test import *
|
||||
|
||||
|
||||
class AdviceTestCase(PluginTestCase):
|
||||
plugins = ('IRCArt',)
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
@ -4,7 +4,7 @@
|
||||
Try the plugin out in #ircart on EFnet. irc://irc.efnet.org/#ircart
|
||||
|
||||
|
||||
<b>IRCArt Plugin</b><br>
|
||||
<b>TextArt Plugin</b><br>
|
||||
Convert text to figlet fonts or image URLs to ASCII/ANSI art. Covert IRC art to PNG. Get weather, moon phase, and cryptocurrecy rates.
|
||||
|
||||
Requires Limnoria https://github.com/ProgVal/Limnoria and Python3
|
@ -1,12 +1,12 @@
|
||||
###
|
||||
# Copyright (c) 2019 oddluck
|
||||
# Copyright (c) 2020 oddluck
|
||||
# All rights reserved.
|
||||
#
|
||||
#
|
||||
###
|
||||
|
||||
"""
|
||||
IRCArt: Make IRC Art
|
||||
TextArt: Make IRC Art
|
||||
"""
|
||||
|
||||
import supybot
|
@ -1,5 +1,5 @@
|
||||
###
|
||||
# Copyright (c) 2019, oddluck
|
||||
# Copyright (c) 2020, oddluck
|
||||
# All rights reserved.
|
||||
#
|
||||
#
|
||||
@ -9,7 +9,7 @@ import supybot.conf as conf
|
||||
import supybot.registry as registry
|
||||
try:
|
||||
from supybot.i18n import PluginInternationalization
|
||||
_ = PluginInternationalization('IRCArt')
|
||||
_ = PluginInternationalization('TextArt')
|
||||
except:
|
||||
# Placeholder that allows to run the plugin on a bot
|
||||
# without the i18n module
|
||||
@ -22,48 +22,48 @@ 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('IRCArt', True)
|
||||
conf.registerPlugin('TextArt', True)
|
||||
|
||||
IRCArt = conf.registerPlugin('IRCArt')
|
||||
TextArt = conf.registerPlugin('TextArt')
|
||||
|
||||
conf.registerGlobalValue(IRCArt, 'pasteAPI',
|
||||
conf.registerGlobalValue(TextArt, 'pasteAPI',
|
||||
registry.String('', _("""Paste.ee API Key""")))
|
||||
|
||||
conf.registerGlobalValue(IRCArt, 'imgurAPI',
|
||||
conf.registerGlobalValue(TextArt, 'imgurAPI',
|
||||
registry.String('', _("""Imgur Client ID""")))
|
||||
|
||||
conf.registerChannelValue(IRCArt, 'pasteEnable',
|
||||
conf.registerChannelValue(TextArt, 'pasteEnable',
|
||||
registry.Boolean(False, _("""Turns on and off paste.ee support""")))
|
||||
|
||||
conf.registerChannelValue(IRCArt, 'showStats',
|
||||
conf.registerChannelValue(TextArt, 'showStats',
|
||||
registry.Boolean(False, _("""Turns on and off showing render stats.""")))
|
||||
|
||||
conf.registerChannelValue(IRCArt, 'delay',
|
||||
conf.registerChannelValue(TextArt, 'delay',
|
||||
registry.Float(1.0, _("""Set the time delay betwen lines. Not currently implemented.""")))
|
||||
|
||||
conf.registerChannelValue(IRCArt, 'quantize',
|
||||
conf.registerChannelValue(TextArt, '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(IRCArt, 'resize',
|
||||
conf.registerChannelValue(TextArt, 'resize',
|
||||
registry.Integer(3, _("""Set the resize algorithm. 0 = nearest, 1 = lanczos, 2 = bilinear, 3 = bicubic, 4 = box, 5 = hamming""")))
|
||||
|
||||
conf.registerChannelValue(IRCArt, 'speed',
|
||||
conf.registerChannelValue(TextArt, '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(IRCArt, 'imgDefault',
|
||||
conf.registerChannelValue(TextArt, '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(IRCArt, 'asciiWidth',
|
||||
conf.registerChannelValue(TextArt, 'asciiWidth',
|
||||
registry.Integer(100, _("""Set the default column width for ascii art images""")))
|
||||
|
||||
conf.registerChannelValue(IRCArt, 'blockWidth',
|
||||
conf.registerChannelValue(TextArt, 'blockWidth',
|
||||
registry.Integer(80, _("""Set the default column width for 1/2 and 1/4 block art images""")))
|
||||
|
||||
conf.registerChannelValue(IRCArt, 'colors',
|
||||
conf.registerChannelValue(TextArt, '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(IRCArt, 'fg',
|
||||
conf.registerChannelValue(TextArt, 'fg',
|
||||
registry.Integer(99, _("""Set the default foreground color for ascii art images. 0-98. 99 is disabled (default)""")))
|
||||
|
||||
conf.registerChannelValue(IRCArt, 'bg',
|
||||
conf.registerChannelValue(TextArt, 'bg',
|
||||
registry.Integer(99, _("""Set the default background color for ascii art images. 0-98. 99 is disabled (default)""")))
|
@ -1,5 +1,5 @@
|
||||
###
|
||||
# Copyright (c) 2019 oddluck
|
||||
# Copyright (c) 2020 oddluck
|
||||
# All rights reserved.
|
||||
#
|
||||
#
|
||||
@ -34,12 +34,12 @@ except ImportError:
|
||||
# without the i18n module
|
||||
_ = lambda x: x
|
||||
|
||||
class IRCArt(callbacks.Plugin):
|
||||
"""IRCArt: Make IRC Art"""
|
||||
class TextArt(callbacks.Plugin):
|
||||
"""TextArt: Make Text Art"""
|
||||
threaded = True
|
||||
|
||||
def __init__(self, irc):
|
||||
self.__parent = super(IRCArt, self)
|
||||
self.__parent = super(TextArt, self)
|
||||
self.__parent.__init__(irc)
|
||||
self.colors = 99
|
||||
self.stopped = {}
|
||||
@ -1681,4 +1681,4 @@ class IRCArt(callbacks.Plugin):
|
||||
irc.reply("\x031,8888\x031,8989\x031,9090\x031,9191\x031,9292\x031,9393\x031,9494\x031,9595\x031,9696\x031,9797\x031,9898\x031,9999", prefixNick=False)
|
||||
codes = wrap(codes)
|
||||
|
||||
Class = IRCArt
|
||||
Class = TextArt
|
15
TextArt/test.py
Normal file
15
TextArt/test.py
Normal file
@ -0,0 +1,15 @@
|
||||
###
|
||||
# Copyright (c) 2020, oddluck
|
||||
# All rights reserved.
|
||||
#
|
||||
#
|
||||
###
|
||||
|
||||
from supybot.test import *
|
||||
|
||||
|
||||
class AdviceTestCase(PluginTestCase):
|
||||
plugins = ('TextArt',)
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
|
Loading…
x
Reference in New Issue
Block a user