1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

pycodestyle (PEP 8) cleanup in Python scripts

These are mainly whitespace changes.  I didn't fix "E501 line too
long", which would require more significant surgery.
This commit is contained in:
Peter Eisentraut
2022-03-09 10:51:41 +01:00
parent e80a7a1f3d
commit ddf590b811
2 changed files with 40 additions and 24 deletions

View File

@ -1,18 +1,20 @@
#! /usr/bin/env python
import sys, string, locale
import locale
import sys
locale.setlocale(locale.LC_ALL, "")
if len(sys.argv) != 2:
sys.stderr.write("Usage: sort.py filename\n")
sys.exit(1)
sys.stderr.write("Usage: sort.py filename\n")
sys.exit(1)
infile = open(sys.argv[1], 'r')
list = infile.readlines()
infile.close()
for i in range(0, len(list)):
list[i] = list[i][:-1] # chop!
list[i] = list[i][:-1] # chop!
list.sort(key=locale.strxfrm)
print('\n'.join(list))