summaryrefslogtreecommitdiffstats
path: root/Tools/framer
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2004-07-18 06:16:08 (GMT)
committerTim Peters <tim.peters@gmail.com>2004-07-18 06:16:08 (GMT)
commit182b5aca27d376b08a2904bed42b751496f932f3 (patch)
treedf13115820dbc879c0fe2eae488c9f8c0215a7da /Tools/framer
parente6ddc8b20b493fef2e7cffb2e1351fe1d238857e (diff)
downloadcpython-182b5aca27d376b08a2904bed42b751496f932f3.zip
cpython-182b5aca27d376b08a2904bed42b751496f932f3.tar.gz
cpython-182b5aca27d376b08a2904bed42b751496f932f3.tar.bz2
Whitespace normalization, via reindent.py.
Diffstat (limited to 'Tools/framer')
-rw-r--r--Tools/framer/example.py9
-rw-r--r--Tools/framer/framer/__init__.py2
-rw-r--r--Tools/framer/framer/bases.py11
-rw-r--r--Tools/framer/framer/function.py10
-rw-r--r--Tools/framer/framer/struct.py2
-rw-r--r--Tools/framer/framer/structparse.py2
-rw-r--r--Tools/framer/framer/template.py6
7 files changed, 19 insertions, 23 deletions
diff --git a/Tools/framer/example.py b/Tools/framer/example.py
index b77f475..96f6278 100644
--- a/Tools/framer/example.py
+++ b/Tools/framer/example.py
@@ -11,7 +11,7 @@ class cStringIO(Module):
generality of StringIO, but it provides enough for most
applications and is especially useful in conjunction with the
pickle module.
-
+
Usage:
from cStringIO import StringIO
@@ -20,7 +20,7 @@ class cStringIO(Module):
an_output_stream.write(some_stuff)
...
value = an_output_stream.getvalue()
-
+
an_input_stream = StringIO(a_string)
spam = an_input_stream.readline()
spam = an_input_stream.read(5)
@@ -36,7 +36,7 @@ class cStringIO(Module):
class InputType(Type):
"Simple type for treating strings as input file streams"
-
+
abbrev = "input"
struct = """\
@@ -121,7 +121,6 @@ class cStringIO(Module):
def writelines(self, lines):
"""Write each string in lines."""
-
-cStringIO.gen()
+cStringIO.gen()
diff --git a/Tools/framer/framer/__init__.py b/Tools/framer/framer/__init__.py
index ab73a30..d8f9058 100644
--- a/Tools/framer/framer/__init__.py
+++ b/Tools/framer/framer/__init__.py
@@ -4,5 +4,3 @@ The basic ideas is the same as modulator, but the code generates code
using many of the new features introduced in Python 2.2. It also
takes a more declarative approach to generating code.
"""
-
-
diff --git a/Tools/framer/framer/bases.py b/Tools/framer/framer/bases.py
index 61052ab..fb3cb03 100644
--- a/Tools/framer/framer/bases.py
+++ b/Tools/framer/framer/bases.py
@@ -64,7 +64,7 @@ class ModuleMetaclass(BaseMetaclass):
self.__types[name] = obj
if obj.has_members():
self.__members = True
-
+
def initvars(self):
v = self.__vars = {}
filename = getattr(self, "__file__", None)
@@ -83,7 +83,7 @@ class ModuleMetaclass(BaseMetaclass):
if self.__members:
p(template.member_include)
print >> f
-
+
if self.__doc__:
p(template.module_doc)
@@ -98,7 +98,7 @@ class ModuleMetaclass(BaseMetaclass):
p(template.module_init_start)
for name, type in sortitems(self.__types):
type.dump_init(f)
-
+
p("}")
class Module:
@@ -121,7 +121,7 @@ class TypeMetaclass(BaseMetaclass):
for name, func in sortitems(self.__methods):
func.dump(f)
-
+
self.dump_methoddef(f, self.__methods, self.__vars)
self.dump_memberdef(f)
self.dump_slots(f)
@@ -199,7 +199,7 @@ class TypeMetaclass(BaseMetaclass):
print >> f, templ % vars
if self.struct:
- p(template.dealloc_func, {"name" : self.__slots[TP_DEALLOC]})
+ p(template.dealloc_func, {"name" : self.__slots[TP_DEALLOC]})
p(template.type_struct_start)
for s in Slots[:-5]: # XXX
@@ -218,4 +218,3 @@ class TypeMetaclass(BaseMetaclass):
class Type:
__metaclass__ = TypeMetaclass
-
diff --git a/Tools/framer/framer/function.py b/Tools/framer/framer/function.py
index 595cc8d..306f7e9 100644
--- a/Tools/framer/framer/function.py
+++ b/Tools/framer/framer/function.py
@@ -55,7 +55,7 @@ class _ArgumentList(object):
def dump_decls(self, f):
pass
-
+
class NoArgs(_ArgumentList):
def __init__(self, args):
@@ -67,7 +67,7 @@ class NoArgs(_ArgumentList):
return "PyObject *self"
class OneArg(_ArgumentList):
-
+
def __init__(self, args):
assert len(args) == 1
super(OneArg, self).__init__(args)
@@ -139,7 +139,7 @@ class Function:
if self.__doc__:
p(template.docstring)
-
+
d = {"name" : self.vars["CName"],
"args" : self.args.c_args(),
}
@@ -149,13 +149,13 @@ class Function:
if self.args.ml_meth == METH_VARARGS:
p(template.varargs)
-
+
p(template.funcdef_end)
def analyze(self):
self.__doc__ = self._func.__doc__
self.args = ArgumentList(self._func, self.method)
-
+
def initvars(self):
v = self.vars = {}
v["PythonName"] = self._func.__name__
diff --git a/Tools/framer/framer/struct.py b/Tools/framer/framer/struct.py
index 3948740..12ea8d7 100644
--- a/Tools/framer/framer/struct.py
+++ b/Tools/framer/framer/struct.py
@@ -35,7 +35,7 @@ def parse(s):
line = line.strip()
if line.startswith("}"):
break
-
+
assert line.endswith(";")
line = line[:-1]
words = line.split()
diff --git a/Tools/framer/framer/structparse.py b/Tools/framer/framer/structparse.py
index 419228a..f24c0da 100644
--- a/Tools/framer/framer/structparse.py
+++ b/Tools/framer/framer/structparse.py
@@ -29,7 +29,7 @@ def parse(s):
line = line.strip()
if line.startswith("}"):
break
-
+
assert line.endswith(";")
line = line[:-1]
words = line.split()
diff --git a/Tools/framer/framer/template.py b/Tools/framer/framer/template.py
index 8d16204..41f9537 100644
--- a/Tools/framer/framer/template.py
+++ b/Tools/framer/framer/template.py
@@ -20,11 +20,11 @@ static struct PyMethodDef %(MethodDefName)s[] = {"""
methoddef_def = """\
{"%(PythonName)s", (PyCFunction)%(CName)s, %(MethType)s},"""
-
+
methoddef_def_doc = """\
{"%(PythonName)s", (PyCFunction)%(CName)s, %(MethType)s,
%(DocstringVar)s},"""
-
+
methoddef_end = """\
{NULL, NULL}
};
@@ -96,7 +96,7 @@ module_add_type = """\
type_struct_start = """\
static PyTypeObject %(CTypeName)s = {
PyObject_HEAD_INIT(0)"""
-
+
type_struct_end = """\
};
"""