From fbd6510d58a47ea0d166c48a82793f05425406e4 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sun, 18 Aug 2013 11:51:25 -0600 Subject: STY: Giant comma spacing fixup. Run the 2to3 ws_comma fixer on *.py files. Some lines are now too long and will need to be broken at some point. OTOH, some lines were already too long and need to be broken at some point. Now seems as good a time as any to do this with open PRs at a minimum. --- numpy/oldnumeric/alter_code2.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'numpy/oldnumeric/alter_code2.py') diff --git a/numpy/oldnumeric/alter_code2.py b/numpy/oldnumeric/alter_code2.py index c163c9565..1ec15c855 100644 --- a/numpy/oldnumeric/alter_code2.py +++ b/numpy/oldnumeric/alter_code2.py @@ -35,11 +35,11 @@ import glob # To convert typecharacters we need to # Not very safe. Disabled for now.. def replacetypechars(astr): - astr = astr.replace("'s'","'h'") - astr = astr.replace("'b'","'B'") - astr = astr.replace("'1'","'b'") - astr = astr.replace("'w'","'H'") - astr = astr.replace("'u'","'I'") + astr = astr.replace("'s'", "'h'") + astr = astr.replace("'b'", "'B'") + astr = astr.replace("'1'", "'b'") + astr = astr.replace("'w'", "'H'") + astr = astr.replace("'u'", "'I'") return astr def changeimports(fstr, name, newname): @@ -49,13 +49,13 @@ def changeimports(fstr, name, newname): fromall=0 fstr = fstr.replace(importasstr, 'import %s as ' % newname) - fstr = fstr.replace(importstr, 'import %s as %s' % (newname,name)) + fstr = fstr.replace(importstr, 'import %s as %s' % (newname, name)) ind = 0 Nlen = len(fromstr) Nlen2 = len("from %s import " % newname) while True: - found = fstr.find(fromstr,ind) + found = fstr.find(fromstr, ind) if (found < 0): break ind = found + Nlen @@ -66,7 +66,7 @@ def changeimports(fstr, name, newname): return fstr, fromall def replaceattr(astr): - astr = astr.replace("matrixmultiply","dot") + astr = astr.replace("matrixmultiply", "dot") return astr def replaceother(astr): @@ -131,7 +131,7 @@ def convertall(direc=os.path.curdir): .py.orig. A new file named .py is then written with the updated code. """ - files = glob.glob(os.path.join(direc,'*.py')) + files = glob.glob(os.path.join(direc, '*.py')) for afile in files: convertfile(afile) -- cgit v1.2.1