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)
|
# File windows, a subclass of textwin (which is a subclass of gwin)
|
||||||
|
|
||||||
import textwin
|
import textwin
|
||||||
from util import readfile
|
import builtin
|
||||||
|
|
||||||
|
|
||||||
# FILE WINDOW
|
# FILE WINDOW
|
||||||
|
|
||||||
def open_readonly(fn): # Open a 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
|
w.fn = fn
|
||||||
return w
|
return w
|
||||||
|
|
||||||
def open(fn): # Open a file window
|
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
|
w.fn = fn
|
||||||
return w
|
return w
|
||||||
|
|
|
@ -2,17 +2,19 @@
|
||||||
# File windows, a subclass of textwin (which is a subclass of gwin)
|
# File windows, a subclass of textwin (which is a subclass of gwin)
|
||||||
|
|
||||||
import textwin
|
import textwin
|
||||||
from util import readfile
|
import builtin
|
||||||
|
|
||||||
|
|
||||||
# FILE WINDOW
|
# FILE WINDOW
|
||||||
|
|
||||||
def open_readonly(fn): # Open a 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
|
w.fn = fn
|
||||||
return w
|
return w
|
||||||
|
|
||||||
def open(fn): # Open a file window
|
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
|
w.fn = fn
|
||||||
return w
|
return w
|
||||||
|
|
Loading…
Reference in New Issue