diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-28 10:40:48 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-28 10:40:48 -0500 |
commit | 4fbf5d1d222610b0775f95472fe1a60aaedea29f (patch) | |
tree | 6f54643e1d3ba24d7c58c429d38f51358db50eea /libbe/ui/util/editor.py | |
parent | f96762deddc0cb6b1380abdcbbe7347ae23f18a1 (diff) | |
download | bugseverywhere-4fbf5d1d222610b0775f95472fe1a60aaedea29f.tar.gz |
Restore comment stripping to libbe.ui.util.editor.editor_string()
Diffstat (limited to 'libbe/ui/util/editor.py')
-rw-r--r-- | libbe/ui/util/editor.py | 4 |
1 files changed, 4 insertions, 0 deletions
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: |