From 4fbf5d1d222610b0775f95472fe1a60aaedea29f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 28 Dec 2009 10:40:48 -0500 Subject: Restore comment stripping to libbe.ui.util.editor.editor_string() --- libbe/ui/util/editor.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libbe') diff --git a/libbe/ui/util/editor.py b/libbe/ui/util/editor.py index 83262e7..1a10fa4 100644 --- a/libbe/ui/util/editor.py +++ b/libbe/ui/util/editor.py @@ -56,6 +56,9 @@ def editor_string(comment=None, encoding=None): >>> os.environ["VISUAL"] = "echo baz > " >>> editor_string() u'baz\\n' + >>> os.environ["VISUAL"] = "echo 'baz\\n== Anything below this line will be ignored\\nHi' > " + >>> editor_string() + u'baz\\n' >>> del os.environ["EDITOR"] >>> del os.environ["VISUAL"] """ @@ -79,6 +82,7 @@ def editor_string(comment=None, encoding=None): os.system("%s %s" % (editor, fname)) output = libbe.util.encoding.get_file_contents( fname, encoding=encoding, decode=True) + output = trimmed_string(output) if output.rstrip('\n') == "": output = None finally: -- cgit