From 56d01ee3e2d4fe14ea763ed22dcd3c89d5f54f10 Mon Sep 17 00:00:00 2001 From: augustin64 Date: Tue, 16 Jan 2024 21:32:00 +0100 Subject: [PATCH] Several minor changes (pylint) --- partitioncloud/__init__.py | 5 +++-- partitioncloud/modules/thumbnails.py | 3 +-- scripts/hooks/config.py | 2 +- scripts/hooks/utils.py | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/partitioncloud/__init__.py b/partitioncloud/__init__.py index ef08977..76369e6 100644 --- a/partitioncloud/__init__.py +++ b/partitioncloud/__init__.py @@ -39,8 +39,9 @@ def load_config(): app.config.from_object(user_config) if os.path.abspath(app.config["INSTANCE_PATH"]) != app.instance_path: - print("[ERROR] Using two different instance path. \ - \nPlease modify INSTANCE_PATH only in default_config.py and remove it from $INSTANCE_PATH/config.py") + print(("[ERROR] Using two different instance path.\n" + "Please modify INSTANCE_PATH only in default_config.py ", + "and remove it from $INSTANCE_PATH/config.py")) sys.exit(1) else: print("[WARNING] Using default config") diff --git a/partitioncloud/modules/thumbnails.py b/partitioncloud/modules/thumbnails.py index 54e2a5b..36dc7c1 100644 --- a/partitioncloud/modules/thumbnails.py +++ b/partitioncloud/modules/thumbnails.py @@ -5,7 +5,6 @@ import os from flask import current_app, abort, Blueprint, send_file -from .db import get_db from .auth import login_required bp = Blueprint("thumbnails", __name__, url_prefix="/thumbnails") @@ -55,4 +54,4 @@ def regular_thumbnail(uuid): return serve_thumbnail( os.path.join(current_app.instance_path, "partitions", f"{uuid}.pdf"), os.path.join(current_app.instance_path, "cache", "thumbnails", f"{uuid}.jpg") - ) \ No newline at end of file + ) diff --git a/scripts/hooks/config.py b/scripts/hooks/config.py index 28e722c..203185d 100644 --- a/scripts/hooks/config.py +++ b/scripts/hooks/config.py @@ -2,4 +2,4 @@ Config parameters, shared between files """ -instance = "instance" \ No newline at end of file +instance = "instance" diff --git a/scripts/hooks/utils.py b/scripts/hooks/utils.py index cb1d2a0..9683c8e 100644 --- a/scripts/hooks/utils.py +++ b/scripts/hooks/utils.py @@ -1,3 +1,4 @@ +import os import random import string import sqlite3