From: duplo Date: Tue, 23 Mar 2010 15:44:25 +0000 (+0000) Subject: Patch submitted by Rasky. X-Git-Tag: 2.5.0~637 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=8c03475b97b0d76cfd62d9c30c78f92a4cd894ef;p=bertos.git Patch submitted by Rasky. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3266 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/bertos.py b/wizard/bertos.py index 05ecf7af..24d61e03 100755 --- a/wizard/bertos.py +++ b/wizard/bertos.py @@ -119,6 +119,7 @@ def showStartPage(): QApplication.instance().dialog.show() def main(): + rundir = os.getcwd() os.chdir(os.path.dirname(os.path.abspath(sys.argv[0]))) app = QApplication(sys.argv) app.settings = QSettings("Develer", "Bertos Configurator") @@ -128,7 +129,7 @@ def main(): os.system("rcc -binary bertos.qrc -o bertos.rcc") QResource.registerResource("bertos.rcc") if len(sys.argv) == 3 and sys.argv[1] == "--edit": - editProject(sys.argv[2]) + editProject(os.path.join(rundir, sys.argv[2])) else: newProject() diff --git a/wizard/exception_handler.py b/wizard/exception_handler.py index 1dc3405c..9e54fa69 100644 --- a/wizard/exception_handler.py +++ b/wizard/exception_handler.py @@ -42,6 +42,8 @@ from PyQt4.QtGui import * def _excepthook(exc_type, exc_value, exc_traceback): project_dir = QApplication.instance().project.info("PROJECT_PATH") + if not project_dir: + project_dir = os.getcwd() file_name = os.path.join(project_dir, "wizard_error.log") if os.path.exists(file_name): content = open(file_name, "r").read() @@ -55,6 +57,7 @@ def _excepthook(exc_type, exc_value, exc_traceback): f.write(">"*80 + "\n") f.write(content) f.close() + print>>sys.stderr, message QMessageBox.critical( None, "Exception occurred",