* Mass change: get rid of all init() methods, in favor of __init__()
constructors. There is no backward compatibility. Not everything has
been tested.
* aiff.{py,doc}: deleted in favor of aifc.py (which contains its docs as
comments)
diff --git a/Lib/lib-stdwin/srcwin.py b/Lib/lib-stdwin/srcwin.py
index a71c568..29b7801 100644
--- a/Lib/lib-stdwin/srcwin.py
+++ b/Lib/lib-stdwin/srcwin.py
@@ -10,7 +10,7 @@
class TextWindow(basewin.BaseWindow):
- def init(self, title, contents):
+ def __init__(self, title, contents):
self.contents = contents
self.linecount = countlines(self.contents)
#
@@ -23,11 +23,10 @@
width = WIDTH*stdwin.textwidth('0')
height = lh*min(MAXHEIGHT, self.linecount)
stdwin.setdefwinsize(width, height)
- self = basewin.BaseWindow.init(self, title)
+ basewin.BaseWindow.__init__(self, title)
#
self.win.setdocsize(0, self.bottom)
self.initeditor()
- return self
def initeditor(self):
r = (self.leftmargin, self.top), (self.rightmargin, self.bottom)
@@ -113,12 +112,12 @@
class SourceWindow(TextWindow):
- def init(self, filename):
+ def __init__(self, filename):
self.filename = filename
f = open(self.filename, 'r')
contents = f.read()
f.close()
- return TextWindow.init(self, self.filename, contents)
+ TextWindow.__init__(self, self.filename, contents)
# ------------------------------ testing ------------------------------
@@ -126,5 +125,5 @@
def test():
import mainloop
- sw = SourceWindow().init(TESTFILE)
+ sw = SourceWindow(TESTFILE)
mainloop.mainloop()