Skip to content

Commit

Permalink
Merge pull request #14 from Alcheri/actions/black
Browse files Browse the repository at this point in the history
Format Python code with psf/black push
  • Loading branch information
Alcheri authored Jan 11, 2025
2 parents 0953dcb + 66003ed commit 5440590
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 72 deletions.
5 changes: 3 additions & 2 deletions ISO/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,19 @@
__version__ = "0.1"

# XXX Replace this with an appropriate author or supybot.Author instance.
__author__ = 'Barry Suridge <barry.suridge@outlook.com>'
__author__ = "Barry Suridge <barry.suridge@outlook.com>"

# 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__ = ""

from . import config
from . import plugin
from importlib import reload

# In case we're being reloaded.
reload(config)
reload(plugin)
Expand Down
9 changes: 6 additions & 3 deletions ISO/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
###

from supybot import conf, registry

try:
from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('ISO')

_ = PluginInternationalization("ISO")
except:
# Placeholder that allows to run the plugin on a bot
# without the i18n module
Expand All @@ -44,10 +46,11 @@ 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('ISO', True)

conf.registerPlugin("ISO", True)


ISO = conf.registerPlugin('ISO')
ISO = conf.registerPlugin("ISO")
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(ISO, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
Expand Down
2 changes: 1 addition & 1 deletion ISO/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


class ISOTestCase(PluginTestCase):
plugins = ('ISO',)
plugins = ("ISO",)


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
9 changes: 5 additions & 4 deletions MyPing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"""

import sys

# Python 3.3 an above ONLY!!
if sys.version_info <= (3, 6):
raise RuntimeError("This plugin requires Python 3.6 or above.")
Expand All @@ -19,22 +20,22 @@

# 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__ = '1.0.2'
__version__ = "1.0.2"

# XXX Replace this with an appropriate author or supybot.Author instance.
__author__ = supybot.Author('Barry Suridge', 'Alcheri',
'barry.suridge@outlook.com')
__author__ = supybot.Author("Barry Suridge", "Alcheri", "barry.suridge@outlook.com")

# 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__ = 'https://github.com/Alcheri/Plugins.git'
__url__ = "https://github.com/Alcheri/Plugins.git"

from . import config
from . import plugin
from importlib import reload

# In case we're being reloaded.
reload(config)
reload(plugin)
Expand Down
17 changes: 11 additions & 6 deletions MyPing/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,33 @@

import supybot.conf as conf
import supybot.registry as registry

try:
from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('MyPing')

_ = PluginInternationalization("MyPing")
except ImportError:
# Placeholder that allows to run the plugin on a bot
# without the i18n module
_ = lambda x:x
_ = lambda x: x


def configure(advanced):
# This will be called by supybot to configure this module. advanced is
# a bool that specifies whether the user identified themself as an 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('MyPing', True)

conf.registerPlugin("MyPing", True)


MyPing = conf.registerPlugin('MyPing')
MyPing = conf.registerPlugin("MyPing")
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(MyPing, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(MyPing, 'enable',
registry.Boolean(False, """Should plugin work in this channel?"""))
conf.registerChannelValue(
MyPing, "enable", registry.Boolean(False, """Should plugin work in this channel?""")
)

# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
64 changes: 42 additions & 22 deletions MyPing/local/colour.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
##############
# FORMATTING #
##############
##############
# FORMATTING #
##############

## mIRC colour codes
#
Expand All @@ -24,81 +24,101 @@

import supybot.ircutils as utils


def white(s):
"""Returns a white string."""
return utils.mircColor(s, 'white')
return utils.mircColor(s, "white")


def black(s):
"""Returns a black string."""
return utils.mircColor(s, 'black')
return utils.mircColor(s, "black")


def blue(s):
"""Returns a blue string."""
return utils.mircColor(s, 'blue')
return utils.mircColor(s, "blue")


def green(s):
"""Returns a green string."""
return utils.mircColor(s, 'green')
return utils.mircColor(s, "green")


def red(s):
"""Returns a red string."""
return utils.mircColor(s, 'red')
return utils.mircColor(s, "red")


def brown(s):
"""Returns a brown string."""
return utils.mircColor(s, 'brown')
return utils.mircColor(s, "brown")


def purple(s):
"""Returns a purple string."""
return utils.mircColor(s, 'purple')
return utils.mircColor(s, "purple")


def orange(s):
"""Returns a orange string."""
return utils.mircColor(s, 'orange')
return utils.mircColor(s, "orange")


def yellow(s):
"""Returns a yellow string."""
return utils.mircColor(s, 'yellow')
return utils.mircColor(s, "yellow")


def light_green(s):
"""Returns a light green string."""
return utils.mircColor(s, 'light green')
return utils.mircColor(s, "light green")


def teal(s):
"""Returns a teal string."""
return utils.mircColor(s, 'teal')
return utils.mircColor(s, "teal")


def light_blue(s):
"""Returns a teal string."""
return utils.mircColor(s, 'blue')
return utils.mircColor(s, "blue")


def dark_blue(s):
"""Returns a dark blue string."""
return utils.mircColor(s, 'dark blue')
return utils.mircColor(s, "dark blue")


def pink(s):
"""Returns a pink string."""
return utils.mircColor(s, 'pink')
return utils.mircColor(s, "pink")


def dark_grey(s):
"""Returns a dark grey string."""
return utils.mircColor(s, 'dark grey')
return utils.mircColor(s, "dark grey")


def dark_gray(s):
"""Returns a dark grey string."""
return utils.mircColor(s, 'dark gray')
return utils.mircColor(s, "dark gray")


def light_grey(s):
"""Returns a light gray string."""
return utils.mircColor(s, 'light grey')
return utils.mircColor(s, "light grey")


def light_gray(s):
"""Returns a light gray string."""
return utils.mircColor(s, 'light gray')
return utils.mircColor(s, "light gray")


# Non-mIRC
def bold(s):
"""Returns the string s, bolded."""
return f'\x02{s}\x02'
return f"\x02{s}\x02"


# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
2 changes: 0 additions & 2 deletions MyPing/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ def _elapsed_loss(loss):


class MyPing(callbacks.Plugin):

def __init__(self, irc):

self.__parent = super(MyPing, self)
self.__parent.__init__(irc)

Expand Down
9 changes: 5 additions & 4 deletions MyPing/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@


class MyPingTestCase(PluginTestCase):
plugins = ('MyPing',)
plugins = ("MyPing",)

def testSimple(self):
self.assertNotError('myping ping google.com')
self.assertNotError('myping ping 2a03:2880:f119:8083:face:b00c:0:25de')

self.assertNotError("myping ping google.com")
self.assertNotError("myping ping 2a03:2880:f119:8083:face:b00c:0:25de")


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
6 changes: 3 additions & 3 deletions OnJoin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@
__version__ = "0.02"

# XXX Replace this with an appropriate author or supybot.Author instance.
__author__ = supybot.Author('Barry Suridge', 'Alcheri',
'barry.suridge@outlook.com')
__author__ = supybot.Author("Barry Suridge", "Alcheri", "barry.suridge@outlook.com")

# 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__ = 'https://github.com/Alcheri/Plugins.git'
__url__ = "https://github.com/Alcheri/Plugins.git"

from . import config
from . import plugin
from importlib import reload

# In case we're being reloaded.
reload(config)
reload(plugin)
Expand Down
14 changes: 9 additions & 5 deletions OnJoin/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@

import supybot.conf as conf
import supybot.registry as registry

try:
from supybot.i18n import PluginInternationalization
_ = PluginInternationalization('OnJoin')

_ = PluginInternationalization("OnJoin")
except:
# Placeholder that allows to run the plugin on a bot
# without the i18n module
Expand All @@ -22,13 +24,15 @@ 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('OnJoin', True)

conf.registerPlugin("OnJoin", True)


OnJoin = conf.registerPlugin('OnJoin')
OnJoin = conf.registerPlugin("OnJoin")
# This is where your configuration variables (if any) should go. For example:
# conf.registerGlobalValue(OnJoin, 'someConfigVariableName',
# registry.Boolean(False, _("""Help for someConfigVariableName.""")))
conf.registerChannelValue(OnJoin, 'enable',
registry.Boolean(False, """Should plugin work in this channel?"""))
conf.registerChannelValue(
OnJoin, "enable", registry.Boolean(False, """Should plugin work in this channel?""")
)
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
2 changes: 1 addition & 1 deletion OnJoin/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


class OnJoinTestCase(PluginTestCase):
plugins = ('OnJoin',)
plugins = ("OnJoin",)


# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
8 changes: 5 additions & 3 deletions Weatherstack/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"""

import sys

if sys.version_info <= (3, 6):
raise RuntimeError("This plugin requires Python 3.6 or above.")
import supybot
Expand All @@ -42,22 +43,23 @@
__version__ = "15092021"

# XXX Replace this with an appropriate author or supybot.Author instance.
__author__ = supybot.Author('Barry Suridge', 'Alcheri',
'barry.suridge@outlook.com')
__author__ = supybot.Author("Barry Suridge", "Alcheri", "barry.suridge@outlook.com")

# 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__ = 'https://github.com/Alcheri/My-Limnoria-Plugins'
__url__ = "https://github.com/Alcheri/My-Limnoria-Plugins"

import sys

if sys.version_info <= (3, 9):
raise RuntimeError("This plugin requires Python 3.9 or above.")
from . import config
from . import plugin
from importlib import reload

# In case we're being reloaded.
reload(config)
reload(plugin)
Expand Down
Loading

0 comments on commit 5440590

Please sign in to comment.