Initial commit.

This commit is contained in:
oddluck 2019-12-05 09:54:21 +00:00
parent 4c5a89f8ef
commit dbe9879f42
7 changed files with 17 additions and 13 deletions

View File

@ -6,7 +6,7 @@
###
"""
Soccer: Fetches soccer scores and other information
SoccerScores: Fetches soccer scores and other information
"""
import sys
@ -18,14 +18,17 @@ from supybot import world
__version__ = ""
# XXX Replace this with an appropriate author or supybot.Author instance.
__author__ = supybot.authors.unknown
__author__ = supybot.Author('cottongin', 'cottongin',
'cottongin@cottongin.club')
__maintainer__ = getattr(supybot.authors, 'oddluck',
supybot.Author('oddluck', 'oddluck', 'oddluck@riseup.net'))
# This is a dictionary mapping supybot.Author instances to lists of
# contributions.
__contributors__ = {}
# This is a url where the most recent plugin package can be downloaded.
__url__ = ''
__url__ = 'https://github.com/oddluck/limnoria-plugins/'
from . import config
from . import plugin

View File

@ -8,7 +8,7 @@
from supybot import conf, registry
try:
from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('Soccer')
_ = PluginInternationalization('SoccerScores')
except:
# Placeholder that allows to run the plugin on a bot
# without the i18n module
@ -21,10 +21,10 @@ 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('Soccer', True)
conf.registerPlugin('SoccerScores', True)
Soccer = conf.registerPlugin('Soccer')
Soccer = conf.registerPlugin('SoccerScores')
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(Soccer, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))

View File

@ -11,7 +11,7 @@ from supybot import utils, plugins, ircutils, callbacks, schedule, conf
from supybot.commands import *
try:
from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('Soccer')
_ = PluginInternationalization('SoccerScores')
except ImportError:
# Placeholder that allows to run the plugin on a bot
# without the i18n module
@ -23,12 +23,12 @@ import pendulum
import pickle
class Soccer(callbacks.Plugin):
class SoccerScores(callbacks.Plugin):
"""Fetches soccer scores and other information"""
threaded = True
def __init__(self, irc):
self.__parent = super(Soccer, self)
self.__parent = super(SoccerScores, self)
self.__parent.__init__(irc)
self.PICKLEFILE = conf.supybot.directories.data.dirize("soccer-leagues.db")
@ -144,7 +144,7 @@ class Soccer(callbacks.Plugin):
if not league:
irc.reply('ERROR: You must provide a league via --league <league>')
doc = irc.getCallback('Soccer').soccer.__doc__
doc = irc.getCallback('SoccerScores').soccer.__doc__
doclines = doc.splitlines()
s = '%s' % (doclines.pop(0))
if doclines:
@ -318,7 +318,7 @@ class Soccer(callbacks.Plugin):
Class = Soccer
Class = SoccerScores
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:

View File

@ -0,0 +1,2 @@
requests
pendulum

View File

@ -9,7 +9,7 @@ from supybot.test import *
class SoccerTestCase(PluginTestCase):
plugins = ('Soccer',)
plugins = ('SoccerScores',)
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:

View File

@ -1 +0,0 @@
# Stub so local is a module, used for third-party modules