From 2c1200b1cd084aeb084971698280176f04daea75 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sun, 26 May 2019 23:16:55 +0200 Subject: Move post relative functions to external file --- pyblog | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'pyblog') diff --git a/pyblog b/pyblog index 1e08a2f3..b8cd4e71 100755 --- a/pyblog +++ b/pyblog @@ -13,6 +13,7 @@ import dateutil.parser from utils import utils from cli import cli +from cli import post def main(): @@ -26,7 +27,7 @@ def main(): "new_post", aliases=["n", "new"], description="Create a new post with metadata pre-filled.") parser_new_post.add_argument("title", help="title of the new post") - parser_new_post.set_defaults(func=cli.new_post_cli) + parser_new_post.set_defaults(func=post.new_post_cli) parser_new_post = subparsers.add_parser( "touch", aliases=["t", "tou"], @@ -41,7 +42,7 @@ def main(): parser_new_post.add_argument("filename", help="path or basename of the source file, " "e.g., 2015-05-05-new-blog-new-start.md") - parser_new_post.set_defaults(func=cli.touch_cli) + parser_new_post.set_defaults(func=post.touch_cli) parser_generate = subparsers.add_parser( "generate", aliases=["g", "gen"], @@ -71,7 +72,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=cli.edit_existing_post) + parser_new_post.set_defaults(func=post.edit_existing_post) with utils.init_colorama(): args = parser.parse_args() -- cgit v1.2.1