From: W. Trevor King Date: Mon, 27 Jul 2009 10:23:20 +0000 (-0400) Subject: Hack Comment.load_settings() to work around From->Author change. X-Git-Tag: 1.0.0~62^2~46^2~9^2~7 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3711c5080619b0decf0ae040a9d244bf3b902c41;p=be.git 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. --- 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):