aboutsummaryrefslogtreecommitdiff
path: root/pyblog
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-05-26 23:16:55 +0200
committerneodarz <neodarz@neodarz.net>2019-05-26 23:30:55 +0200
commit2c1200b1cd084aeb084971698280176f04daea75 (patch)
treee3a15d4a39e2af380e495d2aaad8d83411feda9b /pyblog
parenta9ad96fa335adcaca173f5ef86d24aa2e504411c (diff)
downloadmy_new_personal_website-2c1200b1cd084aeb084971698280176f04daea75.tar.xz
my_new_personal_website-2c1200b1cd084aeb084971698280176f04daea75.zip
Move post relative functions to external file
Diffstat (limited to 'pyblog')
-rwxr-xr-xpyblog7
1 files changed, 4 insertions, 3 deletions
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()