diff options
| author | tassaron | 2017-07-27 18:43:02 -0400 |
|---|---|---|
| committer | tassaron | 2017-07-27 18:43:02 -0400 |
| commit | 6fc0398602c42a3d219ec92163c480c1833ab0c2 (patch) | |
| tree | 299a0009b683544b2fc41936c36a1f830eac5561 | |
| parent | de1324a6a75eb2a9f97d8a6b416077cfc73b2bc9 (diff) | |
quit if project doesn't exist when exporting from commandline
| -rw-r--r-- | src/command.py | 4 | ||||
| -rw-r--r-- | src/core.py | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/command.py b/src/command.py index 74ca821..18f7408 100644 --- a/src/command.py +++ b/src/command.py @@ -64,7 +64,9 @@ class Command(QtCore.QObject): ) if not projPath.endswith('.avp'): projPath += '.avp' - self.core.openProject(self, projPath) + success = self.core.openProject(self, projPath) + if not success: + quit(1) self.core.selectedComponents = list( reversed(self.core.selectedComponents)) self.core.componentListChanged() diff --git a/src/core.py b/src/core.py index b371d64..1c29774 100644 --- a/src/core.py +++ b/src/core.py @@ -214,7 +214,8 @@ class Core: self.clearPreset(i) if hasattr(loader, 'updateComponentTitle'): loader.updateComponentTitle(i, modified) - + self.openingProject = False + return True except Exception: errcode = 1 data = sys.exc_info() @@ -234,7 +235,8 @@ class Core: showCancel=False, icon='Warning', detail=msg) - self.openingProject = False + self.openingProject = False + return False def parseAvFile(self, filepath): ''' |
