Skip to content
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

Pass remaining command line args to Qt #2355

Merged
merged 1 commit into from
Nov 16, 2018

Conversation

ferdnyc
Copy link
Contributor

@ferdnyc ferdnyc commented Nov 14, 2018

Make sure we don't error out when a project file name is passed on the command line, which used to work until I broke it with #1828 .

Fixes #1872 , fixes #2162

Make sure we don't error out when a project file name is passed on the 
command line.

Fixes OpenShot#1872
@DylanC
Copy link
Collaborator

DylanC commented Nov 16, 2018

@ferdnyc - Thanks, I did feel the issue had something to do with those changes in #1828 but I didn't want to call it out unless I was completely wrong. 😆

@DylanC DylanC merged commit f9cbde8 into OpenShot:develop Nov 16, 2018
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Nov 17, 2018

Nope, it was totally 100% my fault. When I added the Python argparse options into launch.py, I completely failed to account for the existing commandline processing. (Which actually happens in src/classes/app.py, way at the end of the OpenShotApp class's __init__.)

In theory it might be cleaner to have launch.py also parse filename(s) on the commandline, and hand them off to the QApplication code as such, rather than stuffing them back into argv. But it works fine as-is.

FYI to any Fedora users, right after I fixed this I deployed new openshot-2.4.3-2.$arch.rpm packages to all supported Fedora releases @ RPMfusion, so the fix has already been released for anyone who installed from the rpmfusion-free repo.

@ferdnyc ferdnyc deleted the cmdline-projects branch November 17, 2018 19:24
@ferdnyc
Copy link
Contributor Author

ferdnyc commented Nov 17, 2018

log.info('Process command-line arguments: %s' % args)
if len(args[0]) == 2:
path = args[0][1]
if ".osp" in path:

P.S: My favorite thing about the commandline processing in app.py is that if (len(args[0]) == 2) ­— so if you pass two filenames on the commandline, or any other argument in addition to a project filename, it ignores all of the arguments.

(...However, that doesn't apply to the arguments recognized by argparse in launch.py, because it processes the argv first. Only the remaining unprocessed arguments (if any) are passed through to the QApplication code.)

@ferdnyc
Copy link
Contributor Author

ferdnyc commented Nov 18, 2018

FYI to any Fedora users, right after I fixed this I deployed new openshot-2.4.3-2.$arch.rpm packages to all supported Fedora releases @ RPMfusion, so the fix has already been released for anyone who installed from the rpmfusion-free repo.

Whoops, sorry, jumped the gun on that. The new builds are released to rawhide, but they're in rpmfusion-free-updates-testing for F27-F29. They haven't been pushed to the main repos yet, but it should only take a few days at most.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants