mirror of
https://github.com/StevenBlack/hosts.git
synced 2026-07-01 02:36:52 +00:00
Document all functions in Python scripts
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user