Download:
child 19:cee789a8154e
parent 17:a17ac8c926c0
18:674e48fa93db draft
Anton Shestakov <av6@dwimlabs.net>, Fri, 09 Nov 2018 15:21:44 +0800
plugin: use limnoria plugin template

4 файлов изменено, 16 вставок(+), 12 удалений(-) [+]
__init__.py file | annotate | diff | comparison | revisions
config.py file | annotate | diff | comparison | revisions
plugin.py file | annotate | diff | comparison | revisions
test.py file | annotate | diff | comparison | revisions
--- a/__init__.py Fri Nov 09 15:20:44 2018 +0800
+++ b/__init__.py Fri Nov 09 15:21:44 2018 +0800
@@ -32,8 +32,11 @@
This plugin provides an interface to the Mercurial help system.
"""
+from __future__ import absolute_import
+
+import sys
import supybot
-import supybot.world as world
+from supybot import 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.
@@ -49,14 +52,20 @@
# This is a url where the most recent plugin package can be downloaded.
__url__ = '' # 'http://supybot.com/Members/yourname/Mercurial/download'
-import config
-import plugin
-reload(plugin) # In case we're being reloaded.
+from . import config
+from . import plugin
+if sys.version_info >= (3, 4):
+ from importlib import reload
+else:
+ from imp import reload
+# In case we're being reloaded.
+reload(config)
+reload(plugin)
# Add more reloads here if you add third-party modules and want them to be
# reloaded when this plugin is reloaded. Don't forget to import them as well!
if world.testing:
- import test
+ from . import test
Class = plugin.Class
configure = config.configure
--- a/config.py Fri Nov 09 15:20:44 2018 +0800
+++ b/config.py Fri Nov 09 15:21:44 2018 +0800
@@ -28,8 +28,7 @@
###
-import supybot.conf as conf
-import supybot.registry as registry
+from supybot import conf, registry
def configure(advanced):
# This will be called by supybot to configure this module. advanced is
--- a/plugin.py Fri Nov 09 15:20:44 2018 +0800
+++ b/plugin.py Fri Nov 09 15:21:44 2018 +0800
@@ -28,11 +28,8 @@
###
-import supybot.utils as utils
+from supybot import utils, plugins, ircutils, callbacks
from supybot.commands import *
-import supybot.plugins as plugins
-import supybot.ircutils as ircutils
-import supybot.callbacks as callbacks
import os
--- a/test.py Fri Nov 09 15:20:44 2018 +0800
+++ b/test.py Fri Nov 09 15:21:44 2018 +0800
@@ -33,7 +33,6 @@
class MercurialTestCase(PluginTestCase):
plugins = ('Mercurial',)
-
def testHghelp(self):
self.assertRegexp('hghelp verify', '.*verify the integrity.*')
self.assertNotError('hghelp foo')