def main2(): if not util.dir_exists(SRCDIR): print("Dir '%s' doesn't exist" % SRCDIR) sys.exit(1) post_files = postsparse.scan_posts(SRCDIR) posts = post_files.values() p = posts[0] print(p.keys())
def upload_blog(): if not util.dir_exists(SRCDIR): print("Dir '%s' doesn't exist" % SRCDIR) sys.exit(1) post_files = postsparse.scan_posts(SRCDIR) posts = post_files.values() posts.sort(lambda x,y: cmp(x[POST_DATE], y[POST_DATE])) genblog.gen_urls(posts) #print("posts: %d" % len(posts)) posts = [convert_blog_post(p) for p in posts] upload_posts(posts)
def upload_blog(): if not util.dir_exists(SRCDIR): print("Dir '%s' doesn't exist" % SRCDIR) sys.exit(1) post_files = postsparse.scan_posts(SRCDIR) posts = post_files.values() posts.sort(lambda x, y: cmp(x[POST_DATE], y[POST_DATE])) genblog.gen_urls(posts) #print("posts: %d" % len(posts)) posts = [convert_blog_post(p) for p in posts] upload_posts(posts)
def main(): if not util.dir_exists(SRCDIR): print("Dir '%s' doesn't exist" % SRCDIR) sys.exit(1) post_files = postsparse.scan_posts(SRCDIR) posts = post_files.values() posts.sort(lambda x, y: cmp(x["date"], y["date"])) gen_urls(posts) print("posts: %d" % len(posts)) write_feed(posts) for p in posts: url = p["url"] urlparts = url.split("/") filename = os.path.join("..", "www", *urlparts) write_one_post(p, filename) latest = posts[-1] filename = os.path.join("..", "www", "index.html") write_index_post(latest, filename) # should be done last since it reverses posts write_archives(posts)
def main(): if not util.dir_exists(SRCDIR): print("Dir '%s' doesn't exist" % SRCDIR) sys.exit(1) post_files = postsparse.scan_posts(SRCDIR) posts = post_files.values() posts.sort(lambda x,y: cmp(x["date"], y["date"])) gen_urls(posts) print("posts: %d" % len(posts)) write_feed(posts) for p in posts: url = p["url"] urlparts = url.split("/") filename = os.path.join("..", "www", *urlparts) write_one_post(p, filename) latest = posts[-1] filename = os.path.join("..", "www", "index.html") write_index_post(latest, filename) # should be done last since it reverses posts write_archives(posts)