Commit aff5a9b3 authored by David Hrbáč's avatar David Hrbáč

Display only errors

parent 530b2a8a
...@@ -28,7 +28,8 @@ def main(location): ...@@ -28,7 +28,8 @@ def main(location):
return_value = 0 return_value = 0
prev_line = lines.pop(0) prev_line = lines.pop(0)
disabled = 0 disabled = 0
print(`location`) echo_filename = False
#print(`location`)
for line in lines: for line in lines:
if line.startswith("``") and disabled == 0: if line.startswith("``") and disabled == 0:
disabled = 1 disabled = 1
...@@ -37,19 +38,22 @@ def main(location): ...@@ -37,19 +38,22 @@ def main(location):
disabled = 0 disabled = 0
if line.startswith('#') and disabled == 0: if line.startswith('#') and disabled == 0:
if line != titlecase(line[:(line.find("]"))], callback=abbreviations)+line[(line.find("]")):]: if line != titlecase(line[:(line.find("]"))], callback=abbreviations)+line[(line.find("]")):]:
print() if return_value == 0 and echo_filename == False:
print("%s" % location)
echo_filename = True
print("-"+line,end="") print("-"+line,end="")
print("+"+titlecase(line[:(line.find("]"))], callback=abbreviations)+line[(line.find("]")):],end="") print("+"+titlecase(line[:(line.find("]"))], callback=abbreviations)+line[(line.find("]")):],end="")
print()
return_value = 1 return_value = 1
if (line.startswith('---') or line.startswith('===')) and disabled == 0: if (line.startswith('---') or line.startswith('===')) and disabled == 0:
if prev_line != titlecase(prev_line[:(prev_line.find("]"))], callback=abbreviations)+prev_line[(prev_line.find("]")):]: if prev_line != titlecase(prev_line[:(prev_line.find("]"))], callback=abbreviations)+prev_line[(prev_line.find("]")):]:
print()
print("-"+prev_line,end="") print("-"+prev_line,end="")
print("+"+titlecase(prev_line[:(prev_line.find("]"))], callback=abbreviations)+prev_line[(prev_line.find("]")):],end="") print("+"+titlecase(prev_line[:(prev_line.find("]"))], callback=abbreviations)+prev_line[(prev_line.find("]")):],end="")
print()
return_value = 1 return_value = 1
prev_line = line prev_line = line
if return_value == 0: #if return_value == 0:
print("==Ok==") # print("==Ok==")
exit(return_value) exit(return_value)
if __name__ == "__main__": if __name__ == "__main__":
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment