Document all functions in Python scripts

This commit is contained in:
gfyoung
2017-05-17 23:17:37 -04:00
parent 674c903ada
commit 51a0ec21bd
4 changed files with 265 additions and 53 deletions

View File

@@ -39,7 +39,9 @@ def main():
else:
keys = data.keys()
keys.sort(key=cmp_keys)
# Sort by the number of en-dashes in the key
# and then by the key string itself.
keys.sort(key=lambda item: (item.count("-"), item))
toc_rows = ""
for key in keys:
@@ -139,9 +141,5 @@ def decode_line(line):
return str(line.decode("UTF-8"))
def cmp_keys(item):
return item.count('-'), item
if __name__ == "__main__":
main()