[pypy-svn] r7338 - pypy/trunk/src/pypy/appspace
mgedmin at codespeak.net
mgedmin at codespeak.net
Wed Nov 17 17:06:47 CET 2004
Author: mgedmin
Date: Wed Nov 17 17:06:46 2004
New Revision: 7338
Modified:
pypy/trunk/src/pypy/appspace/_formatting.py (contents, props changed)
Log:
Removed ^Ms and set svn:eol-style to native.
Modified: pypy/trunk/src/pypy/appspace/_formatting.py
==============================================================================
--- pypy/trunk/src/pypy/appspace/_formatting.py (original)
+++ pypy/trunk/src/pypy/appspace/_formatting.py Wed Nov 17 17:06:46 2004
@@ -9,7 +9,7 @@
class _Flags(object):
def __repr__(self):
- return "<%s>"%(', '.join([f for f in self.__dict__
+ return "<%s>"%(', '.join([f for f in self.__dict__
if f[0] == 'f' and getattr(self, f)]),)
f_ljust = 0
f_sign = 0
@@ -22,7 +22,7 @@
try:
return valueiter.next()
except StopIteration:
- raise TypeError('not enough arguments for format string')
+ raise TypeError('not enough arguments for format string')
def peel_num(c, fmtiter, valueiter):
@@ -109,7 +109,7 @@
self.width = width
self.prec = prec
self.value = value
-
+
def numeric_preprocess(self, v):
# negative zeroes?
# * mwh giggles, falls over
@@ -117,7 +117,7 @@
import math
if v < 0 or v == 0 and math.atan2(0, v) != 0:
sign = '-'
- v = -v
+ v = -v
else:
if self.flags.f_sign:
sign = '+'
@@ -140,7 +140,7 @@
if self.flags.f_zero:
r = sign+padchar*p + r
else:
- r = padchar*p + sign + r
+ r = padchar*p + sign + r
else:
r = sign + r
return r
@@ -220,7 +220,7 @@
self.prec = 6
r = self._format(v)
return self.numeric_postprocess(r, sign)
-
+
class FloatFFormatter(FloatFormatter):
def _format(self, v):
@@ -336,7 +336,7 @@
'%':funcFormatter(lambda x:'%'),
}
-
+
class FmtIter(object):
def __init__(self, fmt):
self.fmt = fmt
@@ -377,12 +377,12 @@
except KeyError:
raise ValueError("unsupported format character "
"'%s' (%x) at index %d"
- %(t[0], ord(t[0]), fmtiter.i))
- # Trying to translate this using the flow space.
- # Currently, star args give a problem there,
- # so let's be explicit about the args:
- # r.append(f(*t).format())
- char, flags, width, prec, value = t
+ %(t[0], ord(t[0]), fmtiter.i))
+ # Trying to translate this using the flow space.
+ # Currently, star args give a problem there,
+ # so let's be explicit about the args:
+ # r.append(f(*t).format())
+ char, flags, width, prec, value = t
r.append(f(char, flags, width, prec, value).format())
else:
# efficiency hack:
@@ -398,4 +398,4 @@
raise TypeError('not all arguments converted '
'during string formatting')
return ''.join(r)
-
+
More information about the Pypy-commit
mailing list