]> projects.mako.cc - kuro5hin_to_wordpress/commitdiff
make comment status open by default master
authorBenjamin Mako Hill <mako@atdot.cc>
Sat, 17 Feb 2018 17:59:35 +0000 (09:59 -0800)
committerBenjamin Mako Hill <mako@atdot.cc>
Sat, 17 Feb 2018 17:59:35 +0000 (09:59 -0800)
k5_to_wordpress_diary_importer.py

index c41cb95bd4cb29f78b8ba6f829eb5f3567e2f64e..8c26222e0fec3ea034dfc1ee4562ebd9e2d0cd02 100755 (executable)
@@ -74,11 +74,12 @@ def process_file(input_text, filename):
     post.date = post_date
     post.terms_names = wp_terms 
     post.post_status = "pending"
-
-    wp.call(NewPost(post))
+    post.comment_status = "open"
     
+    new_post_id = wp.call(NewPost(post))
     
 for filename in sys.argv[1:]:
     with open(filename, "r", encoding="latin1") as f:
         process_file(f.read(), filename)
 
+

Benjamin Mako Hill || Want to submit a patch?