Added utils path to pep8 checks
This commit is contained in:
parent
0358670071
commit
b9dc10c99b
@ -6,6 +6,6 @@ import pycodestyle
|
||||
def test_pep8_conformance():
|
||||
"""Test that we conform to PEP8."""
|
||||
pep8style = pycodestyle.StyleGuide()
|
||||
dirs = ["./controllers", "./models", "./scripts", "./tests"]
|
||||
dirs = ["./controllers", "./models", "./scripts", "./tests", "./utils"]
|
||||
result = pep8style.check_files(dirs)
|
||||
assert result.total_errors == 0
|
||||
|
@ -13,6 +13,7 @@ def allowed_file(filename) -> bool:
|
||||
return '.' in filename and \
|
||||
filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS
|
||||
|
||||
|
||||
def save_image(file) -> str | None:
|
||||
""" Saves a given file to disk with a random UUID4 generated
|
||||
filename. Returns the filename as a string.
|
||||
@ -28,6 +29,7 @@ def save_image(file) -> str | None:
|
||||
file.save(os.path.join(path, filename))
|
||||
return filename
|
||||
|
||||
|
||||
def create_directory(dir: str):
|
||||
""" Creates the given directory string is not alreay made """
|
||||
try:
|
||||
@ -35,6 +37,7 @@ def create_directory(dir: str):
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
|
||||
def remove_file(dir: str):
|
||||
""" Removes a given file if it is present at the given dir """
|
||||
try:
|
||||
|
@ -2,6 +2,7 @@ from flask import session
|
||||
from models.users.user import User
|
||||
from controllers.database.user import UserController
|
||||
|
||||
|
||||
def is_logged_in() -> User | None:
|
||||
""" Returns the user object if the user is logged in
|
||||
Otherwise returns a None type
|
||||
|
Loading…
Reference in New Issue
Block a user