From 04688cd6ff58d09c950ae9791a7d2a6bc066704a Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 26 May 2019 18:16:49 +0200 Subject: Move edit_existing_post to external file --- cli/cli.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cli') diff --git a/cli/cli.py b/cli/cli.py index ed2680f4..d5caf15f 100644 --- a/cli/cli.py +++ b/cli/cli.py @@ -13,6 +13,8 @@ import time import signal +import blessed + from config.config import * from utils import utils @@ -355,3 +357,13 @@ def preview(args): sys.stderr.write("\nSIGINT received, cleaning up...\n") server_process.join() return 0 + + +def edit_existing_post(args): + selector = utils.PostSelector(blessed.Terminal(), utils.list_posts()) + selection = selector.select() + if selection: + print(selection) + edit_post_with_editor(selection) + else: + return 1 -- cgit v1.2.1