pasteup 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. pasteup-0.1.0/.github/workflows/release.yml +206 -0
  2. pasteup-0.1.0/.github/workflows/tests.yml +102 -0
  3. pasteup-0.1.0/.gitignore +6 -0
  4. pasteup-0.1.0/CHANGELOG.md +33 -0
  5. pasteup-0.1.0/LICENSE +202 -0
  6. pasteup-0.1.0/PKG-INFO +481 -0
  7. pasteup-0.1.0/README.md +445 -0
  8. pasteup-0.1.0/SECURITY.md +30 -0
  9. pasteup-0.1.0/pyproject.toml +72 -0
  10. pasteup-0.1.0/scripts/protect-repo.sh +145 -0
  11. pasteup-0.1.0/src/pasteup/__init__.py +3 -0
  12. pasteup-0.1.0/src/pasteup/__main__.py +4 -0
  13. pasteup-0.1.0/src/pasteup/cli.py +171 -0
  14. pasteup-0.1.0/src/pasteup/main.py +34 -0
  15. pasteup-0.1.0/src/pasteup/models/__init__.py +0 -0
  16. pasteup-0.1.0/src/pasteup/models/schemas.py +410 -0
  17. pasteup-0.1.0/src/pasteup/routes/__init__.py +0 -0
  18. pasteup-0.1.0/src/pasteup/routes/jobs.py +678 -0
  19. pasteup-0.1.0/src/pasteup/routes/ui.py +43 -0
  20. pasteup-0.1.0/src/pasteup/services/__init__.py +0 -0
  21. pasteup-0.1.0/src/pasteup/services/cover_collage.py +379 -0
  22. pasteup-0.1.0/src/pasteup/services/exporter.py +113 -0
  23. pasteup-0.1.0/src/pasteup/services/folder_scanner.py +164 -0
  24. pasteup-0.1.0/src/pasteup/services/grid_composer.py +199 -0
  25. pasteup-0.1.0/src/pasteup/services/image_batcher.py +21 -0
  26. pasteup-0.1.0/src/pasteup/services/video_exporter.py +227 -0
  27. pasteup-0.1.0/src/pasteup/shortcut.py +97 -0
  28. pasteup-0.1.0/src/pasteup/static/css/styles.css +983 -0
  29. pasteup-0.1.0/src/pasteup/static/favicon.svg +9 -0
  30. pasteup-0.1.0/src/pasteup/static/fonts/OFL-Caveat.txt +93 -0
  31. pasteup-0.1.0/src/pasteup/static/fonts/OFL-PatrickHand.txt +93 -0
  32. pasteup-0.1.0/src/pasteup/static/fonts/caveat-latin-700.woff2 +0 -0
  33. pasteup-0.1.0/src/pasteup/static/fonts/patrick-hand-latin-400.woff2 +0 -0
  34. pasteup-0.1.0/src/pasteup/static/js/app.js +1680 -0
  35. pasteup-0.1.0/src/pasteup/templates/index.html +309 -0
  36. pasteup-0.1.0/tests/conftest.py +5 -0
  37. pasteup-0.1.0/tests/test_batch_cover_collage_api.py +153 -0
  38. pasteup-0.1.0/tests/test_cli.py +212 -0
  39. pasteup-0.1.0/tests/test_cover_collage.py +451 -0
  40. pasteup-0.1.0/tests/test_cover_collage_api.py +229 -0
  41. pasteup-0.1.0/tests/test_generate_all_folders.py +206 -0
  42. pasteup-0.1.0/tests/test_generate_single_folder_video_status.py +80 -0
  43. pasteup-0.1.0/tests/test_grid_composer.py +34 -0
  44. pasteup-0.1.0/tests/test_image_batcher.py +19 -0
  45. pasteup-0.1.0/tests/test_page_dpi_and_geometry.py +45 -0
  46. pasteup-0.1.0/tests/test_partial_page_and_generation_options.py +264 -0
  47. pasteup-0.1.0/tests/test_request_safety.py +125 -0
  48. pasteup-0.1.0/tests/test_scan_folder_api.py +133 -0
  49. pasteup-0.1.0/tests/test_scan_selected_batch_folders.py +112 -0
  50. pasteup-0.1.0/tests/test_transparent_png_handling.py +65 -0
  51. pasteup-0.1.0/tests/test_ui_defaults.py +62 -0
  52. pasteup-0.1.0/tests/test_ui_generation_modes.py +124 -0
  53. pasteup-0.1.0/tests/test_video_exporter.py +186 -0
@@ -0,0 +1,206 @@
1
+ # Publish a tagged release to PyPI, the way sigrix-io/mullion does. Nothing else
2
+ # in this repository publishes, and nothing here runs on a branch: a release is
3
+ # a pushed `v*` tag, so publishing is an act with a name rather than a side
4
+ # effect of a merge.
5
+ #
6
+ # Trusted publishing (OIDC) rather than an API token: the runner trades a
7
+ # short-lived identity for the upload, so there is no long-lived secret in this
8
+ # repository to store, leak or rotate. PyPI must be told which repository,
9
+ # workflow file and environment it trusts: ftymoshchuk/pasteup, release.yml
10
+ # and `pypi` (see `environment:` below).
11
+ name: Release
12
+
13
+ on:
14
+ push:
15
+ tags: ["v*"]
16
+
17
+ # Read-only by default. Only the publish job widens this, and only to the one
18
+ # permission the OIDC exchange needs.
19
+ permissions:
20
+ contents: read
21
+
22
+ # Deliberately not cancelled in progress, unlike tests.yml: a run stopped
23
+ # mid-upload can leave a release half-landed, and PyPI never accepts the same
24
+ # version number twice, not even after the file is deleted.
25
+ concurrency:
26
+ group: release-${{ github.ref }}
27
+ cancel-in-progress: false
28
+
29
+ jobs:
30
+ # Everything that can say no, said before anything leaves the runner.
31
+ build:
32
+ runs-on: ubuntu-latest
33
+ # A fork can push a tag to itself; it must not build the artifacts this
34
+ # repository's trusted publisher would then be asked to upload.
35
+ if: github.repository == 'ftymoshchuk/pasteup'
36
+ steps:
37
+ # The releases tests.yml runs on (its v5 and v6), pinned by commit: this
38
+ # runs once per release, the worst moment to meet an action's new major.
39
+ - uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
40
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
41
+ with:
42
+ python-version: "3.13"
43
+
44
+ - run: python -m pip install build twine
45
+ - run: python -m build
46
+
47
+ # hatchling reads the version from src/pasteup/__init__.py; the tag is
48
+ # typed by hand, and nothing else makes the two agree. Tagging v0.2.0
49
+ # without the bump would publish 0.1.0 under a tag saying otherwise, or
50
+ # fail at the upload with an error naming neither cause.
51
+ - name: The tag names the version that was built
52
+ run: |
53
+ set -euo pipefail
54
+ tag="${GITHUB_REF_NAME#v}"
55
+ # pasteup-0.1.0-py3-none-any.whl -> 0.1.0. A wheel filename uses "-"
56
+ # as its separator, so a PEP 440 version never contains one.
57
+ built="$(basename "$(ls dist/*.whl)" | cut -d- -f2)"
58
+ echo "tag=${tag} built=${built}"
59
+ if [ "${tag}" != "${built}" ]; then
60
+ echo "::error::tag ${GITHUB_REF_NAME} does not name the packaged version ${built}. Bump __version__ in src/pasteup/__init__.py, or delete the tag and retag."
61
+ exit 1
62
+ fi
63
+
64
+ # Keep a Changelog puts the version in a heading, so both checks are
65
+ # exact. The second catches entries still filed under [Unreleased]: they
66
+ # are on the commit being tagged, so they ship while the changelog says
67
+ # they did not.
68
+ - name: The changelog names this version, and nothing is left unreleased
69
+ run: |
70
+ set -euo pipefail
71
+ export VERSION="${GITHUB_REF_NAME#v}"
72
+ python - <<'PY'
73
+ import os
74
+ import pathlib
75
+ import re
76
+
77
+ version = os.environ["VERSION"]
78
+ text = pathlib.Path("CHANGELOG.md").read_text()
79
+
80
+
81
+ def fail(message: str) -> None:
82
+ # stdout, not stderr: that is where GitHub reads ::error:: from.
83
+ print(message)
84
+ raise SystemExit(1)
85
+
86
+
87
+ if f"## [{version}]" not in text:
88
+ fail(
89
+ f"::error::CHANGELOG.md has no '## [{version}]' heading. Add it, or "
90
+ "move the Unreleased entries under it, before tagging."
91
+ )
92
+
93
+ section = re.search(
94
+ r"^##\s*\[Unreleased\]\s*$(.*?)(?=^##\s|\Z)",
95
+ text,
96
+ re.MULTILINE | re.DOTALL,
97
+ )
98
+ if section:
99
+ leftover = [
100
+ line
101
+ for line in section.group(1).splitlines()
102
+ if line.strip() and not line.lstrip().startswith("#")
103
+ ]
104
+ if leftover:
105
+ fail(
106
+ f"::error::CHANGELOG.md still files {len(leftover)} line(s) under "
107
+ f"[Unreleased], starting {leftover[0].strip()[:60]!r}. They ship in "
108
+ f"{version}: move them under '## [{version}]' before tagging."
109
+ )
110
+ PY
111
+
112
+ # A README that renders on GitHub but not on PyPI is otherwise found at
113
+ # the moment of publishing.
114
+ - run: python -m twine check --strict dist/*
115
+
116
+ # The preview-video tests encode real files; without ffmpeg they skip.
117
+ - name: Install ffmpeg
118
+ run: sudo apt-get update && sudo apt-get install --yes --no-install-recommends ffmpeg
119
+
120
+ # tests.yml proves the source tree; this proves the artifact, the only
121
+ # thing that matters once its bytes are immutable on PyPI. A template or
122
+ # font missing from the wheel fails here.
123
+ - name: The built wheel installs and passes the suite
124
+ run: |
125
+ set -euo pipefail
126
+ python -m venv /tmp/releasecheck
127
+ wheel="$(ls dist/*.whl)"
128
+ /tmp/releasecheck/bin/python -m pip install --quiet "${wheel}[dev]"
129
+ # The src layout leaves nothing in the checkout that `import pasteup`
130
+ # could find, so the suite can only be testing the wheel. Asserted
131
+ # rather than assumed.
132
+ /tmp/releasecheck/bin/python -c "import pasteup; assert 'site-packages' in pasteup.__file__, pasteup.__file__"
133
+ /tmp/releasecheck/bin/pasteup --version
134
+ /tmp/releasecheck/bin/python -m pytest -q tests/
135
+
136
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
137
+ with:
138
+ name: dist
139
+ path: dist/
140
+ if-no-files-found: error
141
+
142
+ # Separate from the build, so a failure above cannot half-publish: this job
143
+ # starts only when every check passed, and builds nothing itself.
144
+ publish:
145
+ needs: build
146
+ runs-on: ubuntu-latest
147
+ environment:
148
+ # PyPI's trusted publisher names this environment alongside the
149
+ # repository and the workflow filename; all three must match what is set
150
+ # up there. It is also where to add a required reviewer, should a release
151
+ # ever need a second pair of eyes.
152
+ name: pypi
153
+ url: https://pypi.org/p/pasteup
154
+ permissions:
155
+ # The only elevated permission in this file: it mints the OIDC token PyPI
156
+ # exchanges for an upload, and lets the action attach attestations.
157
+ id-token: write
158
+ steps:
159
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
160
+ with:
161
+ name: dist
162
+ path: dist/
163
+
164
+ # Pinned to the commit, not the tag: a tag can be moved by whoever owns
165
+ # the action, and this is the one step here holding a credential.
166
+ - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
167
+
168
+ # An upload that succeeded is not yet a package anyone can install. Install
169
+ # it by name from PyPI, the way a user would, and check it is this version
170
+ # and carries the app's files.
171
+ verify:
172
+ needs: publish
173
+ runs-on: ubuntu-latest
174
+ steps:
175
+ - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
176
+ with:
177
+ python-version: "3.13"
178
+
179
+ - name: The published package installs by name and runs
180
+ run: |
181
+ set -euo pipefail
182
+ version="${GITHUB_REF_NAME#v}"
183
+ python -m venv /tmp/published
184
+ # A fresh upload can take a few minutes to be served everywhere.
185
+ for attempt in $(seq 1 20); do
186
+ if /tmp/published/bin/python -m pip install --quiet --no-cache-dir "pasteup==${version}"; then
187
+ break
188
+ fi
189
+ if [ "${attempt}" = 20 ]; then
190
+ echo "::error::pasteup ${version} still cannot be installed from PyPI after 20 attempts."
191
+ exit 1
192
+ fi
193
+ sleep 15
194
+ done
195
+ cd /tmp
196
+ test "$(/tmp/published/bin/pasteup --version)" = "pasteup ${version}"
197
+ /tmp/published/bin/python - <<'PY'
198
+ import pathlib
199
+
200
+ import pasteup
201
+
202
+ root = pathlib.Path(pasteup.__file__).parent
203
+ for asset in ("templates/index.html", "static/js/app.js", "static/fonts/caveat-latin-700.woff2"):
204
+ assert (root / asset).is_file(), f"{asset} did not ship"
205
+ print("pasteup", pasteup.__version__, "installs from PyPI with its files")
206
+ PY
@@ -0,0 +1,102 @@
1
+ name: tests
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ concurrency:
12
+ group: ${{ github.workflow }}-${{ github.ref }}
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+ strategy:
19
+ fail-fast: false
20
+ matrix:
21
+ # 3.11 is the floor: mullion and the app's StrEnum use need it.
22
+ python-version: ["3.11", "3.12", "3.13"]
23
+ steps:
24
+ - uses: actions/checkout@v5
25
+
26
+ - uses: actions/setup-python@v6
27
+ with:
28
+ python-version: ${{ matrix.python-version }}
29
+ cache: pip
30
+ cache-dependency-path: pyproject.toml
31
+
32
+ # The preview-video tests encode real files; without ffmpeg they skip.
33
+ - name: Install ffmpeg
34
+ run: sudo apt-get update && sudo apt-get install --yes --no-install-recommends ffmpeg
35
+
36
+ # A regular (not editable) install, so the tests run against the built
37
+ # package and fail if a template or static file is left out of it.
38
+ - name: Install
39
+ run: pip install ".[dev]"
40
+
41
+ # Lint first: a slip fails in seconds rather than after the suite.
42
+ - name: Lint
43
+ run: ruff check .
44
+
45
+ - name: Test
46
+ run: pytest -rs
47
+
48
+ # The package as users get it from PyPI: build it, check the README renders
49
+ # there, and install the wheel where the checkout cannot stand in for it.
50
+ # The release workflow repeats this; here a slip shows up on the pull request
51
+ # instead of at release time.
52
+ build:
53
+ runs-on: ubuntu-latest
54
+ steps:
55
+ - uses: actions/checkout@v5
56
+
57
+ - uses: actions/setup-python@v6
58
+ with:
59
+ python-version: "3.13"
60
+
61
+ - run: python -m pip install build twine
62
+ - run: python -m build
63
+ - run: python -m twine check --strict dist/*
64
+
65
+ - name: The built wheel installs, runs and carries the app's files
66
+ run: |
67
+ set -euo pipefail
68
+ python -m venv /tmp/wheelcheck
69
+ /tmp/wheelcheck/bin/python -m pip install --quiet dist/*.whl
70
+ cd /tmp
71
+ /tmp/wheelcheck/bin/pasteup --version
72
+ /tmp/wheelcheck/bin/python - <<'PY'
73
+ import pathlib
74
+
75
+ import pasteup
76
+
77
+ root = pathlib.Path(pasteup.__file__).parent
78
+ assert "site-packages" in str(root), root
79
+ for asset in (
80
+ "templates/index.html",
81
+ "static/js/app.js",
82
+ "static/css/styles.css",
83
+ "static/favicon.svg",
84
+ "static/fonts/caveat-latin-700.woff2",
85
+ "static/fonts/patrick-hand-latin-400.woff2",
86
+ ):
87
+ assert (root / asset).is_file(), f"{asset} did not ship"
88
+ print("wheel ok:", pasteup.__version__)
89
+ PY
90
+
91
+ # The aggregate gate, as in sigrix-io/mullion: the one check the branch
92
+ # ruleset requires on main, so changing the matrix or adding a job does not
93
+ # mean editing the ruleset to match.
94
+ ci-passed:
95
+ if: always()
96
+ needs: [test, build]
97
+ runs-on: ubuntu-latest
98
+ steps:
99
+ - name: Every job succeeded
100
+ run: |
101
+ echo '${{ toJSON(needs) }}'
102
+ [ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" = "false" ]
@@ -0,0 +1,6 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ build/
5
+ dist/
6
+ *.egg-info/
@@ -0,0 +1,33 @@
1
+ # Changelog
2
+
3
+ All notable changes to Pasteup are recorded here. The format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and versions follow
5
+ [Semantic Versioning](https://semver.org/spec/v2.0.0.html). While Pasteup is
6
+ 0.x, a minor version may change behaviour.
7
+
8
+ ## [Unreleased]
9
+
10
+ ## [0.1.0] - 2026-10-16
11
+
12
+ The first release on PyPI.
13
+
14
+ ### Added
15
+ - Preview sheets: every image of a bundle in 4x3 grids on a white page, as PNG
16
+ or JPG, sized in pixels, inches or millimetres, with the DPI stamped into
17
+ the file. A part-filled last page is optional.
18
+ - Cover collages in three layouts, optionally limited to images you name.
19
+ - Preview videos: an MP4 slideshow of the sheets, as long as you ask, with a
20
+ crossfade or flip between them. Needs ffmpeg.
21
+ - Batch mode: every bundle folder inside a folder, listed, checked and made in
22
+ one go.
23
+ - Image clean-up: transparent PNGs land on white, phone photos are turned
24
+ upright, and near-white backgrounds can be made pure white or transparent.
25
+ - A hand-drawn browser interface in three steps, with each result beside the
26
+ step that made it. It runs entirely on your computer and needs no internet
27
+ connection.
28
+ - The `pasteup` command opens the app in your browser, reuses a copy that is
29
+ already running and moves to a free port when another program has 8000.
30
+ `pasteup --shortcut` makes a double-click launcher.
31
+
32
+ [Unreleased]: https://github.com/ftymoshchuk/pasteup/compare/v0.1.0...HEAD
33
+ [0.1.0]: https://github.com/ftymoshchuk/pasteup/releases/tag/v0.1.0
pasteup-0.1.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.