diff --git a/pre-commit.py b/pre-commit.py index a72b2a0..b991a8c 100755 --- a/pre-commit.py +++ b/pre-commit.py @@ -4,6 +4,7 @@ # TODO : Test the whole thing # TODO : What happens when I run it as a hook ? # TODO : What happens when I commit with -a option ? +# TODO : git ls-files import sys import getopt @@ -466,7 +467,7 @@ for filename in added_files+modified_files: "\t
\n" "\t\t

"+title+"

\n" "\t\t"+article+"\n" - "\t\t

"+date+"

\n" + "\t\t

"+date_readable+"

\n" "\t
\n") print("[INFO] (GEN ARTICLES) Article "+filename[4:]+" generated") except IOError: @@ -509,7 +510,7 @@ rss += ("\t" # Generate header (except title) + index file + rss file -for i, article in enumerate(last_articles): +for i, article in enumerate(["gen/"+x[4:-5]+".gen" for x in last_articles]): content, title, tags, date, author = "", "", "", "", "" try: with open(article, "r") as fh: @@ -536,14 +537,10 @@ for i, article in enumerate(last_articles): if i < 5: articles_header += "
  • " articles_header += (""+title+"") + article[4:-5]+".html\">"+title+"") articles_header += "
  • " - articles_index += "
  • " - articles_index += (""+title+"") - articles_index += "
  • " - + articles_index += content date_rss = strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime(mktime(datetime.datetime.strptime(date, "%d%m%Y-%H%M")