171 super().__init__(title, menu=menu, quit_button=None) |
171 super().__init__(title, menu=menu, quit_button=None) |
172 |
172 |
173 for index in range(len(backups)): |
173 for index in range(len(backups)): |
174 # Python closures suck dog's balls; hence the _index=index hack |
174 # Python closures suck dog's balls; hence the _index=index hack |
175 # See also http://math.andrej.com/2009/04/09/pythons-lambda-is-broken/ |
175 # See also http://math.andrej.com/2009/04/09/pythons-lambda-is-broken/ |
176 cb=(lambda status, errors=None, _index=index: |
176 cb=(lambda status, errorlog=None, _index=index: |
177 self.__status_callback(_index, status, errorlog=errors)) |
177 self.__status_callback(_index, status, errorlog=errorlog)) |
178 backups[index].set_status_update_callback(cb) |
178 backups[index].set_status_update_callback(cb) |
179 |
179 |
180 dreamtime.add_callback(self, self.refresh_ui) |
180 dreamtime.add_callback(self, self.refresh_ui) |
181 |
181 |
182 def __rebuild_menu(self): |
182 def __rebuild_menu(self): |