1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-21 23:33:13 +00:00

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 source_lang = en
type = QT type = QT
minimum_perc = 80 minimum_perc = 80

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -2,10 +2,17 @@
import subprocess import subprocess
import tempfile import tempfile
from datetime import datetime as dt from datetime import datetime as dt
from vorta.config import LOG_DIR from vorta.config import LOG_DIR
from vorta.i18n import trans_late, translate 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 vorta.utils import borg_compat, format_archive_name, get_network_status_monitor
from .borg_job import BorgJob from .borg_job import BorgJob

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1606,11 +1606,11 @@
</message> </message>
<message> <message>
<location filename="../../views/import_window.py" line="69"/> <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: <source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0} {0}
{1}</source> {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: <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> {1}</translation>
</message> </message>
<message> <message>
@ -2346,4 +2346,4 @@
<translation>Ukládání hesla do nastavení Vorta.</translation> <translation>Ukládání hesla do nastavení Vorta.</translation>
</message> </message>
</context> </context>
</TS> </TS>

View file

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

View file

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

View file

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

View file

@ -1606,8 +1606,8 @@
</message> </message>
<message> <message>
<location filename="../../views/import_window.py" line="69"/> <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: <source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0} {0}
{1}</source> {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: <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> <translation>Het wachtwoord wordt opgeslagen in de Vorta-instellingen.</translation>
</message> </message>
</context> </context>
</TS> </TS>

View file

@ -1606,8 +1606,8 @@
</message> </message>
<message> <message>
<location filename="../../views/import_window.py" line="69"/> <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: <source>Schema upgrade failure, file a bug report with the link in the Misc tab with the following error:
{0} {0}
{1}</source> {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: <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} {0}
@ -2346,4 +2346,4 @@
<translation type="unfinished"/> <translation type="unfinished"/>
</message> </message>
</context> </context>
</TS> </TS>

View file

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

View file

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

View file

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

View file

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

View file

@ -8,6 +8,7 @@
import logging import logging
from logging.handlers import TimedRotatingFileHandler from logging.handlers import TimedRotatingFileHandler
from .config import LOG_DIR from .config import LOG_DIR
logger = logging.getLogger() logger = logging.getLogger()

View file

@ -11,7 +11,11 @@ def get_network_status_monitor(cls) -> 'NetworkStatusMonitor':
return DarwinNetworkStatus() return DarwinNetworkStatus()
else: else:
from .network_manager import DBusException, NetworkManagerMonitor, UnsupportedException from .network_manager import (
DBusException,
NetworkManagerMonitor,
UnsupportedException,
)
try: try:
return NetworkManagerMonitor() return NetworkManagerMonitor()

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -6,8 +6,10 @@
import json import json
from datetime import datetime from datetime import datetime
import peewee as pw import peewee as pw
from playhouse import signals from playhouse import signals
from vorta.utils import slugify from vorta.utils import slugify
DB = pw.Proxy() DB = pw.Proxy()

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,10 +5,21 @@
from dataclasses import dataclass from dataclasses import dataclass
from pathlib import PurePath from pathlib import PurePath
from typing import List, Optional, Tuple from typing import List, Optional, Tuple
from PyQt6 import uic 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.QtGui import QColor, QKeySequence, QShortcut
from PyQt6.QtWidgets import QApplication, QHeaderView, QMenu, QTreeView from PyQt6.QtWidgets import QApplication, QHeaderView, QMenu, QTreeView
from vorta.store.models import SettingsModel from vorta.store.models import SettingsModel
from vorta.utils import get_asset, pretty_bytes, uses_dark_mode from vorta.utils import get_asset, pretty_bytes, uses_dark_mode
from vorta.views.partials.treemodel import ( from vorta.views.partials.treemodel import (

View file

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

View file

@ -5,14 +5,38 @@
from datetime import datetime from datetime import datetime
from pathlib import PurePath from pathlib import PurePath
from typing import Optional, Union from typing import Optional, Union
from PyQt6 import uic 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.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.store.models import SettingsModel
from vorta.utils import borg_compat, get_asset, pretty_bytes, uses_dark_mode from vorta.utils import borg_compat, get_asset, pretty_bytes, uses_dark_mode
from vorta.views.utils import get_colored_icon 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") uifile = get_asset("UI/extractdialog.ui")
ExtractDialogUI, ExtractDialogBase = uic.loadUiType(uifile) ExtractDialogUI, ExtractDialogBase = uic.loadUiType(uifile)

View file

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

View file

@ -1,14 +1,29 @@
import logging import logging
from pathlib import Path from pathlib import Path
from PyQt6 import QtCore, uic from PyQt6 import QtCore, uic
from PyQt6.QtCore import QPoint from PyQt6.QtCore import QPoint
from PyQt6.QtGui import QFontMetrics, QKeySequence, QShortcut 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.profile_export import ImportFailedException, ProfileExport
from vorta.store.models import BackupProfileModel, SettingsModel 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.partials.loading_button import LoadingButton
from vorta.views.utils import get_colored_icon from vorta.views.utils import get_colored_icon
from .archive_tab import ArchiveTab from .archive_tab import ArchiveTab
from .export_window import ExportWindow from .export_window import ExportWindow
from .import_window import ImportWindow from .import_window import ImportWindow

View file

@ -1,7 +1,17 @@
import logging import logging
from PyQt6 import uic from PyQt6 import uic
from PyQt6.QtCore import Qt 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._version import __version__
from vorta.config import LOG_DIR from vorta.config import LOG_DIR
from vorta.i18n import translate from vorta.i18n import translate

View file

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

View file

@ -9,7 +9,15 @@
from functools import reduce from functools import reduce
from pathlib import PurePath from pathlib import PurePath
from typing import Generic, List, Optional, Sequence, Tuple, TypeVar, Union, overload 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 #: A representation of a path
Path = Tuple[str, ...] Path = Tuple[str, ...]

View file

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

View file

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

View file

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

View file

@ -1,6 +1,13 @@
from PyQt6 import QtCore, uic from PyQt6 import QtCore, uic
from PyQt6.QtCore import QDateTime, QLocale 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 import application
from vorta.i18n import get_locale from vorta.i18n import get_locale
from vorta.scheduler import ScheduleStatusType from vorta.scheduler import ScheduleStatusType

View file

@ -1,12 +1,26 @@
import logging import logging
import os import os
from pathlib import PurePath from pathlib import PurePath
from PyQt6 import QtCore, QtGui, uic from PyQt6 import QtCore, QtGui, uic
from PyQt6.QtCore import QFileInfo, QMimeData, QPoint, Qt, QUrl, pyqtSlot from PyQt6.QtCore import QFileInfo, QMimeData, QPoint, Qt, QUrl, pyqtSlot
from PyQt6.QtGui import QShortcut 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.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 from vorta.views.utils import get_colored_icon
uifile = get_asset('UI/sourcetab.ui') uifile = get_asset('UI/sourcetab.ui')

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -1,10 +1,18 @@
from pathlib import PurePath from pathlib import PurePath
import pytest import pytest
from PyQt6.QtCore import QDateTime, QItemSelectionModel, Qt
import vorta.borg import vorta.borg
import vorta.utils import vorta.utils
import vorta.views.archive_tab 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( @pytest.mark.parametrize(

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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