aboutsummaryrefslogtreecommitdiffstats
path: root/libbe
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-28 10:40:48 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-28 10:40:48 -0500
commit4fbf5d1d222610b0775f95472fe1a60aaedea29f (patch)
tree6f54643e1d3ba24d7c58c429d38f51358db50eea /libbe
parentf96762deddc0cb6b1380abdcbbe7347ae23f18a1 (diff)
downloadbugseverywhere-4fbf5d1d222610b0775f95472fe1a60aaedea29f.tar.gz
Restore comment stripping to libbe.ui.util.editor.editor_string()
Diffstat (limited to 'libbe')
-rw-r--r--libbe/ui/util/editor.py4
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: