diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-13 02:35:31 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-13 02:35:31 -0500 |
commit | ea10f0e350c5c683d5a4243a85716024562ab375 (patch) | |
tree | bc3820f80a8fc1cd7c5c1f7d5a68d5f3377deefd /clients/urwid/main.py | |
parent | 4b55d702c5580a04da3f81db4e287a588833ef72 (diff) | |
download | bbj-ea10f0e350c5c683d5a4243a85716024562ab375.tar.gz |
discard bodies with only quotes as empty
Diffstat (limited to 'clients/urwid/main.py')
-rw-r--r-- | clients/urwid/main.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/clients/urwid/main.py b/clients/urwid/main.py index 827863a..6963e3c 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -31,6 +31,7 @@ import tempfile import urwid import json import os +import re try: port_spec = argv.index("--port") @@ -1199,9 +1200,11 @@ class ExternalEditor(urwid.Terminal): if self.terminated: app.close_editor() with open(self.path) as _: - self.params.update({"body": _.read().strip()}) + body = _.read().strip() os.remove(self.path) - if self.params["body"]: + + if body and not re.search("^>>[0-9]+$", body): + self.params.update({"body": body}) network.request(self.endpoint, **self.params) return app.refresh(True) else: |