Quellcode durchsuchen

refactor - use new function to detect new content

remove dead code
Oz N Tiram vor 9 Jahren
Ursprung
Commit
4d6bd0ada6
1 geänderte Dateien mit 6 neuen und 13 gelöschten Zeilen
  1. 6 13
      blogit/blogit.py

+ 6 - 13
blogit/blogit.py

@@ -1,4 +1,3 @@
-#!/usr/bin/env python
 # ============================================================================
 # Blogit.py is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License, version 3
@@ -435,27 +434,21 @@ def new_build():
     c. update archive page
 
     """
+    # TODO: slug each page to it's unique location
     print
     print "Rendering website now..."
     print
     print " entries:"
-    entries = list()
     tags = dict()
     root = CONFIG['content_root']
-    for post_id, post in find_new_items(DB.posts):
-        try:
-            entry = Entry(post)
-            if entry.render():
-                entries.append(entry)
+    for post_id, post in find_new_posts_and_pages(DB):
+        entry = post
+        if post.render():
+            if post.header['kind'] in ['writing', 'link']:
                 for tag in entry.tags:
                     tag.posts = [post_id]
                     tags[tag.name] = tag
-            print "     %s" % entry.path
-        except Exception as e:
-            print "Found some problem in: ", post
-            print e
-            print "Please correct this problem ..."
-            sys.exit(1)
+        print "     %s" % entry.path
 
     for name, to in tags.iteritems():
         print "updating tag %s" % name