]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use readfile from util.py.
authorGuido van Rossum <guido@python.org>
Tue, 19 Feb 1991 13:02:13 +0000 (13:02 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 19 Feb 1991 13:02:13 +0000 (13:02 +0000)
Lib/lib-stdwin/filewin.py
Lib/stdwin/filewin.py

index 1beb0b6520cfa9dcd66e71f7d16b9a1319a6b1a3..6a224e7c0a4894c8bf0b92dea829666be7253132 100644 (file)
@@ -1,21 +1,8 @@
 # Module 'filewin'
 # File windows, a subclass of textwin (which is a subclass of gwin)
 
-import stdwin
 import textwin
-import path
-
-builtin_open = open
-
-def readfile(fn): # Return a string containing the file's contents
-       fp = builtin_open(fn, 'r')
-       a = ''
-       n = 8096
-       while 1:
-               b = fp.read(n)
-               if not b: break
-               a = a + b
-       return a
+from util import readfile
 
 
 # FILE WINDOW
index 1beb0b6520cfa9dcd66e71f7d16b9a1319a6b1a3..6a224e7c0a4894c8bf0b92dea829666be7253132 100755 (executable)
@@ -1,21 +1,8 @@
 # Module 'filewin'
 # File windows, a subclass of textwin (which is a subclass of gwin)
 
-import stdwin
 import textwin
-import path
-
-builtin_open = open
-
-def readfile(fn): # Return a string containing the file's contents
-       fp = builtin_open(fn, 'r')
-       a = ''
-       n = 8096
-       while 1:
-               b = fp.read(n)
-               if not b: break
-               a = a + b
-       return a
+from util import readfile
 
 
 # FILE WINDOW