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

AttributeError: 'dict' object has no attribute 'resolvePath' #4

Closed
pikor opened this issue Dec 19, 2016 · 2 comments
Closed

AttributeError: 'dict' object has no attribute 'resolvePath' #4

pikor opened this issue Dec 19, 2016 · 2 comments

Comments

@pikor
Copy link

pikor commented Dec 19, 2016

Type of issue: [ Bug ]


Related Files:

None


Description:

Hi! First of all I must say nslocalizer looks like a great tool. Thank you for open-sourcing it!
I've installed nslocalizer according to Installation section of readme and I'm using it this way nslocalizer --project Inbbbox.xcodeproj/ --target Inbbbox --find-unused. Unfortunately, it's not working for me, please see crash report. Project I'm trying to check is open-sourced so you can check it for yourself (https://github.com/netguru/inbbbox-ios)
Let me know if you need more informations, happy to help to debug this issue.


Crash Report:

Summary Goes Here
Traceback (most recent call last):
  File "/usr/local/Cellar/nslocalizer/1.0/libexec/bin/nslocalizer", line 9, in <module>
    load_entry_point('nslocalizer==1.0', 'console_scripts', 'nslocalizer')()
  File "/usr/local/Cellar/nslocalizer/1.0/libexec/lib/python3.5/site-packages/nslocalizer/main.py", line 117, in main
    Executor.run(args)
  File "/usr/local/Cellar/nslocalizer/1.0/libexec/lib/python3.5/site-packages/nslocalizer/Executor/Executor.py", line 75, in run
    unused_strings = cls.findUnusedStrings(xcodeproj_file, desired_targets)
  File "/usr/local/Cellar/nslocalizer/1.0/libexec/lib/python3.5/site-packages/nslocalizer/Executor/Executor.py", line 98, in findUnusedStrings
    code_files.extend(CodeFinder.getCodeFileList(project.project_file, target))
  File "/usr/local/Cellar/nslocalizer/1.0/libexec/lib/python3.5/site-packages/nslocalizer/Finder/CodeFinder.py", line 45, in getCodeFileList
    all_file_refs = [PathFinder.resolveFilePathForReference(project, build_file.store[pbProj.PBX_Constants.kPBX_BUILDFILE_fileRef]) for build_file in all_build_files]
  File "/usr/local/Cellar/nslocalizer/1.0/libexec/lib/python3.5/site-packages/nslocalizer/Finder/CodeFinder.py", line 45, in <listcomp>
    all_file_refs = [PathFinder.resolveFilePathForReference(project, build_file.store[pbProj.PBX_Constants.kPBX_BUILDFILE_fileRef]) for build_file in all_build_files]
  File "/usr/local/Cellar/nslocalizer/1.0/libexec/lib/python3.5/site-packages/nslocalizer/Finder/PathFinder.py", line 34, in resolveFilePathForReference
    file_path = reference.resolvePath(project)
  File "/usr/local/Cellar/nslocalizer/1.0/libexec/lib/python3.5/site-packages/nslocalizer/xcodeproj/pbProj/PBXItem.py", line 77, in __getattr__
    return getattr(self.store, attrib)
AttributeError: 'dict' object has no attribute 'resolvePath'

@samdmarshall
Copy link
Owner

Thanks for the crash report, I will give it a go myself to reproduce the crash; however i would like to know if there are any parts of this that are auto-generated through some other tool.

@samdmarshall
Copy link
Owner

OK, I found an fixed the issue. It seems that there was a xcdatamodel file being included in list of source files for the project. I've address it to handle that type of file correctly. That uncovered some additional bugs which have now been fixed. I will be able to push the 1.0.1 update as soon as pypi propagates the update of the package i distribute pbPlist which is used for parsing the xcodeproj's project.pbxproj file as well as the .strings and .stringsdict files. I have run the updated code against the repo in question and it works fine now. I'll update and close this ticket once I publish the update via GitHub and homebrew.

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

No branches or pull requests

2 participants