1
|
|
|
from typing import List |
2
|
|
|
|
3
|
|
|
from cleo import Application, Command |
4
|
|
|
|
5
|
|
|
from backuppc_clone.command.AutoCommand import AutoCommand |
6
|
|
|
from backuppc_clone.command.BackupCloneCommand import BackupCloneCommand |
7
|
|
|
from backuppc_clone.command.BackupDeleteCommand import BackupDeleteCommand |
8
|
|
|
from backuppc_clone.command.BackupPreScanCommand import BackupPreScanCommand |
9
|
|
|
from backuppc_clone.command.HostDeleteCommand import HostDeleteCommand |
10
|
|
|
from backuppc_clone.command.InitCloneCommand import InitCloneCommand |
11
|
|
|
from backuppc_clone.command.InitOriginalCommand import InitOriginalCommand |
12
|
|
|
from backuppc_clone.command.NagiosCommand import NagiosCommand |
13
|
|
|
from backuppc_clone.command.PoolCommand import PoolCommand |
14
|
|
|
from backuppc_clone.command.SyncAuxiliaryCommand import SyncAuxiliaryCommand |
15
|
|
|
from backuppc_clone.command.TraversePerformanceTestCommand import TraversePerformanceTestCommand |
16
|
|
|
from backuppc_clone.command.VacuumCommand import VacuumCommand |
17
|
|
|
|
18
|
|
|
|
19
|
|
View Code Duplication |
class BackupPcCloneApplication(Application): |
|
|
|
|
20
|
|
|
""" |
21
|
|
|
The BackupPC Clone application. |
22
|
|
|
""" |
23
|
|
|
|
24
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
25
|
|
|
def __init__(self): |
26
|
|
|
""" |
27
|
|
|
Object constructor |
28
|
|
|
""" |
29
|
|
|
Application.__init__(self, 'backuppc-clone', '1.0.1') |
30
|
|
|
|
31
|
|
|
# ------------------------------------------------------------------------------------------------------------------ |
32
|
|
|
def get_default_commands(self) -> List[Command]: |
33
|
|
|
""" |
34
|
|
|
Returns the default commands of this application. |
35
|
|
|
|
36
|
|
|
:rtype: list[Command] |
37
|
|
|
""" |
38
|
|
|
commands = Application.get_default_commands(self) |
39
|
|
|
|
40
|
|
|
commands.append(AutoCommand()) |
41
|
|
|
commands.append(BackupCloneCommand()) |
42
|
|
|
commands.append(BackupDeleteCommand()) |
43
|
|
|
commands.append(BackupPreScanCommand()) |
44
|
|
|
commands.append(HostDeleteCommand()) |
45
|
|
|
commands.append(InitCloneCommand()) |
46
|
|
|
commands.append(InitOriginalCommand()) |
47
|
|
|
commands.append(NagiosCommand()) |
48
|
|
|
commands.append(PoolCommand()) |
49
|
|
|
commands.append(SyncAuxiliaryCommand()) |
50
|
|
|
commands.append(TraversePerformanceTestCommand()) |
51
|
|
|
commands.append(VacuumCommand()) |
52
|
|
|
|
53
|
|
|
return commands |
54
|
|
|
|
55
|
|
|
# ---------------------------------------------------------------------------------------------------------------------- |
56
|
|
|
|