Flake8 errors corrected

Corrected all errors given by Flake8 except line length
This commit is contained in:
Phyks 2013-07-23 21:29:14 +02:00
parent a74f4f3feb
commit cb0acf7ea6
2 changed files with 5 additions and 9 deletions

4
TODO
View File

@ -2,7 +2,3 @@ What happen when a file is moved with git ?
Flake8 the whole thing ! :)
basepath ?
tags / smileys / ...
Known bugs:
==========
* Test RSS in Firefox (different view than traditionnal RSS view ?)

View File

@ -11,6 +11,7 @@ import subprocess
from time import gmtime, strftime, mktime
def isset(variable):
return variable in locals() or variable in globals()
@ -494,7 +495,7 @@ for i in years_list:
except ValueError:
continue
#Generate page per year
#Generate page per year
page_year = header_gen.replace("@titre", params["BLOG_TITLE"]+" - "+i, 1)
months_list = os.listdir("blog/"+i)
@ -508,7 +509,7 @@ for i in years_list:
articles_list = list_directory("gen/"+i+"/"+j)
articles_list.sort(key=lambda x: os.stat(x).st_mtime, reverse=True)
for article in articles_list:
for article in articles_list:
try:
with open(article, "r") as article_fh:
article_content = article_fh.read()
@ -517,14 +518,13 @@ for i in years_list:
except IOError:
sys.exit("[ERROR] Error while generating years and months pages. Check your gen folder, you may need to regenerate some articles. The error was due to "+article+".")
page_month += footer_gen
try:
with open("blog/"+i+"/"+j+"/index.html", "w") as page_month_fh:
page_month_fh.write(page_month)
except IOError:
sys.exit("[ERROR] Unable to write index file for "+i+"/"+j+".")
sys.exit("[ERROR] Unable to write index file for "+i+"/"+j+".")
page_year += footer_gen
try:
with open("blog/"+i+"/index.html", "w") as page_year_fh: