Commit 80b22290 authored by kliment's avatar kliment

Remove dependency on "with" - works with python 2.5

parent cee36985
......@@ -180,10 +180,11 @@ class pronsole(cmd.Cmd):
def preloop(self):
self.processing_rc=True
try:
with open(os.path.join(os.path.expanduser("~"),".pronsolerc")) as rc:
for rc_cmd in rc:
if not rc_cmd.lstrip().startswith("#"):
self.onecmd(rc_cmd)
rc=open(os.path.join(os.path.expanduser("~"),".pronsolerc"))
for rc_cmd in rc:
if not rc_cmd.lstrip().startswith("#"):
self.onecmd(rc_cmd)
rc.close()
except IOError:
pass
self.processing_rc=False
......@@ -768,8 +769,8 @@ class pronsole(cmd.Cmd):
print "Skeinforge not found. \nPlease copy Skeinforge into a directory named \"skeinforge\" in the same directory as this file."
return
if not os.path.exists("skeinforge/__init__.py"):
with open("skeinforge/__init__.py","w"):
pass
f=open("skeinforge/__init__.py","w")
f.close()
try:
from skeinforge.skeinforge_application.skeinforge_utilities import skeinforge_craft
from skeinforge.skeinforge_application import skeinforge
......
......@@ -218,7 +218,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.logbox.SetEditable(0)
self.sendbtn=wx.Button(self.panel,-1,"Send",pos=(700,420))
self.sendbtn.Bind(wx.EVT_BUTTON,self.sendline)
self.monitorbox=wx.CheckBox(self.panel,-1,"Monitor printer",pos=(500,40))
self.monitorbox=wx.CheckBox(self.panel,-1,"Monitor\nprinter",pos=(450,37))
self.monitorbox.Bind(wx.EVT_CHECKBOX,self.setmonitor)
self.status=self.CreateStatusBar()
self.status.SetStatusText("Not connected to printer.")
......@@ -462,8 +462,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
print "Skeinforge not found. \nPlease copy Skeinforge into a directory named \"skeinforge\" in the same directory as this file."
return
if not os.path.exists("skeinforge/__init__.py"):
with open("skeinforge/__init__.py","w"):
pass
f=open("skeinforge/__init__.py","w")
f.close()
self.cout=StringIO.StringIO()
self.filename=filename
self.stopsf=0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment