]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
* Got entirely rid of path.py.
authorGuido van Rossum <guido@python.org>
Mon, 14 Dec 1992 12:57:56 +0000 (12:57 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 14 Dec 1992 12:57:56 +0000 (12:57 +0000)
* Many modules: fixes for new, stricter, argument passing rules
  (most changes were automatic ones -- not all of this is tested!).
* gwin.py: now uses mainloop.py for its main loop and window admin.
* mainloop.py: always call dispatch() with event as a tuple!
* Fix bug in pdb's 'clear' command -- don't set the bpt but clear it!

41 files changed:
Lib/bdb.py
Lib/dircmp.py
Lib/irix5/flp.py
Lib/lib-stdwin/Abstract.py
Lib/lib-stdwin/BoxParent.py
Lib/lib-stdwin/Buttons.py
Lib/lib-stdwin/CSplit.py
Lib/lib-stdwin/DirList.py
Lib/lib-stdwin/FormSplit.py
Lib/lib-stdwin/HVSplit.py
Lib/lib-stdwin/Histogram.py
Lib/lib-stdwin/Sliders.py
Lib/lib-stdwin/Soundogram.py
Lib/lib-stdwin/Split.py
Lib/lib-stdwin/StripChart.py
Lib/lib-stdwin/TextEdit.py
Lib/lib-stdwin/WindowParent.py
Lib/lib-stdwin/formatter.py
Lib/lib-stdwin/gwin.py
Lib/lib-stdwin/mainloop.py
Lib/mutex.py
Lib/pdb.py
Lib/plat-irix5/flp.py
Lib/sched.py
Lib/stdwin/Abstract.py
Lib/stdwin/BoxParent.py
Lib/stdwin/Buttons.py
Lib/stdwin/CSplit.py
Lib/stdwin/DirList.py
Lib/stdwin/FormSplit.py
Lib/stdwin/HVSplit.py
Lib/stdwin/Histogram.py
Lib/stdwin/Sliders.py
Lib/stdwin/Soundogram.py
Lib/stdwin/Split.py
Lib/stdwin/StripChart.py
Lib/stdwin/TextEdit.py
Lib/stdwin/WindowParent.py
Lib/stdwin/formatter.py
Lib/stdwin/gwin.py
Lib/stdwin/mainloop.py

index 8a722fe3f2b8f0445ad4dae1577aa1ce25f68e88..66d3457c6b7a5f6ca17354b41280054512cbde04 100644 (file)
@@ -217,8 +217,9 @@ class Bdb: # Basic Debugger
        
        # 
        
-       def format_stack_entry(self, (frame, lineno)):
+       def format_stack_entry(self, frame_lineno):
                import codehack, linecache, repr, string
+               frame, lineno = frame_lineno
                filename = frame.f_code.co_filename
                s = filename + '(' + `lineno` + ')'
                s = s + codehack.getcodename(frame.f_code)
index cbbce1b8c18f130c301e4042599f0dbd35163328..1227aa753c3a4683f756ab178da3240c56098af5 100644 (file)
@@ -13,46 +13,46 @@ from stat import *
 #
 class dircmp:
        #
-       def new(dd, (a, b)): # Initialize
-               dd.a = a
-               dd.b = b
-               # Properties that caller may change before calling dd.run():
-               dd.hide = [os.curdir, os.pardir] # Names never to be shown
-               dd.ignore = ['RCS', 'tags'] # Names ignored in comparison
+       def new(self, a, b): # Initialize
+               self.a = a
+               self.b = b
+               # Properties that caller may change before calling self.run():
+               self.hide = [os.curdir, os.pardir] # Names never to be shown
+               self.ignore = ['RCS', 'tags'] # Names ignored in comparison
                #
-               return dd
+               return self
        #
-       def run(dd): # Compare everything except common subdirectories
-               dd.a_list = filter(dircache.listdir(dd.a), dd.hide)
-               dd.b_list = filter(dircache.listdir(dd.b), dd.hide)
-               dd.a_list.sort()
-               dd.b_list.sort()
-               dd.phase1()
-               dd.phase2()
-               dd.phase3()
+       def run(self): # Compare everything except common subdirectories
+               self.a_list = filter(dircache.listdir(self.a), self.hide)
+               self.b_list = filter(dircache.listdir(self.b), self.hide)
+               self.a_list.sort()
+               self.b_list.sort()
+               self.phase1()
+               self.phase2()
+               self.phase3()
        #
-       def phase1(dd): # Compute common names
-               dd.a_only = []
-               dd.common = []
-               for x in dd.a_list:
-                       if x in dd.b_list:
-                               dd.common.append(x)
+       def phase1(self): # Compute common names
+               self.a_only = []
+               self.common = []
+               for x in self.a_list:
+                       if x in self.b_list:
+                               self.common.append(x)
                        else:
-                               dd.a_only.append(x)
+                               self.a_only.append(x)
                #
-               dd.b_only = []
-               for x in dd.b_list:
-                       if x not in dd.common:
-                               dd.b_only.append(x)
+               self.b_only = []
+               for x in self.b_list:
+                       if x not in self.common:
+                               self.b_only.append(x)
        #
-       def phase2(dd): # Distinguish files, directories, funnies
-               dd.common_dirs = []
-               dd.common_files = []
-               dd.common_funny = []
+       def phase2(self): # Distinguish files, directories, funnies
+               self.common_dirs = []
+               self.common_files = []
+               self.common_funny = []
                #
-               for x in dd.common:
-                       a_path = os.path.join(dd.a, x)
-                       b_path = os.path.join(dd.b, x)
+               for x in self.common:
+                       a_path = os.path.join(self.a, x)
+                       b_path = os.path.join(self.b, x)
                        #
                        ok = 1
                        try:
@@ -70,74 +70,74 @@ class dircmp:
                                a_type = S_IFMT(a_stat[ST_MODE])
                                b_type = S_IFMT(b_stat[ST_MODE])
                                if a_type <> b_type:
-                                       dd.common_funny.append(x)
+                                       self.common_funny.append(x)
                                elif S_ISDIR(a_type):
-                                       dd.common_dirs.append(x)
+                                       self.common_dirs.append(x)
                                elif S_ISREG(a_type):
-                                       dd.common_files.append(x)
+                                       self.common_files.append(x)
                                else:
-                                       dd.common_funny.append(x)
+                                       self.common_funny.append(x)
                        else:
-                               dd.common_funny.append(x)
+                               self.common_funny.append(x)
        #
-       def phase3(dd): # Find out differences between common files
-               xx = cmpfiles(dd.a, dd.b, dd.common_files)
-               dd.same_files, dd.diff_files, dd.funny_files = xx
+       def phase3(self): # Find out differences between common files
+               xx = cmpfiles(self.a, self.b, self.common_files)
+               self.same_files, self.diff_files, self.funny_files = xx
        #
-       def phase4(dd): # Find out differences between common subdirectories
+       def phase4(self): # Find out differences between common subdirectories
                # A new dircmp object is created for each common subdirectory,
                # these are stored in a dictionary indexed by filename.
                # The hide and ignore properties are inherited from the parent
-               dd.subdirs = {}
-               for x in dd.common_dirs:
-                       a_x = os.path.join(dd.a, x)
-                       b_x = os.path.join(dd.b, x)
-                       dd.subdirs[x] = newdd = dircmp().new(a_x, b_x)
-                       newdd.hide = dd.hide
-                       newdd.ignore = dd.ignore
+               self.subdirs = {}
+               for x in self.common_dirs:
+                       a_x = os.path.join(self.a, x)
+                       b_x = os.path.join(self.b, x)
+                       self.subdirs[x] = newdd = dircmp().new(a_x, b_x)
+                       newdd.hide = self.hide
+                       newdd.ignore = self.ignore
                        newdd.run()
        #
-       def phase4_closure(dd): # Recursively call phase4() on subdirectories
-               dd.phase4()
-               for x in dd.subdirs.keys():
-                       dd.subdirs[x].phase4_closure()
+       def phase4_closure(self): # Recursively call phase4() on subdirectories
+               self.phase4()
+               for x in self.subdirs.keys():
+                       self.subdirs[x].phase4_closure()
        #
-       def report(dd): # Print a report on the differences between a and b
+       def report(self): # Print a report on the differences between a and b
                # Assume that phases 1 to 3 have been executed
                # Output format is purposely lousy
-               print 'diff', dd.a, dd.b
-               if dd.a_only:
-                       print 'Only in', dd.a, ':', dd.a_only
-               if dd.b_only:
-                       print 'Only in', dd.b, ':', dd.b_only
-               if dd.same_files:
-                       print 'Identical files :', dd.same_files
-               if dd.diff_files:
-                       print 'Differing files :', dd.diff_files
-               if dd.funny_files:
-                       print 'Trouble with common files :', dd.funny_files
-               if dd.common_dirs:
-                       print 'Common subdirectories :', dd.common_dirs
-               if dd.common_funny:
-                       print 'Common funny cases :', dd.common_funny
+               print 'diff', self.a, self.b
+               if self.a_only:
+                       print 'Only in', self.a, ':', self.a_only
+               if self.b_only:
+                       print 'Only in', self.b, ':', self.b_only
+               if self.same_files:
+                       print 'Identical files :', self.same_files
+               if self.diff_files:
+                       print 'Differing files :', self.diff_files
+               if self.funny_files:
+                       print 'Trouble with common files :', self.funny_files
+               if self.common_dirs:
+                       print 'Common subdirectories :', self.common_dirs
+               if self.common_funny:
+                       print 'Common funny cases :', self.common_funny
        #
-       def report_closure(dd): # Print reports on dd and on subdirs
+       def report_closure(self): # Print reports on self and on subdirs
                # If phase 4 hasn't been done, no subdir reports are printed
-               dd.report()
+               self.report()
                try:
-                       x = dd.subdirs
+                       x = self.subdirs
                except AttributeError:
                        return # No subdirectories computed
-               for x in dd.subdirs.keys():
+               for x in self.subdirs.keys():
                        print
-                       dd.subdirs[x].report_closure()
+                       self.subdirs[x].report_closure()
        #
-       def report_phase4_closure(dd): # Report and do phase 4 recursively
-               dd.report()
-               dd.phase4()
-               for x in dd.subdirs.keys():
+       def report_phase4_closure(self): # Report and do phase 4 recursively
+               self.report()
+               self.phase4()
+               for x in self.subdirs.keys():
                        print
-                       dd.subdirs[x].report_phase4_closure()
+                       self.subdirs[x].report_phase4_closure()
 
 
 # Compare common files in two directories.
index 39b45dcd45577efa473e6f4c6f28f108b345dda6..0904efeb85fd9aca35cb0dc33c07102377fbfa5e 100755 (executable)
@@ -208,7 +208,7 @@ def _parse_fd_form(file, name):
 class _newobj:
     def init(self):
        return self
-    def add(self, (name, value)):
+    def add(self, name, value):
        self.__dict__[name] = value
     def make(self, dict):
        for name in dict.keys():
@@ -299,9 +299,9 @@ def _parse_object(file):
            if datum == FORMLINE:
                file.seek(pos)
            return obj
-       if type(datum) <> type(()):
+       if type(datum) <> type(()) or len(datum) <> 2:
            raise error, 'Parse error, illegal line in object: '+datum
-       obj.add(datum)
+       obj.add(datum[0], datum[1])
 
 #################################################################
 #   Part 2 - High-level object/form creation routines            #
index c6fe137e73939459a81494796dcf4c5959a9902a..51bd305a8644d5afaa57214544e7aaa01bbb759b 100644 (file)
@@ -30,7 +30,7 @@ class AbstractParent:
        def getwindow(self): return unimpl() # Only for very special cases
        #
        def change(self, area): unimpl()
-       def scroll(self, (area, (dh, dv))): unimpl()
+       def scroll(self, area, (dh, dv)): unimpl()
        def settimer(self, itimer): unimpl()
 
 class AbstractChild:
@@ -40,10 +40,10 @@ class AbstractChild:
        def destroy(self): unimpl()
        #
        def realize(self): return unimpl()
-       def getminsize(self, (m, (width, height))): return unimpl()
+       def getminsize(self, m, (width, height)): return unimpl()
        def getbounds(self): return unimpl()
        def setbounds(self, bounds): unimpl()
-       def draw(self, (d, area)): unimpl()
+       def draw(self, d, area): unimpl()
        #
        # Downcalls only made after certain upcalls
        #
index d042e880cb57e908f48dccf6ce483ba5180e9227..a44995d90c4699b6dc5a91e10c155061a1930cb9 100644 (file)
@@ -2,13 +2,13 @@ from TransParent import TransParent
 
 class BoxParent(TransParent):
        #
-       def create(self, (parent, (dh, dv))):
+       def create(self, parent, (dh, dv)):
                self = TransParent.create(self, parent)
                self.dh = dh
                self.dv = dv
                return self
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                width = max(0, width - 2*self.dh)
                height = max(0, height - 2*self.dv)
                width, height = self.child.getminsize(m, (width, height))
index d1435d3acfbc9b55f5e97a1a1ed88e0f122718ab..9a9970789b6fa5adb09c9214b19b8fc1192d768d 100644 (file)
@@ -35,7 +35,7 @@ class LabelAppearance:
        #
        # Size enquiry
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                width = max(width, m.textwidth(self.text) + 6)
                height = max(height, m.lineheight() + 6)
                return width, height
@@ -108,8 +108,8 @@ class LabelAppearance:
                        d.erase(self.bounds)
                        self.draw(d, self.bounds)
        #
-       def draw(self, (d, area)):
-               area = _rect.intersect(area, self.bounds)
+       def draw(self, d, area):
+               area = _rect.intersect([area, self.bounds])
                if area == _rect.empty:
                        return
                d.cliprect(area)
@@ -145,7 +145,7 @@ class LabelAppearance:
 
 class StrutAppearance(LabelAppearance):
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                height = max(height, m.lineheight() + 6)
                return width, height
        #
@@ -175,7 +175,7 @@ class ButtonAppearance(LabelAppearance):
 #
 class CheckAppearance(LabelAppearance):
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                minwidth = m.textwidth(self.text) + 6
                minheight = m.lineheight() + 6
                width = max(width, minwidth + minheight + m.textwidth(' '))
@@ -382,7 +382,7 @@ class Define:
        def destroy(self):
                self.parent = 0
        #
-       def definetext(self, (parent, text)):
+       def definetext(self, parent, text):
                self = self.define(parent)
                self.settext(text)
                return self
index 90d137e6fcb0f510486affb6282e90ba0a14c5c1..90d51119c3775470e05314dd96ffac11bf20a5aa 100644 (file)
@@ -9,7 +9,7 @@ from Split import Split
 
 class CSplit(Split):
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                # Since things look best if the children are spaced evenly
                # along the circle (and often all children have the same
                # size anyway) we compute the max child size and assume
@@ -65,5 +65,5 @@ class CSplit(Split):
                        right, bottom = \
                                left + child_width, \
                                top + child_height
-                       child.setbounds((left, top), (right, bottom))
+                       child.setbounds(((left, top), (right, bottom)))
        #
index 00e9a8c50993a95ed673f1684e9d9be8e09b5800..4b98b1dc42af70e854e58521e40bf6c97c98a495 100644 (file)
@@ -11,7 +11,7 @@ from HVSplit import HSplit, VSplit
 
 class DirList(VSplit):
        #
-       def create(self, (parent, dirname)):
+       def create(self, parent, dirname):
                self = VSplit.create(self, parent)
                names = os.listdir(dirname)
                for name in names:
index 16f3293259873333816a2050550ff3ff216d4677..271cb23fc18f73d7a4a7bd6ed427aa4ac22c929d 100644 (file)
@@ -20,7 +20,7 @@ class FormSplit(Split):
                self.last_child = None
                return Split.create(self, parent)
        #
-       def getminsize(self, (m, sugg_size)):
+       def getminsize(self, m, sugg_size):
                max_width, max_height = 0, 0
                for c in self.children:
                        c.form_width, c.form_height = c.getminsize(m, (0, 0))
@@ -38,9 +38,9 @@ class FormSplit(Split):
                for c in self.children:
                        left, top = c.form_left + fleft, c.form_top + ftop
                        right, bottom = left + c.form_width, top + c.form_height
-                       c.setbounds((left, top), (right, bottom))
+                       c.setbounds(((left, top), (right, bottom)))
        #
-       def placenext(self, (left, top)):
+       def placenext(self, left, top):
                self.next_left = left
                self.next_top = top
                self.last_child = None
index 9790b7bdc84031b70af44abd3ab12a69642d2be7..c42327dcfcff875c279134808e88c7314232dcc6 100644 (file)
@@ -9,13 +9,13 @@ from Split import Split
 
 class HVSplit(Split):
        #
-       def create(self, (parent, hv)):
+       def create(self, parent, hv):
                # hv is 0 for HSplit, 1 for VSplit
                self = Split.create(self, parent)
                self.hv = hv
                return self
        #
-       def getminsize(self, (m, sugg_size)):
+       def getminsize(self, m, sugg_size):
                hv, vh = self.hv, 1 - self.hv
                size = [0, 0]
                sugg_size = [sugg_size[0], sugg_size[1]]
@@ -46,8 +46,8 @@ class HVSplit(Split):
                        corner = [0, 0]
                        corner[vh] = end[vh]
                        corner[hv] = origin[hv] + size[hv]
-                       c.setbounds((origin[0], origin[1]), \
-                                       (corner[0], corner[1]))
+                       c.setbounds(((origin[0], origin[1]), \
+                                       (corner[0], corner[1])))
                        origin[hv] = corner[hv]
                        # XXX stretch
                        # XXX too-small
index 27ae673a25df9370549fd7772021389b3a63bc5d..74a75f374fb860cb73c831c08f46b42ec663508c 100644 (file)
@@ -12,7 +12,7 @@ class HistogramAppearance(LabelAppearance, Define):
                self.scale = (0, 100)
                return self
        #
-       def setdata(self, (ydata, scale)):
+       def setdata(self, ydata, scale):
                self.ydata = ydata
                self.scale = scale # (min, max)
                self.parent.change(self.bounds)
index 0a709d609ea8c8f8f5146d936a303021579046cd..cbf776daee31806b2dda84ad8ea0332513762b7b 100644 (file)
@@ -69,12 +69,12 @@ class DragSliderAppearance(ButtonAppearance):
        def sethook(self, hook):
                self.hook = hook
        #
-       def setminvalmax(self, (min, val, max)):
+       def setminvalmax(self, min, val, max):
                self.min = min
                self.max = max
                self.setval(val)
        #
-       def settexts(self, (pretext, postext)):
+       def settexts(self, pretext, postext):
                self.pretext = pretext
                self.postext = postext
                self.recalctext()
@@ -95,7 +95,7 @@ class DragSliderAppearance(ButtonAppearance):
        #
 
 class DragSlider(DragSliderReactivity, DragSliderAppearance, Define):
-       def definetext(self, (parent, text)):
+       def definetext(self, parent, text):
                raise RuntimeError, 'DragSlider.definetext() not supported'
 
 
@@ -108,7 +108,7 @@ class _StepButton(PushButton):
                return self
        def setstep(self, step):
                self.step = step
-       def definetextstep(self, (parent, text, step)):
+       def definetextstep(self, parent, text, step):
                self = self.definetext(parent, text)
                self.setstep(step)
                return self
@@ -145,7 +145,7 @@ class ComplexSlider(HSplit):
        #
        # Override HSplit methods
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                w1, h1 = self.downbutton.getminsize(m, (0, height))
                w3, h3 = self.upbutton.getminsize(m, (0, height))
                w1 = max(w1, h1)
@@ -156,10 +156,10 @@ class ComplexSlider(HSplit):
        def setbounds(self, bounds):
                (left, top), (right, bottom) = self.bounds = bounds
                size = bottom - top
-               self.downbutton.setbounds((left, top), (left+size, bottom))
-               self.dragbutton.setbounds((left+size, top), \
-                                               (right-size, bottom))
-               self.upbutton.setbounds((right-size, top), (right, bottom))
+               self.downbutton.setbounds(((left, top), (left+size, bottom)))
+               self.dragbutton.setbounds(((left+size, top), \
+                                               (right-size, bottom)))
+               self.upbutton.setbounds(((right-size, top), (right, bottom)))
        #
        # Pass other Slider methods on to dragbutton
        #
index a68d4b38c8d375508986755a0da2861801aa11d4..e3c797e3dd9169d4854613c04ea75199e3786684 100644 (file)
@@ -5,7 +5,7 @@ from Histogram import Histogram
 
 class Soundogram(Histogram):
        #
-       def define(self, (win, chunk)):
+       def define(self, win, chunk):
                width, height = corner = win.getwinsize()
                bounds = (0, 0), corner
                self.chunk = chunk
index aacfa9896909d791613fc08f4af42e2158b480a4..8eb02543f49b16d134a330b5717d7b549f1632ab 100644 (file)
@@ -39,7 +39,7 @@ class Split:
                self.mouse_focus = None
                self.keybd_focus = None
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                return unimpl()                 # Should ask children
        def getbounds(self):
                return unimpl()
index 5bce412069ef387c7a754a7abcfd0db5ed7b17d7..afec007ae4b6e066adcb1de23ef366c7d74b230c 100644 (file)
@@ -8,7 +8,7 @@ from Buttons import LabelAppearance, NoReactivity
 
 class StripChart(LabelAppearance, NoReactivity):
        #
-       def define(self, (parent, scale)):
+       def define(self, parent, scale):
                self.parent = parent
                parent.addchild(self)
                self.init_appearance()
@@ -49,8 +49,8 @@ class StripChart(LabelAppearance, NoReactivity):
                        area = (left+i-1, top), (left+i, bottom)
                        self.draw(self.parent.begindrawing(), area)
        #
-       def draw(self, (d, area)):
-               area = rect.intersect(area, self.bounds)
+       def draw(self, d, area):
+               area = rect.intersect([area, self.bounds])
                if area == rect.empty:
                        return
                d.cliprect(area)
index 698a7d5ca67a5603499fd709eecf7cf2ae301f0d..e08e49681196193403e6b65396a9c7a4ec5e791b 100644 (file)
@@ -7,7 +7,7 @@ from stdwinevents import *
 
 class TextEdit:
        #
-       def create(self, (parent, (cols, rows))):
+       def create(self, parent, (cols, rows)):
                parent.addchild(self)
                self.parent = parent
                self.cols = cols
@@ -18,7 +18,7 @@ class TextEdit:
                self.dh = self.dv = 0
                return self
        #
-       def createboxed(self, (parent, (cols, rows), (dh, dv))):
+       def createboxed(self, parent, (cols, rows), (dh, dv)):
                self = self.create(parent, (cols, rows))
                self.dh = max(0, dh)
                self.dv = max(0, dv)
@@ -37,7 +37,7 @@ class TextEdit:
                del self.editor
                del self.window
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                width = max(0, width - 2*self.dh)
                height = max(0, height - 2*self.dv)
                if width > 0 and self.editor:
@@ -96,7 +96,7 @@ class TextEdit:
                self.parent.need_keybd(self)
                self.parent.need_altdraw(self)
        #
-       def draw(self, (d, area)):
+       def draw(self, d, area):
                if self.dh and self.dv:
                        d.box(self.bounds)
        #
@@ -114,7 +114,7 @@ class TextEdit:
        def mouse_up(self, detail):
                x = self.editor.event(WE_MOUSE_UP, self.window, detail)
        #
-       def keybd(self, (type, detail)):
+       def keybd(self, type, detail):
                x = self.editor.event(type, self.window, detail)
        #
        def activate(self):
index 697ed07b74c8824b44ddb5e9e7ace4971b5f90a8..1964d38a6ab39ff5a319ab444763061b962278bb 100644 (file)
@@ -14,7 +14,7 @@ Error = 'WindowParent.Error'  # Exception
 
 class WindowParent(ManageOneChild):
        #
-       def create(self, (title, size)):
+       def create(self, title, size):
                self.title = title
                self.size = size                # (width, height)
                self._reset()
@@ -47,7 +47,7 @@ class WindowParent(ManageOneChild):
        def close_trigger(self):
                if self.close_hook: self.close_hook(self)
        #
-       def menu_trigger(self, (menu, item)):
+       def menu_trigger(self, menu, item):
                if self.menu_hook:
                        self.menu_hook(self, menu, item)
        #
@@ -94,7 +94,7 @@ class WindowParent(ManageOneChild):
                        width = self.size[0]
                if self.vbar:
                        height = self.size[1]
-               self.child.setbounds((0, 0), (width, height))
+               self.child.setbounds(((0, 0), (width, height)))
                self.child.realize()
                self.win.dispatch = self.dispatch
                mainloop.register(self.win)
@@ -109,7 +109,7 @@ class WindowParent(ManageOneChild):
                        width = self.size[0]
                if self.vbar:
                        height = self.size[1]
-               self.child.setbounds((0, 0), (width, height))
+               self.child.setbounds(((0, 0), (width, height)))
                # Force a redraw of the entire window:
                self.win.change((0, 0), self.size)
        #
index b2d4add7e0a4e0355e41ba09fe78f1e9a18eb703..ac34ce952c649f870d6177dd27164242ba66e8ea 100644 (file)
@@ -13,7 +13,7 @@ class formatter:
        # Pass the window's drawing object, and left, top, right
        # coordinates of the drawing space as arguments.
        #
-       def init(self, (d, left, top, right)):
+       def init(self, d, left, top, right):
                self.d = d              # Drawing object
                self.left = left        # Left margin
                self.right = right      # Right margin
@@ -50,10 +50,10 @@ class formatter:
        # of the current font's space width.
        # (Two variations: one without, one with explicit stretch factor.)
        #
-       def addword(self, (word, spacefactor)):
+       def addword(self, word, spacefactor):
                self.addwordstretch(word, spacefactor, spacefactor)
        #
-       def addwordstretch(self, (word, spacefactor, stretchfactor)):
+       def addwordstretch(self, word, spacefactor, stretchfactor):
                width = self.d.textwidth(word)
                if width > self.avail_width:
                        self._flush(1)
index 12ed90bba010edb3934c1b1a647dcbb9f5d04bd5..626c8fa2fb4fd6afe98ae26f2dc6c39a6976cecf 100644 (file)
@@ -2,16 +2,11 @@
 # Generic stdwin windows
 
 # This is used as a base class from which to derive other window types.
-# The mainloop() function here is an event dispatcher for all window types.
-
-# XXX This is really obsoleted by "mainloop.py".
-# XXX Also you should to it class-oriented...
+# XXX DON'T USE THIS CODE ANY MORE!  It is ages old!
 
 import stdwin, stdwinq
 from stdwinevents import *
-
-windows = []                           # List of open windows
-
+from mainloop import mainloop, register, unregister, windows
 
 # Open a window
 
@@ -37,16 +32,11 @@ def open(title):                    # Open a generic window
        w.backspace = backspace
        w.arrow = arrow
        w.kleft = w.kup = w.kright = w.kdown = nop
-       windows.append(w)
+       w.dispatch = treatevent
+       register(w)
        return w
 
 
-# Generic event dispatching
-
-def mainloop():                                # Handle events until no windows left
-       while windows:
-               treatevent(stdwinq.getevent())
-
 def treatevent(e):                     # Handle a stdwin event
        type, w, detail = e
        if type == WE_DRAW:
@@ -95,10 +85,9 @@ def treatcommand(w, type):           # Handle a we_command event
 # Methods
 
 def close(w):                          # Close method
-       for i in range(len(windows)):
-               if windows[i] is w:
-                       del windows[i]
-                       break
+       unregister(w)
+       del w.close     # Delete our close function
+       w.close()       # Call the close method
 
 def arrow(w, detail):                  # Arrow key method
        if detail == WC_LEFT:
@@ -118,4 +107,4 @@ def enter(w): w.char(w, '\n')               # 'return' is a Python reserved word
 def backspace(w): w.char(w, '\b')
 def m2down(w, detail): w.mdown(w, detail)
 def m2up(w, detail): w.mup(w, detail)
-def nop(args): pass
+def nop(*args): pass
index ab8ad3a014cc7a940666351b09299b119806c760..f1fe6170b12fdf27a6df71522662e083ef055289 100644 (file)
@@ -23,7 +23,7 @@ last_window = None
 def register(win):
        # First test the dispatch function by passing it a null event --
        # this catches registration of unconforming windows.
-       win.dispatch(WE_NULL, win, None)
+       win.dispatch((WE_NULL, win, None))
        if win not in windows:
                windows.append(win)
 
index c939b1a607b30ed3997749d302a8998fd7865f54..374f457dbc4982e725ec209effd091b558e747d1 100644 (file)
@@ -40,7 +40,7 @@ class mutex:
        # If the mutex is already locked, place function and argument
        # in the queue.
        #
-       def lock(self, (function, argument)):
+       def lock(self, function, argument):
                if self.testandset():
                        function(argument)
                else:
index fa35fc444154079ddbdd8bbcec3635dcc594963a..48d0b2719f2b95d388b6237d08cb9a79c3ddea26 100755 (executable)
@@ -105,7 +105,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
                        print '*** Error in argument:', `arg`
                        return
                filename = self.curframe.f_code.co_filename
-               err = self.set_break(filename, lineno)
+               err = self.clear_break(filename, lineno)
                if err: print '***', err
        do_cl = do_clear # 'c' is already an abbreviation for 'continue'
        
index 39b45dcd45577efa473e6f4c6f28f108b345dda6..0904efeb85fd9aca35cb0dc33c07102377fbfa5e 100755 (executable)
@@ -208,7 +208,7 @@ def _parse_fd_form(file, name):
 class _newobj:
     def init(self):
        return self
-    def add(self, (name, value)):
+    def add(self, name, value):
        self.__dict__[name] = value
     def make(self, dict):
        for name in dict.keys():
@@ -299,9 +299,9 @@ def _parse_object(file):
            if datum == FORMLINE:
                file.seek(pos)
            return obj
-       if type(datum) <> type(()):
+       if type(datum) <> type(()) or len(datum) <> 2:
            raise error, 'Parse error, illegal line in object: '+datum
-       obj.add(datum)
+       obj.add(datum[0], datum[1])
 
 #################################################################
 #   Part 2 - High-level object/form creation routines            #
index 685b2bc077d0c4984dc58a282d3bcf8ee3abd5d4..29ccc2add3a8fb1fcaf349a9f789a697e7db3260 100644 (file)
@@ -34,7 +34,7 @@ class scheduler:
        #
        # Initialize a new instance, passing the time and delay functions
        #
-       def init(self, (timefunc, delayfunc)):
+       def init(self, timefunc, delayfunc):
                self.queue = []
                self.timefunc = timefunc
                self.delayfunc = delayfunc
@@ -44,14 +44,15 @@ class scheduler:
        # Returns an ID for the event which can be used
        # to remove it, if necessary.
        #
-       def enterabs(self, event):
+       def enterabs(self, time, priority, action, argument):
+               event = time, priority, action, argument
                bisect.insort(self.queue, event)
                return event # The ID
        #
        # A variant that specifies the time as a relative time.
        # This is actually the more commonly used interface.
        #
-       def enter(self, (delay, priority, action, argument)):
+       def enter(self, delay, priority, action, argument):
                time = self.timefunc() + delay
                return self.enterabs(time, priority, action, argument)
        #
@@ -95,6 +96,6 @@ class scheduler:
                                self.delayfunc(time - now)
                        else:
                                del q[0]
-                               void = action(argument)
+                               void = apply(action, argument)
                                self.delayfunc(0) # Let other threads run
        #
index c6fe137e73939459a81494796dcf4c5959a9902a..51bd305a8644d5afaa57214544e7aaa01bbb759b 100755 (executable)
@@ -30,7 +30,7 @@ class AbstractParent:
        def getwindow(self): return unimpl() # Only for very special cases
        #
        def change(self, area): unimpl()
-       def scroll(self, (area, (dh, dv))): unimpl()
+       def scroll(self, area, (dh, dv)): unimpl()
        def settimer(self, itimer): unimpl()
 
 class AbstractChild:
@@ -40,10 +40,10 @@ class AbstractChild:
        def destroy(self): unimpl()
        #
        def realize(self): return unimpl()
-       def getminsize(self, (m, (width, height))): return unimpl()
+       def getminsize(self, m, (width, height)): return unimpl()
        def getbounds(self): return unimpl()
        def setbounds(self, bounds): unimpl()
-       def draw(self, (d, area)): unimpl()
+       def draw(self, d, area): unimpl()
        #
        # Downcalls only made after certain upcalls
        #
index d042e880cb57e908f48dccf6ce483ba5180e9227..a44995d90c4699b6dc5a91e10c155061a1930cb9 100755 (executable)
@@ -2,13 +2,13 @@ from TransParent import TransParent
 
 class BoxParent(TransParent):
        #
-       def create(self, (parent, (dh, dv))):
+       def create(self, parent, (dh, dv)):
                self = TransParent.create(self, parent)
                self.dh = dh
                self.dv = dv
                return self
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                width = max(0, width - 2*self.dh)
                height = max(0, height - 2*self.dv)
                width, height = self.child.getminsize(m, (width, height))
index d1435d3acfbc9b55f5e97a1a1ed88e0f122718ab..9a9970789b6fa5adb09c9214b19b8fc1192d768d 100755 (executable)
@@ -35,7 +35,7 @@ class LabelAppearance:
        #
        # Size enquiry
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                width = max(width, m.textwidth(self.text) + 6)
                height = max(height, m.lineheight() + 6)
                return width, height
@@ -108,8 +108,8 @@ class LabelAppearance:
                        d.erase(self.bounds)
                        self.draw(d, self.bounds)
        #
-       def draw(self, (d, area)):
-               area = _rect.intersect(area, self.bounds)
+       def draw(self, d, area):
+               area = _rect.intersect([area, self.bounds])
                if area == _rect.empty:
                        return
                d.cliprect(area)
@@ -145,7 +145,7 @@ class LabelAppearance:
 
 class StrutAppearance(LabelAppearance):
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                height = max(height, m.lineheight() + 6)
                return width, height
        #
@@ -175,7 +175,7 @@ class ButtonAppearance(LabelAppearance):
 #
 class CheckAppearance(LabelAppearance):
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                minwidth = m.textwidth(self.text) + 6
                minheight = m.lineheight() + 6
                width = max(width, minwidth + minheight + m.textwidth(' '))
@@ -382,7 +382,7 @@ class Define:
        def destroy(self):
                self.parent = 0
        #
-       def definetext(self, (parent, text)):
+       def definetext(self, parent, text):
                self = self.define(parent)
                self.settext(text)
                return self
index 90d137e6fcb0f510486affb6282e90ba0a14c5c1..90d51119c3775470e05314dd96ffac11bf20a5aa 100755 (executable)
@@ -9,7 +9,7 @@ from Split import Split
 
 class CSplit(Split):
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                # Since things look best if the children are spaced evenly
                # along the circle (and often all children have the same
                # size anyway) we compute the max child size and assume
@@ -65,5 +65,5 @@ class CSplit(Split):
                        right, bottom = \
                                left + child_width, \
                                top + child_height
-                       child.setbounds((left, top), (right, bottom))
+                       child.setbounds(((left, top), (right, bottom)))
        #
index 00e9a8c50993a95ed673f1684e9d9be8e09b5800..4b98b1dc42af70e854e58521e40bf6c97c98a495 100755 (executable)
@@ -11,7 +11,7 @@ from HVSplit import HSplit, VSplit
 
 class DirList(VSplit):
        #
-       def create(self, (parent, dirname)):
+       def create(self, parent, dirname):
                self = VSplit.create(self, parent)
                names = os.listdir(dirname)
                for name in names:
index 16f3293259873333816a2050550ff3ff216d4677..271cb23fc18f73d7a4a7bd6ed427aa4ac22c929d 100755 (executable)
@@ -20,7 +20,7 @@ class FormSplit(Split):
                self.last_child = None
                return Split.create(self, parent)
        #
-       def getminsize(self, (m, sugg_size)):
+       def getminsize(self, m, sugg_size):
                max_width, max_height = 0, 0
                for c in self.children:
                        c.form_width, c.form_height = c.getminsize(m, (0, 0))
@@ -38,9 +38,9 @@ class FormSplit(Split):
                for c in self.children:
                        left, top = c.form_left + fleft, c.form_top + ftop
                        right, bottom = left + c.form_width, top + c.form_height
-                       c.setbounds((left, top), (right, bottom))
+                       c.setbounds(((left, top), (right, bottom)))
        #
-       def placenext(self, (left, top)):
+       def placenext(self, left, top):
                self.next_left = left
                self.next_top = top
                self.last_child = None
index 9790b7bdc84031b70af44abd3ab12a69642d2be7..c42327dcfcff875c279134808e88c7314232dcc6 100755 (executable)
@@ -9,13 +9,13 @@ from Split import Split
 
 class HVSplit(Split):
        #
-       def create(self, (parent, hv)):
+       def create(self, parent, hv):
                # hv is 0 for HSplit, 1 for VSplit
                self = Split.create(self, parent)
                self.hv = hv
                return self
        #
-       def getminsize(self, (m, sugg_size)):
+       def getminsize(self, m, sugg_size):
                hv, vh = self.hv, 1 - self.hv
                size = [0, 0]
                sugg_size = [sugg_size[0], sugg_size[1]]
@@ -46,8 +46,8 @@ class HVSplit(Split):
                        corner = [0, 0]
                        corner[vh] = end[vh]
                        corner[hv] = origin[hv] + size[hv]
-                       c.setbounds((origin[0], origin[1]), \
-                                       (corner[0], corner[1]))
+                       c.setbounds(((origin[0], origin[1]), \
+                                       (corner[0], corner[1])))
                        origin[hv] = corner[hv]
                        # XXX stretch
                        # XXX too-small
index 27ae673a25df9370549fd7772021389b3a63bc5d..74a75f374fb860cb73c831c08f46b42ec663508c 100755 (executable)
@@ -12,7 +12,7 @@ class HistogramAppearance(LabelAppearance, Define):
                self.scale = (0, 100)
                return self
        #
-       def setdata(self, (ydata, scale)):
+       def setdata(self, ydata, scale):
                self.ydata = ydata
                self.scale = scale # (min, max)
                self.parent.change(self.bounds)
index 0a709d609ea8c8f8f5146d936a303021579046cd..cbf776daee31806b2dda84ad8ea0332513762b7b 100755 (executable)
@@ -69,12 +69,12 @@ class DragSliderAppearance(ButtonAppearance):
        def sethook(self, hook):
                self.hook = hook
        #
-       def setminvalmax(self, (min, val, max)):
+       def setminvalmax(self, min, val, max):
                self.min = min
                self.max = max
                self.setval(val)
        #
-       def settexts(self, (pretext, postext)):
+       def settexts(self, pretext, postext):
                self.pretext = pretext
                self.postext = postext
                self.recalctext()
@@ -95,7 +95,7 @@ class DragSliderAppearance(ButtonAppearance):
        #
 
 class DragSlider(DragSliderReactivity, DragSliderAppearance, Define):
-       def definetext(self, (parent, text)):
+       def definetext(self, parent, text):
                raise RuntimeError, 'DragSlider.definetext() not supported'
 
 
@@ -108,7 +108,7 @@ class _StepButton(PushButton):
                return self
        def setstep(self, step):
                self.step = step
-       def definetextstep(self, (parent, text, step)):
+       def definetextstep(self, parent, text, step):
                self = self.definetext(parent, text)
                self.setstep(step)
                return self
@@ -145,7 +145,7 @@ class ComplexSlider(HSplit):
        #
        # Override HSplit methods
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                w1, h1 = self.downbutton.getminsize(m, (0, height))
                w3, h3 = self.upbutton.getminsize(m, (0, height))
                w1 = max(w1, h1)
@@ -156,10 +156,10 @@ class ComplexSlider(HSplit):
        def setbounds(self, bounds):
                (left, top), (right, bottom) = self.bounds = bounds
                size = bottom - top
-               self.downbutton.setbounds((left, top), (left+size, bottom))
-               self.dragbutton.setbounds((left+size, top), \
-                                               (right-size, bottom))
-               self.upbutton.setbounds((right-size, top), (right, bottom))
+               self.downbutton.setbounds(((left, top), (left+size, bottom)))
+               self.dragbutton.setbounds(((left+size, top), \
+                                               (right-size, bottom)))
+               self.upbutton.setbounds(((right-size, top), (right, bottom)))
        #
        # Pass other Slider methods on to dragbutton
        #
index a68d4b38c8d375508986755a0da2861801aa11d4..e3c797e3dd9169d4854613c04ea75199e3786684 100755 (executable)
@@ -5,7 +5,7 @@ from Histogram import Histogram
 
 class Soundogram(Histogram):
        #
-       def define(self, (win, chunk)):
+       def define(self, win, chunk):
                width, height = corner = win.getwinsize()
                bounds = (0, 0), corner
                self.chunk = chunk
index aacfa9896909d791613fc08f4af42e2158b480a4..8eb02543f49b16d134a330b5717d7b549f1632ab 100755 (executable)
@@ -39,7 +39,7 @@ class Split:
                self.mouse_focus = None
                self.keybd_focus = None
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                return unimpl()                 # Should ask children
        def getbounds(self):
                return unimpl()
index 5bce412069ef387c7a754a7abcfd0db5ed7b17d7..afec007ae4b6e066adcb1de23ef366c7d74b230c 100755 (executable)
@@ -8,7 +8,7 @@ from Buttons import LabelAppearance, NoReactivity
 
 class StripChart(LabelAppearance, NoReactivity):
        #
-       def define(self, (parent, scale)):
+       def define(self, parent, scale):
                self.parent = parent
                parent.addchild(self)
                self.init_appearance()
@@ -49,8 +49,8 @@ class StripChart(LabelAppearance, NoReactivity):
                        area = (left+i-1, top), (left+i, bottom)
                        self.draw(self.parent.begindrawing(), area)
        #
-       def draw(self, (d, area)):
-               area = rect.intersect(area, self.bounds)
+       def draw(self, d, area):
+               area = rect.intersect([area, self.bounds])
                if area == rect.empty:
                        return
                d.cliprect(area)
index 698a7d5ca67a5603499fd709eecf7cf2ae301f0d..e08e49681196193403e6b65396a9c7a4ec5e791b 100755 (executable)
@@ -7,7 +7,7 @@ from stdwinevents import *
 
 class TextEdit:
        #
-       def create(self, (parent, (cols, rows))):
+       def create(self, parent, (cols, rows)):
                parent.addchild(self)
                self.parent = parent
                self.cols = cols
@@ -18,7 +18,7 @@ class TextEdit:
                self.dh = self.dv = 0
                return self
        #
-       def createboxed(self, (parent, (cols, rows), (dh, dv))):
+       def createboxed(self, parent, (cols, rows), (dh, dv)):
                self = self.create(parent, (cols, rows))
                self.dh = max(0, dh)
                self.dv = max(0, dv)
@@ -37,7 +37,7 @@ class TextEdit:
                del self.editor
                del self.window
        #
-       def getminsize(self, (m, (width, height))):
+       def getminsize(self, m, (width, height)):
                width = max(0, width - 2*self.dh)
                height = max(0, height - 2*self.dv)
                if width > 0 and self.editor:
@@ -96,7 +96,7 @@ class TextEdit:
                self.parent.need_keybd(self)
                self.parent.need_altdraw(self)
        #
-       def draw(self, (d, area)):
+       def draw(self, d, area):
                if self.dh and self.dv:
                        d.box(self.bounds)
        #
@@ -114,7 +114,7 @@ class TextEdit:
        def mouse_up(self, detail):
                x = self.editor.event(WE_MOUSE_UP, self.window, detail)
        #
-       def keybd(self, (type, detail)):
+       def keybd(self, type, detail):
                x = self.editor.event(type, self.window, detail)
        #
        def activate(self):
index 697ed07b74c8824b44ddb5e9e7ace4971b5f90a8..1964d38a6ab39ff5a319ab444763061b962278bb 100755 (executable)
@@ -14,7 +14,7 @@ Error = 'WindowParent.Error'  # Exception
 
 class WindowParent(ManageOneChild):
        #
-       def create(self, (title, size)):
+       def create(self, title, size):
                self.title = title
                self.size = size                # (width, height)
                self._reset()
@@ -47,7 +47,7 @@ class WindowParent(ManageOneChild):
        def close_trigger(self):
                if self.close_hook: self.close_hook(self)
        #
-       def menu_trigger(self, (menu, item)):
+       def menu_trigger(self, menu, item):
                if self.menu_hook:
                        self.menu_hook(self, menu, item)
        #
@@ -94,7 +94,7 @@ class WindowParent(ManageOneChild):
                        width = self.size[0]
                if self.vbar:
                        height = self.size[1]
-               self.child.setbounds((0, 0), (width, height))
+               self.child.setbounds(((0, 0), (width, height)))
                self.child.realize()
                self.win.dispatch = self.dispatch
                mainloop.register(self.win)
@@ -109,7 +109,7 @@ class WindowParent(ManageOneChild):
                        width = self.size[0]
                if self.vbar:
                        height = self.size[1]
-               self.child.setbounds((0, 0), (width, height))
+               self.child.setbounds(((0, 0), (width, height)))
                # Force a redraw of the entire window:
                self.win.change((0, 0), self.size)
        #
index b2d4add7e0a4e0355e41ba09fe78f1e9a18eb703..ac34ce952c649f870d6177dd27164242ba66e8ea 100755 (executable)
@@ -13,7 +13,7 @@ class formatter:
        # Pass the window's drawing object, and left, top, right
        # coordinates of the drawing space as arguments.
        #
-       def init(self, (d, left, top, right)):
+       def init(self, d, left, top, right):
                self.d = d              # Drawing object
                self.left = left        # Left margin
                self.right = right      # Right margin
@@ -50,10 +50,10 @@ class formatter:
        # of the current font's space width.
        # (Two variations: one without, one with explicit stretch factor.)
        #
-       def addword(self, (word, spacefactor)):
+       def addword(self, word, spacefactor):
                self.addwordstretch(word, spacefactor, spacefactor)
        #
-       def addwordstretch(self, (word, spacefactor, stretchfactor)):
+       def addwordstretch(self, word, spacefactor, stretchfactor):
                width = self.d.textwidth(word)
                if width > self.avail_width:
                        self._flush(1)
index 12ed90bba010edb3934c1b1a647dcbb9f5d04bd5..626c8fa2fb4fd6afe98ae26f2dc6c39a6976cecf 100755 (executable)
@@ -2,16 +2,11 @@
 # Generic stdwin windows
 
 # This is used as a base class from which to derive other window types.
-# The mainloop() function here is an event dispatcher for all window types.
-
-# XXX This is really obsoleted by "mainloop.py".
-# XXX Also you should to it class-oriented...
+# XXX DON'T USE THIS CODE ANY MORE!  It is ages old!
 
 import stdwin, stdwinq
 from stdwinevents import *
-
-windows = []                           # List of open windows
-
+from mainloop import mainloop, register, unregister, windows
 
 # Open a window
 
@@ -37,16 +32,11 @@ def open(title):                    # Open a generic window
        w.backspace = backspace
        w.arrow = arrow
        w.kleft = w.kup = w.kright = w.kdown = nop
-       windows.append(w)
+       w.dispatch = treatevent
+       register(w)
        return w
 
 
-# Generic event dispatching
-
-def mainloop():                                # Handle events until no windows left
-       while windows:
-               treatevent(stdwinq.getevent())
-
 def treatevent(e):                     # Handle a stdwin event
        type, w, detail = e
        if type == WE_DRAW:
@@ -95,10 +85,9 @@ def treatcommand(w, type):           # Handle a we_command event
 # Methods
 
 def close(w):                          # Close method
-       for i in range(len(windows)):
-               if windows[i] is w:
-                       del windows[i]
-                       break
+       unregister(w)
+       del w.close     # Delete our close function
+       w.close()       # Call the close method
 
 def arrow(w, detail):                  # Arrow key method
        if detail == WC_LEFT:
@@ -118,4 +107,4 @@ def enter(w): w.char(w, '\n')               # 'return' is a Python reserved word
 def backspace(w): w.char(w, '\b')
 def m2down(w, detail): w.mdown(w, detail)
 def m2up(w, detail): w.mup(w, detail)
-def nop(args): pass
+def nop(*args): pass
index ab8ad3a014cc7a940666351b09299b119806c760..f1fe6170b12fdf27a6df71522662e083ef055289 100755 (executable)
@@ -23,7 +23,7 @@ last_window = None
 def register(win):
        # First test the dispatch function by passing it a null event --
        # this catches registration of unconforming windows.
-       win.dispatch(WE_NULL, win, None)
+       win.dispatch((WE_NULL, win, None))
        if win not in windows:
                windows.append(win)