Showing preview only (271K chars total). Download the full file or copy to clipboard to get everything.
Repository: samdmarshall/nslocalizer
Branch: develop
Commit: df086165d920
Files: 115
Total size: 242.3 KB
Directory structure:
gitextract_5412qdru/
├── .codeclimate.yml
├── .github/
│ ├── ISSUE_TEMPLATE.md
│ └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .gitmodules
├── Dangerfile
├── Gemfile
├── LICENSE
├── Makefile
├── circle.yml
├── contributing/
│ └── code-of-conduct.md
├── contributing.md
├── install_requirements.txt
├── nslocalizer/
│ ├── Executor/
│ │ ├── Executor.py
│ │ └── __init__.py
│ ├── Finder/
│ │ ├── CodeFinder.py
│ │ ├── LanguageFinder.py
│ │ ├── PathFinder.py
│ │ └── __init__.py
│ ├── Helpers/
│ │ ├── FileOperations.py
│ │ ├── Logger.py
│ │ ├── Switch.py
│ │ ├── __init__.py
│ │ └── xcrun.py
│ ├── Language/
│ │ ├── Language.py
│ │ ├── LanguageString.py
│ │ └── __init__.py
│ ├── Reporter/
│ │ ├── Reporter.py
│ │ └── __init__.py
│ ├── __init__.py
│ ├── main.py
│ ├── version.py
│ ├── version_info.py
│ └── xcodeproj/
│ ├── __init__.py
│ ├── pbProj/
│ │ ├── PBXAggregateTarget.py
│ │ ├── PBXAppleScriptBuildPhase.py
│ │ ├── PBXApplicationReference.py
│ │ ├── PBXApplicationTarget.py
│ │ ├── PBXBuildFile.py
│ │ ├── PBXBuildRule.py
│ │ ├── PBXBundleReference.py
│ │ ├── PBXBundleTarget.py
│ │ ├── PBXContainerItemProxy.py
│ │ ├── PBXCopyFilesBuildPhase.py
│ │ ├── PBXExecutableFileReference.py
│ │ ├── PBXFileReference.py
│ │ ├── PBXFrameworkReference.py
│ │ ├── PBXFrameworkTarget.py
│ │ ├── PBXFrameworksBuildPhase.py
│ │ ├── PBXGroup.py
│ │ ├── PBXHeadersBuildPhase.py
│ │ ├── PBXItem.py
│ │ ├── PBXJavaArchiveBuildPhase.py
│ │ ├── PBXLegacyTarget.py
│ │ ├── PBXLibraryReference.py
│ │ ├── PBXLibraryTarget.py
│ │ ├── PBXNativeTarget.py
│ │ ├── PBXProject.py
│ │ ├── PBXReferenceProxy.py
│ │ ├── PBXResourcesBuildPhase.py
│ │ ├── PBXRezBuildPhase.py
│ │ ├── PBXShellScriptBuildPhase.py
│ │ ├── PBXSourcesBuildPhase.py
│ │ ├── PBXStandAloneTarget.py
│ │ ├── PBXTargetDependency.py
│ │ ├── PBXToolTarget.py
│ │ ├── PBXVariantGroup.py
│ │ ├── PBXZipArchiveReference.py
│ │ ├── PBX_Constants.py
│ │ ├── PBX_Lookup.py
│ │ ├── XCBuildConfiguration.py
│ │ ├── XCConfigurationList.py
│ │ ├── XCVersionGroup.py
│ │ ├── __init__.py
│ │ └── pbProj.py
│ └── xcodeproj.py
├── nslocalizer.py
├── pylintrc
├── readme.md
├── requirements.txt
├── setup.py
├── tests/
│ ├── __init__.py
│ ├── nslocalizer-example/
│ │ ├── Base.lproj/
│ │ │ └── Localizable.strings
│ │ ├── de.lproj/
│ │ │ └── Localizable.strings
│ │ ├── en.lproj/
│ │ │ └── Localizable.strings
│ │ ├── es.lproj/
│ │ │ └── Localizable.strings
│ │ ├── fr.lproj/
│ │ │ └── Localizable.strings
│ │ ├── pylocalizer-example/
│ │ │ ├── AppDelegate.h
│ │ │ ├── AppDelegate.m
│ │ │ ├── Assets.xcassets/
│ │ │ │ └── AppIcon.appiconset/
│ │ │ │ └── Contents.json
│ │ │ ├── Base.lproj/
│ │ │ │ ├── LaunchScreen.storyboard
│ │ │ │ └── Main.storyboard
│ │ │ ├── DetailViewController.h
│ │ │ ├── DetailViewController.m
│ │ │ ├── Info.plist
│ │ │ ├── MasterViewController.h
│ │ │ ├── MasterViewController.m
│ │ │ ├── de.lproj/
│ │ │ │ ├── LaunchScreen.strings
│ │ │ │ └── Main.strings
│ │ │ ├── es.lproj/
│ │ │ │ ├── LaunchScreen.strings
│ │ │ │ └── Main.strings
│ │ │ ├── fr.lproj/
│ │ │ │ ├── LaunchScreen.strings
│ │ │ │ └── Main.strings
│ │ │ └── main.m
│ │ └── pylocalizer-example.xcodeproj/
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace/
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcuserdata/
│ │ │ └── Samantha.xcuserdatad/
│ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcuserdata/
│ │ └── Samantha.xcuserdatad/
│ │ └── xcschemes/
│ │ ├── pylocalizer-example.xcscheme
│ │ └── xcschememanagement.plist
│ ├── nslocalizer_test.py
│ └── test_runner.py
├── tools/
│ ├── checkout_by_version.sh
│ ├── hooks/
│ │ └── pre-commit
│ └── hooks-config.py
└── tox.ini
================================================
FILE CONTENTS
================================================
================================================
FILE: .codeclimate.yml
================================================
engines:
radon:
enabled: true
duplication:
enabled: true
config:
languages:
- python
exclude_fingerprints:
FIXME:
enabled: true
ratings:
paths:
- nslocalizer/
exclude_paths:
- examples/
- tests/
- tools/
- "*.md"
- "*.yml"
- "*.ini"
- Makefile
- Dangerfile
- Gemfile
- LICENSE
- contributing/
- docs/
- setup.py
- nslocalizer.py
================================================
FILE: .github/ISSUE_TEMPLATE.md
================================================
<!-- REQUIRED FIELDS -->
**Type of issue**: [ Bug | Enhancement | Request ]
---
**Related Files**:
---
**Description**:
---
<!-- OPTIONAL FIELDS, REMOVE THE FIELDS THAT ARE NOT APPLICABLE -->
**Crash Report**:
<details>
<summary>Summary Goes Here</summary>
```
...crash report trace goes here...
```
</details>
---
**Sample File**:
<details>
<summary>`sample.pyconfig`</summary>
```
...sample.pyconfig contents go here...
```
</details>
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
<!-- REQUIRED FIELDS -->
**Title**:
---
**Description**:
<!--
Please create a list of changes using the following format:
* Top level change description, this can be a couple of sentences. please be descriptive.
- <commit hash of relevant change regarding the described change>
- <commit hash of another relevant change>
-->
================================================
FILE: .gitignore
================================================
.DS_Store
installed_files.txt
build/
dist/
nslocalizer.egg-info/
.tox/
.coverage
*.pyc
__pycache__/
htmlcov/
.eggs/
lint_output.txt
*_output.plist
================================================
FILE: .gitmodules
================================================
[submodule "docs"]
path = docs
url = https://samdmarshall@github.com/samdmarshall/pylocalizer.wiki.git
================================================
FILE: Dangerfile
================================================
# this dangerfile sets values that will be consumed by the global danger
# file. The global dangerfile is run automatically after this repo-specific
# file is run. The global dangerfile is located at: https://github.com/samdmarshall/danger
# set the number of lines that must be changed before this classifies as a 'Big PR'
@SDM_DANGER_BIG_PR_LINES = 75
# set the files to watch and warn about if there are changes made
@SDM_DANGER_BUILD_FILES = ['Makefile', 'Gemfile', 'Dangerfile', 'circle.yml', '.codeclimate.yml', 'tox.ini', 'pylintrc']
# set the files to watch and warn about if there are
@SDM_DANGER_INSTALL_REQUIREMENTS_FILES = ['requirements.txt', 'setup.py']
# set the files to watch and fail if there are changes
@SDM_DANGER_IMMUTABLE_FILES = ['LICENSE', 'contributing.md', 'contributing/code-of-conduct.md']
# mark the paths that should be reported as part of the circle ci build artifacts
@SDM_DANGER_REPORT_CIRCLE_CI_ARTIFACTS = Array[
{
'message'=> 'html coverage report',
'path'=> 'htmlcov/index.html'
},
{
'message'=> 'linter report',
'path'=> 'lint_output.txt'
}
]
================================================
FILE: Gemfile
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
source 'https://rubygems.org'
gem 'danger'
================================================
FILE: LICENSE
================================================
Copyright (c) 2016, Samantha Marshall
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of Samantha Marshall nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: Makefile
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
# Variables
# path to installation record that gets written when performing:
# - make build2
# - make build3
INSTALLED_FILES_RECORD := ./installed_files.txt
# names of the executables that are used as a part of this project
PYTHON3_CMD := python3
TOX_CMD := tox
COVERAGE_CMD := coverage
DANGER_CMD := danger
GEM_CMD := gem
FIND_CMD := find
RM_CMD := rm
WHICH_CMD := which
XARGS_CMD := xargs
PRINTF_CMD := printf
TOUCH_CMD := touch
CP_CMD := cp
CAT_CMD := cat
PIP_CMD := pip
PIP3_CMD := pip3
CCTREPORTER_CMD := codeclimate-test-reporter
UNAME_CMD := uname
EXIT_CMD := exit
TPUT_CMD := tput
TR_CMD := tr
PYLINT_CMD := pylint
BREW_CMD := brew
PYENV_CMD := pyenv
TOX_PYENV := tox-pyenv
PYOBJC_CORE := pyobjc-core
PYOBJC_COCOA := pyobjc-framework-Cocoa
# invoke the specific executable command
PYTHON3 = $(shell command -v $(PYTHON3_CMD) 2> /dev/null)
TOX = $(shell command -v $(TOX_CMD) 2> /dev/null)
COVERAGE = $(shell command -v $(COVERAGE_CMD) 2> /dev/null)
DANGER = $(shell command -v $(DANGER_CMD) 2> /dev/null)
GEM = $(shell command -v $(GEM_CMD) 2> /dev/null)
FIND = $(shell command -v $(FIND_CMD) 2> /dev/null)
RM = $(shell command -v $(RM_CMD) 2> /dev/null)
WHICH = $(shell command -v $(WHICH_CMD) 2> /dev/null)
XARGS = $(shell command -v $(XARGS_CMD) 2> /dev/null)
PRINTF = $(shell command -v $(PRINTF_CMD) 2> /dev/null)
TOUCH = $(shell command -v $(TOUCH_CMD) 2> /dev/null)
CP = $(shell command -v $(CP_CMD) 2> /dev/null)
CAT = $(shell command -v $(CAT_CMD) 2> /dev/null)
PIP = $(shell command -v $(PIP_CMD) 2> /dev/null)
PIP3 = $(shell command -v $(PIP3_CMD) 2> /dev/null)
CCTREPORTER = $(shell command -v $(CCTREPORTER_CMD) 2> /dev/null)
UNAME = $(shell command -v $(UNAME_CMD) 2> /dev/null)
EXIT = $(shell command -v $(EXIT_CMD) 2> /dev/null)
TPUT = $(shell command -v $(TPUT_CMD) 2> /dev/null)
TR = $(shell command -v $(TR_CMD) 2> /dev/null)
PYLINT = $(shell command -v $(PYLINT_CMD) 2> /dev/null)
BREW = $(shell command -v $(BREW_CMD) 2> /dev/null)
PYENV = $(shell command -v $(PYENV_CMD) 2> /dev/null)
SYSTEM := $(shell $(UNAME) -s)
ifeq ($(SYSTEM),Darwin)
USER_FLAG := --user
else
USER_FLAG :=
endif
TERM_COLUMNS := `$(TPUT) cols`
DISPLAY_SEPARATOR := $(PRINTF) "%*.s\n" $(TERM_COLUMNS) " " | $(TR) ' ' '='
# Targets
# ---
checkfor = @$(PRINTF) "Checking for $1..."; \
if [ -z `$(WHICH) $1` ]; then \
$(PRINTF) " no\n"; \
$(EXIT) 1;\
else \
$(PRINTF) " yes\n"; \
fi
check:
$(call checkfor,$(WHICH_CMD))
$(call checkfor,$(CAT_CMD))
$(call checkfor,$(CP_CMD))
$(call checkfor,$(TPUT_CMD))
$(call checkfor,$(TR_CMD))
$(call checkfor,$(PRINTF_CMD))
$(call checkfor,$(TOUCH_CMD))
$(call checkfor,$(FIND_CMD))
$(call checkfor,$(XARGS_CMD))
$(call checkfor,$(RM_CMD))
$(call checkfor,$(BREW_CMD))
$(call checkfor,$(PYTHON3_CMD))
$(call checkfor,$(PIP3_CMD))
$(call checkfor,$(TOX_CMD))
$(call checkfor,$(COVERAGE_CMD))
$(call checkfor,$(PYLINT_CMD))
$(call checkfor,$(PYENV_CMD))
$(call checkfor,$(GEM_CMD))
$(call checkfor,$(DANGER_CMD))
@$(DISPLAY_SEPARATOR)
# ---
pipinstall = @$(PIP) install $1 $(USER_FLAG)
pipthreeinstall = @$(PIP3_CMD) install $1
geminstall = @$(GEM) install $1
brewinstall = @$(BREW) install $1
pyenv_exec = @$(PYENV_CMD) $1 $2
install-deps:
$(call brewinstall,$(PYENV_CMD))
$(call brewinstall,$(PYTHON3_CMD))
$(call checkfor,$(PIP3_CMD))
$(call pipthreeinstall,-r requirements.txt)
@$(DISPLAY_SEPARATOR)
$(call checkfor,$(GEM_CMD))
$(call geminstall,$(DANGER_CMD))
@$(DISPLAY_SEPARATOR)
$(call pyenv_exec, install, 3.5.1)
@$(DISPLAY_SEPARATOR)
# ---
# this is for installing any tools that we don't already have
install-tools: check
@$(PRINTF) "Installing git hooks..."
@$(PYTHON2) ./tools/hooks-config.py
@$(PRINTF) " done!\n"
@$(DISPLAY_SEPARATOR)
# ---
removeall = $(RM) -rRf
cleanlocation = @$(FIND) $1 $2 -print0 | $(XARGS) -0 $(removeall)
clean: check
@$(PRINTF) "Removing existing installation... "
@$(TOUCH) $(INSTALLED_FILES_RECORD)
@$(CAT) $(INSTALLED_FILES_RECORD) | $(XARGS) $(removeall)
@$(removeall) ./nslocalizer.egg-info
@$(removeall) ./build
@$(removeall) ./dist
@$(removeall) ./.tox
@$(removeall) .coverage
@$(removeall) ./htmlcov
@$(removeall) ./.eggs
$(call cleanlocation, ., -name ".DS_Store")
$(call cleanlocation, ., -name "*.pyc")
$(call cleanlocation, ., -name "__pycache__" -type d)
$(call cleanlocation, ., -name "*_output.plist")
@$(PRINTF) "done!\n"
@$(DISPLAY_SEPARATOR)
# ---
build: clean
$(PYTHON3) ./setup.py install --record $(INSTALLED_FILES_RECORD)
@$(DISPLAY_SEPARATOR)
# ---
test: clean
$(TOX)
@$(DISPLAY_SEPARATOR)
# ---
upload_artifacts = @$(PRINTF) "Checking for path to upload artifacts..." ; \
if [ -d $1 ] ; then \
$(PRINTF) "uploading.\n" ; \
$(CP) -r ./htmlcov $1 ; \
$(CP) lint_output.txt $1 ; \
else \
$(PRINTF) "skipping.\n" ; \
fi
run_cctreporter = @$(PRINTF) "Checking CI branch to upload coverage results... " ; \
if [ "$(CIRCLE_BRANCH)" = "develop" ]; then \
$(PRINTF) "OK.\n"; \
$(CCTREPORTER) --token $(value CIRCLECI_CODECLIMATE_TOKEN) ; \
else \
$(PRINTF) "skipping.\n"; \
fi
checktest = @$(PRINTF) "Checking that coverage data exists... " ; \
if [ -e ./.coverage ] ; then \
$(PRINTF) "ok!\n" ; \
else \
$(PRINTF) "not found!\n" ; \
$(PRINTF) "Please run 'make test' before running 'make report'\n" ; \
exit 1 ; \
fi \
report: check
@$(call checktest)
$(COVERAGE) report
@$(DISPLAY_SEPARATOR)
@$(PRINTF) "Generating html report... "
@$(COVERAGE) html
@$(PRINTF) "done!\n"
@$(PRINTF) "Generated html report is located at: ./htmlcov/index.html\n"
ifdef CIRCLE_ARTIFACTS
@$(DISPLAY_SEPARATOR)
$(call upload_artifacts,$(CIRCLE_ARTIFACTS))
endif
@$(DISPLAY_SEPARATOR)
$(call run_cctreporter)
@$(DISPLAY_SEPARATOR)
# ---
danger: check
@$(PRINTF) "Running danger "
ifdef CIRCLECI_DANGER_GITHUB_API_TOKEN
@$(PRINTF) "(PR)... \n"
@export DANGER_GITHUB_API_TOKEN=$(value CIRCLECI_DANGER_GITHUB_API_TOKEN)
@$(DANGER) --verbose
else
@$(PRINTF) "(local)... \n"
@$(DANGER) local --verbose
endif
@$(DISPLAY_SEPARATOR)
# ---
ci: test lint report danger
# ---
lint: check
@$(TOUCH) lint_output.txt
@$(PRINTF) "Running linter... "
@$(PYLINT) --rcfile=pylintrc ./nslocalizer > lint_output.txt || :
@$(PRINTF) " done!\n"
@$(PRINTF) "Generated linter report: lint_output.txt\n"
@$(DISPLAY_SEPARATOR)
# ---
.PHONY: danger lint ci report test build clean install-tools install-deps check
================================================
FILE: circle.yml
================================================
machine:
environment:
XCODE_SCHEME: CIRCLECI_IS_BROKEN
XCODE_WORKSPACE: CIRCLECI_IS_BROKEN
xcode:
version: 7.3.1
pre:
- export PATH=/usr/local/bin:$PATH:/Users/distiller/Library/Python/2.7/bin
- pip install --user --ignore-installed --upgrade virtualenv
- ln -s $HOME/Library/Python/2.7/bin/virtualenv /usr/local/bin/virtualenv
- cd "$(brew --repository)" && git fetch && git reset --hard origin/master
- brew update
dependencies:
override:
- make install-deps
- pyenv local 3.5.1
test:
override:
- make ci
================================================
FILE: contributing/code-of-conduct.md
================================================
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
================================================
FILE: contributing.md
================================================
# [Code of Conduct](./contributing/code-of-conduct.md)
This project has and enforces a Code of Conduct. This must be adhered to at all times when engaging with maintainers not only on Github but also all other mediums (including social networks). The maintainers reserve the right to remove you from being able to contribute or comment on this project.
---
# [Issues](../../wiki/github_issues)
When a new issue is created it will use a template that will ask for all the relevant information. If there is something missing or confusing, please look at the contributing guidelines for Issues on the wiki.
---
# [Pull Requests](../../wiki/github_prs)
On each pull request, a new CI build will be dispatched. This will run the test suite and upload the results of the coverage report. This project uses a tool called Danger to analyze many aspects of a PR and report if anything about the PR breaks expectations that the repo has. If you are interested in what will be analyzed, then please look at the contributing guildelines for PRs on the wiki.
---
You made it! If you have finished reading the contributing guide then you can put 🌈 in your issue or pull request to acknowledge that you have read this document and have done your best to adhere
================================================
FILE: install_requirements.txt
================================================
pyobjc-core >= 2.5.1
pyobjc-framework-Cocoa >= 2.5.1
pbPlist >= 1.0.4
langcodes >= 1.2.0
================================================
FILE: nslocalizer/Executor/Executor.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import os
import re
import sys
from ..Helpers.Logger import Logger
from ..Helpers.FileOperations import FileOperations
from ..Language import Language
from ..Reporter import Reporter
from ..xcodeproj.xcodeproj import xcodeproj
from ..Finder.LanguageFinder import LanguageFinder
from ..Finder import CodeFinder
class Executor(object):
base_language = None
additional_languages = None
@classmethod
def run(cls, arguments) -> None:
has_set_flag = arguments.find_missing or arguments.find_unused
can_run = arguments.project and len(arguments.target) > 0 and has_set_flag
xcodeproj_file = None
desired_targets = list()
if can_run:
Logger.write().info('Loading project file...')
# parse project file
project_file_path = os.path.normpath(arguments.project)
xcodeproj_file = xcodeproj(project_file_path)
Logger.write().info('Search for target "%s" in project "%s"' % (arguments.target, os.path.basename(project_file_path)))
# find target
desired_targets = [target for target in xcodeproj_file.project_file.targets() if target['name'] in arguments.target]
else:
Logger.write().error('Please specify a project (--project) with a valid target (--target), and at least one search flag (--find-unused, --find-missing).') # pragma: no cover
if xcodeproj is not None and len(desired_targets) == len(arguments.target):
missing_strings = dict()
unused_strings = dict()
if arguments.find_missing:
missing_strings = cls.findMissingStrings(xcodeproj_file, desired_targets)
# log data to xcode console
Reporter.logMissingStrings(missing_strings, arguments.ignore, arguments.error)
if arguments.find_unused:
unused_strings = cls.findUnusedStrings(xcodeproj_file, desired_targets)
# log data to xcode console
Reporter.logUnusedStrings(unused_strings, arguments.error)
else: # pragma: no cover
missing_targets = [target for target in arguments.target if target not in desired_targets]
Logger.write().info('Could not find target "%s" in the specified project file.' % '", "'.join(missing_targets))
@classmethod
def findMissingStrings(cls, project, targets) -> dict:
Logger.write().info('Finding strings that are missing from language files...')
_ = targets
base_language, additional_languages = cls.generateLanguages(project)
missing_results = [string.processMapping(base_language, additional_languages) for string in base_language.strings]
return dict(missing_results)
@classmethod
def findUnusedStrings(cls, project, targets) -> list:
Logger.write().info('Finding strings that are unused but are in language files...')
code_files = list()
for target in targets:
code_files.extend(CodeFinder.getCodeFileList(project.project_file, target))
base_language, _ = cls.generateLanguages(project)
known_strings = set()
for source_code_file in code_files:
data = FileOperations.getData(source_code_file)
if data is None:
continue
matches = re.findall(r'NSLocalizedString\(@?\"(.*?)\",', data)
Logger.write().debug('%s: %i results' % (os.path.basename(source_code_file), len(matches)))
known_strings.update(matches)
unused_strings = [lstring for lstring in base_language.strings if lstring.string not in known_strings]
for unused_string in unused_strings:
unused_string.registerBase(base_language)
return unused_strings
@classmethod
def generateLanguages(cls, project) -> (Language, {Language}):
strings_files, stringsdict_files = LanguageFinder.getLocalizationFiles(project.project_file)
languages = set([Language.Language(path) for path in strings_files])
for language in languages:
language.loadStringsDictFile(stringsdict_files)
if cls.base_language is None and cls.additional_languages is None:
cls.additional_languages = set([language for language in languages if language.code != 'Base'])
if len(cls.additional_languages) == len(languages):
Logger.write().info('Could not find a "Base" language, assuming "English"...')
cls.additional_languages = set([language for language in languages if language.code != 'en'])
if len(cls.additional_languages) == len(languages):
Logger.write().error('Unable to locate the "Base" language, please assign one in the project file!')
sys.exit(1)
other_languages = languages.difference(cls.additional_languages)
cls.base_language = other_languages.pop()
cls.base_language.findStrings()
return (cls.base_language, cls.additional_languages)
================================================
FILE: nslocalizer/Executor/__init__.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: nslocalizer/Finder/CodeFinder.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from ..Helpers.Logger import Logger
from ..xcodeproj.pbProj import pbProj
from ..xcodeproj.pbProj.PBXSourcesBuildPhase import PBXSourcesBuildPhase
from . import PathFinder
def getCodeFileList(project, target) -> list:
Logger.write().info('Finding Code files for target "%s"...' % target[pbProj.PBX_Constants.kPBX_TARGET_name])
build_phases = target.store[pbProj.PBX_Constants.kPBX_TARGET_buildPhases]
source_phases = [build_phase for build_phase in build_phases if isinstance(build_phase, PBXSourcesBuildPhase)]
all_build_files = list()
for phase in source_phases:
all_build_files.extend(phase.store[pbProj.PBX_Constants.kPBX_PHASE_files])
all_file_refs = [PathFinder.resolveFilePathForReference(project, build_file.store[pbProj.PBX_Constants.kPBX_BUILDFILE_fileRef]) for build_file in all_build_files]
return all_file_refs
================================================
FILE: nslocalizer/Finder/LanguageFinder.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from ..Helpers.Logger import Logger
from ..xcodeproj.pbProj import pbProj
from ..xcodeproj.pbProj.PBXVariantGroup import PBXVariantGroup
from . import PathFinder
def FilterByName(items, name) -> PBXVariantGroup:
matched_items = [item for item in items if item.store[pbProj.PBX_Constants.kPBX_REFERENCE_name] == name]
if len(matched_items):
matched_items = matched_items[0]
else:
matched_items = None
return matched_items
class LanguageFinder(object):
localizable_strings = None
localizable_stringsdict = None
strings_file_refs = list()
stringsdict_file_refs = list()
@classmethod
def getLocalizationFiles(cls, project) -> (dict, dict):
if cls.localizable_strings is None or cls.localizable_stringsdict is None:
variant_groups = [pbx_object for pbx_object in project.pbx_objects if isinstance(pbx_object, PBXVariantGroup)]
# localizable.strings
if cls.localizable_strings is None:
Logger.write().info('Filtering for Localizable.strings files...')
cls.localizable_strings = FilterByName(variant_groups, 'Localizable.strings')
# localizable.stringsdict
if cls.localizable_stringsdict is None:
Logger.write().info('Filtering for Localizable.stringsdict files...')
cls.localizable_stringsdict = FilterByName(variant_groups, 'Localizable.stringsdict')
if len(cls.strings_file_refs) == 0 or len(cls.stringsdict_file_refs) == 0:
Logger.write().info('Resolving language-specific file paths...')
if len(cls.strings_file_refs) == 0 and cls.localizable_strings is not None:
languages = cls.localizable_strings.store[pbProj.PBX_Constants.kPBX_REFERENCE_children]
cls.strings_file_refs = [PathFinder.resolveFilePathForReference(project, language_file) for language_file in languages]
else:
Logger.write().info('Could not find any Localizable.strings files, continuing...')
if len(cls.stringsdict_file_refs) == 0 and cls.localizable_stringsdict is not None:
language_dicts = cls.localizable_stringsdict.store[pbProj.PBX_Constants.kPBX_REFERENCE_children]
cls.stringsdict_file_refs = [PathFinder.resolveFilePathForReference(project, language_file_dict) for language_file_dict in language_dicts]
else:
Logger.write().info('Could not find any Localizable.stringsdict files, continuing...')
return (cls.strings_file_refs, cls.stringsdict_file_refs)
================================================
FILE: nslocalizer/Finder/PathFinder.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import os
def resolveFilePathForReference(project, reference) -> str:
file_path = reference.resolvePath(project)
project_dir = os.path.dirname(os.path.dirname(project.pbx_file_path))
file_path = os.path.join(project_dir, file_path)
norm_file_path = os.path.normpath(file_path)
return norm_file_path
================================================
FILE: nslocalizer/Finder/__init__.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: nslocalizer/Helpers/FileOperations.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import os
import sys
from pbPlist import pbParser
class FileOperations(object):
@classmethod
def getData(cls, file_path) -> object:
data = None
if os.path.isfile(file_path) is True:
try:
encoding = pbParser.GetFileEncoding(file_path)
file_descriptor = pbParser.OpenFileWithEncoding(file_path, encoding)
data = file_descriptor.read()
file_descriptor.close()
except IOError as exception: # pragma: no cover
print('I/O error({0}): {1}'.format(exception.errno, exception.strerror))
except: # pragma: no cover
print('Unexpected error:'+str(sys.exc_info()[0]))
raise
return data
================================================
FILE: nslocalizer/Helpers/Logger.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import logging
class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs): # pragma: no cover
if cls not in cls._instances.keys():
cls._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs)
return cls._instances[cls]
#These are the sequences need to get colored ouput
RESET_SEQ = '\033[0m'
BOLD_SEQ = '\033[1m'
COLORS = {
'BLACK': '\033[1;30m',
'RED': '\033[1;31m',
'GREEN': '\033[1;32m',
'YELLOW': '\033[1;33m',
'BLUE': '\033[1;34m',
'MAGENTA': '\033[1;35m',
'CYAN': '\033[1;36m',
'WHITE': '\033[1;37m'
}
LEVELS = {
'WARNING': COLORS['YELLOW'],
'INFO': COLORS['BLACK'],
'DEBUG': COLORS['MAGENTA'],
'CRITICAL': COLORS['BLUE'],
'ERROR': COLORS['RED']
}
class ColoredFormatter(logging.Formatter):
def __init__(self, msg, use_color=True):
logging.Formatter.__init__(self, msg)
self.use_color = use_color
def format(self, record): # pragma: no cover
levelname = record.levelname
if self.use_color and levelname in LEVELS:
levelname_color = LEVELS[levelname] + levelname + RESET_SEQ
record.levelname = levelname_color
return logging.Formatter.format(self, record)
class Logger(object):
__metaclass__ = Singleton
_internal_logger = None
_debug_logging = False
_use_ansi_codes = False
def __init__(self, *args, **kwargs): # pragma: no cover
pass
@staticmethod
def enableDebugLogger(is_debug_logger=False):
Logger._debug_logging = is_debug_logger
@staticmethod
def disableANSI(disable_ansi=False):
Logger._use_ansi_codes = not disable_ansi
@staticmethod
def setupLogger():
Logger._internal_logger = logging.getLogger('com.pewpewthespells.py.logging_helper')
level = logging.DEBUG if Logger._debug_logging else logging.INFO
Logger._internal_logger.setLevel(level)
handler = logging.StreamHandler()
handler.setLevel(level)
# create formatter
formatter = None
if Logger._debug_logging is True: # pragma: no cover
formatter = ColoredFormatter('[%(levelname)s][%(filename)s:%(lineno)s]: %(message)s', Logger._use_ansi_codes)
else:
formatter = ColoredFormatter('[%(levelname)s]: %(message)s', Logger._use_ansi_codes)
# add formatter to ch
handler.setFormatter(formatter)
# add ch to logger
Logger._internal_logger.addHandler(handler)
@staticmethod
def isVerbose(verbose_logging=False):
if Logger._internal_logger is None: # pragma: no cover
Logger.setupLogger()
if not verbose_logging:
Logger._internal_logger.setLevel(logging.WARNING)
@staticmethod
def isSilent(should_quiet=False):
if Logger._internal_logger is None: # pragma: no cover
Logger.setupLogger()
if should_quiet:
logging_filter = logging.Filter(name='com.pewpewthespells.py.logging_helper.shut_up')
Logger._internal_logger.addFilter(logging_filter)
@staticmethod
def write():
if Logger._internal_logger is None: # pragma: no cover
Logger.setupLogger()
return Logger._internal_logger
================================================
FILE: nslocalizer/Helpers/Switch.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
# Original code taken from http://code.activestate.com/recipes/410692/
class Switch(object):
def __init__(self, value):
self.value = value
self.fall = False
def __iter__(self):
"""Return the match method once, then stop"""
yield self.match
raise StopIteration # pragma: no cover
def match(self, *args):
"""Indicate whether or not to enter a case suite"""
result = False
if self.fall or not args:
result = True
elif self.value in args: # changed for v1.5, see below
self.fall = True
result = True
return result
================================================
FILE: nslocalizer/Helpers/__init__.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: nslocalizer/Helpers/xcrun.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/pylocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import os
import sys
import struct
import hashlib
import subprocess
import CoreFoundation
from .Logger import Logger
from .Switch import Switch
def hashStringForPath(path) -> str:
"""
Returns the hash for a project's DerivedData location.
path is the filesystem path to the .xcodeproj file.
"""
hash_context = hashlib.md5()
hash_context.update(path)
md5_digest_hex = hash_context.digest()
hash_path = [None] * 28
first_value = struct.unpack('>Q', md5_digest_hex[:8])[0]
counter = 13
while counter >= 0:
hash_path[counter] = chr((first_value % 26) + ord('a'))
first_value = first_value / 26
counter -= 1
second_value = struct.unpack('>Q', md5_digest_hex[8:])[0]
counter = 27
while counter > 13:
hash_path[counter] = chr((second_value % 26) + ord('a'))
second_value = second_value / 26
counter -= 1
hash_path_string = ''.join(hash_path)
return hash_path_string
def ResolveDerivedDataPath(project) -> str:
default_dd_path = os.path.expanduser("~/Library/Developer/Xcode/DerivedData/")
derived_data = CoreFoundation.CFPreferencesCopyAppValue('IDECustomDerivedDataLocation', 'com.apple.dt.Xcode') # pylint: disable=no-member
if derived_data is None:
derived_data = default_dd_path
else:
if derived_data[0] != '/':
derived_data = os.path.join(project.path, derived_data)
return derived_data
def ResolveBuildLocation(project, sym_root) -> str:
build_dir_path = ''
derived_data = ResolveDerivedDataPath(project)
location_style = CoreFoundation.CFPreferencesCopyAppValue('IDEBuildLocationStyle', 'com.apple.dt.Xcode') # pylint: disable=no-member
for case in Switch(location_style):
if case('Unique'):
xcodeproj_path = os.path.join(project.projectRoot.obj_path, project.name)
unique_path = hashStringForPath(xcodeproj_path)
# this is missing the configuration path.
project_dir_name = os.path.splitext(project.name)[0]+'-'+unique_path+'/Build/Products/'
build_dir_path = os.path.join(derived_data, project_dir_name)
break
if case('Shared'):
shared_path = CoreFoundation.CFPreferencesCopyAppValue('IDESharedBuildFolderName', 'com.apple.dt.Xcode') # pylint: disable=no-member
build_dir_path = os.path.join(derived_data, shared_path)
break
if case('Custom'):
location_type = CoreFoundation.CFPreferencesCopyAppValue('IDECustomBuildLocationType', 'com.apple.dt.Xcode') # pylint: disable=no-member
custom_path = CoreFoundation.CFPreferencesCopyAppValue('IDECustomBuildProductsPath', 'com.apple.dt.Xcode') # pylint: disable=no-member
for case in Switch(location_type):
if case('RelativeToDerivedData'):
build_dir_path = os.path.join(derived_data, custom_path)
break
if case('RelativeToWorkspace'):
build_dir_path = os.path.join(project.path.base_path, custom_path)
break
if case('Absolute'):
build_dir_path = custom_path
break
if case():
break
if case('DeterminedByTargets'):
# this is missing the configuration path
build_dir_path = os.path.join(project.projectRoot.obj_path, sym_root)
break
if case(): # pragma: no cover
break
return build_dir_path
def IntermediatesBuildLocation(project, target_name, config_name, sym_root) -> str:
build_dir_path = ResolveBuildLocation(project, sym_root)
project_name = project.name.split('.')[0]
project_dir_path = os.path.join(build_dir_path, project_name+'.build')
config_dir_path = os.path.join(project_dir_path, config_name)
target_dir_path = os.path.join(config_dir_path, target_name+'.build')
return target_dir_path
def ProductsBuildLocation(project, sym_root) -> str:
"""
Returns the full path to the location of the build products.
project is the project that the build product is in.
sym_root is the value of $(SYMROOT) for the current configuration
"""
# this needs to also take CONFIGURATION_DIR
build_dir_path = ResolveBuildLocation(project, sym_root)
return build_dir_path
def resolvePathFromLocation(location_string, path, base_path) -> str:
path_string = ''
path_type, item_path = location_string.split(':')
for case in Switch(path_type):
if case('group'):
path = os.path.join(base_path, path)
path_string = os.path.join(path, item_path)
break
if case('absolute'):
path_string = item_path
break
if case('developer'):
path_string = os.path.join(resolve_developer_path(), item_path)
break
if case('container'):
path_string = os.path.join(base_path, item_path)
break
if case(): # pragma: no cover
Logger.write().error('Invalid item path name!')
path_string = item_path
break
return path_string
def make_subprocess_call(call_args, shell_state=False) -> (str, int):
error = 0
output = ''
try:
output = subprocess.check_output(call_args, shell=shell_state)
error = 0
except subprocess.CalledProcessError as exception: # pragma: no cover
output = str(exception.output)
error = exception.returncode
return (output, error)
def make_xcrun_with_args(args_tuple) -> str:
xcrun_result = make_subprocess_call((('xcrun',) + args_tuple))
if xcrun_result[1] != 0: # pragma: no cover
Logger.write().error('[xcrun]: Error in exec!')
sys.exit()
xcrun_output = str(xcrun_result[0]).rstrip('\n')
return xcrun_output
def resolve_sdk_path(sdk_name) -> str:
return make_xcrun_with_args(('--show-sdk-path', '--sdk', sdk_name))
def resolve_developer_path() -> str:
xcrun_result = make_subprocess_call(('xcode-select', '-p'))
if xcrun_result[1] != 0: # pragma: no cover
Logger.write().error('[xcrun]: Please run Xcode first!')
sys.exit()
developer_path = str(xcrun_result[0]).rstrip('\n')
return developer_path
DEVELOPER_DIR = os.environ.get('DEVELOPER_DIR')
if DEVELOPER_DIR:
Logger.write().info('DEVELOPER_DIR environment variable is already set, existing value "%s" will be used.' % (DEVELOPER_DIR))
else:
os.environ['DEVELOPER_DIR'] = resolve_developer_path()
================================================
FILE: nslocalizer/Language/Language.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import os
import langcodes
from pbPlist import pbPlist
from .LanguageString import LanguageString
from ..Helpers.Logger import Logger
from ..Helpers.FileOperations import FileOperations
def GetLanguageCodeFromPath(path) -> str:
dirname = os.path.dirname(path)
basename = os.path.basename(dirname)
locale, _ = os.path.splitext(basename)
return locale
def FindLineIndex(data, string) -> int:
line_index = 0
localized_string_entry = '"'+str(string)+'"'
if data is not None:
position = data.find(localized_string_entry)
line_index = data[:position].count('\n') + 1
return line_index
def LoadStrings(file_path) -> list:
strings_file_contents = pbPlist.PBPlist(file_path)
results = [LanguageString(localized_string_key, strings_file_contents.root[localized_string_key]) for localized_string_key in list(strings_file_contents.root.keys())]
return results
class Language(object):
def __init__(self, strings_file_path):
self.code = GetLanguageCodeFromPath(strings_file_path)
self.name = langcodes.LanguageData(language=self.code).language_name()
self.strings_file = strings_file_path
self.stringsdict_file = None
self.stringsdict = None
self.strings = LoadStrings(self.strings_file)
def findStrings(self) -> None:
strings_missing_line_numbers = [lstring for lstring in self.strings if lstring.line_number == 0]
if len(strings_missing_line_numbers):
Logger.write().info('Resolving line numbers...')
data = FileOperations.getData(self.strings_file)
for lstring in strings_missing_line_numbers:
lstring.line_number = FindLineIndex(data, lstring.string)
def loadStringsDictFile(self, stringsdict_file_array) -> None:
for stringsdict_file in stringsdict_file_array:
dict_locale = GetLanguageCodeFromPath(stringsdict_file)
if self.code == dict_locale:
self.stringsdict_file = stringsdict_file
break
if self.stringsdict_file is not None:
self.stringsdict = LoadStrings(self.stringsdict_file)
def __repr__(self) -> str: # pragma: no cover
return '<%s : %s>' % (type(self).__name__, self.name)
================================================
FILE: nslocalizer/Language/LanguageString.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
def HasStringForLanguage(string, language) -> bool:
result = False
for lang_string in language.strings:
result = (string == lang_string.string)
if result is True:
break
return result
class LanguageString(object):
def __init__(self, string_key, string_value):
self.line_number = 0
self.string = string_key
self.value = string_value
self.base = None
self.mapping = dict()
def __repr__(self) -> str: # pragma: no cover
return str(self.string)
def registerBase(self, base_language):
self.base = base_language
def processMapping(self, base_language, additional_languages) -> (object, list):
self.registerBase(base_language)
results = [(language, HasStringForLanguage(self.string, language)) for language in additional_languages]
self.mapping = dict(results)
missing_keys = [key for key in self.mapping if self.mapping[key] is False]
return (self, missing_keys)
================================================
FILE: nslocalizer/Language/__init__.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: nslocalizer/Reporter/Reporter.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
def log(file_name, line_number, type_string, message_string) -> None:
message = '%s:%s: %s: %s' % (file_name, line_number, type_string, message_string)
ascii_message = message.encode('ascii', 'replace')
display_message = ascii_message.decode('ascii', 'ignore')
print(display_message)
def logError(file_name, line_number, message_string) -> None:
log(file_name, line_number, 'error', message_string)
def logWarning(file_name, line_number, message_string) -> None:
log(file_name, line_number, 'warning', message_string)
def logMissingStrings(warnings_dictionary, ignore_languages, is_error=False) -> None:
keys = list(warnings_dictionary.keys())
keys.sort(key=lambda string: string.line_number)
for key in keys:
locale_names = [language.name for language in warnings_dictionary.get(key) if language.code not in ignore_languages]
if len(locale_names):
message = ', '.join(locale_names)
message_string = 'String "%s" missing for: %s' % (key.string, message)
if is_error is False:
logWarning(key.base.strings_file, key.line_number, message_string)
else:
logError(key.base.strings_file, key.line_number, message_string)
def logUnusedStrings(unused_strings_list, is_error=False) -> None:
unused_strings_list.sort(key=lambda string: string.line_number)
for unused_string in unused_strings_list:
message = 'String "%s" is not used' % unused_string.string
if is_error is False:
logWarning(unused_string.base.strings_file, unused_string.line_number, message)
else:
logError(unused_string.base.strings_file, unused_string.line_number, message)
================================================
FILE: nslocalizer/Reporter/__init__.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: nslocalizer/__init__.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .main import main
from .version import __version__ as PYLOCALIZER_VERSION
__version__ = PYLOCALIZER_VERSION
================================================
FILE: nslocalizer/main.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import sys
import argparse
from .version import __version__ as PYLOCALIZER_VERSION
from .Helpers.Logger import Logger
from .Executor.Executor import Executor
# Main
def main(argv=sys.argv[1:]):
parser = argparse.ArgumentParser(description='nslocalizer is a tool for identifying unused or missing localization string usage in Xcode projects')
parser.add_argument(
'--version',
help='Displays the version information',
action='version',
version=PYLOCALIZER_VERSION
)
parser.add_argument(
'--project',
metavar='<Xcode project path>',
help='specify the path to the .xcodeproj file',
required=True,
action='store'
)
parser.add_argument(
'--target',
metavar='<target name>',
help='specify the name of targets to analyze, this accepts multiple target names',
type=str,
default=list(),
required=True,
action='store',
nargs='*'
)
parser.add_argument(
'--find-missing',
help='look for localized strings that are missing from any of the .strings files',
default=False,
action='store_true'
)
parser.add_argument(
'--find-unused',
help='look for localized strings that are not used in the code',
default=False,
action='store_true'
)
parser.add_argument(
'--quiet',
help='Silences all logging output',
default=False,
action='store_true'
)
parser.add_argument(
'--verbose',
help='Adds verbosity to logging output',
default=False,
action='store_true'
)
parser.add_argument(
'--ignore',
help='Specify languages to ignore (by code; eg: German = de).',
type=str,
default=list(),
nargs='*'
)
parser.add_argument(
'--no-ansi',
help='Disables the ANSI color codes as part of the logger',
default=False,
action='store_true'
)
parser.add_argument(
'--error',
help='Changes warnings to errors',
default=False,
action='store_true'
)
parser.add_argument(
'--debug',
help=argparse.SUPPRESS,
default=False,
action='store_true'
)
args = parser.parse_args(argv)
# perform the logging modifications before we do any other operations
Logger.disableANSI(args.no_ansi)
Logger.enableDebugLogger(args.debug)
Logger.isVerbose(args.verbose)
Logger.isSilent(args.quiet)
ignored_locales = ', '.join(args.ignore)
Logger.write().info('Ignoring languages: %s' % ignored_locales)
Executor.run(args)
if __name__ == "__main__": # pragma: no cover
main()
================================================
FILE: nslocalizer/version.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import version_info
__version__ = '1.0.2 ('+version_info.remote_origin+' @ '+version_info.commit_hash+')'
================================================
FILE: nslocalizer/version_info.py
================================================
remote_origin = 'ssh://github.com/samdmarshall/nslocalizer'
commit_hash = '14d376e'
================================================
FILE: nslocalizer/xcodeproj/__init__.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from ..Helpers import Logger
from ..Helpers import xcrun
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXAggregateTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Target
class PBXAggregateTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXAppleScriptBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXAppleScriptBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXApplicationReference.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Reference
class PBXApplicationReference(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXApplicationTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Target
class PBXApplicationTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXBuildFile.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBXItem
class PBXBuildFile(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_BUILDFILE_fileRef, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXBuildRule.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBXItem
class PBXBuildRule(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXBundleReference.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Reference
class PBXBundleReference(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXBundleTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Target
class PBXBundleTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXContainerItemProxy.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBXItem
class PBXContainerItemProxy(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_CONTAINERITEMPROXY_containerPortal, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXCopyFilesBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXCopyFilesBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXExecutableFileReference.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Reference
class PBXExecutableFileReference(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXFileReference.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Reference
class PBXFileReference(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXFrameworkReference.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Reference
class PBXFrameworkReference(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXFrameworkTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Target
class PBXFrameworkTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXFrameworksBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXFrameworksBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXGroup.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBX_Base_Reference
class PBXGroup(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_REFERENCE_children, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXHeadersBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXHeadersBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXItem.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/pylocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import os
import collections
from . import PBX_Constants
from ...Helpers import xcrun
def getGraphNodeWithIdentifier(identifier, project):
found_object = project.objectForIdentifier(identifier)
if found_object and not found_object.resolved:
found_object.resolveGraph(project)
return found_object
class PBXItem(collections.MutableMapping):
def __init__(self, identifier, dictionary):
self.isa = dictionary.get(PBX_Constants.kPBX_isa, None)
self.identifier = identifier
self.store = dict()
self.key_storage = set()
self.update(dictionary) # use the free update to set keys
self.resolved = False
def __getitem__(self, key):
return self.store[key]
def __setitem__(self, key, value):
if key not in self.key_storage:
self.key_storage.add(key)
self.store[key] = value
def __delitem__(self, key):
if key in self.key_storage:
self.key_storage.remove(key)
del self.store[key]
def __iter__(self):
return self.key_storage.__iter__()
def __len__(self):
return self.key_storage.__len__()
def __str__(self):
return self.__repr__()+'\n'+self.store.__str__()+'\n'
def __contains__(self, item):
return item in self.key_storage
def __getattr__(self, attrib):
return getattr(self.store, attrib)
def __hash__(self):
return hash(self.identifier)
def __repr__(self):
return '<%s : %s>' % (self.isa, self.identifier)
def resolveGraphNodeForKey(self, key, project):
identifier = self.get(key, None)
if not isinstance(identifier, PBXItem):
found_object = getGraphNodeWithIdentifier(identifier, project)
if found_object:
self[key] = found_object
def resolveGraphNodesForArray(self, key, project):
identifier_array = self.get(key, None)
resolved_array = list()
for identifier in identifier_array:
resolved_item = getGraphNodeWithIdentifier(identifier, project)
if resolved_item:
resolved_array.append(resolved_item)
else:
resolved_array.append(identifier)
self[key] = resolved_array
def resolveGraph(self, project):
self.resolved = True
_ = project
class PBX_Base_Target(PBXItem):
def __init__(self, identifier, dictionary):
super(PBX_Base_Target, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(PBX_Base_Target, self).resolveGraph(project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_TARGET_buildConfigurationList, project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_TARGET_buildPhases, project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_TARGET_dependencies, project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_TARGET_productReference, project)
class PBX_Base_Phase(PBXItem):
def __init__(self, identifier, dictionary):
super(PBX_Base_Phase, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(PBX_Base_Phase, self).resolveGraph(project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_PHASE_files, project)
def resolvePathTypeFromSource(source):
result = None
lookup = {
'<absolute>': 'resolveAbsolutePath',
'<group>': 'resolveGroupPath',
'SOURCE_ROOT': 'resolveSourceRootPath',
'DEVELOPER_DIR': 'resolveDeveloperDirPath',
'BUILT_PRODUCTS_DIR': 'resolveBuildProductsPath',
'SDKROOT': 'resolveSDKPath',
}
if source in list(lookup.keys()):
result = lookup[source]
return result
class PBX_Base_Reference(PBXItem):
def __init__(self, identifier, dictionary):
super(PBX_Base_Reference, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(PBX_Base_Reference, self).resolveGraph(project)
def findParent(self, project):
parent = None
results = [pbx_object for pbx_object in project.pbx_objects if isinstance(pbx_object, PBX_Base_Reference) and PBX_Constants.kPBX_REFERENCE_children in list(pbx_object.keys())]
for item in results:
child_results = [ref for ref in item[PBX_Constants.kPBX_REFERENCE_children] if self.identifier == ref.identifier]
if len(child_results) > 0:
parent = item
break
return parent
def resolveAbsolutePath(self, project): # pylint: disable=no-self-use,unused-argument
return ''
def resolveGroupPath(self, project):
file_path = ''
parent = self.findParent(project)
if parent is not None:
grandparent_path = parent.resolvePath(project)
file_path = os.path.join(grandparent_path, '')
return file_path
def resolveSourceRootPath(self, project): # pylint: disable=no-self-use
project_dir = os.path.dirname(os.path.dirname(project.pbx_file_path))
return project_dir
def resolveDeveloperDirPath(self, project): # pylint: disable=no-self-use
_ = project
return xcrun.resolve_developer_path()
def resolveSDKPath(self, project): # pylint: disable=no-self-use
_ = project
sdk_name = os.environ.get('SDKROOT')
if sdk_name == '':
raise ValueError('Unable to get a value for SDKROOT, please make sure to run this inside of Xcode!')
return xcrun.resolve_sdk_path(sdk_name)
def resolvePath(self, project):
source = self.store[PBX_Constants.kPBX_REFERENCE_sourceTree]
source_func = resolvePathTypeFromSource(source)
parent_path = getattr(self, source_func)(project)
current_path = ''
if PBX_Constants.kPBX_REFERENCE_path in list(self.store.keys()):
current_path = self.store[PBX_Constants.kPBX_REFERENCE_path]
file_path = os.path.join(parent_path, current_path)
return file_path
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXJavaArchiveBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXJavaArchiveBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXLegacyTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Target
class PBXLegacyTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXLibraryReference.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Reference
class PBXLibraryReference(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXLibraryTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Target
class PBXLibraryTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXNativeTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBX_Base_Target
class PBXNativeTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_TARGET_buildRules, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXProject.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBXItem
class PBXProject_ProjectReference(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def __repr__(self):
return self.store.__repr__()
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_PROJECTREF_ProjectRef, project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_PROJECTREF_ProductGroup, project)
class PBXProject(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_TARGET_buildConfigurationList, project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_PROJECT_mainGroup, project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_PROJECT_productRefGroup, project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_PROJECT_targets, project)
project_references = self.get(PBX_Constants.kPBX_PROJECT_projectReferences, None)
if project_references:
resolved_references = list()
for reference in project_references:
project_reference = PBXProject_ProjectReference(None, reference)
project_reference.resolveGraph(project)
resolved_references.append(project_reference)
self[PBX_Constants.kPBX_PROJECT_projectReferences] = resolved_references
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXReferenceProxy.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBXItem
class PBXReferenceProxy(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_PROXY_remoteRef, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXResourcesBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXResourcesBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXRezBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXRezBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXShellScriptBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXShellScriptBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXSourcesBuildPhase.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Phase
class PBXSourcesBuildPhase(PBX_Base_Phase):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXStandAloneTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBX_Base_Target
class PBXStandAloneTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_TARGET_buildRules, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXTargetDependency.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBXItem
class PBXTargetDependency(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_TARGETDEP_target, project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_TARGETDEP_targetProxy, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXToolTarget.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Target
class PBXToolTarget(PBX_Base_Target):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXVariantGroup.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBX_Base_Reference
class PBXVariantGroup(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_REFERENCE_children, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBXZipArchiveReference.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from .PBXItem import PBX_Base_Reference
class PBXZipArchiveReference(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBX_Constants.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
kPBX_rootObject = 'rootObject'
kPBX_objects = 'objects'
kPBX_archiveVersion = 'archiveVersion'
kPBX_objectVersion = 'objectVersion'
kPBX_classes = 'classes'
kPBX_ProjectRef = 'ProjectRef'
kPBX_isa = 'isa'
kPBX_TARGET_name = 'name'
kPBX_TARGET_productName = 'productName'
kPBX_TARGET_buildConfigurationList = 'buildConfigurationList'
kPBX_TARGET_buildPhases = 'buildPhases'
kPBX_TARGET_dependencies = 'dependencies'
kPBX_TARGET_productReference = 'productReference'
kPBX_TARGET_buildSettings = 'buildSettings'
kPBX_TARGET_productInstallPath = 'productInstallPath'
kPBX_TARGET_productSettingsXML = 'productSettingsXML'
kPBX_TARGET_shouldUseHeadermap = 'shouldUseHeadermap'
kPBX_TARGET_buildRules = 'buildRules'
kPBX_TARGET_passBuildSettingsInEnvironment = 'passBuildSettingsInEnvironment'
kPBX_TARGET_buildArgumentsString = 'buildArgumentsString'
kPBX_TARGET_buildToolPath = 'buildToolPath'
kPBX_TARGET_buildWorkingDirectory = 'buildWorkingDirectory'
kPBX_TARGET_settingsToExpand = 'settingsToExpand'
kPBX_TARGET_settingsToPassInEnvironment = 'settingsToPassInEnvironment'
kPBX_TARGET_settingsToPassOnCommandLine = 'settingsToPassOnCommandLine'
kPBX_TARGET_productType = 'productType'
kPBX_TARGET_buildProperties = 'buildProperties'
kPBX_PHASE_buildActionMask = 'buildActionMask'
kPBX_PHASE_files = 'files'
kPBX_PHASE_runOnlyForDeploymentPostprocessing = 'runOnlyForDeploymentPostprocessing'
kPBX_PHASE_contextName = 'contextName'
kPBX_PHASE_isSharedContext = 'isSharedContext'
kPBX_PHASE_dstPath = 'dstPath'
kPBX_PHASE_dstSubfolderSpec = 'dstSubfolderSpec'
kPBX_PHASE_shellScript = 'shellScript'
kPBX_PHASE_shellPath = 'shellPath'
kPBX_PHASE_inputPaths = 'inputPaths'
kPBX_PHASE_outputPaths = 'outputPaths'
kPBX_PHASE_showEnvVarsInLog = 'showEnvVarsInLog'
kPBX_REFERENCE_path = 'path'
kPBX_REFERENCE_name = 'name'
kPBX_REFERENCE_refType = 'refType'
kPBX_REFERENCE_sourceTree = 'sourceTree'
kPBX_REFERENCE_lastKnownFileType = 'lastKnownFileType'
kPBX_REFERENCE_fileEncoding = 'fileEncoding'
kPBX_REFERENCE_explicitFileType = 'explicitFileType'
kPBX_REFERENCE_includeInIndex = 'includeInIndex'
kPBX_REFERENCE_children = 'children'
kPBX_BUILDFILE_fileRef = 'fileRef'
kPBX_BUILDFILE_settings = 'settings'
kPBX_PROXY_remoteRef = 'remoteRef'
kPBX_PROJECT_mainGroup = 'mainGroup'
kPBX_PROJECT_targets = 'targets'
kPBX_PROJECT_attributes = 'attributes'
kPBX_PROJECT_compatibilityVersion = 'compatibilityVersion'
kPBX_PROJECT_developmentRegion = 'developmentRegion'
kPBX_PROJECT_hasScannedForEncodings = 'hasScannedForEncodings'
kPBX_PROJECT_knownRegions = 'knownRegions'
kPBX_PROJECT_productRefGroup = 'productRefGroup'
kPBX_PROJECT_projectReferences = 'projectReferences'
kPBX_PROJECTREF_ProductGroup = 'ProductGroup'
kPBX_PROJECTREF_ProjectRef = 'ProjectRef'
kPBX_TARGETDEP_target = 'target'
kPBX_TARGETDEP_targetProxy = 'targetProxy'
kPBX_CONTAINERITEMPROXY_remoteGlobalIDString = 'remoteGlobalIDString'
kPBX_CONTAINERITEMPROXY_containerPortal = 'containerPortal'
kPBX_XCBUILDCONFIG_baseConfigurationReference = 'baseConfigurationReference'
kPBX_XCCONFIGURATION_buildConfigurations = 'buildConfigurations'
kPBX_XCVersionGroup_currentVersion = 'currentVersion'
================================================
FILE: nslocalizer/xcodeproj/pbProj/PBX_Lookup.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from . import PBXItem
from . import PBXAggregateTarget
from . import PBXAppleScriptBuildPhase
from . import PBXApplicationReference
from . import PBXApplicationTarget
from . import PBXBuildFile
from . import PBXBuildRule
from . import PBXBundleReference
from . import PBXBundleTarget
from . import PBXContainerItemProxy
from . import PBXCopyFilesBuildPhase
from . import PBXExecutableFileReference
from . import PBXFileReference
from . import PBXFrameworkReference
from . import PBXFrameworksBuildPhase
from . import PBXFrameworkTarget
from . import PBXGroup
from . import PBXHeadersBuildPhase
from . import PBXJavaArchiveBuildPhase
from . import PBXLegacyTarget
from . import PBXLibraryReference
from . import PBXLibraryTarget
from . import PBXNativeTarget
from . import PBXProject
from . import PBXReferenceProxy
from . import PBXResourcesBuildPhase
from . import PBXRezBuildPhase
from . import PBXShellScriptBuildPhase
from . import PBXSourcesBuildPhase
from . import PBXStandAloneTarget
from . import PBXTargetDependency
from . import PBXToolTarget
from . import PBXVariantGroup
from . import PBXZipArchiveReference
from . import XCBuildConfiguration
from . import XCConfigurationList
from . import XCVersionGroup
PBX_TYPE_TABLE = {
'PBXAggregateTarget': PBXAggregateTarget.PBXAggregateTarget,
'PBXAppleScriptBuildPhase': PBXAppleScriptBuildPhase.PBXAppleScriptBuildPhase,
'PBXApplicationReference': PBXApplicationReference.PBXApplicationReference,
'PBXApplicationTarget': PBXApplicationTarget.PBXApplicationTarget,
'PBXBuildFile': PBXBuildFile.PBXBuildFile,
'PBXBuildRule': PBXBuildRule.PBXBuildRule,
'PBXBundleReference': PBXBundleReference.PBXBundleReference,
'PBXBundleTarget': PBXBundleTarget.PBXBundleTarget,
'PBXContainerItemProxy': PBXContainerItemProxy.PBXContainerItemProxy,
'PBXCopyFilesBuildPhase': PBXCopyFilesBuildPhase.PBXCopyFilesBuildPhase,
'PBXExecutableFileReference': PBXExecutableFileReference.PBXExecutableFileReference,
'PBXFileReference': PBXFileReference.PBXFileReference,
'PBXFrameworkReference': PBXFrameworkReference.PBXFrameworkReference,
'PBXFrameworksBuildPhase': PBXFrameworksBuildPhase.PBXFrameworksBuildPhase,
'PBXFrameworkTarget': PBXFrameworkTarget.PBXFrameworkTarget,
'PBXGroup': PBXGroup.PBXGroup,
'PBXHeadersBuildPhase': PBXHeadersBuildPhase.PBXHeadersBuildPhase,
'PBXJavaArchiveBuildPhase': PBXJavaArchiveBuildPhase.PBXJavaArchiveBuildPhase,
'PBXLegacyTarget': PBXLegacyTarget.PBXLegacyTarget,
'PBXLibraryReference': PBXLibraryReference.PBXLibraryReference,
'PBXLibraryTarget': PBXLibraryTarget.PBXLibraryTarget,
'PBXNativeTarget': PBXNativeTarget.PBXNativeTarget,
'PBXProject': PBXProject.PBXProject,
'PBXReferenceProxy': PBXReferenceProxy.PBXReferenceProxy,
'PBXResourcesBuildPhase': PBXResourcesBuildPhase.PBXResourcesBuildPhase,
'PBXRezBuildPhase': PBXRezBuildPhase.PBXRezBuildPhase,
'PBXShellScriptBuildPhase': PBXShellScriptBuildPhase.PBXShellScriptBuildPhase,
'PBXSourcesBuildPhase': PBXSourcesBuildPhase.PBXSourcesBuildPhase,
'PBXStandAloneTarget': PBXStandAloneTarget.PBXStandAloneTarget,
'PBXTargetDependency': PBXTargetDependency.PBXTargetDependency,
'PBXToolTarget': PBXToolTarget.PBXToolTarget,
'PBXVariantGroup': PBXVariantGroup.PBXVariantGroup,
'PBXZipArchiveReference': PBXZipArchiveReference.PBXZipArchiveReference,
'XCBuildConfiguration': XCBuildConfiguration.XCBuildConfiguration,
'XCConfigurationList': XCConfigurationList.XCConfigurationList,
'XCVersionGroup': XCVersionGroup.XCVersionGroup,
}
def PBX_Type_Resolver(identifier, dictionary):
object_type = dictionary.get(PBX_Constants.kPBX_isa, None)
result = None
if object_type:
result = PBX_TYPE_TABLE.get(object_type, PBXItem.PBXItem)(identifier, dictionary)
return result
================================================
FILE: nslocalizer/xcodeproj/pbProj/XCBuildConfiguration.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBXItem
class XCBuildConfiguration(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_XCBUILDCONFIG_baseConfigurationReference, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/XCConfigurationList.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBXItem
class XCConfigurationList(PBXItem):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_XCCONFIGURATION_buildConfigurations, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/XCVersionGroup.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
from . import PBX_Constants
from .PBXItem import PBX_Base_Reference
class XCVersionGroup(PBX_Base_Reference):
def __init__(self, identifier, dictionary):
super(self.__class__, self).__init__(identifier, dictionary)
def resolveGraph(self, project):
super(self.__class__, self).resolveGraph(project)
self.resolveGraphNodesForArray(PBX_Constants.kPBX_REFERENCE_children, project)
self.resolveGraphNodeForKey(PBX_Constants.kPBX_XCVersionGroup_currentVersion, project)
================================================
FILE: nslocalizer/xcodeproj/pbProj/__init__.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import sys
import os
import pbPlist
================================================
FILE: nslocalizer/xcodeproj/pbProj/pbProj.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import pbPlist
from . import PBX_Constants
from . import PBX_Lookup
class PBXProj(object):
def __init__(self, file_path):
plist = pbPlist.pbPlist.PBPlist(file_path)
contents = plist.root.nativeType()
self.pbx_objects = set()
self.pbx_identifier = None
self.pbx_root_object = None
self.pbx_object_version = 0
self.pbx_archive_version = 0
if contents is not None:
# get the path that we read from
self.pbx_file_path = plist.file_path
# get the root object identifier
self.pbx_identifier = contents.get(PBX_Constants.kPBX_rootObject, None)
# get the archive version number
archive_version = contents.get(PBX_Constants.kPBX_archiveVersion, None)
if archive_version:
self.pbx_archive_version = int(archive_version)
# get the object version number
object_version = contents.get(PBX_Constants.kPBX_objectVersion, None)
if object_version:
self.pbx_object_version = int(object_version)
# get the classes
self.pbx_classes = contents.get(PBX_Constants.kPBX_classes, None)
# get all the objects
objects_dict = contents.get(PBX_Constants.kPBX_objects, None)
self.pbx_objects = [PBX_Lookup.PBX_Type_Resolver(entry, value) for entry, value in list(objects_dict.items())]
self.pbx_root_object = self.objectForIdentifier(self.pbx_identifier)
self.pbx_root_object.resolveGraph(self)
def __repr__(self):
rep_string = '<%s : INVALID OBJECT>' % (self.__class__.__name__)
if self.isValid():
rep_string = '<%s : %s : %s>' % (self.__class__.__name__, self.pbx_identifier, self.pbx_file_path)
return rep_string
def __attrs(self):
return (self.pbx_identifier, self.pbx_file_path)
def __eq__(self, other):
return isinstance(other, PBXProj) and self.pbx_identifier == other.pbx_identifier and self.pbx_file_path == other.pbx_file_path
def __hash__(self):
return hash(self.__attrs())
def isValid(self):
return self.pbx_identifier is not None
def objectForIdentifier(self, identifier):
"""
Returns the parsed object from the project file for matching identifier, if no matching object is found it will return None.
"""
result = None
if self.isValid():
filter_results = [pbx_object for pbx_object in self.pbx_objects if pbx_object.identifier == identifier]
if len(filter_results):
result = filter_results[0]
return result
def projects(self):
"""
This method returns a set of 'xcodeproj' objects that represents any referenced
xcodeproj files in this project.
"""
subprojects = set()
if self.isValid():
subprojects = [path for path in self.__subproject_paths()]
return subprojects
def __subproject_paths(self):
"""
This method is for returning a list of paths to referenced project files in this
xcodeproj file.
"""
paths = list()
if self.isValid():
project_references = self.pbx_root_object.get(PBX_Constants.kPBX_PROJECT_projectReferences, None)
if project_references:
paths = [project_dict[PBX_Constants.kPBX_PROJECTREF_ProjectRef] for project_dict in project_references]
return paths
def targets(self):
"""
This method will return a list of build targets that are associated with this xcodeproj.
"""
targets = list()
if self.isValid():
target_list = self.pbx_root_object.get(PBX_Constants.kPBX_PROJECT_targets, None)
if target_list:
targets.extend(target_list)
return targets
================================================
FILE: nslocalizer/xcodeproj/xcodeproj.py
================================================
# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# 3. Neither the name of Samantha Marshall nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
# OF THE POSSIBILITY OF SUCH DAMAGE.
import os
from .pbProj import pbProj
from ..Helpers.Logger import Logger
class xcodeproj(object):
def __init__(self, xcodeproj_file_path):
if os.path.exists(xcodeproj_file_path):
if xcodeproj_file_path.endswith(('.xcodeproj', '.pbproj')):
self.file_path = xcodeproj_file_path
# loading the pbxproj
pbxproj_file_path = os.path.join(self.file_path, 'project.pbxproj')
if os.path.exists(pbxproj_file_path):
self.project_file = pbProj.PBXProj(pbxproj_file_path)
else: # pragma: no cover
Logger.write().error('Could not find the pbxproj file!')
else: # pragma: no cover
Logger.write().error('Not a Xcode project file!')
else: # pragma: no cover
Logger.write().error('Could not find the Xcode project file!')
def projects(self):
return self.project_file.projects()
================================================
FILE: nslocalizer.py
================================================
#!/usr/bin/python
import nslocalizer
def main():
nslocalizer.main()
if __name__ == "__main__":
main()
================================================
FILE: pylintrc
================================================
[MASTER]
# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=
# Add files or directories matching the regex patterns to the blacklist. The
# regex matches against base names, not paths.
ignore-patterns=
# Pickle collected data for later comparisons.
persistent=yes
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=
# Use multiple processes to speed up Pylint.
jobs=1
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=
# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
# be used to obtain the result of joining multiple strings with the addition
# operator. Joining a lot of strings can lead to a maximum recursion error in
# Pylint and this flag can prevent that. It has one side effect, the resulting
# AST will be different than the one from reality. This option is deprecated
# and it will be removed in Pylint 2.0.
optimize-ast=no
[MESSAGES CONTROL]
# Only show warnings with the listed confidence levels. Leave empty to show
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
confidence=
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
#enable=
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=missing-docstring,too-many-lines,locally-disabled,too-many-ancestors
[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text
# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no
# Tells whether to display a full report or only the messages
reports=yes
# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
# Template used to display messages. This is a python new-style format string
# used to format the message information. See doc for all details
#msg-template=
[BASIC]
# Good variable names which should always be accepted, separated by a comma
good-names=Run,_
# Bad variable names which should always be refused, separated by a comma
bad-names=foo,bar,baz,toto,tutu,tata,i,j,k,idx
# Colon-delimited sets of names that determine each other's naming style when
# the name regexes allow several styles.
name-group=
# Include a hint for the correct naming format with invalid-name
include-naming-hint=no
# List of decorators that produce properties, such as abc.abstractproperty. Add
# to this list to register other decorators that produce valid properties.
property-classes=abc.abstractproperty
# Regular expression matching correct function names
function-rgx=[A-Za-z_][a-zA-Z0-9_]{2,40}$
# Naming hint for function names
function-name-hint=[A-Za-z_][a-zA-Z0-9_]{2,40}$
# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct constant names
const-rgx=(([A-Za-z_][A-Za-z0-9_]*)|(__.*__))$
# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$
# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$
# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
# Regular expression matching correct class names
class-rgx=[a-zA-Z0-9_]+$
# Naming hint for class names
class-name-hint=[a-zA-Z0-9_]+$
# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_]*)|([A-Za-z][a-zA-Z0-9_]+))$
# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Za-z][a-zA-Z0-9]+))$
# Regular expression matching correct method names
method-rgx=[a-z_][a-zA-Z0-9_]{2,40}$
# Naming hint for method names
method-name-hint=[a-zA-Z0-9_]{2,40}$
# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
docstring-min-length=0
[ELIF]
# Maximum number of nested blocks for function / method body
max-nested-blocks=5
[FORMAT]
# Maximum number of characters on a single line.
max-line-length=100000
# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt=no
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator
# Maximum number of lines in a module
max-module-lines=0
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
# tab).
indent-string=' '
# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
expected-line-ending-format=
[LOGGING]
# Logging modules to check that the string format arguments are in logging
# function parameter format
logging-modules=logging
[MISCELLANEOUS]
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO
[SIMILARITIES]
# Minimum lines number of a similarity.
min-similarity-lines=10
# Ignore comments when computing similarities.
ignore-comments=yes
# Ignore docstrings when computing similarities.
ignore-docstrings=yes
# Ignore imports when computing similarities.
ignore-imports=yes
[SPELLING]
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict=
# List of comma separated words that should not be checked.
spelling-ignore-words=
# A path to a file that contains private dictionary; one word per line.
spelling-private-dict-file=
# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
spelling-store-unknown-words=no
[TYPECHECK]
# Tells whether missing members accessed in mixin class should be ignored. A
# mixin class is detected if its name ends with "mixin" (case insensitive).
ignore-mixin-members=yes
# List of module names for which member attributes should not be checked
# (useful for modules/projects where namespaces are manipulated during runtime
# and thus existing member attributes cannot be deduced by static analysis. It
# supports qualified module names, as well as Unix pattern matching.
ignored-modules=
# List of class names for which member attributes should not be checked (useful
# for classes with dynamically set attributes). This supports the use of
# qualified names.
ignored-classes=optparse.Values,thread._local,_thread._local
# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=
# List of decorators that produce context managers, such as
# contextlib.contextmanager. Add to this list to register other decorators that
# produce valid context managers.
contextmanager-decorators=contextlib.contextmanager
[VARIABLES]
# Tells whether we should check for unused import in __init__ files.
init-import=no
# A regular expression matching the name of dummy variables (i.e. expectedly
# not used).
dummy-variables-rgx=(_+[a-zA-Z0-9]*?$)|dummy
# List of additional names supposed to be defined in builtins. Remember that
# you should avoid to define new builtins when possible.
additional-builtins=
# List of strings which can identify a callback function by name. A callback
# name must start or end with one of those strings.
callbacks=cb_,_cb
# List of qualified module names which can have objects that can redefine
# builtins.
redefining-builtins-modules=six.moves,future.builtins
[CLASSES]
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
# List of valid names for the first argument in a class method.
valid-classmethod-first-arg=cls
# List of valid names for the first argument in a metaclass class method.
valid-metaclass-classmethod-first-arg=mcs
# List of member names, which should be excluded from the protected access
# warning.
exclude-protected=_asdict,_fields,_replace,_source,_make
[DESIGN]
# Maximum number of arguments for function / method
max-args=5
# Argument names that match this expression will be ignored. Default to name
# with leading underscore
ignored-argument-names=_.*
# Maximum number of locals for function / method body
max-locals=15
# Maximum number of return / yield for function / method body
max-returns=1
# Maximum number of branch for function / method body
max-branches=12
# Maximum number of statements in function / method body
max-statements=50
# Maximum number of parents for a class (see R0901).
max-parents=7
# Maximum number of attributes for a class (see R0902).
max-attributes=10
# Minimum number of public methods for a class (see R0903).
min-public-methods=0
# Maximum number of public methods for a class (see R0904).
max-public-methods=20
# Maximum number of boolean expressions in a if statement
max-bool-expr=3
[IMPORTS]
# Deprecated modules which should not be used, separated by a comma
deprecated-modules=regsub,TERMIOS,Bastion,rexec
# Create a graph of every (i.e. internal and external) dependencies in the
# given file (report RP0402 must not be disabled)
import-graph=
# Create a graph of external dependencies in the given file (report RP0402 must
# not be disabled)
ext-import-graph=
# Create a graph of internal depen
gitextract_5412qdru/ ├── .codeclimate.yml ├── .github/ │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .gitmodules ├── Dangerfile ├── Gemfile ├── LICENSE ├── Makefile ├── circle.yml ├── contributing/ │ └── code-of-conduct.md ├── contributing.md ├── install_requirements.txt ├── nslocalizer/ │ ├── Executor/ │ │ ├── Executor.py │ │ └── __init__.py │ ├── Finder/ │ │ ├── CodeFinder.py │ │ ├── LanguageFinder.py │ │ ├── PathFinder.py │ │ └── __init__.py │ ├── Helpers/ │ │ ├── FileOperations.py │ │ ├── Logger.py │ │ ├── Switch.py │ │ ├── __init__.py │ │ └── xcrun.py │ ├── Language/ │ │ ├── Language.py │ │ ├── LanguageString.py │ │ └── __init__.py │ ├── Reporter/ │ │ ├── Reporter.py │ │ └── __init__.py │ ├── __init__.py │ ├── main.py │ ├── version.py │ ├── version_info.py │ └── xcodeproj/ │ ├── __init__.py │ ├── pbProj/ │ │ ├── PBXAggregateTarget.py │ │ ├── PBXAppleScriptBuildPhase.py │ │ ├── PBXApplicationReference.py │ │ ├── PBXApplicationTarget.py │ │ ├── PBXBuildFile.py │ │ ├── PBXBuildRule.py │ │ ├── PBXBundleReference.py │ │ ├── PBXBundleTarget.py │ │ ├── PBXContainerItemProxy.py │ │ ├── PBXCopyFilesBuildPhase.py │ │ ├── PBXExecutableFileReference.py │ │ ├── PBXFileReference.py │ │ ├── PBXFrameworkReference.py │ │ ├── PBXFrameworkTarget.py │ │ ├── PBXFrameworksBuildPhase.py │ │ ├── PBXGroup.py │ │ ├── PBXHeadersBuildPhase.py │ │ ├── PBXItem.py │ │ ├── PBXJavaArchiveBuildPhase.py │ │ ├── PBXLegacyTarget.py │ │ ├── PBXLibraryReference.py │ │ ├── PBXLibraryTarget.py │ │ ├── PBXNativeTarget.py │ │ ├── PBXProject.py │ │ ├── PBXReferenceProxy.py │ │ ├── PBXResourcesBuildPhase.py │ │ ├── PBXRezBuildPhase.py │ │ ├── PBXShellScriptBuildPhase.py │ │ ├── PBXSourcesBuildPhase.py │ │ ├── PBXStandAloneTarget.py │ │ ├── PBXTargetDependency.py │ │ ├── PBXToolTarget.py │ │ ├── PBXVariantGroup.py │ │ ├── PBXZipArchiveReference.py │ │ ├── PBX_Constants.py │ │ ├── PBX_Lookup.py │ │ ├── XCBuildConfiguration.py │ │ ├── XCConfigurationList.py │ │ ├── XCVersionGroup.py │ │ ├── __init__.py │ │ └── pbProj.py │ └── xcodeproj.py ├── nslocalizer.py ├── pylintrc ├── readme.md ├── requirements.txt ├── setup.py ├── tests/ │ ├── __init__.py │ ├── nslocalizer-example/ │ │ ├── Base.lproj/ │ │ │ └── Localizable.strings │ │ ├── de.lproj/ │ │ │ └── Localizable.strings │ │ ├── en.lproj/ │ │ │ └── Localizable.strings │ │ ├── es.lproj/ │ │ │ └── Localizable.strings │ │ ├── fr.lproj/ │ │ │ └── Localizable.strings │ │ ├── pylocalizer-example/ │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Assets.xcassets/ │ │ │ │ └── AppIcon.appiconset/ │ │ │ │ └── Contents.json │ │ │ ├── Base.lproj/ │ │ │ │ ├── LaunchScreen.storyboard │ │ │ │ └── Main.storyboard │ │ │ ├── DetailViewController.h │ │ │ ├── DetailViewController.m │ │ │ ├── Info.plist │ │ │ ├── MasterViewController.h │ │ │ ├── MasterViewController.m │ │ │ ├── de.lproj/ │ │ │ │ ├── LaunchScreen.strings │ │ │ │ └── Main.strings │ │ │ ├── es.lproj/ │ │ │ │ ├── LaunchScreen.strings │ │ │ │ └── Main.strings │ │ │ ├── fr.lproj/ │ │ │ │ ├── LaunchScreen.strings │ │ │ │ └── Main.strings │ │ │ └── main.m │ │ └── pylocalizer-example.xcodeproj/ │ │ ├── project.pbxproj │ │ ├── project.xcworkspace/ │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcuserdata/ │ │ │ └── Samantha.xcuserdatad/ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata/ │ │ └── Samantha.xcuserdatad/ │ │ └── xcschemes/ │ │ ├── pylocalizer-example.xcscheme │ │ └── xcschememanagement.plist │ ├── nslocalizer_test.py │ └── test_runner.py ├── tools/ │ ├── checkout_by_version.sh │ ├── hooks/ │ │ └── pre-commit │ └── hooks-config.py └── tox.ini
SYMBOL INDEX (199 symbols across 54 files)
FILE: nslocalizer.py
function main (line 5) | def main():
FILE: nslocalizer/Executor/Executor.py
class Executor (line 42) | class Executor(object):
method run (line 47) | def run(cls, arguments) -> None:
method findMissingStrings (line 85) | def findMissingStrings(cls, project, targets) -> dict:
method findUnusedStrings (line 95) | def findUnusedStrings(cls, project, targets) -> list:
method generateLanguages (line 118) | def generateLanguages(cls, project) -> (Language, {Language}):
FILE: nslocalizer/Finder/CodeFinder.py
function getCodeFileList (line 36) | def getCodeFileList(project, target) -> list:
FILE: nslocalizer/Finder/LanguageFinder.py
function FilterByName (line 36) | def FilterByName(items, name) -> PBXVariantGroup:
class LanguageFinder (line 44) | class LanguageFinder(object):
method getLocalizationFiles (line 51) | def getLocalizationFiles(cls, project) -> (dict, dict):
FILE: nslocalizer/Finder/PathFinder.py
function resolveFilePathForReference (line 33) | def resolveFilePathForReference(project, reference) -> str:
FILE: nslocalizer/Helpers/FileOperations.py
class FileOperations (line 35) | class FileOperations(object):
method getData (line 38) | def getData(cls, file_path) -> object:
FILE: nslocalizer/Helpers/Logger.py
class Singleton (line 33) | class Singleton(type):
method __call__ (line 36) | def __call__(cls, *args, **kwargs): # pragma: no cover
class ColoredFormatter (line 64) | class ColoredFormatter(logging.Formatter):
method __init__ (line 65) | def __init__(self, msg, use_color=True):
method format (line 69) | def format(self, record): # pragma: no cover
class Logger (line 76) | class Logger(object):
method __init__ (line 82) | def __init__(self, *args, **kwargs): # pragma: no cover
method enableDebugLogger (line 86) | def enableDebugLogger(is_debug_logger=False):
method disableANSI (line 90) | def disableANSI(disable_ansi=False):
method setupLogger (line 94) | def setupLogger():
method isVerbose (line 117) | def isVerbose(verbose_logging=False):
method isSilent (line 124) | def isSilent(should_quiet=False):
method write (line 132) | def write():
FILE: nslocalizer/Helpers/Switch.py
class Switch (line 33) | class Switch(object):
method __init__ (line 34) | def __init__(self, value):
method __iter__ (line 38) | def __iter__(self):
method match (line 43) | def match(self, *args):
FILE: nslocalizer/Helpers/xcrun.py
function hashStringForPath (line 40) | def hashStringForPath(path) -> str:
function ResolveDerivedDataPath (line 72) | def ResolveDerivedDataPath(project) -> str:
function ResolveBuildLocation (line 82) | def ResolveBuildLocation(project, sym_root) -> str:
function IntermediatesBuildLocation (line 121) | def IntermediatesBuildLocation(project, target_name, config_name, sym_ro...
function ProductsBuildLocation (line 129) | def ProductsBuildLocation(project, sym_root) -> str:
function resolvePathFromLocation (line 141) | def resolvePathFromLocation(location_string, path, base_path) -> str:
function make_subprocess_call (line 164) | def make_subprocess_call(call_args, shell_state=False) -> (str, int):
function make_xcrun_with_args (line 175) | def make_xcrun_with_args(args_tuple) -> str:
function resolve_sdk_path (line 183) | def resolve_sdk_path(sdk_name) -> str:
function resolve_developer_path (line 186) | def resolve_developer_path() -> str:
FILE: nslocalizer/Language/Language.py
function GetLanguageCodeFromPath (line 38) | def GetLanguageCodeFromPath(path) -> str:
function FindLineIndex (line 44) | def FindLineIndex(data, string) -> int:
function LoadStrings (line 52) | def LoadStrings(file_path) -> list:
class Language (line 57) | class Language(object):
method __init__ (line 58) | def __init__(self, strings_file_path):
method findStrings (line 66) | def findStrings(self) -> None:
method loadStringsDictFile (line 74) | def loadStringsDictFile(self, stringsdict_file_array) -> None:
method __repr__ (line 83) | def __repr__(self) -> str: # pragma: no cover
FILE: nslocalizer/Language/LanguageString.py
function HasStringForLanguage (line 31) | def HasStringForLanguage(string, language) -> bool:
class LanguageString (line 39) | class LanguageString(object):
method __init__ (line 40) | def __init__(self, string_key, string_value):
method __repr__ (line 47) | def __repr__(self) -> str: # pragma: no cover
method registerBase (line 50) | def registerBase(self, base_language):
method processMapping (line 53) | def processMapping(self, base_language, additional_languages) -> (obje...
FILE: nslocalizer/Reporter/Reporter.py
function log (line 31) | def log(file_name, line_number, type_string, message_string) -> None:
function logError (line 37) | def logError(file_name, line_number, message_string) -> None:
function logWarning (line 40) | def logWarning(file_name, line_number, message_string) -> None:
function logMissingStrings (line 43) | def logMissingStrings(warnings_dictionary, ignore_languages, is_error=Fa...
function logUnusedStrings (line 56) | def logUnusedStrings(unused_strings_list, is_error=False) -> None:
FILE: nslocalizer/main.py
function main (line 38) | def main(argv=sys.argv[1:]):
FILE: nslocalizer/xcodeproj/pbProj/PBXAggregateTarget.py
class PBXAggregateTarget (line 33) | class PBXAggregateTarget(PBX_Base_Target):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXAppleScriptBuildPhase.py
class PBXAppleScriptBuildPhase (line 33) | class PBXAppleScriptBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXApplicationReference.py
class PBXApplicationReference (line 33) | class PBXApplicationReference(PBX_Base_Reference):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXApplicationTarget.py
class PBXApplicationTarget (line 33) | class PBXApplicationTarget(PBX_Base_Target):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXBuildFile.py
class PBXBuildFile (line 34) | class PBXBuildFile(PBXItem):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXBuildRule.py
class PBXBuildRule (line 33) | class PBXBuildRule(PBXItem):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXBundleReference.py
class PBXBundleReference (line 33) | class PBXBundleReference(PBX_Base_Reference):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXBundleTarget.py
class PBXBundleTarget (line 33) | class PBXBundleTarget(PBX_Base_Target):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXContainerItemProxy.py
class PBXContainerItemProxy (line 34) | class PBXContainerItemProxy(PBXItem):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXCopyFilesBuildPhase.py
class PBXCopyFilesBuildPhase (line 33) | class PBXCopyFilesBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXExecutableFileReference.py
class PBXExecutableFileReference (line 33) | class PBXExecutableFileReference(PBX_Base_Reference):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXFileReference.py
class PBXFileReference (line 33) | class PBXFileReference(PBX_Base_Reference):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXFrameworkReference.py
class PBXFrameworkReference (line 33) | class PBXFrameworkReference(PBX_Base_Reference):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXFrameworkTarget.py
class PBXFrameworkTarget (line 33) | class PBXFrameworkTarget(PBX_Base_Target):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXFrameworksBuildPhase.py
class PBXFrameworksBuildPhase (line 33) | class PBXFrameworksBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXGroup.py
class PBXGroup (line 34) | class PBXGroup(PBX_Base_Reference):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXHeadersBuildPhase.py
class PBXHeadersBuildPhase (line 33) | class PBXHeadersBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXItem.py
function getGraphNodeWithIdentifier (line 36) | def getGraphNodeWithIdentifier(identifier, project):
class PBXItem (line 42) | class PBXItem(collections.MutableMapping):
method __init__ (line 43) | def __init__(self, identifier, dictionary):
method __getitem__ (line 51) | def __getitem__(self, key):
method __setitem__ (line 54) | def __setitem__(self, key, value):
method __delitem__ (line 59) | def __delitem__(self, key):
method __iter__ (line 64) | def __iter__(self):
method __len__ (line 67) | def __len__(self):
method __str__ (line 70) | def __str__(self):
method __contains__ (line 73) | def __contains__(self, item):
method __getattr__ (line 76) | def __getattr__(self, attrib):
method __hash__ (line 79) | def __hash__(self):
method __repr__ (line 82) | def __repr__(self):
method resolveGraphNodeForKey (line 85) | def resolveGraphNodeForKey(self, key, project):
method resolveGraphNodesForArray (line 92) | def resolveGraphNodesForArray(self, key, project):
method resolveGraph (line 103) | def resolveGraph(self, project):
class PBX_Base_Target (line 107) | class PBX_Base_Target(PBXItem):
method __init__ (line 108) | def __init__(self, identifier, dictionary):
method resolveGraph (line 110) | def resolveGraph(self, project):
class PBX_Base_Phase (line 117) | class PBX_Base_Phase(PBXItem):
method __init__ (line 118) | def __init__(self, identifier, dictionary):
method resolveGraph (line 120) | def resolveGraph(self, project):
function resolvePathTypeFromSource (line 124) | def resolvePathTypeFromSource(source):
class PBX_Base_Reference (line 138) | class PBX_Base_Reference(PBXItem):
method __init__ (line 139) | def __init__(self, identifier, dictionary):
method resolveGraph (line 141) | def resolveGraph(self, project):
method findParent (line 143) | def findParent(self, project):
method resolveAbsolutePath (line 152) | def resolveAbsolutePath(self, project): # pylint: disable=no-self-use,...
method resolveGroupPath (line 154) | def resolveGroupPath(self, project):
method resolveSourceRootPath (line 161) | def resolveSourceRootPath(self, project): # pylint: disable=no-self-use
method resolveDeveloperDirPath (line 164) | def resolveDeveloperDirPath(self, project): # pylint: disable=no-self-use
method resolveSDKPath (line 167) | def resolveSDKPath(self, project): # pylint: disable=no-self-use
method resolvePath (line 173) | def resolvePath(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXJavaArchiveBuildPhase.py
class PBXJavaArchiveBuildPhase (line 33) | class PBXJavaArchiveBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXLegacyTarget.py
class PBXLegacyTarget (line 33) | class PBXLegacyTarget(PBX_Base_Target):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXLibraryReference.py
class PBXLibraryReference (line 33) | class PBXLibraryReference(PBX_Base_Reference):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXLibraryTarget.py
class PBXLibraryTarget (line 33) | class PBXLibraryTarget(PBX_Base_Target):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXNativeTarget.py
class PBXNativeTarget (line 34) | class PBXNativeTarget(PBX_Base_Target):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXProject.py
class PBXProject_ProjectReference (line 34) | class PBXProject_ProjectReference(PBXItem):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method __repr__ (line 37) | def __repr__(self):
method resolveGraph (line 39) | def resolveGraph(self, project):
class PBXProject (line 44) | class PBXProject(PBXItem):
method __init__ (line 45) | def __init__(self, identifier, dictionary):
method resolveGraph (line 47) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXReferenceProxy.py
class PBXReferenceProxy (line 34) | class PBXReferenceProxy(PBXItem):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXResourcesBuildPhase.py
class PBXResourcesBuildPhase (line 33) | class PBXResourcesBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXRezBuildPhase.py
class PBXRezBuildPhase (line 33) | class PBXRezBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXShellScriptBuildPhase.py
class PBXShellScriptBuildPhase (line 33) | class PBXShellScriptBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXSourcesBuildPhase.py
class PBXSourcesBuildPhase (line 33) | class PBXSourcesBuildPhase(PBX_Base_Phase):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXStandAloneTarget.py
class PBXStandAloneTarget (line 34) | class PBXStandAloneTarget(PBX_Base_Target):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXTargetDependency.py
class PBXTargetDependency (line 34) | class PBXTargetDependency(PBXItem):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXToolTarget.py
class PBXToolTarget (line 33) | class PBXToolTarget(PBX_Base_Target):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBXVariantGroup.py
class PBXVariantGroup (line 34) | class PBXVariantGroup(PBX_Base_Reference):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/PBXZipArchiveReference.py
class PBXZipArchiveReference (line 33) | class PBXZipArchiveReference(PBX_Base_Reference):
method __init__ (line 34) | def __init__(self, identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/PBX_Lookup.py
function PBX_Type_Resolver (line 109) | def PBX_Type_Resolver(identifier, dictionary):
FILE: nslocalizer/xcodeproj/pbProj/XCBuildConfiguration.py
class XCBuildConfiguration (line 34) | class XCBuildConfiguration(PBXItem):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/XCConfigurationList.py
class XCConfigurationList (line 34) | class XCConfigurationList(PBXItem):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/XCVersionGroup.py
class XCVersionGroup (line 34) | class XCVersionGroup(PBX_Base_Reference):
method __init__ (line 35) | def __init__(self, identifier, dictionary):
method resolveGraph (line 37) | def resolveGraph(self, project):
FILE: nslocalizer/xcodeproj/pbProj/pbProj.py
class PBXProj (line 35) | class PBXProj(object):
method __init__ (line 37) | def __init__(self, file_path):
method __repr__ (line 74) | def __repr__(self):
method __attrs (line 80) | def __attrs(self):
method __eq__ (line 83) | def __eq__(self, other):
method __hash__ (line 86) | def __hash__(self):
method isValid (line 89) | def isValid(self):
method objectForIdentifier (line 92) | def objectForIdentifier(self, identifier):
method projects (line 103) | def projects(self):
method __subproject_paths (line 113) | def __subproject_paths(self):
method targets (line 125) | def targets(self):
FILE: nslocalizer/xcodeproj/xcodeproj.py
class xcodeproj (line 35) | class xcodeproj(object):
method __init__ (line 37) | def __init__(self, xcodeproj_file_path):
method projects (line 52) | def projects(self):
FILE: tests/nslocalizer_test.py
class nslocalizerTestCases (line 35) | class nslocalizerTestCases(unittest.TestCase):
method test_missing_strings (line 37) | def test_missing_strings(self):
method test_unused_strings (line 42) | def test_unused_strings(self):
Condensed preview — 115 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (265K chars).
[
{
"path": ".codeclimate.yml",
"chars": 373,
"preview": "engines:\n radon:\n enabled: true\n\n duplication:\n enabled: true\n config:\n languages:\n - python\n ex"
},
{
"path": ".github/ISSUE_TEMPLATE.md",
"chars": 449,
"preview": "<!-- REQUIRED FIELDS -->\n**Type of issue**: [ Bug | Enhancement | Request ]\n\n---\n\n**Related Files**: \n\n---\n\n**Descriptio"
},
{
"path": ".github/PULL_REQUEST_TEMPLATE.md",
"chars": 330,
"preview": "<!-- REQUIRED FIELDS -->\n**Title**:\n\n---\n\n**Description**:\n<!-- \nPlease create a list of changes using the following for"
},
{
"path": ".gitignore",
"chars": 146,
"preview": ".DS_Store\ninstalled_files.txt\nbuild/\ndist/\nnslocalizer.egg-info/\n.tox/\n.coverage\n*.pyc\n__pycache__/\nhtmlcov/\n.eggs/\nlint"
},
{
"path": ".gitmodules",
"chars": 105,
"preview": "[submodule \"docs\"]\n\tpath = docs\n\turl = https://samdmarshall@github.com/samdmarshall/pylocalizer.wiki.git\n"
},
{
"path": "Dangerfile",
"chars": 1114,
"preview": "# this dangerfile sets values that will be consumed by the global danger \n# file. The global dangerfile is run automatic"
},
{
"path": "Gemfile",
"chars": 1675,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "LICENSE",
"chars": 1484,
"preview": "Copyright (c) 2016, Samantha Marshall\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or w"
},
{
"path": "Makefile",
"chars": 8007,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "circle.yml",
"chars": 562,
"preview": "machine:\n environment:\n XCODE_SCHEME: CIRCLECI_IS_BROKEN\n XCODE_WORKSPACE: CIRCLECI_IS_BROKEN\n xcode:\n versio"
},
{
"path": "contributing/code-of-conduct.md",
"chars": 3227,
"preview": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, w"
},
{
"path": "contributing.md",
"chars": 1251,
"preview": "# [Code of Conduct](./contributing/code-of-conduct.md)\nThis project has and enforces a Code of Conduct. This must be adh"
},
{
"path": "install_requirements.txt",
"chars": 89,
"preview": "pyobjc-core >= 2.5.1\npyobjc-framework-Cocoa >= 2.5.1\npbPlist >= 1.0.4\nlangcodes >= 1.2.0\n"
},
{
"path": "nslocalizer/Executor/Executor.py",
"chars": 6742,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Executor/__init__.py",
"chars": 1611,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Finder/CodeFinder.py",
"chars": 2570,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Finder/LanguageFinder.py",
"chars": 4310,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Finder/PathFinder.py",
"chars": 1932,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Finder/__init__.py",
"chars": 1611,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Helpers/FileOperations.py",
"chars": 2367,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Helpers/Logger.py",
"chars": 4891,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Helpers/Switch.py",
"chars": 2253,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Helpers/__init__.py",
"chars": 1611,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Helpers/xcrun.py",
"chars": 8212,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Language/Language.py",
"chars": 3921,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Language/LanguageString.py",
"chars": 2624,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Language/__init__.py",
"chars": 1611,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Reporter/Reporter.py",
"chars": 3337,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/Reporter/__init__.py",
"chars": 1611,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/__init__.py",
"chars": 1736,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/main.py",
"chars": 4375,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/version.py",
"chars": 1726,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/version_info.py",
"chars": 84,
"preview": "remote_origin = 'ssh://github.com/samdmarshall/nslocalizer'\ncommit_hash = '14d376e'\n"
},
{
"path": "nslocalizer/xcodeproj/__init__.py",
"chars": 1669,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXAggregateTarget.py",
"chars": 1810,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXAppleScriptBuildPhase.py",
"chars": 1814,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXApplicationReference.py",
"chars": 1821,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXApplicationTarget.py",
"chars": 1812,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXBuildFile.py",
"chars": 2001,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXBuildRule.py",
"chars": 1788,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXBundleReference.py",
"chars": 1816,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXBundleTarget.py",
"chars": 1807,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXContainerItemProxy.py",
"chars": 2027,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXCopyFilesBuildPhase.py",
"chars": 1812,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXExecutableFileReference.py",
"chars": 1824,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXFileReference.py",
"chars": 1814,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXFrameworkReference.py",
"chars": 1819,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXFrameworkTarget.py",
"chars": 1810,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXFrameworksBuildPhase.py",
"chars": 1813,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXGroup.py",
"chars": 2023,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXHeadersBuildPhase.py",
"chars": 1810,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXItem.py",
"chars": 7630,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXJavaArchiveBuildPhase.py",
"chars": 1814,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXLegacyTarget.py",
"chars": 1807,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXLibraryReference.py",
"chars": 1817,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXLibraryTarget.py",
"chars": 1808,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXNativeTarget.py",
"chars": 2023,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXProject.py",
"chars": 3256,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXReferenceProxy.py",
"chars": 2004,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXResourcesBuildPhase.py",
"chars": 1812,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXRezBuildPhase.py",
"chars": 1806,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXShellScriptBuildPhase.py",
"chars": 1814,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXSourcesBuildPhase.py",
"chars": 1810,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXStandAloneTarget.py",
"chars": 2027,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXTargetDependency.py",
"chars": 2094,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXToolTarget.py",
"chars": 1805,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXVariantGroup.py",
"chars": 2030,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBXZipArchiveReference.py",
"chars": 1820,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBX_Constants.py",
"chars": 4780,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/PBX_Lookup.py",
"chars": 5501,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/XCBuildConfiguration.py",
"chars": 2032,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/XCConfigurationList.py",
"chars": 2029,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/XCVersionGroup.py",
"chars": 2124,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/__init__.py",
"chars": 1648,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/pbProj/pbProj.py",
"chars": 5561,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer/xcodeproj/xcodeproj.py",
"chars": 2588,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "nslocalizer.py",
"chars": 112,
"preview": "#!/usr/bin/python\n\nimport nslocalizer\n\ndef main():\n nslocalizer.main()\n\nif __name__ == \"__main__\":\n main()"
},
{
"path": "pylintrc",
"chars": 12876,
"preview": "[MASTER]\n\n# Add files or directories to the blacklist. They should be base names, not\n# paths.\nignore=\n\n# Add files or d"
},
{
"path": "readme.md",
"chars": 3877,
"preview": "nslocalizer\n===========\n\n[](https"
},
{
"path": "requirements.txt",
"chars": 187,
"preview": "coverage >= 4\ntox >= 2.3.1\ntox_pyenv >= 1.0.3\ncodeclimate-test-reporter >= 0.1.2\npylint >= 1.6.1\n\npyobjc-core >= 2.5.1\np"
},
{
"path": "setup.py",
"chars": 2648,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "tests/__init__.py",
"chars": 1657,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "tests/nslocalizer-example/Base.lproj/Localizable.strings",
"chars": 154,
"preview": "/* \n Localizable.strings\n pylocalizer-example\n\n Created by Samantha Marshall on 7/27/16.\n Copyright © 2016 Samantha "
},
{
"path": "tests/nslocalizer-example/de.lproj/Localizable.strings",
"chars": 154,
"preview": "/* \n Localizable.strings\n pylocalizer-example\n\n Created by Samantha Marshall on 7/27/16.\n Copyright © 2016 Samantha "
},
{
"path": "tests/nslocalizer-example/en.lproj/Localizable.strings",
"chars": 154,
"preview": "/* \n Localizable.strings\n pylocalizer-example\n\n Created by Samantha Marshall on 7/27/16.\n Copyright © 2016 Samantha "
},
{
"path": "tests/nslocalizer-example/es.lproj/Localizable.strings",
"chars": 154,
"preview": "/* \n Localizable.strings\n pylocalizer-example\n\n Created by Samantha Marshall on 7/27/16.\n Copyright © 2016 Samantha "
},
{
"path": "tests/nslocalizer-example/fr.lproj/Localizable.strings",
"chars": 154,
"preview": "/* \n Localizable.strings\n pylocalizer-example\n\n Created by Samantha Marshall on 7/27/16.\n Copyright © 2016 Samantha "
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/AppDelegate.h",
"chars": 301,
"preview": "//\n// AppDelegate.h\n// pylocalizer-example\n//\n// Created by Samantha Marshall on 7/27/16.\n// Copyright © 2016 Samant"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/AppDelegate.m",
"chars": 3206,
"preview": "//\n// AppDelegate.m\n// pylocalizer-example\n//\n// Created by Samantha Marshall on 7/27/16.\n// Copyright © 2016 Samant"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/Assets.xcassets/AppIcon.appiconset/Contents.json",
"chars": 1077,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"iphone\",\n \"size\" : \"29x29\",\n \"scale\" : \"2x\"\n },\n {\n \"idiom\""
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/Base.lproj/LaunchScreen.storyboard",
"chars": 1665,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/Base.lproj/Main.storyboard",
"chars": 9888,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/DetailViewController.h",
"chars": 366,
"preview": "//\n// DetailViewController.h\n// pylocalizer-example\n//\n// Created by Samantha Marshall on 7/27/16.\n// Copyright © 20"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/DetailViewController.m",
"chars": 951,
"preview": "//\n// DetailViewController.m\n// pylocalizer-example\n//\n// Created by Samantha Marshall on 7/27/16.\n// Copyright © 20"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/Info.plist",
"chars": 1694,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/MasterViewController.h",
"chars": 361,
"preview": "//\n// MasterViewController.h\n// pylocalizer-example\n//\n// Created by Samantha Marshall on 7/27/16.\n// Copyright © 20"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/MasterViewController.m",
"chars": 3384,
"preview": "//\n// MasterViewController.m\n// pylocalizer-example\n//\n// Created by Samantha Marshall on 7/27/16.\n// Copyright © 20"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/de.lproj/LaunchScreen.strings",
"chars": 1,
"preview": "\n"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/de.lproj/Main.strings",
"chars": 796,
"preview": "\n/* Class = \"UILabel\"; text = \"Detail view content goes here\"; ObjectID = \"0XM-y9-sOw\"; */\n\"0XM-y9-sOw.text\" = \"Detail v"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/es.lproj/LaunchScreen.strings",
"chars": 1,
"preview": "\n"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/es.lproj/Main.strings",
"chars": 796,
"preview": "\n/* Class = \"UILabel\"; text = \"Detail view content goes here\"; ObjectID = \"0XM-y9-sOw\"; */\n\"0XM-y9-sOw.text\" = \"Detail v"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/fr.lproj/LaunchScreen.strings",
"chars": 1,
"preview": "\n"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/fr.lproj/Main.strings",
"chars": 796,
"preview": "\n/* Class = \"UILabel\"; text = \"Detail view content goes here\"; ObjectID = \"0XM-y9-sOw\"; */\n\"0XM-y9-sOw.text\" = \"Detail v"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example/main.m",
"chars": 349,
"preview": "//\n// main.m\n// pylocalizer-example\n//\n// Created by Samantha Marshall on 7/27/16.\n// Copyright © 2016 Samantha Mars"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example.xcodeproj/project.pbxproj",
"chars": 14209,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 164,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:pylocalizer-exa"
},
{
"path": "tests/nslocalizer-example/pylocalizer-example.xcodeproj/xcuserdata/Samantha.xcuserdatad/xcschemes/pylocalizer-example.xcscheme",
"chars": 3447,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n LastUpgradeVersion = \"0730\"\n version = \"1.3\">\n <BuildAction\n "
},
{
"path": "tests/nslocalizer-example/pylocalizer-example.xcodeproj/xcuserdata/Samantha.xcuserdatad/xcschemes/xcschememanagement.plist",
"chars": 491,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "tests/nslocalizer_test.py",
"chars": 2292,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "tests/test_runner.py",
"chars": 1862,
"preview": "# Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)\n# All rights reserved.\n#\n# https://github.com/samdm"
},
{
"path": "tools/checkout_by_version.sh",
"chars": 144,
"preview": "#!/bin/bash\ncommit_hash=\"$1\"\nactual_commit=`git rev-list --all --parents | grep \". $commit_hash\" | awk '{print $1}'`\ngit"
},
{
"path": "tools/hooks/pre-commit",
"chars": 295,
"preview": "#!/bin/sh\ngit_path=`git rev-parse --show-toplevel`\npushd $git_path\n\t\ncommit_hash=`git rev-parse --short HEAD`\nremote_ori"
},
{
"path": "tools/hooks-config.py",
"chars": 826,
"preview": "#!/usr/bin/env python\n\nimport sys\nimport os\nimport filecmp\nimport shutil\nimport stat\n\n# Copies the commit-msg file into "
},
{
"path": "tox.ini",
"chars": 186,
"preview": "[tox]\nplatform = darwin\n\nenvlist = py35\n\n[testenv]\nwhitelist_externals =\n\tcoverage\n\ndeps =\n\tcoverage\n\nsitepackages = Tru"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the samdmarshall/nslocalizer GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 115 files (242.3 KB), approximately 61.1k tokens, and a symbol index with 199 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.