Use built-in file.read() instead of util.readfile().
This commit is contained in:
parent
001fa6a20f
commit
40b0f3aa0e
|
@ -2,17 +2,19 @@
|
|||
# File windows, a subclass of textwin (which is a subclass of gwin)
|
||||
|
||||
import textwin
|
||||
from util import readfile
|
||||
import builtin
|
||||
|
||||
|
||||
# FILE WINDOW
|
||||
|
||||
def open_readonly(fn): # Open a file window
|
||||
w = textwin.open_readonly(fn, readfile(fn))
|
||||
fp = builtin.open(fn, 'r')
|
||||
w = textwin.open_readonly(fn, fp.read())
|
||||
w.fn = fn
|
||||
return w
|
||||
|
||||
def open(fn): # Open a file window
|
||||
w = textwin.open(fn, readfile(fn))
|
||||
fp = builtin.open(fn, 'r')
|
||||
w = textwin.open(fn, fp.read())
|
||||
w.fn = fn
|
||||
return w
|
||||
|
|
|
@ -2,17 +2,19 @@
|
|||
# File windows, a subclass of textwin (which is a subclass of gwin)
|
||||
|
||||
import textwin
|
||||
from util import readfile
|
||||
import builtin
|
||||
|
||||
|
||||
# FILE WINDOW
|
||||
|
||||
def open_readonly(fn): # Open a file window
|
||||
w = textwin.open_readonly(fn, readfile(fn))
|
||||
fp = builtin.open(fn, 'r')
|
||||
w = textwin.open_readonly(fn, fp.read())
|
||||
w.fn = fn
|
||||
return w
|
||||
|
||||
def open(fn): # Open a file window
|
||||
w = textwin.open(fn, readfile(fn))
|
||||
fp = builtin.open(fn, 'r')
|
||||
w = textwin.open(fn, fp.read())
|
||||
w.fn = fn
|
||||
return w
|
||||
|
|
Loading…
Reference in New Issue