Skip to content
Snippets Groups Projects
Commit bf8ae91f authored by Christoph Lehmann's avatar Christoph Lehmann
Browse files

[scr/doc] fixed python format strings

parent ee2a6349
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ github_data_url = "https://github.com/ufz/ogs-data/tree/master" ...@@ -18,7 +18,7 @@ github_data_url = "https://github.com/ufz/ogs-data/tree/master"
if len(sys.argv) != 4: if len(sys.argv) != 4:
print("Usage:") print("Usage:")
print("{} EXT DATADIR DOCAUXDIR".format(sys.argv[0])) print("{0} EXT DATADIR DOCAUXDIR".format(sys.argv[0]))
sys.exit(1) sys.exit(1)
ext = sys.argv[1] ext = sys.argv[1]
...@@ -152,9 +152,9 @@ for (dirpath, _, filenames) in os.walk(docdir): ...@@ -152,9 +152,9 @@ for (dirpath, _, filenames) in os.walk(docdir):
fh.write("- This is a required parameter.\n") fh.write("- This is a required parameter.\n")
datatype = info[5] datatype = info[5]
if datatype: fh.write("- Data type: <tt>{}</tt>\n".format(datatype)) if datatype: fh.write("- Data type: <tt>{0}</tt>\n".format(datatype))
fh.write("- Expanded tag path: {}\n".format(tagpath_expanded)) fh.write("- Expanded tag path: {0}\n".format(tagpath_expanded))
fh.write("- Go to source code: [&rarr; ufz/ogs/master]({2}/{0}#L{1})\n" fh.write("- Go to source code: [&rarr; ufz/ogs/master]({2}/{0}#L{1})\n"
.format(path, line, github_src_url)) .format(path, line, github_src_url))
......
...@@ -51,7 +51,7 @@ for inline in sys.stdin: ...@@ -51,7 +51,7 @@ for inline in sys.stdin:
param_or_attr_comment = m.group(1) param_or_attr_comment = m.group(1)
tag_path_comment = m.group(2).replace("__", ".") tag_path_comment = m.group(2).replace("__", ".")
debug(" {:>5} //! {}".format(lineno, tag_path_comment)) debug(" {0:>5} //! {1}".format(lineno, tag_path_comment))
tag_name_comment = tag_path_comment.split(".")[-1] tag_name_comment = tag_path_comment.split(".")[-1]
continue continue
...@@ -83,7 +83,7 @@ for inline in sys.stdin: ...@@ -83,7 +83,7 @@ for inline in sys.stdin:
if state != "comment" or oldpath != path: if state != "comment" or oldpath != path:
write_out("NODOC", path, lineno, "NONE", param, paramtype, method) write_out("NODOC", path, lineno, "NONE", param, paramtype, method)
else: else:
debug(" {:>5} {} {} ".format(lineno, param, paramtype)) debug(" {0:>5} {1} {2} ".format(lineno, param, paramtype))
if param != tag_name_comment: if param != tag_name_comment:
debug("error: parameter name from comment and code do not match: " debug("error: parameter name from comment and code do not match: "
...@@ -91,7 +91,7 @@ for inline in sys.stdin: ...@@ -91,7 +91,7 @@ for inline in sys.stdin:
write_out("NODOC", path, lineno, tag_path_comment, param, paramtype, method) write_out("NODOC", path, lineno, tag_path_comment, param, paramtype, method)
elif lineno != oldlineno+1: elif lineno != oldlineno+1:
debug("error: the associated comment is not on the line preceding this one." debug("error: the associated comment is not on the line preceding this one."
+ " line numbers {} vs. {}".format(oldlineno, lineno)) + " line numbers {0} vs. {1}".format(oldlineno, lineno))
write_out("NODOC", path, lineno, tag_path_comment, param, paramtype, method) write_out("NODOC", path, lineno, tag_path_comment, param, paramtype, method)
elif param_or_attr_comment == "param" and m.group(2) != "Param" and m.group(2) != "Subtree": elif param_or_attr_comment == "param" and m.group(2) != "Param" and m.group(2) != "Subtree":
debug("error: comment says param but code says different.") debug("error: comment says param but code says different.")
...@@ -118,7 +118,7 @@ for inline in sys.stdin: ...@@ -118,7 +118,7 @@ for inline in sys.stdin:
else: else:
if lineno != oldlineno+1: if lineno != oldlineno+1:
debug("error: the associated comment is not on the line preceding this one." debug("error: the associated comment is not on the line preceding this one."
+ " line numbers {} vs. {}".format(oldlineno, lineno)) + " line numbers {0} vs. {1}".format(oldlineno, lineno))
write_out("NODOC", path, lineno, "UNKNOWN", "UNKNOWN", paramtype, method) write_out("NODOC", path, lineno, "UNKNOWN", "UNKNOWN", paramtype, method)
elif param_or_attr_comment != "special": elif param_or_attr_comment != "special":
debug("error: comment does not comment a special line.") debug("error: comment does not comment a special line.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment