Adapt it to modern times (0.9.6)
This commit is contained in:
parent
9cf8f3372c
commit
4ea570d972
@ -1,7 +1,5 @@
|
|||||||
#! /usr/local/python
|
#! /usr/local/python
|
||||||
|
|
||||||
XXX This file needs some work for Python 0.9.6!!!
|
|
||||||
|
|
||||||
# A STDWIN-based front end for the Python interpreter.
|
# A STDWIN-based front end for the Python interpreter.
|
||||||
#
|
#
|
||||||
# This is useful if you want to avoid console I/O and instead
|
# This is useful if you want to avoid console I/O and instead
|
||||||
@ -29,15 +27,7 @@ import stdwin
|
|||||||
from stdwinevents import *
|
from stdwinevents import *
|
||||||
import rand
|
import rand
|
||||||
import mainloop
|
import mainloop
|
||||||
|
import os
|
||||||
from util import readfile # 0.9.1
|
|
||||||
|
|
||||||
try:
|
|
||||||
import mac
|
|
||||||
os = mac
|
|
||||||
except NameError:
|
|
||||||
import posix
|
|
||||||
os = posix
|
|
||||||
|
|
||||||
|
|
||||||
# Filename used to capture output from commands; change to suit your taste
|
# Filename used to capture output from commands; change to suit your taste
|
||||||
@ -213,8 +203,7 @@ def do_open(win):
|
|||||||
filename = stdwin.askfile('Open file', '', 0)
|
filename = stdwin.askfile('Open file', '', 0)
|
||||||
win = makewindow()
|
win = makewindow()
|
||||||
win.filename = filename
|
win.filename = filename
|
||||||
win.editor.replace(readfile(filename)) # 0.9.1
|
win.editor.replace(open(filename, 'r').read())
|
||||||
# win.editor.replace(open(filename, 'r').read()) # 0.9.2
|
|
||||||
win.editor.setfocus(0, 0)
|
win.editor.setfocus(0, 0)
|
||||||
win.settitle(win.filename)
|
win.settitle(win.filename)
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user