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:
@ -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))
|
||||
|
Reference in New Issue
Block a user