Run pre-commit (with newly added ruff) on code base.

Includes all changes by `pre-commit --all-files` including the changes introduced by ruff.
This commit is contained in:
real-yfprojects 2023-05-01 10:28:11 +02:00
parent f0a5a36275
commit 24e1dd5c56
No known key found for this signature in database
GPG Key ID: 00F630DFDEE25747
80 changed files with 256 additions and 50 deletions

View File

@ -7,4 +7,3 @@ source_file = src/vorta/i18n/ts/vorta.en.ts
source_lang = en
type = QT
minimum_perc = 80

View File

@ -1,7 +1,9 @@
import os
import signal
import sys
from peewee import SqliteDatabase
from vorta._version import __version__
from vorta.config import SETTINGS_DIR
from vorta.i18n import trans_late, translate
@ -14,6 +16,7 @@ from vorta.utils import parse_args
def main():
def exception_handler(type, value, tb):
from traceback import format_exception
from PyQt6.QtWidgets import QMessageBox
logger.critical(

View File

@ -3,8 +3,10 @@ import os
import sys
from pathlib import Path
from typing import Any, Dict, List, Tuple
from PyQt6 import QtCore
from PyQt6.QtWidgets import QMessageBox
from vorta.borg.break_lock import BorgBreakJob
from vorta.borg.create import BorgCreateJob
from vorta.borg.jobs_manager import JobsManager

View File

@ -275,4 +275,4 @@
</widget>
<resources />
<connections />
</ui>
</ui>

View File

@ -50,6 +50,7 @@ def open_app_at_startup(enabled=True):
elif sys.platform.startswith('linux'):
from pathlib import Path
from platformdirs import user_config_path
is_flatpak = Path('/.flatpak-info').exists()

View File

@ -11,8 +11,10 @@ from collections import namedtuple
from datetime import datetime as dt
from subprocess import PIPE, Popen, TimeoutExpired
from threading import Lock
from PyQt6 import QtCore
from PyQt6.QtWidgets import QApplication
from vorta import application
from vorta.borg.jobs_manager import JobInterface
from vorta.i18n import trans_late, translate

View File

@ -1,7 +1,9 @@
from typing import Any, Dict
from vorta.config import LOG_DIR
from vorta.i18n import translate
from vorta.utils import borg_compat
from .borg_job import BorgJob

View File

@ -1,7 +1,9 @@
from typing import Any, Dict
from vorta.config import LOG_DIR
from vorta.i18n import trans_late, translate
from vorta.utils import borg_compat
from .borg_job import BorgJob

View File

@ -2,10 +2,17 @@ import os
import subprocess
import tempfile
from datetime import datetime as dt
from vorta.config import LOG_DIR
from vorta.i18n import trans_late, translate
from vorta.store.models import ArchiveModel, RepoModel, SourceFileModel, WifiSettingModel
from vorta.store.models import (
ArchiveModel,
RepoModel,
SourceFileModel,
WifiSettingModel,
)
from vorta.utils import borg_compat, format_archive_name, get_network_status_monitor
from .borg_job import BorgJob

View File

@ -1,6 +1,8 @@
from typing import List
from vorta.store.models import RepoModel
from vorta.utils import borg_compat
from .borg_job import BorgJob

View File

@ -1,4 +1,5 @@
from vorta.utils import borg_compat
from .borg_job import BorgJob

View File

@ -1,8 +1,11 @@
import tempfile
from PyQt6.QtCore import QModelIndex, Qt
from vorta.utils import borg_compat
from vorta.views.extract_dialog import ExtractTree, FileData
from vorta.views.partials.treemodel import FileSystemItem, path_to_str
from .borg_job import BorgJob

View File

@ -1,5 +1,6 @@
from vorta.store.models import ArchiveModel, RepoModel
from vorta.utils import borg_compat
from .borg_job import BorgJob

View File

@ -1,6 +1,7 @@
from vorta.i18n import trans_late
from vorta.store.models import RepoModel
from vorta.utils import borg_compat
from .borg_job import BorgJob, FakeProfile, FakeRepo

View File

@ -1,5 +1,6 @@
from vorta.store.models import RepoModel
from vorta.utils import borg_compat
from .borg_job import BorgJob, FakeProfile, FakeRepo

View File

@ -2,6 +2,7 @@ import logging
import queue
import threading
from abc import abstractmethod
from PyQt6.QtCore import QObject
logger = logging.getLogger(__name__)

View File

@ -1,4 +1,5 @@
from vorta.utils import borg_compat
from .borg_job import BorgJob

View File

@ -1,6 +1,8 @@
from datetime import datetime as dt
from vorta.store.models import ArchiveModel, RepoModel
from vorta.utils import borg_compat
from .borg_job import BorgJob

View File

@ -1,7 +1,9 @@
import logging
import os
from vorta.store.models import SettingsModel
from vorta.utils import SHELL_PATTERN_ELEMENT, borg_compat
from .borg_job import BorgJob
logger = logging.getLogger(__name__)

View File

@ -1,5 +1,6 @@
from vorta.store.models import RepoModel
from vorta.utils import borg_compat, format_archive_name
from .borg_job import BorgJob

View File

@ -1,5 +1,6 @@
from vorta.store.models import ArchiveModel, RepoModel
from vorta.utils import borg_compat
from .borg_job import BorgJob

View File

@ -1,5 +1,7 @@
import os.path
import psutil
from ..i18n import trans_late
from .borg_job import BorgJob

View File

@ -1,4 +1,5 @@
from vorta.i18n import trans_late
from .borg_job import BorgJob

View File

@ -1,4 +1,5 @@
from pathlib import Path
import platformdirs
APP_NAME = 'Vorta'

View File

@ -3,6 +3,7 @@ internationalisation (i18n) support code
"""
import logging
import os
from PyQt6.QtCore import QLocale, QTranslator
logger = logging.getLogger(__name__)

View File

@ -1606,11 +1606,11 @@
</message>
<message>
<location filename="../../views/import_window.py" line="69"/>
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
{1}</source>
<translation>Aktualizace schématu se nezdařila, vyplňte hlášení chyby s odkazem v panelu Různé s následující chybou:
{0}
{0}
{1}</translation>
</message>
<message>
@ -2346,4 +2346,4 @@
<translation>Ukládání hesla do nastavení Vorta.</translation>
</message>
</context>
</TS>
</TS>

View File

@ -1604,11 +1604,11 @@
</message>
<message>
<location filename="../../views/import_window.py" line="69"/>
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
{1}</source>
<translation>Schema-Upgrade Fehler, erstelle einen Bugreport auf dem Link um &quot;Misc&quot;-Tab, mit folgendem Fehler:
{0}
<translation>Schema-Upgrade Fehler, erstelle einen Bugreport auf dem Link um &quot;Misc&quot;-Tab, mit folgendem Fehler:
{0}
{1}</translation>
</message>
<message>
@ -2344,4 +2344,4 @@
<translation>Speichere Kennwort in der Vortakonfiguration</translation>
</message>
</context>
</TS>
</TS>

View File

@ -1606,8 +1606,8 @@
</message>
<message>
<location filename="../../views/import_window.py" line="69"/>
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
{1}</source>
<translation>Falla al actualizar esquema, registre un reporte de error con el enlace en la pestaña Varios con el siguiente error:
{0}
@ -2346,4 +2346,4 @@
<translation type="unfinished"/>
</message>
</context>
</TS>
</TS>

View File

@ -1606,11 +1606,11 @@
</message>
<message>
<location filename="../../views/import_window.py" line="69"/>
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
{1}</source>
<translation>Skeeman päivitys epäonnistui, lähetä virheraportti Sekalaiset-välilehdellä olevasta linkistä. Liitä raporttiin seuraavat tiedot:
{0}
<translation>Skeeman päivitys epäonnistui, lähetä virheraportti Sekalaiset-välilehdellä olevasta linkistä. Liitä raporttiin seuraavat tiedot:
{0}
{1}</translation>
</message>
<message>
@ -2346,4 +2346,4 @@
<translation type="unfinished"/>
</message>
</context>
</TS>
</TS>

View File

@ -1606,8 +1606,8 @@
</message>
<message>
<location filename="../../views/import_window.py" line="69"/>
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
{1}</source>
<translation>Het schema kan niet worden bijgewerkt. Stel een bugmelding op via de link op het tabblad Overig. Stuur de volgende informatie mee:
@ -2347,4 +2347,4 @@
<translation>Het wachtwoord wordt opgeslagen in de Vorta-instellingen.</translation>
</message>
</context>
</TS>
</TS>

View File

@ -1606,8 +1606,8 @@
</message>
<message>
<location filename="../../views/import_window.py" line="69"/>
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
<source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0}
{1}</source>
<translation>Upgrade schémy skončil s chybou, otvorte hlásenie o chybe kliknutím na odkaz na karte Rôzne a skopírujte tento text:
{0}
@ -2346,4 +2346,4 @@
<translation type="unfinished"/>
</message>
</context>
</TS>
</TS>

View File

@ -1,5 +1,6 @@
import importlib
import logging
from vorta.i18n import trans_late
logger = logging.getLogger(__name__)

View File

@ -1,6 +1,9 @@
import logging
import peewee
from vorta.store.models import SettingsModel
from .abc import VortaKeyring
logger = logging.getLogger(__name__)

View File

@ -1,7 +1,9 @@
import logging
import os
from PyQt6 import QtDBus
from PyQt6.QtCore import QMetaType, QVariant
from vorta.keyring.abc import VortaKeyring
logger = logging.getLogger(__name__)

View File

@ -1,7 +1,9 @@
import asyncio
import logging
import os
import secretstorage
from vorta.keyring.abc import VortaKeyring
logger = logging.getLogger(__name__)

View File

@ -8,6 +8,7 @@ Set up logging to user log dir. Uses the platform's default location:
import logging
from logging.handlers import TimedRotatingFileHandler
from .config import LOG_DIR
logger = logging.getLogger()

View File

@ -11,7 +11,11 @@ class NetworkStatusMonitor:
return DarwinNetworkStatus()
else:
from .network_manager import DBusException, NetworkManagerMonitor, UnsupportedException
from .network_manager import (
DBusException,
NetworkManagerMonitor,
UnsupportedException,
)
try:
return NetworkManagerMonitor()

View File

@ -1,6 +1,7 @@
import subprocess
from datetime import datetime as dt
from typing import Iterator, Optional
from vorta.log import logger
from vorta.network_status.abc import NetworkStatusMonitor, SystemWifiInfo

View File

@ -2,8 +2,10 @@ import logging
from datetime import datetime
from enum import Enum
from typing import Any, List, Mapping, NamedTuple, Optional
from PyQt6 import QtDBus
from PyQt6.QtCore import QObject, QVersionNumber
from vorta.network_status.abc import NetworkStatusMonitor, SystemWifiInfo
logger = logging.getLogger(__name__)

View File

@ -1,6 +1,8 @@
import logging
import sys
from PyQt6 import QtCore, QtDBus
from vorta.store.models import SettingsModel
try:

View File

@ -1,7 +1,9 @@
import datetime
import json
from json import JSONDecodeError
from playhouse.shortcuts import dict_to_model, model_to_dict
from vorta.keyring.abc import VortaKeyring
from vorta.store.connection import DB, SCHEMA_VERSION, init_db
from vorta.store.models import (

View File

@ -4,9 +4,11 @@ import threading
from datetime import datetime as dt
from datetime import timedelta
from typing import Dict, NamedTuple, Optional, Tuple, Union
from PyQt6 import QtCore, QtDBus
from PyQt6.QtCore import QTimer
from PyQt6.QtWidgets import QApplication
from vorta import application
from vorta.borg.check import BorgCheckJob
from vorta.borg.create import BorgCreateJob

View File

@ -1,8 +1,11 @@
import os
from datetime import datetime, timedelta
from peewee import Tuple, fn
from playhouse import signals
from vorta.autostart import open_app_at_startup
from .migrations import run_migrations
from .models import (
DB,

View File

@ -1,6 +1,8 @@
from datetime import datetime
import peewee as pw
from playhouse.migrate import SqliteMigrator, migrate
from .models import (
DB,
ArchiveModel,

View File

@ -6,8 +6,10 @@ At the bottom there is a simple schema migration system.
import json
from datetime import datetime
import peewee as pw
from playhouse import signals
from vorta.utils import slugify
DB = pw.Proxy()

View File

@ -1,5 +1,6 @@
import sys
from typing import Dict, List
from vorta.i18n import trans_late

View File

@ -1,6 +1,8 @@
import os
from PyQt6.QtGui import QIcon
from PyQt6.QtWidgets import QApplication, QMenu, QSystemTrayIcon
from vorta.store.models import BackupProfileModel
from vorta.utils import get_asset

View File

@ -1,5 +1,6 @@
import os
import sys
from vorta.store.models import SettingsModel

View File

@ -11,10 +11,12 @@ import unicodedata
from datetime import datetime as dt
from functools import reduce
from typing import Any, Callable, Iterable, List, Optional, Tuple, TypeVar
import psutil
from PyQt6 import QtCore
from PyQt6.QtCore import QFileInfo, QThread, pyqtSignal
from PyQt6.QtWidgets import QApplication, QFileDialog, QSystemTrayIcon
from vorta.borg._compatibility import BorgCompatibility
from vorta.i18n import trans_late
from vorta.log import logger

View File

@ -2,6 +2,7 @@ import logging
import sys
from datetime import timedelta
from typing import Dict, Optional
from PyQt6 import QtCore, uic
from PyQt6.QtCore import QItemSelectionModel, QMimeData, QPoint, Qt, pyqtSlot
from PyQt6.QtGui import QAction, QDesktopServices, QKeySequence, QShortcut
@ -17,6 +18,7 @@ from PyQt6.QtWidgets import (
QTableWidgetItem,
QWidget,
)
from vorta.borg.check import BorgCheckJob
from vorta.borg.compact import BorgCompactJob
from vorta.borg.delete import BorgDeleteJob

View File

@ -5,10 +5,21 @@ import re
from dataclasses import dataclass
from pathlib import PurePath
from typing import List, Optional, Tuple
from PyQt6 import uic
from PyQt6.QtCore import QDateTime, QLocale, QMimeData, QModelIndex, QPoint, Qt, QThread, QUrl
from PyQt6.QtCore import (
QDateTime,
QLocale,
QMimeData,
QModelIndex,
QPoint,
Qt,
QThread,
QUrl,
)
from PyQt6.QtGui import QColor, QKeySequence, QShortcut
from PyQt6.QtWidgets import QApplication, QHeaderView, QMenu, QTreeView
from vorta.store.models import SettingsModel
from vorta.utils import get_asset, pretty_bytes, uses_dark_mode
from vorta.views.partials.treemodel import (

View File

@ -1,12 +1,15 @@
import logging
import os
from pathlib import Path
from PyQt6 import uic
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QFileDialog, QMessageBox
from vorta.keyring.abc import VortaKeyring
from vorta.store.models import BackupProfileModel # noqa: F401
from vorta.utils import get_asset
from ..notifications import VortaNotifications
from ..profile_export import ProfileExport

View File

@ -5,14 +5,38 @@ from dataclasses import dataclass
from datetime import datetime
from pathlib import PurePath
from typing import Optional, Union
from PyQt6 import uic
from PyQt6.QtCore import QDateTime, QLocale, QMimeData, QModelIndex, QPoint, Qt, QThread, QUrl
from PyQt6.QtCore import (
QDateTime,
QLocale,
QMimeData,
QModelIndex,
QPoint,
Qt,
QThread,
QUrl,
)
from PyQt6.QtGui import QColor, QKeySequence, QShortcut
from PyQt6.QtWidgets import QApplication, QDialogButtonBox, QHeaderView, QMenu, QPushButton
from PyQt6.QtWidgets import (
QApplication,
QDialogButtonBox,
QHeaderView,
QMenu,
QPushButton,
)
from vorta.store.models import SettingsModel
from vorta.utils import borg_compat, get_asset, pretty_bytes, uses_dark_mode
from vorta.views.utils import get_colored_icon
from .partials.treemodel import FileSystemItem, FileTreeModel, FileTreeSortProxyModel, path_to_str, relative_path
from .partials.treemodel import (
FileSystemItem,
FileTreeModel,
FileTreeSortProxyModel,
path_to_str,
relative_path,
)
uifile = get_asset("UI/extractdialog.ui")
ExtractDialogUI, ExtractDialogBase = uic.loadUiType(uifile)

View File

@ -1,5 +1,6 @@
from PyQt6 import QtCore
from PyQt6.QtWidgets import QMessageBox
from vorta.keyring.abc import VortaKeyring
from vorta.profile_export import VersionException
from vorta.store.connection import SCHEMA_VERSION

View File

@ -1,14 +1,29 @@
import logging
from pathlib import Path
from PyQt6 import QtCore, uic
from PyQt6.QtCore import QPoint
from PyQt6.QtGui import QFontMetrics, QKeySequence, QShortcut
from PyQt6.QtWidgets import QApplication, QCheckBox, QFileDialog, QMenu, QMessageBox, QToolTip
from PyQt6.QtWidgets import (
QApplication,
QCheckBox,
QFileDialog,
QMenu,
QMessageBox,
QToolTip,
)
from vorta.profile_export import ImportFailedException, ProfileExport
from vorta.store.models import BackupProfileModel, SettingsModel
from vorta.utils import borg_compat, get_asset, get_network_status_monitor, is_system_tray_available
from vorta.utils import (
borg_compat,
get_asset,
get_network_status_monitor,
is_system_tray_available,
)
from vorta.views.partials.loading_button import LoadingButton
from vorta.views.utils import get_colored_icon
from .archive_tab import ArchiveTab
from .export_window import ExportWindow
from .import_window import ImportWindow

View File

@ -1,7 +1,17 @@
import logging
from PyQt6 import uic
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QApplication, QCheckBox, QFormLayout, QHBoxLayout, QLabel, QSizePolicy, QSpacerItem
from PyQt6.QtWidgets import (
QApplication,
QCheckBox,
QFormLayout,
QHBoxLayout,
QLabel,
QSizePolicy,
QSpacerItem,
)
from vorta._version import __version__
from vorta.config import LOG_DIR
from vorta.i18n import translate

View File

@ -1,4 +1,5 @@
from typing import Optional
from PyQt6.QtCore import QCoreApplication, QEvent, QSize, Qt
from PyQt6.QtGui import QHelpEvent, QIcon, QMouseEvent, QPaintEvent
from PyQt6.QtWidgets import QSizePolicy, QStyle, QStylePainter, QToolTip, QWidget

View File

@ -9,7 +9,15 @@ import os.path as osp
from functools import reduce
from pathlib import PurePath
from typing import Generic, List, Optional, Sequence, Tuple, TypeVar, Union, overload
from PyQt6.QtCore import QAbstractItemModel, QModelIndex, QObject, QSortFilterProxyModel, Qt, pyqtSignal
from PyQt6.QtCore import (
QAbstractItemModel,
QModelIndex,
QObject,
QSortFilterProxyModel,
Qt,
pyqtSignal,
)
#: A representation of a path
Path = Tuple[str, ...]

View File

@ -1,5 +1,6 @@
from PyQt6 import QtCore, uic
from PyQt6.QtWidgets import QDialogButtonBox
from vorta.i18n import trans_late, translate
from vorta.store.models import BackupProfileModel
from vorta.utils import get_asset

View File

@ -1,13 +1,21 @@
import re
from PyQt6 import QtCore, uic
from PyQt6.QtGui import QAction
from PyQt6.QtWidgets import QApplication, QDialogButtonBox, QLineEdit
from vorta.borg.info_repo import BorgInfoRepoJob
from vorta.borg.init import BorgInitJob
from vorta.i18n import translate
from vorta.keyring.abc import VortaKeyring
from vorta.store.models import RepoModel
from vorta.utils import borg_compat, choose_file_dialog, get_asset, get_private_keys, validate_passwords
from vorta.utils import (
borg_compat,
choose_file_dialog,
get_asset,
get_private_keys,
validate_passwords,
)
from vorta.views.utils import get_colored_icon
uifile = get_asset('UI/repoadd.ui')

View File

@ -1,10 +1,13 @@
import os
from pathlib import PurePath
from PyQt6 import QtCore, uic
from PyQt6.QtCore import QMimeData, QUrl
from PyQt6.QtWidgets import QApplication, QLayout, QMenu, QMessageBox
from vorta.store.models import ArchiveModel, BackupProfileMixin, RepoModel
from vorta.utils import borg_compat, get_asset, get_private_keys, pretty_bytes
from .repo_add_dialog import AddRepoWindow, ExistingRepoWindow
from .ssh_dialog import SSHAddWindow
from .utils import get_colored_icon

View File

@ -1,6 +1,13 @@
from PyQt6 import QtCore, uic
from PyQt6.QtCore import QDateTime, QLocale
from PyQt6.QtWidgets import QAbstractItemView, QApplication, QHeaderView, QListWidgetItem, QTableWidgetItem
from PyQt6.QtWidgets import (
QAbstractItemView,
QApplication,
QHeaderView,
QListWidgetItem,
QTableWidgetItem,
)
from vorta import application
from vorta.i18n import get_locale
from vorta.scheduler import ScheduleStatusType

View File

@ -1,12 +1,26 @@
import logging
import os
from pathlib import PurePath
from PyQt6 import QtCore, QtGui, uic
from PyQt6.QtCore import QFileInfo, QMimeData, QPoint, Qt, QUrl, pyqtSlot
from PyQt6.QtGui import QShortcut
from PyQt6.QtWidgets import QApplication, QHeaderView, QMenu, QMessageBox, QTableWidgetItem
from PyQt6.QtWidgets import (
QApplication,
QHeaderView,
QMenu,
QMessageBox,
QTableWidgetItem,
)
from vorta.store.models import BackupProfileMixin, SettingsModel, SourceFileModel
from vorta.utils import FilePathInfoAsync, choose_file_dialog, get_asset, pretty_bytes, sort_sizes
from vorta.utils import (
FilePathInfoAsync,
choose_file_dialog,
get_asset,
pretty_bytes,
sort_sizes,
)
from vorta.views.utils import get_colored_icon
uifile = get_asset('UI/sourcetab.ui')

View File

@ -1,7 +1,9 @@
import os
from PyQt6 import uic
from PyQt6.QtCore import QProcess, Qt
from PyQt6.QtWidgets import QApplication, QDialogButtonBox
from ..utils import get_asset
uifile = get_asset('UI/sshadd.ui')

View File

@ -1,4 +1,5 @@
from PyQt6.QtGui import QIcon, QImage, QPixmap
from vorta.utils import get_asset, uses_dark_mode

View File

@ -1,5 +1,6 @@
import os
import sys
import vorta._version
resource_file = os.path.join(os.path.dirname(vorta._version.__file__), 'assets/icons')

View File

@ -2,11 +2,12 @@ import os
import sys
from datetime import datetime as dt
from unittest.mock import MagicMock
import pytest
from peewee import SqliteDatabase
import vorta
import vorta.application
import vorta.borg.jobs_manager
from peewee import SqliteDatabase
from vorta.store.models import (
ArchiveModel,
BackupProfileModel,

View File

@ -1,5 +1,6 @@
from datetime import datetime
from unittest.mock import MagicMock
import pytest
from vorta.network_status.abc import SystemWifiInfo
from vorta.network_status.network_manager import (

View File

@ -1,10 +1,11 @@
from collections import namedtuple
import psutil
import pytest
from PyQt6 import QtCore
import vorta.borg
import vorta.utils
import vorta.views.archive_tab
from PyQt6 import QtCore
from vorta.store.models import ArchiveModel, BackupProfileModel

View File

@ -1,10 +1,18 @@
from pathlib import PurePath
import pytest
from PyQt6.QtCore import QDateTime, QItemSelectionModel, Qt
import vorta.borg
import vorta.utils
import vorta.views.archive_tab
from vorta.views.diff_result import ChangeType, DiffData, DiffTree, FileType, parse_diff_json, parse_diff_lines
from PyQt6.QtCore import QDateTime, QItemSelectionModel, Qt
from vorta.views.diff_result import (
ChangeType,
DiffData,
DiffTree,
FileType,
parse_diff_json,
parse_diff_lines,
)
@pytest.mark.parametrize(

View File

@ -1,5 +1,5 @@
from PyQt6.QtCore import QModelIndex, Qt
import vorta.borg
from PyQt6.QtCore import QModelIndex, Qt
from vorta.views.extract_dialog import ExtractTree, FileData, FileType, parse_json_lines
from vorta.views.partials.treemodel import FileSystemItem

View File

@ -1,5 +1,6 @@
import os
from pathlib import Path
import pytest
from PyQt6 import QtCore
from PyQt6.QtWidgets import QDialogButtonBox, QFileDialog, QMessageBox

View File

@ -1,7 +1,7 @@
import pytest
from PyQt6 import QtCore
import vorta.application
import vorta.borg.borg_job
from PyQt6 import QtCore
def test_create_perm_error(qapp, borg_json_output, mocker, qtbot):

View File

@ -2,10 +2,11 @@ import os
import sys
from pathlib import Path
from unittest.mock import Mock
import pytest
import vorta.store.models
from PyQt6 import QtCore
from PyQt6.QtWidgets import QCheckBox, QFormLayout
import vorta.store.models
def test_autostart(qapp, qtbot):

View File

@ -1,8 +1,9 @@
import sys
import pytest
from PyQt6 import QtDBus
import vorta.borg
import vorta.notifications
from PyQt6 import QtDBus
@pytest.mark.skipif(sys.platform != 'linux', reason="DBus notifications only on Linux")

View File

@ -1,9 +1,10 @@
import os
import uuid
import pytest
import vorta.borg.borg_job
from PyQt6 import QtCore
from PyQt6.QtWidgets import QMessageBox
import vorta.borg.borg_job
from vorta.keyring.abc import VortaKeyring
from vorta.store.models import ArchiveModel, EventLogModel, RepoModel

View File

@ -1,9 +1,10 @@
from datetime import datetime as dt
from datetime import timedelta
from unittest.mock import MagicMock
import pytest
from PyQt6 import QtCore
import vorta.scheduler
from PyQt6 import QtCore
from vorta.application import VortaApp
from vorta.store.models import BackupProfileModel, EventLogModel

View File

@ -2,10 +2,11 @@ from datetime import datetime as dt
from datetime import timedelta as td
from functools import wraps
from unittest.mock import MagicMock
import pytest
from pytest import mark
import vorta.borg
import vorta.scheduler
from pytest import mark
from vorta.scheduler import ScheduleStatus, ScheduleStatusType, VortaScheduler
from vorta.store.models import BackupProfileModel, EventLogModel

View File

@ -1,4 +1,5 @@
from pathlib import PurePath
import pytest
from PyQt6.QtCore import QModelIndex
from vorta.views.partials.treemodel import FileSystemItem, FileTreeModel

View File

@ -1,4 +1,5 @@
import uuid
from vorta.keyring.abc import VortaKeyring
from vorta.utils import find_best_unit_for_sizes, pretty_bytes