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

Switch --permission to accept >=1 parameters #966

Merged
merged 1 commit into from
Jan 12, 2017

Conversation

KeyWeeUsr
Copy link
Contributor

Usage results:

  • single value

    ['param']
    
  • two or more values

    ['param1', 'param2']
    
  • two or more --permission args with at least one value each

    [['param1', 'param2'], ['param3', 'param4']]
    

which is later flattened.

Closes #673

When used with a single value -> ['param'], two or more values -> ['param1', 'param2'], two or more --permission args -> [['param1', 'param2'], ['param3', 'param4']] which is later flattened. Closes kivy#673
@@ -488,6 +488,9 @@ def parse_args(args=None):

if args.permissions is None:
args.permissions = []
elif args.permissions:
if isinstance(args.permissions[0], list):
args.permissions = [p for perm in args.permissions for p in perm]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using p as the variable name twice makes me twitchy ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I don't understand. It's a list comprehension, it wants the returning variable like that, otherwise it'd be this:

_new_permissions = []
for permission in args.permissions:
    for perm in permission:
        _new_permissions.append(perm)
args.permissions = _new_permissions

and repeated three times (pygame+sdl2+webview).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, I just misread it.

@inclement inclement merged commit f6433d0 into kivy:master Jan 12, 2017
@inclement
Copy link
Member

Thanks :)

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

Successfully merging this pull request may close these issues.

2 participants