From 06c27a48bc3f52e15c15445d822e8a6f523ab98f Mon Sep 17 00:00:00 2001 From: tassaron Date: Thu, 13 Jul 2017 17:03:25 -0400 Subject: more error messages for blank components --- src/components/video.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/components/video.py') diff --git a/src/components/video.py b/src/components/video.py index 53487b1..8861d70 100644 --- a/src/components/video.py +++ b/src/components/video.py @@ -115,6 +115,7 @@ class Component(Component): self.settings = parent.settings page = self.loadUi('video.ui') self.videoPath = '' + self.badVideo = False self.x = 0 self.y = 0 self.loopVideo = False @@ -156,14 +157,18 @@ class Component(Component): props = [] if self.useAudio: props.append('audio') - if self.videoPath and not os.path.exists(self.videoPath): + if not self.videoPath or self.badVideo \ + or not os.path.exists(self.videoPath): props.append('error') return props def error(self): + if not self.videoPath: + return "There is no video selected." if not os.path.exists(self.videoPath): - return "The video selected on " \ - "layer %s does not exist!" % str(self.compPos) + return "The video selected does not exist!" + if self.badVideo: + return "The video selected is corrupt!" def audio(self): return (self.videoPath, {'map': '-v'}) @@ -300,6 +305,7 @@ def finalizeFrame(self, imageData, width, height): '### BAD VIDEO SELECTED ###\n' 'Video will not export with these settings' ) + self.badVideo = True return BlankFrame(width, height) if self.scale != 100 \ @@ -308,4 +314,5 @@ def finalizeFrame(self, imageData, width, height): frame.paste(image, box=(self.xPosition, self.yPosition)) else: frame = image + self.badVideo = False return frame -- cgit v1.2.3