Format with default line-length=88 (was 79 with Sanic).

This commit is contained in:
L. Kärkkäinen
2023-10-25 04:13:13 +01:00
parent e4daf1ab21
commit 1afea39cb2
137 changed files with 540 additions and 1613 deletions

View File

@@ -28,13 +28,9 @@ def create_app(root: Path) -> Sanic:
app.config.STYLE_DIR = root / "style"
app.config.NODE_MODULES_DIR = root / "node_modules"
app.config.LANGUAGES = ["en"]
app.config.SIDEBAR = load_menu(
app.config.CONFIG_DIR / "en" / "sidebar.yaml"
)
app.config.SIDEBAR = load_menu(app.config.CONFIG_DIR / "en" / "sidebar.yaml")
app.config.NAVBAR = load_menu(app.config.CONFIG_DIR / "en" / "navbar.yaml")
app.config.GENERAL = load_config(
app.config.CONFIG_DIR / "en" / "general.yaml"
)
app.config.GENERAL = load_config(app.config.CONFIG_DIR / "en" / "general.yaml")
setup_livereload(app)
setup_style(app)
@@ -66,8 +62,6 @@ def create_app(root: Path) -> Sanic:
@app.on_request
async def set_language(request: Request):
request.ctx.language = request.match_info.get(
"language", Page.DEFAULT_LANGUAGE
)
request.ctx.language = request.match_info.get("language", Page.DEFAULT_LANGUAGE)
return app

View File

@@ -53,16 +53,12 @@ class Livereload:
"serverName": SERVER_NAME,
}
def __init__(
self, reload_queue: Queue, debug: bool, state: dict[str, Any]
):
def __init__(self, reload_queue: Queue, debug: bool, state: dict[str, Any]):
self.reload_queue = reload_queue
self.app = Sanic(self.SERVER_NAME)
self.debug = debug
self.state = state
self.app.static(
"/livereload.js", Path(__file__).parent / "livereload.js"
)
self.app.static("/livereload.js", Path(__file__).parent / "livereload.js")
self.app.add_websocket_route(
self.livereload_handler, "/livereload", name="livereload"
)
@@ -108,7 +104,5 @@ class Livereload:
break
def _run_reload_server(
reload_queue: Queue, debug: bool, state: dict[str, Any]
):
def _run_reload_server(reload_queue: Queue, debug: bool, state: dict[str, Any]):
Livereload(reload_queue, debug, state).run()