black default setting: line length is 88 chars max
This commit is contained in:
parent
b90e50e3d5
commit
470155345f
4 changed files with 8 additions and 13 deletions
2
Makefile
2
Makefile
|
@ -10,4 +10,4 @@ lint:
|
|||
pylint stacosys/
|
||||
|
||||
black:
|
||||
black -l 79 stacosys/
|
||||
black stacosys/
|
|
@ -47,9 +47,7 @@ def count_published_comments(url):
|
|||
.where((Comment.url == url) & (Comment.published.is_null(False)))
|
||||
.count()
|
||||
if url
|
||||
else Comment.select(Comment)
|
||||
.where(Comment.published.is_null(False))
|
||||
.count()
|
||||
else Comment.select(Comment).where(Comment.published.is_null(False)).count()
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -51,9 +51,7 @@ def logout():
|
|||
|
||||
@app.route("/web/admin", methods=["GET"])
|
||||
def admin_homepage():
|
||||
if not (
|
||||
"user" in session and session["user"] == app.config.get("WEB_USERNAME")
|
||||
):
|
||||
if not ("user" in session and session["user"] == app.config.get("WEB_USERNAME")):
|
||||
# TODO localization
|
||||
flash("Vous avez été déconnecté.")
|
||||
return redirect("/web/login")
|
||||
|
|
|
@ -20,12 +20,11 @@ from stacosys.interface.web import admin
|
|||
def configure_logging(level):
|
||||
root_logger = logging.getLogger()
|
||||
root_logger.setLevel(level)
|
||||
ch = logging.StreamHandler()
|
||||
ch.setLevel(level)
|
||||
formatter = logging.Formatter(
|
||||
"[%(asctime)s] %(name)s %(levelname)s %(message)s")
|
||||
ch.setFormatter(formatter)
|
||||
root_logger.addHandler(ch)
|
||||
handler = logging.StreamHandler()
|
||||
handler.setLevel(level)
|
||||
formatter = logging.Formatter("[%(asctime)s] %(name)s %(levelname)s %(message)s")
|
||||
handler.setFormatter(formatter)
|
||||
root_logger.addHandler(handler)
|
||||
|
||||
|
||||
def stacosys_server(config_pathname):
|
||||
|
|
Loading…
Add table
Reference in a new issue