From 85f447df4bd2a1764858a14012d4b1365309a895 Mon Sep 17 00:00:00 2001 From: neodarz Date: Thu, 4 May 2017 03:28:35 +0200 Subject: Drop some usless code and add some usfull code --- pyblog | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'pyblog') diff --git a/pyblog b/pyblog index 8d7fc377..461a9934 100755 --- a/pyblog +++ b/pyblog @@ -37,8 +37,6 @@ import dateutil.parser import dateutil.tz import lxml.etree as ET -from pyfiglet import Figlet - ############################# BLOG CONFIGURATIONS ############################## # Safe to customize BLOG_HOME = "http://neodarz.net/" @@ -643,7 +641,8 @@ def rewrite_title(): lines = indexmd.readlines() with open(filename, 'w', encoding='utf-8') as indexmd: for line in lines: - indexmd.write(re.sub(r'\
\(.+?)\<\/code\>\<\/pre\>', '
'+f.renderText('Miou')+'(^._.^)ノ
', line)) + #indexmd.write(re.sub(r'\
\(.+?)\<\/code\>\<\/pre\>', '
'+f.renderText('Miou')+'(^._.^)ノ
', line)) + indexmd.write(re.suv(r'\', '\', line)) except Exception: sys.stderr.write("=== /!\ ERROR /!\ ===\n") @@ -651,7 +650,6 @@ def rewrite_title(): sys.stderr.write("sudo cp source/fonts/3d.flf /usr/lib/python3.6/site-packages/pyfiglet/fonts\n\n") sys.exit(0) - def absolutify_links(soup, baseurl): """Make links in an article absolute. @@ -1031,7 +1029,7 @@ def generate_blog(fresh=False, report_total_errors=True): continue extension = name.split(".")[-1] - if extension not in ["css", "html", "jpg", "md", "png", "svg", "ico", "txt", + if extension not in ["css", "js", "asc", "html", "jpg", "md", "png", "svg", "ico", "txt", "eot", "ttf", "woff", "woff2"]: continue @@ -1048,7 +1046,7 @@ def generate_blog(fresh=False, report_total_errors=True): anything_modified = True if srcpath == INDEXMD: continue # index will be processed separately - if extension in ["css", "html", "jpg", "png", "svg", "ico", "txt", + if extension in ["css", "js", "asc", "html", "jpg", "png", "svg", "ico", "txt", "eot", "ttf", "woff", "woff2"]: sys.stderr.write("copying %s\n" % relpath) shutil.copy(srcpath, dstpath) -- cgit v1.2.1