From 9d45f7f1a986aaa5d3c084c7ae747442b94a61b1 Mon Sep 17 00:00:00 2001 From: tassaron Date: Sun, 15 Sep 2024 17:00:03 -0400 Subject: fix #78 --- src/__main__.py | 3 +++ src/components/video.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/__main__.py b/src/__main__.py index bd35e32..284fd2c 100644 --- a/src/__main__.py +++ b/src/__main__.py @@ -21,6 +21,9 @@ def main() -> int: mode = 'commandline' else: # remove unsafe punctuation characters such as \/?*&^%$# + if sys.argv[1].endswith('.avp'): + # remove file extension + sys.argv[1] = sys.argv[1][:-4] sys.argv[1] = re.sub(f'[{re.escape(string.punctuation)}]', '', sys.argv[1]) # opening a project file with gui proj = sys.argv[1] diff --git a/src/components/video.py b/src/components/video.py index 9fffc26..60ca800 100644 --- a/src/components/video.py +++ b/src/components/video.py @@ -63,16 +63,16 @@ class Component(Component): def properties(self): props = [] + outputFile = None if hasattr(self.parent, 'lineEdit_outputFile'): + # check only happens in GUI mode outputFile = self.parent.lineEdit_outputFile.text() - else: - outputFile = str(self.parent.args.output) if not self.videoPath: self.lockError("There is no video selected.") elif not os.path.exists(self.videoPath): self.lockError("The video selected does not exist!") - elif os.path.realpath(self.videoPath) == os.path.realpath(outputFile): + elif outputFile and os.path.realpath(self.videoPath) == os.path.realpath(outputFile): self.lockError("Input and output paths match.") if self.useAudio: -- cgit v1.2.3