97 return str(self.type) |
97 return str(self.type) |
98 |
98 |
99 |
99 |
100 class Status(Operation): |
100 class Status(Operation): |
101 def __init__(self, backup, op=None): |
101 def __init__(self, backup, op=None): |
102 op=None |
102 op=backup.current_operation |
103 errorsop=None |
103 errorsop=backup.previous_operation |
104 |
104 |
105 if backup.current_operation: |
105 if not op: |
106 op=backup.current_operation |
|
107 elif backup.scheduled_operation: |
|
108 op=backup.scheduled_operation |
106 op=backup.scheduled_operation |
109 if backup.previous_operation: |
|
110 errorsop=backup.previous_operation |
|
111 |
107 |
112 if op: |
108 if op: |
113 super().__init__(op.type, op.start_time, **op.detail) |
109 super().__init__(op.type, op.start_time, **op.detail) |
114 if not errorsop: |
110 else: |
115 errorsop=op |
111 super().__init__(None, None) |
|
112 |
|
113 if not errorsop: |
|
114 errorsop=op |
|
115 |
|
116 if errorsop: |
116 self.errors=errorsop.errors |
117 self.errors=errorsop.errors |
117 else: |
|
118 super().__init__(None, None) |
|
119 |
118 |
120 self.name=backup.name |
119 self.name=backup.name |
121 self.state=backup.state |
120 self.state=backup.state |
122 |
121 |
123 # |
122 # |