1990-10-13 16:23:40 -03:00
|
|
|
# Module 'filewin'
|
|
|
|
# File windows, a subclass of textwin (which is a subclass of gwin)
|
|
|
|
|
|
|
|
import textwin
|
1994-08-01 08:34:53 -03:00
|
|
|
import __builtin__
|
1990-10-13 16:23:40 -03:00
|
|
|
|
|
|
|
|
|
|
|
# FILE WINDOW
|
|
|
|
|
|
|
|
def open_readonly(fn): # Open a file window
|
1994-08-01 08:34:53 -03:00
|
|
|
fp = __builtin__.open(fn, 'r')
|
1991-04-21 16:31:39 -03:00
|
|
|
w = textwin.open_readonly(fn, fp.read())
|
1990-10-13 16:23:40 -03:00
|
|
|
w.fn = fn
|
|
|
|
return w
|
|
|
|
|
|
|
|
def open(fn): # Open a file window
|
1994-08-01 08:34:53 -03:00
|
|
|
fp = __builtin__.open(fn, 'r')
|
1991-04-21 16:31:39 -03:00
|
|
|
w = textwin.open(fn, fp.read())
|
1990-10-13 16:23:40 -03:00
|
|
|
w.fn = fn
|
|
|
|
return w
|