diff --git a/pyproject.toml b/pyproject.toml index ba978c245..00b059557 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -200,18 +200,9 @@ lint.per-file-ignores."docker/wait-for-redis.py" = [ "INP001", "T201", ] -lint.per-file-ignores."src/documents/management/commands/document_consumer.py" = [ - "PTH", -] # TODO Enable & remove -lint.per-file-ignores."src/documents/management/commands/document_exporter.py" = [ - "PTH", -] # TODO Enable & remove lint.per-file-ignores."src/documents/migrations/1012_fix_archive_files.py" = [ "PTH", ] # TODO Enable & remove -lint.per-file-ignores."src/documents/models.py" = [ - "SIM115", -] lint.per-file-ignores."src/documents/signals/handlers.py" = [ "PTH", ] # TODO Enable & remove @@ -251,6 +242,15 @@ lint.per-file-ignores."src/paperless/checks.py" = [ lint.per-file-ignores."src/paperless/file_handling.py" = [ "PTH", ] # TODO Enable & remove +lint.per-file-ignores."src/paperless/management/commands/document_consumer.py" = [ + "PTH", +] # TODO Enable & remove +lint.per-file-ignores."src/paperless/management/commands/document_exporter.py" = [ + "PTH", +] # TODO Enable & remove +lint.per-file-ignores."src/paperless/models.py" = [ + "SIM115", +] lint.per-file-ignores."src/paperless/parsers.py" = [ "PTH", ] # TODO Enable & remove diff --git a/src/documents/management/commands/__init__.py b/src/documents/management/commands/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/documents/management/__init__.py b/src/paperless/management/commands/__init__.py similarity index 100% rename from src/documents/management/__init__.py rename to src/paperless/management/commands/__init__.py diff --git a/src/documents/management/commands/convert_mariadb_uuid.py b/src/paperless/management/commands/convert_mariadb_uuid.py similarity index 100% rename from src/documents/management/commands/convert_mariadb_uuid.py rename to src/paperless/management/commands/convert_mariadb_uuid.py diff --git a/src/documents/management/commands/decrypt_documents.py b/src/paperless/management/commands/decrypt_documents.py similarity index 100% rename from src/documents/management/commands/decrypt_documents.py rename to src/paperless/management/commands/decrypt_documents.py diff --git a/src/documents/management/commands/document_archiver.py b/src/paperless/management/commands/document_archiver.py similarity index 96% rename from src/documents/management/commands/document_archiver.py rename to src/paperless/management/commands/document_archiver.py index 6120b10df..1e7900450 100644 --- a/src/documents/management/commands/document_archiver.py +++ b/src/paperless/management/commands/document_archiver.py @@ -6,8 +6,8 @@ from django import db from django.conf import settings from django.core.management.base import BaseCommand -from documents.management.commands.mixins import MultiProcessMixin -from documents.management.commands.mixins import ProgressBarMixin +from paperless.management.commands.mixins import MultiProcessMixin +from paperless.management.commands.mixins import ProgressBarMixin from paperless.models import Document from paperless.tasks import update_document_content_maybe_archive_file diff --git a/src/documents/management/commands/document_consumer.py b/src/paperless/management/commands/document_consumer.py similarity index 100% rename from src/documents/management/commands/document_consumer.py rename to src/paperless/management/commands/document_consumer.py diff --git a/src/documents/management/commands/document_create_classifier.py b/src/paperless/management/commands/document_create_classifier.py similarity index 100% rename from src/documents/management/commands/document_create_classifier.py rename to src/paperless/management/commands/document_create_classifier.py diff --git a/src/documents/management/commands/document_exporter.py b/src/paperless/management/commands/document_exporter.py similarity index 99% rename from src/documents/management/commands/document_exporter.py rename to src/paperless/management/commands/document_exporter.py index 519d294be..4bf581d05 100644 --- a/src/documents/management/commands/document_exporter.py +++ b/src/paperless/management/commands/document_exporter.py @@ -32,14 +32,11 @@ if TYPE_CHECKING: if settings.AUDIT_LOG_ENABLED: from auditlog.models import LogEntry -from documents.management.commands.mixins import CryptMixin -from documents.settings import EXPORTER_ARCHIVE_NAME -from documents.settings import EXPORTER_FILE_NAME -from documents.settings import EXPORTER_THUMBNAIL_NAME from paperless import version from paperless.db import GnuPG from paperless.file_handling import delete_empty_directories from paperless.file_handling import generate_filename +from paperless.management.commands.mixins import CryptMixin from paperless.models import ApplicationConfiguration from paperless.models import Correspondent from paperless.models import CustomField @@ -57,6 +54,9 @@ from paperless.models import WorkflowAction from paperless.models import WorkflowActionEmail from paperless.models import WorkflowActionWebhook from paperless.models import WorkflowTrigger +from paperless.settings import EXPORTER_ARCHIVE_NAME +from paperless.settings import EXPORTER_FILE_NAME +from paperless.settings import EXPORTER_THUMBNAIL_NAME from paperless.utils import copy_file_with_basic_stats from paperless_mail.models import MailAccount from paperless_mail.models import MailRule diff --git a/src/documents/management/commands/document_fuzzy_match.py b/src/paperless/management/commands/document_fuzzy_match.py similarity index 97% rename from src/documents/management/commands/document_fuzzy_match.py rename to src/paperless/management/commands/document_fuzzy_match.py index 1197fdece..640e0a534 100644 --- a/src/documents/management/commands/document_fuzzy_match.py +++ b/src/paperless/management/commands/document_fuzzy_match.py @@ -7,8 +7,8 @@ import tqdm from django.core.management import BaseCommand from django.core.management import CommandError -from documents.management.commands.mixins import MultiProcessMixin -from documents.management.commands.mixins import ProgressBarMixin +from paperless.management.commands.mixins import MultiProcessMixin +from paperless.management.commands.mixins import ProgressBarMixin from paperless.models import Document diff --git a/src/documents/management/commands/document_importer.py b/src/paperless/management/commands/document_importer.py similarity index 98% rename from src/documents/management/commands/document_importer.py rename to src/paperless/management/commands/document_importer.py index 3a66ee1c2..1bb320d0c 100644 --- a/src/documents/management/commands/document_importer.py +++ b/src/paperless/management/commands/document_importer.py @@ -21,15 +21,11 @@ from django.db.models.signals import m2m_changed from django.db.models.signals import post_save from filelock import FileLock -from documents.management.commands.mixins import CryptMixin -from documents.settings import EXPORTER_ARCHIVE_NAME -from documents.settings import EXPORTER_CRYPTO_SETTINGS_NAME -from documents.settings import EXPORTER_FILE_NAME -from documents.settings import EXPORTER_THUMBNAIL_NAME from documents.signals.handlers import check_paths_and_prune_custom_fields from documents.signals.handlers import update_filename_and_move_files from paperless import version from paperless.file_handling import create_source_path_directory +from paperless.management.commands.mixins import CryptMixin from paperless.models import Correspondent from paperless.models import CustomField from paperless.models import CustomFieldInstance @@ -38,6 +34,10 @@ from paperless.models import DocumentType from paperless.models import Note from paperless.models import Tag from paperless.parsers import run_convert +from paperless.settings import EXPORTER_ARCHIVE_NAME +from paperless.settings import EXPORTER_CRYPTO_SETTINGS_NAME +from paperless.settings import EXPORTER_FILE_NAME +from paperless.settings import EXPORTER_THUMBNAIL_NAME from paperless.utils import copy_file_with_basic_stats if settings.AUDIT_LOG_ENABLED: diff --git a/src/documents/management/commands/document_index.py b/src/paperless/management/commands/document_index.py similarity index 92% rename from src/documents/management/commands/document_index.py rename to src/paperless/management/commands/document_index.py index 08d5f4657..ac951bc62 100644 --- a/src/documents/management/commands/document_index.py +++ b/src/paperless/management/commands/document_index.py @@ -1,7 +1,7 @@ from django.core.management import BaseCommand from django.db import transaction -from documents.management.commands.mixins import ProgressBarMixin +from paperless.management.commands.mixins import ProgressBarMixin from paperless.tasks import index_optimize from paperless.tasks import index_reindex diff --git a/src/documents/management/commands/document_renamer.py b/src/paperless/management/commands/document_renamer.py similarity index 92% rename from src/documents/management/commands/document_renamer.py rename to src/paperless/management/commands/document_renamer.py index 76dcb69cb..e561f2469 100644 --- a/src/documents/management/commands/document_renamer.py +++ b/src/paperless/management/commands/document_renamer.py @@ -4,7 +4,7 @@ import tqdm from django.core.management.base import BaseCommand from django.db.models.signals import post_save -from documents.management.commands.mixins import ProgressBarMixin +from paperless.management.commands.mixins import ProgressBarMixin from paperless.models import Document diff --git a/src/documents/management/commands/document_retagger.py b/src/paperless/management/commands/document_retagger.py similarity index 98% rename from src/documents/management/commands/document_retagger.py rename to src/paperless/management/commands/document_retagger.py index 50bcf979b..b89e4cd64 100644 --- a/src/documents/management/commands/document_retagger.py +++ b/src/paperless/management/commands/document_retagger.py @@ -3,12 +3,12 @@ import logging import tqdm from django.core.management.base import BaseCommand -from documents.management.commands.mixins import ProgressBarMixin from documents.signals.handlers import set_correspondent from documents.signals.handlers import set_document_type from documents.signals.handlers import set_storage_path from documents.signals.handlers import set_tags from paperless.classifier import load_classifier +from paperless.management.commands.mixins import ProgressBarMixin from paperless.models import Document logger = logging.getLogger("paperless.management.retagger") diff --git a/src/documents/management/commands/document_sanity_checker.py b/src/paperless/management/commands/document_sanity_checker.py similarity index 88% rename from src/documents/management/commands/document_sanity_checker.py rename to src/paperless/management/commands/document_sanity_checker.py index b634d4dc9..88295445c 100644 --- a/src/documents/management/commands/document_sanity_checker.py +++ b/src/paperless/management/commands/document_sanity_checker.py @@ -1,7 +1,7 @@ from django.core.management.base import BaseCommand -from documents.management.commands.mixins import ProgressBarMixin from documents.sanity_checker import check_sanity +from paperless.management.commands.mixins import ProgressBarMixin class Command(ProgressBarMixin, BaseCommand): diff --git a/src/documents/management/commands/document_thumbnails.py b/src/paperless/management/commands/document_thumbnails.py similarity index 95% rename from src/documents/management/commands/document_thumbnails.py rename to src/paperless/management/commands/document_thumbnails.py index 3c1b7c542..5ba2a4f4c 100644 --- a/src/documents/management/commands/document_thumbnails.py +++ b/src/paperless/management/commands/document_thumbnails.py @@ -6,8 +6,8 @@ import tqdm from django import db from django.core.management.base import BaseCommand -from documents.management.commands.mixins import MultiProcessMixin -from documents.management.commands.mixins import ProgressBarMixin +from paperless.management.commands.mixins import MultiProcessMixin +from paperless.management.commands.mixins import ProgressBarMixin from paperless.models import Document from paperless.parsers import get_parser_class_for_mime_type diff --git a/src/documents/management/commands/loaddata_stdin.py b/src/paperless/management/commands/loaddata_stdin.py similarity index 100% rename from src/documents/management/commands/loaddata_stdin.py rename to src/paperless/management/commands/loaddata_stdin.py diff --git a/src/documents/management/commands/manage_superuser.py b/src/paperless/management/commands/manage_superuser.py similarity index 100% rename from src/documents/management/commands/manage_superuser.py rename to src/paperless/management/commands/manage_superuser.py diff --git a/src/documents/management/commands/mixins.py b/src/paperless/management/commands/mixins.py similarity index 100% rename from src/documents/management/commands/mixins.py rename to src/paperless/management/commands/mixins.py diff --git a/src/documents/management/commands/prune_audit_logs.py b/src/paperless/management/commands/prune_audit_logs.py similarity index 95% rename from src/documents/management/commands/prune_audit_logs.py rename to src/paperless/management/commands/prune_audit_logs.py index b49f4afc2..dae167505 100644 --- a/src/documents/management/commands/prune_audit_logs.py +++ b/src/paperless/management/commands/prune_audit_logs.py @@ -3,7 +3,7 @@ from django.core.management.base import BaseCommand from django.db import transaction from tqdm import tqdm -from documents.management.commands.mixins import ProgressBarMixin +from paperless.management.commands.mixins import ProgressBarMixin class Command(BaseCommand, ProgressBarMixin):