Lines 579-588
def writedict(mydict, myfilename, writekey=True):
Link Here
|
579 |
the key and assumes all values are strings, not lists.""" |
579 |
the key and assumes all values are strings, not lists.""" |
580 |
lines = [] |
580 |
lines = [] |
581 |
if not writekey: |
581 |
if not writekey: |
582 |
for v in mydict.values(): |
582 |
for v in sorted(mydict.values()): |
583 |
lines.append(v + "\n") |
583 |
lines.append(v + "\n") |
584 |
else: |
584 |
else: |
585 |
for k, v in mydict.items(): |
585 |
for k, v in sorted(mydict.items()): |
586 |
lines.append("%s %s\n" % (k, " ".join(v))) |
586 |
lines.append("%s %s\n" % (k, " ".join(v))) |
587 |
write_atomic(myfilename, "".join(lines)) |
587 |
write_atomic(myfilename, "".join(lines)) |
588 |
|
588 |
|