Mercurial > cpython-lru_cache-weakref
diff Lib/stdwin/srcwin.py @ 1435:560ec7030817 legacy-trunk
* 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)
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Fri, 17 Dec 1993 15:25:27 +0000 |
| parents | 8bba14f7db8a |
| children |
line wrap: on
line diff
--- a/Lib/stdwin/srcwin.py Fri Dec 17 15:18:37 1993 +0000 +++ b/Lib/stdwin/srcwin.py Fri Dec 17 15:25:27 1993 +0000 @@ -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()
