summaryrefslogtreecommitdiffstats
path: root/Tools/modulator
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/modulator
parente6ddc8b20b493fef2e7cffb2e1351fe1d238857e (diff)
downloadcpython-182b5aca27d376b08a2904bed42b751496f932f3.zip
cpython-182b5aca27d376b08a2904bed42b751496f932f3.tar.gz
cpython-182b5aca27d376b08a2904bed42b751496f932f3.tar.bz2
Whitespace normalization, via reindent.py.
Diffstat (limited to 'Tools/modulator')
-rwxr-xr-xTools/modulator/Tkextra.py4
-rwxr-xr-xTools/modulator/genmodule.py4
-rwxr-xr-xTools/modulator/modulator.py26
-rw-r--r--Tools/modulator/varsubst.py2
4 files changed, 18 insertions, 18 deletions
diff --git a/Tools/modulator/Tkextra.py b/Tools/modulator/Tkextra.py
index 00ed5eb..8f55728 100755
--- a/Tools/modulator/Tkextra.py
+++ b/Tools/modulator/Tkextra.py
@@ -105,7 +105,7 @@ def strdialog(master, title, text, bitmap, default, *args):
{'width': '3i',
'text': text,
'font': '-Adobe-Times-Medium-R-Normal-*-180-*',
- Pack: {'side': 'left',
+ Pack: {'side': 'left',
'fill': 'both',
'padx': '3m', 'pady': '3m'}})
@@ -187,7 +187,7 @@ def askstr(str):
def askfile(str): # XXXX For now...
i = strdialog(mainWidget, 'Question', str, '', 0)
return i
-
+
# The rest is the test program.
def _go():
diff --git a/Tools/modulator/genmodule.py b/Tools/modulator/genmodule.py
index 5788b95..da30684 100755
--- a/Tools/modulator/genmodule.py
+++ b/Tools/modulator/genmodule.py
@@ -65,7 +65,7 @@ class writer:
return open(fn, 'r')
raise error, 'Template '+name+' not found for '+self._type+' '+ \
self.name
-
+
class module(writer):
_type = 'module'
@@ -116,7 +116,7 @@ class object(writer):
# Add getattr if we have methods
if self.methodlist and not 'tp_getattr' in self.funclist:
self.funclist.insert(0, 'tp_getattr')
-
+
for fn in FUNCLIST:
setattr(self, fn, '0')
diff --git a/Tools/modulator/modulator.py b/Tools/modulator/modulator.py
index 4828743..3e06bc2 100755
--- a/Tools/modulator/modulator.py
+++ b/Tools/modulator/modulator.py
@@ -49,7 +49,7 @@ def getlistlist(list):
for i in range(n):
rv.append(list.get(i))
return rv
-
+
class UI:
def __init__(self):
self.main = Frame()
@@ -97,7 +97,7 @@ class UI:
o.synchronize()
except oops:
pass
-
+
def cb_save(self, *args):
try:
pycode = self.module.gencode('m', self.objects)
@@ -177,12 +177,12 @@ class UI_module:
'command':self.cb_newobj,
Pack:{'side':'left',
'padx':'0.5m'}})
-
+
def cb_delmethod(self, *args):
list = self.method_list.curselection()
for i in list:
self.method_list.delete(i)
-
+
def cb_newobj(self, *arg):
self.parent.objects.append(UI_object(self.parent))
@@ -208,7 +208,7 @@ class UI_module:
if not checkid(n):
message('Method name not an identifier:\n'+n)
raise oops
-
+
def gencode(self, name, objects):
rv = ''
self.synchronize()
@@ -226,7 +226,7 @@ class UI_module:
rv = rv + '%s.objects = [%s]\n' % (name, ','.join(onames))
rv = rv + '\n'
return rv
-
+
object_number = 0
class UI_object:
@@ -250,7 +250,7 @@ class UI_object:
'fill':'x'}})
self.f4 = Frame(self.frame, {Pack:{'side':'top', 'pady':'0.5m',
'fill':'x'}})
-
+
self.l1 = Label(self.f1, {'text':'Object:', Pack:{'side':'left',
'padx':'0.5m'}})
@@ -305,7 +305,7 @@ class UI_object:
Pack:{'side':'top', 'pady':'0.5m',
'anchor':'w'}})
self.types[i] = b
-
+
def cb_method(self, *arg):
name = self.method_entry.get()
if not name:
@@ -317,7 +317,7 @@ class UI_object:
list = self.method_list.curselection()
for i in list:
self.method_list.delete(i)
-
+
def synchronize(self):
n = self.name_entry.get()
if not n:
@@ -337,7 +337,7 @@ class UI_object:
if m:
self.f5.setvar(self.vpref+'tp_getattr', 1)
pass
-
+
def gencode(self, name):
rv = ''
rv = rv + '%s = genmodule.object()\n' % (name,)
@@ -356,12 +356,12 @@ class UI_object:
vname = self.vpref + fn
if self.f5.getvar(vname) == '1':
fl.append(fn)
-
+
rv = rv + '%s.typelist = %r\n' % (name, fl)
rv = rv + '\n'
return rv
-
+
def main():
if len(sys.argv) < 2:
@@ -379,5 +379,5 @@ def main():
else:
sys.stderr.write('Usage: modulator [file]\n')
sys.exit(1)
-
+
main()
diff --git a/Tools/modulator/varsubst.py b/Tools/modulator/varsubst.py
index 5516be2..3b33950 100644
--- a/Tools/modulator/varsubst.py
+++ b/Tools/modulator/varsubst.py
@@ -13,7 +13,7 @@ class Varsubst:
def useindent(self, onoff):
self.do_useindent = onoff
-
+
def subst(self, s):
rv = ''
while 1: