diff --git a/LICENSE b/NBAScores/LICENSE similarity index 100% rename from LICENSE rename to NBAScores/LICENSE diff --git a/README.md b/NBAScores/README.md similarity index 91% rename from README.md rename to NBAScores/README.md index a240e01..5ccbe91 100644 --- a/README.md +++ b/NBAScores/README.md @@ -1,4 +1,4 @@ -# NBA +# NBAScores A [Limnoria](https://github.com/ProgVal/Limnoria) plugin to retrieve NBA scores from NBA.com. diff --git a/__init__.py b/NBAScores/__init__.py similarity index 76% rename from __init__.py rename to NBAScores/__init__.py index 41b1015..c6e73fe 100644 --- a/__init__.py +++ b/NBAScores/__init__.py @@ -29,7 +29,7 @@ ### """ -NBA: Get scores from NBA.com +NBAScores: Get scores from NBA.com """ import supybot @@ -37,17 +37,25 @@ import supybot.world as world # Use this for the version of this plugin. You may wish to put a CVS keyword # in here if you're keeping the plugin in CVS or some similar system. -__version__ = "0.1" +__version__ = "" # XXX Replace this with an appropriate author or supybot.Author instance. -__author__ = supybot.authors.unknown +__author__ = supybot.Author('Santiago Gil', 'santigl', '') +__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__ = {} +if not hasattr(supybot.authors, 'cottongin') or not hasattr(supybot.authors, 'santigl'): + supybot.authors.cottongin = supybot.Author('cottongin', 'cottongin', + 'cottongin@cottongin.club') + supybot.authors.santigl = supybot.Author('Santiago Gil', 'santigl', '') + +__contributors__ = {supybot.authors.santigl: ['original plugin base'], + supybot.authors.cottongin: ['code enhancement']} # This is a url where the most recent plugin package can be downloaded. -__url__ = 'https://github.com/santigl/limnoria-nba' +__url__ = 'https://github.com/oddluck/limnoria-plugins/' from . import config from . import plugin diff --git a/config.py b/NBAScores/config.py similarity index 94% rename from config.py rename to NBAScores/config.py index a203dc7..3c6fe8a 100644 --- a/config.py +++ b/NBAScores/config.py @@ -32,7 +32,7 @@ import supybot.conf as conf import supybot.registry as registry try: from supybot.i18n import PluginInternationalization - _ = PluginInternationalization('NBA') + _ = PluginInternationalization('NBAScores') except: # Placeholder that allows to run the plugin on a bot # without the i18n module @@ -45,10 +45,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('NBA', True) + conf.registerPlugin('NBAScores', True) -NBA = conf.registerPlugin('NBA') +NBA = conf.registerPlugin('NBAScores') # This is where your configuration variables (if any) should go. For example: # conf.registerGlobalValue(NBA, 'someConfigVariableName', # registry.Boolean(False, _("""Help for someConfigVariableName."""))) diff --git a/plugin.py b/NBAScores/plugin.py similarity index 98% rename from plugin.py rename to NBAScores/plugin.py index 501c4af..be6cd83 100644 --- a/plugin.py +++ b/NBAScores/plugin.py @@ -27,7 +27,7 @@ import supybot.ircutils as ircutils import supybot.callbacks as callbacks try: from supybot.i18n import PluginInternationalization - _ = PluginInternationalization('NBA') + _ = PluginInternationalization('NBAScores') except ImportError: # Placeholder that allows to run the plugin on a bot # without the i18n module @@ -40,7 +40,7 @@ import json import pytz from xml.etree import ElementTree -class NBA(callbacks.Plugin): +class NBAScores(callbacks.Plugin): """Get scores from NBA.com.""" _ENDPOINT_BASE_URL = 'https://data.nba.net' @@ -63,7 +63,7 @@ class NBA(callbacks.Plugin): 'BKN', 'POR', 'GSW', 'LAC', 'WAS')) def __init__(self, irc): - self.__parent = super(NBA, self) + self.__parent = super(NBAScores, self) self.__parent.__init__(irc) self._http = httplib2.Http('.cache') @@ -131,7 +131,7 @@ class NBA(callbacks.Plugin): nba = wrap(nba, [optional('somethingWithoutSpaces'), optional('somethingWithoutSpaces')]) - def tv(self, irc, msg, args, team): + def nbatv(self, irc, msg, args, team): """[] Given a team, if there is a game scheduled for today, @@ -154,9 +154,9 @@ class NBA(callbacks.Plugin): broadcasters_string = self._broadcastersToString(game['tv_broadcasters']) irc.reply('{} on: {}'.format(game_string, broadcasters_string)) - tv = wrap(tv, ['somethingWithoutSpaces']) + nbatv = wrap(nbatv, ['somethingWithoutSpaces']) - def next(self, irc, msg, args, n, team, team2): + def nbanext(self, irc, msg, args, n, team, team2): """[] [] Get the next games (1 by default; max. 10) for a given team @@ -205,11 +205,11 @@ class NBA(callbacks.Plugin): irc.reply(self._upcomingGameToString(game)) - next = wrap(next, [optional('positiveInt'), + nbanext = wrap(nbanext, [optional('positiveInt'), 'somethingWithoutSpaces', optional('somethingWithoutSpaces')]) - def last(self, irc, msg, args, n, team, team2): + def nbalast(self, irc, msg, args, n, team, team2): """[] [] Get the last games (1 by default; max. 10) for a given team @@ -259,7 +259,7 @@ class NBA(callbacks.Plugin): irc.reply(self._pastGameToString(game)) - last = wrap(last, [optional('positiveInt'), + nbalast = wrap(nbalast, [optional('positiveInt'), 'somethingWithoutSpaces', optional('somethingWithoutSpaces')]) @@ -814,6 +814,6 @@ class NBA(callbacks.Plugin): return url -Class = NBA +Class = NBAScores # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: diff --git a/NBAScores/requirements.txt b/NBAScores/requirements.txt new file mode 100644 index 0000000..9850437 --- /dev/null +++ b/NBAScores/requirements.txt @@ -0,0 +1 @@ +pytz \ No newline at end of file diff --git a/test.py b/NBAScores/test.py similarity index 98% rename from test.py rename to NBAScores/test.py index 30ac554..94f2bd5 100644 --- a/test.py +++ b/NBAScores/test.py @@ -32,7 +32,7 @@ from supybot.test import * class NBATestCase(PluginTestCase): - plugins = ('NBA',) + plugins = ('NBAScores',) # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/local/__init__.py b/local/__init__.py deleted file mode 100644 index e86e97b..0000000 --- a/local/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# Stub so local is a module, used for third-party modules