diff options
| author | tassaron | 2024-09-15 17:00:03 -0400 |
|---|---|---|
| committer | tassaron | 2024-09-15 17:00:03 -0400 |
| commit | 9d45f7f1a986aaa5d3c084c7ae747442b94a61b1 (patch) | |
| tree | bef1567cad354586b65b342f49664776a72aea5f | |
| parent | 53590f47a3812ea563417d2e1276e57a92a8654a (diff) | |
fix #78
| -rw-r--r-- | src/__main__.py | 3 | ||||
| -rw-r--r-- | src/components/video.py | 6 |
2 files changed, 6 insertions, 3 deletions
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: | |||
| 21 | mode = 'commandline' | 21 | mode = 'commandline' |
| 22 | else: | 22 | else: |
| 23 | # remove unsafe punctuation characters such as \/?*&^%$# | 23 | # remove unsafe punctuation characters such as \/?*&^%$# |
| 24 | if sys.argv[1].endswith('.avp'): | ||
| 25 | # remove file extension | ||
| 26 | sys.argv[1] = sys.argv[1][:-4] | ||
| 24 | sys.argv[1] = re.sub(f'[{re.escape(string.punctuation)}]', '', sys.argv[1]) | 27 | sys.argv[1] = re.sub(f'[{re.escape(string.punctuation)}]', '', sys.argv[1]) |
| 25 | # opening a project file with gui | 28 | # opening a project file with gui |
| 26 | proj = sys.argv[1] | 29 | 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): | |||
| 63 | 63 | ||
| 64 | def properties(self): | 64 | def properties(self): |
| 65 | props = [] | 65 | props = [] |
| 66 | outputFile = None | ||
| 66 | if hasattr(self.parent, 'lineEdit_outputFile'): | 67 | if hasattr(self.parent, 'lineEdit_outputFile'): |
| 68 | # check only happens in GUI mode | ||
| 67 | outputFile = self.parent.lineEdit_outputFile.text() | 69 | outputFile = self.parent.lineEdit_outputFile.text() |
| 68 | else: | ||
| 69 | outputFile = str(self.parent.args.output) | ||
| 70 | 70 | ||
| 71 | if not self.videoPath: | 71 | if not self.videoPath: |
| 72 | self.lockError("There is no video selected.") | 72 | self.lockError("There is no video selected.") |
| 73 | elif not os.path.exists(self.videoPath): | 73 | elif not os.path.exists(self.videoPath): |
| 74 | self.lockError("The video selected does not exist!") | 74 | self.lockError("The video selected does not exist!") |
| 75 | elif os.path.realpath(self.videoPath) == os.path.realpath(outputFile): | 75 | elif outputFile and os.path.realpath(self.videoPath) == os.path.realpath(outputFile): |
| 76 | self.lockError("Input and output paths match.") | 76 | self.lockError("Input and output paths match.") |
| 77 | 77 | ||
| 78 | if self.useAudio: | 78 | if self.useAudio: |
