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 --- pyblog | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'pyblog') diff --git a/pyblog b/pyblog index 8813d4af..37a37bc3 100755 --- a/pyblog +++ b/pyblog @@ -53,16 +53,6 @@ from generators import generators from cli import cli -def edit_existing_post(args): - selector = utils.PostSelector(blessed.Terminal(), utils.list_posts()) - selection = selector.select() - if selection: - print(selection) - cli.edit_post_with_editor(selection) - else: - return 1 - - def main(): """CLI interface.""" description = "Simple blog generator in Python with Pandoc as backend." @@ -119,7 +109,7 @@ def main(): parser_new_post = subparsers.add_parser( "edit", aliases=["e", "ed"], description="Bring up post selector to select post for editing.") - parser_new_post.set_defaults(func=edit_existing_post) + parser_new_post.set_defaults(func=cli.edit_existing_post) with utils.init_colorama(): args = parser.parse_args() -- cgit v1.2.1