Format with default line-length=88 (was 79 with Sanic).
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user