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

Variant groups #116

Closed
wants to merge 2 commits into from
Closed

Variant groups #116

wants to merge 2 commits into from

Conversation

kronenthaler
Copy link
Owner

Attempt to solve #113. Needs confirmation from @st3fan.
How to use:

# load project as usual
project.add_file('en.lproj/<file1>.strings', ...)
project.add_file('en.lproj/<file2>.strings', ...)
project.add_file('en.lproj/<file3>.strings', ...)

Maybe i will add a helper method to add a full folder later on, after confirm that this works as expected.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.9%) to 95.082% when pulling 4dc184f on variant-groups into 90ce0b6 on master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.9%) to 95.082% when pulling 48cd983 on variant-groups into 118ee28 on master.

@eAi
Copy link

eAi commented Feb 20, 2017

I've created a pull request that fixes some issues with this: #124 (I apologies if I've done this incorrectly, I'm a bit of a GitHub newb!)

@st3fan
Copy link

st3fan commented Feb 25, 2017

Sorry for not responding, I will try to give this a go next week.

@MacAccount
Copy link

I'm trying to do the same thing as st3fan here. I have a bunch of InfoPlist.strings in different language_code.lprof folders where language_code can be de, fr etc and I want to add them to my project. I have tried the following:

from pbxproj import XcodeProject project = XcodeProject.load('./myProject.xcodeproj/project.pbxproj')

project.add_file('./de.lproj/InfoPlist.strings', force=False)

project.save()

However, after executing the above the InfoPlist.strings file was not added. Using diff shows no changes were made to the project.pbxproj file.

If I instead set force=True in the add_file function then I get the following error:

Traceback (most recent call last):

File "import.py", line 4, in <module>
project.add_file('./de.lproj/InfoPlist.strings', force=True, parent='InfoPlist.strings')
File "/Library/Python/2.7/site-packages/pbxproj/pbxextensions/ProjectFiles.py", line 123, in add_file
file_options)
File "/Library/Python/2.7/site-packages/pbxproj/pbxextensions/ProjectFiles.py", line 395, in _add_file_reference
self._get_parent_group(parent).add_child(file_ref)
AttributeError: 'NoneType' object has no attribute 'add_child'

@kronenthaler
Copy link
Owner Author

This PR is very incomplete and buggy. It needs more work. I will close and reopen when better solution comes.

Repository owner locked and limited conversation to collaborators Sep 26, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants