mirror of
https://github.com/nlohmann/json.git
synced 2026-02-17 09:03:58 +00:00
Clean up and document project files (#4560)
This commit is contained in:
8
tests/thirdparty/imapdl/filterbr.py
vendored
8
tests/thirdparty/imapdl/filterbr.py
vendored
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# 2017, Georg Sauthoff <mail@gms.tf>, GPLv3
|
||||
# 2022, Alexander Stohr, ZF Friedrichshafen AG: benign handling of UTF-8 violations
|
||||
|
||||
import sys
|
||||
|
||||
@@ -49,7 +50,7 @@ def cond_lines(lines):
|
||||
p = n
|
||||
continue
|
||||
if (p == 0 or not line[p-1].isalpha()) \
|
||||
and (p+2 == len(line) or not line[p+2].isalpha()):
|
||||
and (p+2 == len(line) or not line[p+2].isalpha()):
|
||||
do_yield = True
|
||||
state = 1
|
||||
p += 2
|
||||
@@ -93,7 +94,9 @@ def filter_lcov_trace(lines):
|
||||
yield line
|
||||
|
||||
def filter_lcov_trace_file(s_filename, d_file):
|
||||
with open(s_filename) as f:
|
||||
# encoding is anyways the python default: utf-8
|
||||
# standard error is "strict"; python style escaping is "backslashreplace"; alternate benign handler is "surrogateescape"
|
||||
with open(s_filename, encoding="utf-8", errors="backslashreplace") as f:
|
||||
for l in filter_lcov_trace(f):
|
||||
print(l, end='', file=d_file)
|
||||
|
||||
@@ -106,4 +109,3 @@ if __name__ == '__main__':
|
||||
#with open(sys.argv[1]) as f:
|
||||
# for l in skip_comments(f):
|
||||
# print(l)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user