diff options
author | W. Trevor King <wking@drexel.edu> | 2009-07-27 06:23:20 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-07-27 06:23:20 -0400 |
commit | 3711c5080619b0decf0ae040a9d244bf3b902c41 (patch) | |
tree | e8b8cd2f2ae1d4c70253b3b95297d17ecfdd60ae /libbe/comment.py | |
parent | 5ce4bd3f4ce955577c46fe8e3c5a8f54b60ce3df (diff) | |
download | bugseverywhere-3711c5080619b0decf0ae040a9d244bf3b902c41.tar.gz |
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.
Diffstat (limited to 'libbe/comment.py')
-rw-r--r-- | libbe/comment.py | 3 |
1 files changed, 3 insertions, 0 deletions
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): |