Skip to content

Corrections for Fix bootstraps for webview and service_only (recently merged) #1586

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

Merged
merged 4 commits into from
Jan 21, 2019

Conversation

opacam
Copy link
Member

@opacam opacam commented Jan 13, 2019

We merged by mistake the mentioned pr #1541 with some minor issues that should had been fixed in there. We solve that in here.

¡¡¡Thanks @AndreMiras!!!

@@ -687,7 +689,7 @@ def _read_configuration():
if args.meta_data is None:
args.meta_data = []

if (not hasattr(args, 'services')) or args.services is None:
if getattr(args, 'services', None) is None:
args.services = []
Copy link
Member

Choose a reason for hiding this comment

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

Now I'm thinking we may go even more concise with:

args.services = getattr(args, 'services', [])

What do you think?

Copy link

Choose a reason for hiding this comment

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

yes that looks exactly how the default value of getattr is supposed to be used like 👍

Copy link

Choose a reason for hiding this comment

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

oh wait, actually this was supposed to also apply if args.services is None, right? which it won't, so it's not the same thing

Copy link

Choose a reason for hiding this comment

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

This would work, but it looks uglier: args.services = getattr(args, 'services', None) or [] (or alternatively, args.services = getattr(args, 'services', []) or [] but that's super redundant)

Copy link
Member

Choose a reason for hiding this comment

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

True, the semantic would not be the same for the args.services is None use case. But is that even an use case with add_argument('--service', dest='services', action='append')? I'm really wondering

Copy link

Choose a reason for hiding this comment

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

hmm only if the default is wrong, I suppose. if we checked that the default has a proper value and never None then it would be fine

We merged by mistake the mentioned pr with some minor issues that should had been fixed in there. We solve that in here.

¡¡¡Thanks @AndreMiras!!!
@opacam opacam force-pushed the minor-fix-bootstraps branch from 3b5da81 to cb94ed5 Compare January 21, 2019 02:44
@opacam
Copy link
Member Author

opacam commented Jan 21, 2019

Well, thanks to @KeyWeeUsr that noticed that the --service argument was disabled.

This is related with the problematic line discussed above, which I think that all the discussion started because of the --service argument being disabled (which leaded me to change the discussed line to avoid compilation errors)...so...I restored the problematic line as it was originally and enabled the --service argument again....I think that this should close the above discussion...

I also modified the testapp_service in order that the test made in there matches one of the options explained in the python-for-android's docs to create a service (thanks again to @KeyWeeUsr 😄...who pointed me to the right direction via discord)

This changes has been tested for python2 and python3 with the service's test app (the one I modify in here)

Note: While testing the new app, I realised that the file Service.tmpl.java needed a slight modifications to make it work with the new python core (a wrong path and a couple of missing imports) so I also fixed it.

@opacam opacam changed the title Minor corrections for Fix bootstraps for webview and service_only (recently merged) Corrections for Fix bootstraps for webview and service_only (recently merged) Jan 21, 2019
@AndreMiras AndreMiras merged commit 52f4bbc into kivy:master Jan 21, 2019
@AndreMiras
Copy link
Member

Great changeset again, thanks!

AndreMiras added a commit to AndreMiras/EtherollApp that referenced this pull request Jan 21, 2019
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.

3 participants