dabo Commit
Revision 7139
Date: 2012-04-24 01:48:17 -0700 (Tue, 24 Apr 2012)
Author: Ed
Trac: http://trac.dabodev.com/changeset/7139

Changed:
U   trunk/ide/Editor.py

Log:
Improved error logging when opening a file fails. Moved file saving to the 
dEditor class.

Diff:
Modified: trunk/ide/Editor.py
===================================================================
--- trunk/ide/Editor.py 2012-04-24 08:46:22 UTC (rev 7138)
+++ trunk/ide/Editor.py 2012-04-24 08:48:17 UTC (rev 7139)
@@ -210,7 +210,8 @@
                                if fileTarget:
                                        self.SelectedPage = pg
                                        ret = pg
-                       except:
+                       except StandardError as e:
+                               dabo.log.error(_("Error opening file '%s': %s") 
% (pth, e))
                                dabo.ui.callAfter(self.removePage, pg)
                                ret = None
                return ret
@@ -899,9 +900,7 @@
                        os.chdir(fileDir)
                txt = ed.Text
                fname = getTempFile(ext="py")
-               f = open(fname, "w")
-               f.write(txt)
-               f.close()
+               ed.saveFile(fname, force=True, isTmp=True)
 
                # Find out if we will use pythonw or just python:
                if "linux" in sys.platform:



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message: 
http://leafe.com/archives/byMID/[email protected]

Reply via email to