-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support cross-platform apps and directories #3
base: master
Are you sure you want to change the base?
Conversation
…uffix on windows) and temp directory locations
@@ -0,0 +1,17 @@ | |||
[tool.poetry] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please exclude this python poetry configuration file from your commit
import tempfile # platform-independent tempoary files and directories | ||
|
||
# default filenames | ||
MP4BOX_DEFAULT_FILENAME = "mp4box" if not (platform.system() == "Windows") else "mp4box.exe" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider simplifying the conditional here to not use a negative, easier to read, also consider making the comparison case insensitive, i.e.
"mp4box.exe" if platform.system().casefold() == "Windows".casefold() else "mp4box"
@@ -55,6 +61,8 @@ def runMain(): | |||
|
|||
# Construct the argument parser for the commandline | |||
args = parseArguments() | |||
|
|||
print(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove print statement
def findffmpeg(path_to_ffmpeg_install=None, working_dir=None): | ||
if( not path_to_ffmpeg_install is None and os.path.isfile(os.path.join(path_to_ffmpeg_install, "ffmpeg.exe")) ): | ||
return os.path.join(path_to_ffmpeg_install, "ffmpeg.exe") | ||
def findffmpeg(path_to_ffmpeg_install=None, working_dir=None, ffmpeg_filename="ffmpeg"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please make the same type of constant for FFMPEG as you've done for mp4box otherwise the script breaks on Windows
@@ -611,4 +619,5 @@ def parseArguments(): | |||
|
|||
# If the script file is called by itself then execute the main function | |||
if __name__ == '__main__': | |||
print("HELLO") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this print statement
Added support for running on Macs (and maybe other platforms) by using cross-platform libraries to identify the temp directory and file names.