diff --git a/actions.py b/actions.py index b210799..bb77778 100644 --- a/actions.py +++ b/actions.py @@ -831,8 +831,8 @@ class Actions(object): current_conjur_hash = conjur_repo.head.object.hexsha current_ofxVideoArtTools_hash = ofxVideoArtTools_repo.head.object.hexsha - self.try_remove_file(self.data.PATH_TO_DATA_OBJECTS + self.data.SETTINGS_JSON ) - self.try_remove_file(self.data.PATH_TO_DEFAULT_CONJUR_DATA) + self.data.try_remove_file(self.data.PATH_TO_DATA_OBJECTS + self.data.SETTINGS_JSON ) + self.data.try_remove_file(self.data.PATH_TO_DEFAULT_CONJUR_DATA) try: recur_repo.remotes.origin.pull() conjur_repo.remotes.origin.pull() @@ -869,7 +869,4 @@ class Actions(object): self.message_handler.clear_all_messages() - @staticmethod - def try_remove_file(path): - if os.path.exists(path): - os.remove(path) + diff --git a/data_centre/data.py b/data_centre/data.py index 7c18d20..58e6d88 100644 --- a/data_centre/data.py +++ b/data_centre/data.py @@ -57,7 +57,7 @@ class Data(object): ### persisted data (use default if doesnt exits): if not os.path.isfile(self.PATH_TO_CONJUR_DATA): - os.remove(self.PATH_TO_DATA_OBJECTS + self.SETTINGS_JSON ) # keep the, in sync + self.try_remove_file(self.PATH_TO_DATA_OBJECTS + self.SETTINGS_JSON ) # keep the, in sync copyfile(self.PATH_TO_DEFAULT_CONJUR_DATA, self.PATH_TO_CONJUR_DATA) self.bank_data = [self.create_empty_bank()] @@ -405,3 +405,7 @@ class Data(object): else: return [] + @staticmethod + def try_remove_file(path): + if os.path.exists(path): + os.remove(path)