From 1a72a7d6d06ceee954080123bd7814f46006d56f Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Tue, 9 Nov 2021 20:40:35 +0100 Subject: [PATCH] Geography: run Black --- plugins/Geography/__init__.py | 3 ++- plugins/Geography/config.py | 8 +++++--- plugins/Geography/plugin.py | 3 ++- plugins/Geography/test.py | 2 +- plugins/Geography/wikidata.py | 3 ++- pyproject.toml | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) diff --git a/plugins/Geography/__init__.py b/plugins/Geography/__init__.py index bbbcabf43..559ff38d9 100644 --- a/plugins/Geography/__init__.py +++ b/plugins/Geography/__init__.py @@ -47,10 +47,11 @@ __author__ = supybot.authors.unknown __contributors__ = {} # This is a url where the most recent plugin package can be downloaded. -__url__ = '' +__url__ = "" from . import config from . import plugin + if sys.version_info >= (3, 4): from importlib import reload else: diff --git a/plugins/Geography/config.py b/plugins/Geography/config.py index c71ed0973..396b7f9c0 100644 --- a/plugins/Geography/config.py +++ b/plugins/Geography/config.py @@ -30,7 +30,8 @@ from supybot import conf, registry from supybot.i18n import PluginInternationalization -_ = PluginInternationalization('Geography') + +_ = PluginInternationalization("Geography") def configure(advanced): @@ -39,10 +40,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('Geography', True) + + conf.registerPlugin("Geography", True) -Geography = conf.registerPlugin('Geography') +Geography = conf.registerPlugin("Geography") # This is where your configuration variables (if any) should go. For example: # conf.registerGlobalValue(Geography, 'someConfigVariableName', # registry.Boolean(False, _("""Help for someConfigVariableName."""))) diff --git a/plugins/Geography/plugin.py b/plugins/Geography/plugin.py index fa395a002..59cc2d3d3 100644 --- a/plugins/Geography/plugin.py +++ b/plugins/Geography/plugin.py @@ -32,11 +32,12 @@ from supybot import utils, plugins, ircutils, callbacks from supybot.commands import * from supybot.i18n import PluginInternationalization -_ = PluginInternationalization('Geography') +_ = PluginInternationalization("Geography") class Geography(callbacks.Plugin): """Provides geography facts, such as timezones.""" + threaded = True diff --git a/plugins/Geography/test.py b/plugins/Geography/test.py index 09f05cae1..3304ab820 100644 --- a/plugins/Geography/test.py +++ b/plugins/Geography/test.py @@ -37,7 +37,7 @@ from supybot import utils from . import wikidata class GeographyTestCase(PluginTestCase): - plugins = ('Geography',) + plugins = ("Geography",) class GeographyWikidataTestCase(SupyTestCase): diff --git a/plugins/Geography/wikidata.py b/plugins/Geography/wikidata.py index 5eefa075f..68978c10f 100644 --- a/plugins/Geography/wikidata.py +++ b/plugins/Geography/wikidata.py @@ -37,7 +37,8 @@ import supybot.utils as utils SPARQL_URL = "https://query.wikidata.org/sparql" -TIMEZONE_QUERY = string.Template(""" +TIMEZONE_QUERY = string.Template( + """ SELECT ?item ?itemLabel ?rank ?endtime ?appliestopart ?utcoffset ?tzid (MIN(?area) AS ?min_area) WHERE { # find all ?item entities that the subject is part of, recursively; diff --git a/pyproject.toml b/pyproject.toml index 99248acc8..27271b59c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,4 +5,4 @@ build-backend = "setuptools.build_meta" [tool.black] line-length = 79 -include = 'plugins/(Autocomplete|Fediverse|Poll)/.*\.pyi?$' +include = 'plugins/(Autocomplete|Fediverse|Geography|Poll)/.*\.pyi?$'