diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-12 07:00:53 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-12 07:00:53 -0500 |
commit | 7eef803084d58b9a67736a5e67efd63ea825bd94 (patch) | |
tree | 615726584652f1cfd65e67552156fdb04c01fabb /clients/urwid/main.py | |
parent | 76aced8875c3c68b41fda9191ff4c0a7570f929e (diff) | |
download | bbj-7eef803084d58b9a67736a5e67efd63ea825bd94.tar.gz |
integrate init_bodies into overthrowing edit
Diffstat (limited to 'clients/urwid/main.py')
-rw-r--r-- | clients/urwid/main.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clients/urwid/main.py b/clients/urwid/main.py index 6d70c1a..110f3d0 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -804,7 +804,7 @@ class App(object): self.set_footer(string) - def overthrow_ext_edit(self): + def overthrow_ext_edit(self, init_body=""): """ Opens the external editor, but instead of integreating it into the app, stops the mainloop and blocks until the editor is killed. Returns the @@ -812,6 +812,8 @@ class App(object): """ self.loop.stop() descriptor, path = tempfile.mkstemp() + with open(path, "w") as _: + _.write(init_body) run("%s %s" % (self.prefs["editor"], path), shell=True) with open(path) as _: body = _.read() @@ -835,7 +837,7 @@ class App(object): "Title", self.compose, extra_text=e.description) if self.prefs["editor"] and not self.prefs["integrate_external_editor"]: - body = self.overthrow_ext_edit() + body = self.overthrow_ext_edit(init_body) if not body: return self.temp_footer_message("EMPTY POST DISCARDED") params = {"body": body} |