From 3711c5080619b0decf0ae040a9d244bf3b902c41 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 27 Jul 2009 06:23:20 -0400 Subject: [PATCH] Hack Comment.load_settings() to work around From->Author change. "Author" -> comment.author obeys settings_object.setting_name_to_attr_name(), but all the current on-disk mapfiles talk about "From". Add a hack to accept both forms of on-disk comment files. --- libbe/comment.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libbe/comment.py b/libbe/comment.py index 7b43c08..53519bf 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -557,6 +557,9 @@ class Comment(Tree, settings_object.SavedSettingsObject): if self.sync_with_disk == False: raise DiskAccessRequired("load settings") self.settings = mapfile.map_load(self.rcs, self.get_path("values")) + # hack to deal with old BE comments: + if "From" in self.settings: + self.settings["Author"] = self.settings.pop("From") self._setup_saved_settings() def save_settings(self): -- 2.26.2