Rename some classes to meaningful names (pep8)

This commit is contained in:
Bullet64 2022-09-14 15:56:17 +02:00
parent 0692a5411e
commit 31c08fe70f
4 changed files with 64 additions and 68 deletions

View file

@ -9,7 +9,6 @@ cryptography = "*"
pylint = "*"
[dev-packages]
flake8 = "*"
[requires]
python_version = "3.10"

37
Pipfile.lock generated
View file

@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
"sha256": "29f8ad32ea4c5e44436b2d3b27dfa1f8ae15fc8f90853c0ce96ff19462200468"
"sha256": "487ba5622c2c55bc646bf28eaf9249b2e39011db8f7fcc46b164e7c6950284db"
},
"pipfile-spec": 6,
"requires": {
@ -341,38 +341,5 @@
"version": "==1.14.1"
}
},
"develop": {
"flake8": {
"hashes": [
"sha256:6fbe320aad8d6b95cec8b8e47bc933004678dc63095be98528b7bdd2a9f510db",
"sha256:7a1cf6b73744f5806ab95e526f6f0d8c01c66d7bbe349562d22dfca20610b248"
],
"index": "pypi",
"version": "==5.0.4"
},
"mccabe": {
"hashes": [
"sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325",
"sha256:6c2d30ab6be0e4a46919781807b4f0d834ebdd6c6e3dca0bda5a15f863427b6e"
],
"markers": "python_version >= '3.6'",
"version": "==0.7.0"
},
"pycodestyle": {
"hashes": [
"sha256:2c9607871d58c76354b697b42f5d57e1ada7d261c261efac224b664affdc5785",
"sha256:d1735fc58b418fd7c5f658d28d943854f8a849b01a5d0a1e6f3f3fdd0166804b"
],
"markers": "python_version >= '3.6'",
"version": "==2.9.1"
},
"pyflakes": {
"hashes": [
"sha256:4579f67d887f804e67edb544428f264b7b24f435b263c4614f384135cea553d2",
"sha256:491feb020dca48ccc562a8c0cbe8df07ee13078df59813b83959cbdada312ea3"
],
"markers": "python_version >= '3.6'",
"version": "==2.5.0"
}
}
"develop": {}
}

33
requirements.txt Normal file
View file

@ -0,0 +1,33 @@
astroid==2.12.9
cffi==1.15.1
cryptography==38.0.1
dill==0.3.5.1
docstring-to-markdown==0.10
gitdb==4.0.9
GitPython==3.1.27
isort==5.10.1
jedi==0.18.1
lazy-object-proxy==1.7.1
mccabe==0.7.0
numpy==1.23.3
parso==0.8.3
pbr==5.10.0
platformdirs==2.5.2
pyarrow==9.0.0
pycodestyle==2.9.1
pycparser==2.21
pydantic==1.9.2
pyflakes==2.5.0
pygls==0.12.1
pylint==2.15.2
PyQt6==6.3.1
PyQt6-Qt6==6.3.1
PyQt6-sip==13.4.0
PyYAML==6.0
smmap==5.0.0
stevedore==4.0.0
tomli==2.0.1
tomlkit==0.11.4
typeguard==2.13.3
typing_extensions==4.3.0
wrapt==1.14.1

View file

@ -148,7 +148,7 @@ class Spinner():
###############################################
class Worker(QObject):
class WorkerResticStats(QObject):
""" Worker Class for Rest function restic_stats """
stats_finished = pyqtSignal(str)
@ -166,7 +166,6 @@ class Worker(QObject):
row = ActiveRow.get(self)
try:
#list = []
match_list = [backup_data[row].rest, bool(backup_data[row].password)]
match match_list:
@ -174,7 +173,6 @@ class Worker(QObject):
# backup_data[row].rest, bool(backup_data[row].password)
case ["0", False]:
# Restic function
print("1")
args = [restic,
'-r',
backup_data[row].repository,
@ -192,7 +190,6 @@ class Worker(QObject):
# backup_data[row].rest, bool(backup_data[row].password)
case["0", True]:
# Restic function
print("2")
args = [restic,
'-r',
backup_data[row].repository,
@ -261,7 +258,7 @@ class Worker(QObject):
###############################################
class Worker2(QObject):
class WorkerResticBackup(QObject):
""" Worker Class for Rest function restic_backup """
backup_finished = pyqtSignal(str)
@ -446,7 +443,7 @@ class Worker2(QObject):
###############################################
class Worker3(QObject):
class WorkerResticSnapshots(QObject):
""" Worker Class for Rest function restic_snapshots """
snapshots_finished = pyqtSignal(str)
@ -553,7 +550,7 @@ class Worker3(QObject):
###############################################
class Worker4(QObject):
class WorkerResticListSnapshot(QObject):
""" Worker Class for Rest function restic_ls2 """
ls2_finished = pyqtSignal(str)
@ -657,7 +654,7 @@ class Worker4(QObject):
###############################################
class Worker5(QObject):
class WorkerResticInit(QObject):
""" Worker Class for Rest function init """
init_finished = pyqtSignal(str)
@ -823,8 +820,8 @@ class Worker5(QObject):
###############################################
class Worker6(QObject):
""" Worker Class for Rest function restic_prune2 """
class WorkerResticPrune(QObject):
""" Worker Class for Rest function restic_prune """
prune_finished = pyqtSignal(str)
prune_error = pyqtSignal(str)
@ -950,7 +947,7 @@ class Worker6(QObject):
###############################################
class Worker7(QObject):
class WorkerResticCheck(QObject):
""" Worker Class for Rest function restic_check """
check_finished = pyqtSignal(str)
@ -1063,7 +1060,7 @@ class Worker7(QObject):
###############################################
class Worker8(QObject):
class WorkerResticUnlock(QObject):
""" Worker Class for Rest function check """
unlock_finished = pyqtSignal(str)
@ -1165,7 +1162,7 @@ class Worker8(QObject):
###############################################
class Worker9(QObject):
class WorkerResticRestore(QObject):
""" Worker Class for Rest function restic_restore """
restore_finished = pyqtSignal(str)
@ -1287,7 +1284,7 @@ class Worker9(QObject):
###############################################
class Worker10(QObject):
class WorkerResticMount(QObject):
""" Worker Class for Rest function restic_mount """
mount_finished = pyqtSignal(str)
@ -1426,7 +1423,7 @@ class Worker10(QObject):
###############################################
class Worker11(QObject):
class WorkerResticClearCache(QObject):
""" Worker Class for Rest function clear cache """
cache_finished = pyqtSignal(str)
@ -1531,7 +1528,7 @@ class Worker11(QObject):
###############################################
class Worker12(QObject):
class WorkerResticCheckMigrate(QObject):
""" Worker Class for Rest function migrate check """
migrate_check_finished = pyqtSignal(str)
@ -1632,7 +1629,7 @@ class Worker12(QObject):
###############################################
class Worker13(QObject):
class WorkerResticMigrateUpdate(QObject):
""" Worker Class for Rest function migrate update """
migrate_update_finished = pyqtSignal(str)
@ -1735,7 +1732,7 @@ class Worker13(QObject):
###############################################
class Worker14(QObject):
class WorkerResticCallRepoVersion(QObject):
""" Worker Class for call repo version, v1 or v2? """
call_repo_version_finished = pyqtSignal(str)
@ -3323,7 +3320,7 @@ class MainWindow(QMainWindow):
# Create a QThread object
self.thread = QThread()
# Create a worker object
self.worker1 = Worker()
self.worker1 = WorkerResticStats()
# Move worker to the thread
self.worker1.moveToThread(self.thread)
# Connect signals and slots
@ -3334,7 +3331,7 @@ class MainWindow(QMainWindow):
# Worker for restic_backup
self.thread2 = QThread()
self.worker2 = Worker2()
self.worker2 = WorkerResticBackup()
self.worker2.moveToThread(self.thread2)
self.thread2.started.connect(self.worker2.run)
self.worker2.backup_finished[str].connect(self.restic_backup_finished)
@ -3342,7 +3339,7 @@ class MainWindow(QMainWindow):
# Worker for restic_snapshots
self.thread3 = QThread()
self.worker3 = Worker3()
self.worker3 = WorkerResticSnapshots()
self.worker3.moveToThread(self.thread3)
self.thread3.started.connect(self.worker3.run)
self.worker3.snapshots_finished[str].connect(self.restic_snapshots_finished)
@ -3350,7 +3347,7 @@ class MainWindow(QMainWindow):
# Worker for restic_ls2
self.thread4 = QThread()
self.worker4 = Worker4()
self.worker4 = WorkerResticListSnapshot()
self.worker4.moveToThread(self.thread4)
self.thread4.started.connect(self.worker4.run)
self.worker4.ls2_finished[str].connect(self.restic_ls2_finished)
@ -3358,7 +3355,7 @@ class MainWindow(QMainWindow):
# Worker for restic_init
self.thread5 = QThread()
self.worker5 = Worker5()
self.worker5 = WorkerResticInit()
self.worker5.moveToThread(self.thread5)
self.thread5.started.connect(self.worker5.run)
self.worker5.init_finished[str].connect(self.restic_init_finished)
@ -3366,7 +3363,7 @@ class MainWindow(QMainWindow):
# Worker for restic_prune
self.thread6 = QThread()
self.worker6 = Worker6()
self.worker6 = WorkerResticPrune()
self.worker6.moveToThread(self.thread6)
self.thread6.started.connect(self.worker6.run)
self.worker6.prune_finished[str].connect(self.restic_prune_finished)
@ -3374,7 +3371,7 @@ class MainWindow(QMainWindow):
# Worker for restic_check
self.thread7 = QThread()
self.worker7 = Worker7()
self.worker7 = WorkerResticCheck()
self.worker7.moveToThread(self.thread7)
self.thread7.started.connect(self.worker7.run)
self.worker7.check_finished[str].connect(self.restic_check_finished)
@ -3382,7 +3379,7 @@ class MainWindow(QMainWindow):
# Worker for restic_unlock
self.thread8 = QThread()
self.worker8 = Worker8()
self.worker8 = WorkerResticUnlock()
self.worker8.moveToThread(self.thread8)
self.thread8.started.connect(self.worker8.run)
self.worker8.unlock_finished[str].connect(self.restic_unlock_finished)
@ -3390,7 +3387,7 @@ class MainWindow(QMainWindow):
# Worker for restic_restore
self.thread9 = QThread()
self.worker9 = Worker9()
self.worker9 = WorkerResticRestore()
self.worker9.moveToThread(self.thread9)
self.thread9.started.connect(self.worker9.run)
self.worker9.restore_finished[str].connect(self.restic_restore_finished)
@ -3398,7 +3395,7 @@ class MainWindow(QMainWindow):
# Worker for restic_mount
self.thread10 = QThread()
self.worker10 = Worker10()
self.worker10 = WorkerResticMount()
self.worker10.moveToThread(self.thread10)
self.thread10.started.connect(self.worker10.run)
self.worker10.mount_finished[str].connect(self.restic_mount_finished)
@ -3406,7 +3403,7 @@ class MainWindow(QMainWindow):
# Worker for restic_cache
self.thread11 = QThread()
self.worker11 = Worker11()
self.worker11 = WorkerResticClearCache()
self.worker11.moveToThread(self.thread11)
self.thread11.started.connect(self.worker11.run)
self.worker11.cache_finished[str].connect(self.restic_cache_finished)
@ -3414,7 +3411,7 @@ class MainWindow(QMainWindow):
# Worker for restic_migrate -r Check!
self.thread12 = QThread()
self.worker12 = Worker12()
self.worker12 = WorkerResticCheckMigrate()
self.worker12.moveToThread(self.thread12)
self.thread12.started.connect(self.worker12.run)
self.worker12.migrate_check_finished[str].connect(self.restic_migrate_check_finished)
@ -3422,7 +3419,7 @@ class MainWindow(QMainWindow):
# Worker for restic_migrate upgrade_repo_v2
self.thread13 = QThread()
self.worker13 = Worker13()
self.worker13 = WorkerResticMigrateUpdate()
self.worker13.moveToThread(self.thread13)
self.thread13.started.connect(self.worker13.run)
self.worker13.migrate_update_finished[str].connect(self.restic_migrate_update_finished)
@ -3430,7 +3427,7 @@ class MainWindow(QMainWindow):
# Worker for call repo version, v1 or v2 ?
self.thread14 = QThread()
self.worker14 = Worker14()
self.worker14 = WorkerResticCallRepoVersion()
self.worker14.moveToThread(self.thread14)
self.thread14.started.connect(self.worker14.run)
self.worker14.call_repo_version_finished[str].connect(self.call_repo_version_finished)