Fix issues

This commit is contained in:
Phyks 2014-10-18 22:45:56 +02:00
parent a6eb3e0c2c
commit 11da6ecbba

View File

@ -44,7 +44,7 @@ def gfm(text):
extractions = {} extractions = {}
def pre_extraction_callback(matchobj): def pre_extraction_callback(matchobj):
digest = md5(matchobj.group(0)).hexdigest() digest = md5(matchobj.group(0).encode("utf-8")).hexdigest()
extractions[digest] = matchobj.group(0) extractions[digest] = matchobj.group(0)
return "{gfm-extraction-%s}" % digest return "{gfm-extraction-%s}" % digest
pattern = re.compile(r'<pre>.*?</pre>', re.MULTILINE | re.DOTALL) pattern = re.compile(r'<pre>.*?</pre>', re.MULTILINE | re.DOTALL)
@ -567,7 +567,10 @@ for filename in modified_files:
print("[INFO] (TAGS) Found new tag " print("[INFO] (TAGS) Found new tag "
+ tag[:tag.index(".tmp")]+" for modified article " + tag[:tag.index(".tmp")]+" for modified article "
+ filename[4:]+".") + filename[4:]+".")
tags.remove(tag_file[9:]) try:
tags.remove(tag[9:])
except ValueError:
pass
if (tag[tag.index("tags/") + 5:tag.index(".tmp")] not in tags if (tag[tag.index("tags/") + 5:tag.index(".tmp")] not in tags
and filename[4:] in tag_file.read()): and filename[4:] in tag_file.read()):
tag_old = tag_file.read() tag_old = tag_file.read()
@ -592,7 +595,10 @@ for filename in modified_files:
os.system('git rm '+tag) os.system('git rm '+tag)
print(tags) print(tags)
try:
tags.remove(tag[9:]) tags.remove(tag[9:])
except ValueError:
pass
except IOError: except IOError:
sys.exit("[ERROR] (TAGS) An error occurred when parsing tags " sys.exit("[ERROR] (TAGS) An error occurred when parsing tags "