Skip to content

Jules #3656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 4, 2024
Merged

Jules #3656

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
branch: 'CLA'
allowlist:

# the followings are the optional inputs - If the optional inputs are not given, then default values will be taken
# the following are the optional inputs - If the optional inputs are not given, then default values will be taken
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
Expand Down
4 changes: 2 additions & 2 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ button.cta a {
:target>h1:first-of-type, span:target~h1:first-of-type {
background-color: #007aff !important;
color: #fff !important;
padding-top: 40px; /* accomodates header search blocking target */
padding-top: 40px; /* accommodates header search blocking target */
margin-top: -40px;
}

Expand All @@ -182,7 +182,7 @@ button.cta a {
span:target~h2:first-of-type, span:target~h3:first-of-type,
span:target~h4:first-of-type, span:target~h5:first-of-type, span:target~h6:first-of-type {
background-color: transparent !important;
padding-top: 40px; /* accomodates header search blocking target */
padding-top: 40px; /* accommodates header search blocking target */
margin-top: -40px;
text-decoration: underline;
}
Expand Down
6 changes: 3 additions & 3 deletions docs/_static/pymupdf-console.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,15 @@
window.term.exec("data = await r.bytes()");
window.term.exec("doc = fitz.Document(stream=data)");

function pressEnter() {
function pressEnter() { // codespell:ignore
window.term.invoke_key("ENTER");
}

setTimeout(pressEnter,1000);
setTimeout(pressEnter,1000); // codespell:ignore


}

</script>
</body>
</html>
</html>
2 changes: 1 addition & 1 deletion docs/annot.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ There is a parent-child relationship between an annotation and its page. If the
================================== ==============================================================
**Attribute** **Short Description**
================================== ==============================================================
:meth:`Annot.delete_responses` delete all responding annotions
:meth:`Annot.delete_responses` delete all responding annotations
:meth:`Annot.get_file` get attached file content
:meth:`Annot.get_oc` get :data:`xref` of an :data:`OCG` / :data:`OCMD`
:meth:`Annot.get_pixmap` image of the annotation as a pixmap
Expand Down
2 changes: 1 addition & 1 deletion docs/footer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
document.getElementById("footerDisclaimer").innerHTML = getHeaderAndFooterTranslation("This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at <a href='https://www.artifex.com?utm_source=rtd-pymupdf&utm_medium=rtd&utm_content=footer-link'>artifex.com</a> or contact Artifex Software Inc., 39 Mesa Street, Suite 108A, San Francisco CA 94129, United States for further information.");


// more tranlsation for admonition-title as the in-built translation isn't great, needs: 注釈 -> 注
// more translation for admonition-title as the in-built translation isn't great, needs: 注釈 -> 注
if (docLanguage == "ja") {
const collection = document.getElementsByClassName("admonition-title");
for (var i=0;i<collection.length;i++) {
Expand Down
2 changes: 1 addition & 1 deletion docs/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Glossary

.. data:: coordinate

This is an esential general mathematical / geometrical term for understanding this documentation. Please see this section for a more detailed discussion: :ref:`Coordinates`.
This is an essential general mathematical / geometrical term for understanding this documentation. Please see this section for a more detailed discussion: :ref:`Coordinates`.

.. data:: matrix_like

Expand Down
2 changes: 1 addition & 1 deletion docs/locales/ja/LC_MESSAGES/annot.po
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ msgid ":meth:`Annot.delete_responses`"
msgstr ""

#: ../../annot.rst:18 4bb5054e003e4a0eab4557a602962f43
msgid "delete all responding annotions"
msgid "delete all responding annotations"
msgstr "すべての応答アノテーションを削除します"

#: ../../annot.rst:19 be33f456bc764e028444f979903ac32d
Expand Down
2 changes: 1 addition & 1 deletion docs/locales/ja/LC_MESSAGES/glossary.po
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ msgstr "用語集"

#: ../../glossary.rst:11 d9645c6f37d7406983e6e2be167f78d4
msgid ""
"This is an esential general mathematical / geometrical term for "
"This is an essential general mathematical / geometrical term for "
"understanding this documentation. Please see this section for a more "
"detailed discussion: :ref:`Coordinates`."
msgstr ""
Expand Down
6 changes: 3 additions & 3 deletions docs/locales/ja/LC_MESSAGES/page.po
Original file line number Diff line number Diff line change
Expand Up @@ -4089,7 +4089,7 @@ msgstr "extended=Trueを指定すると、出力が大幅に変更されます
#: ../../page.rst:1549 ccaea771d67d4124863f8fae82b372c6
msgid ""
"Any path with a smaller level value than its predecessor will end the "
"scope of (at least) the preceeding hierarchy level. A \"clip\" path with "
"scope of (at least) the preceding hierarchy level. A \"clip\" path with "
"the same level as the preceding clip will end the scope of that clip. "
"Same is true for groups. This is best explained by an example::"
msgstr ""
Expand Down Expand Up @@ -6171,7 +6171,7 @@ msgstr ""
#~ msgstr ""

#~ msgid ""
#~ "The text may inlude arbitrary languages"
#~ "The text may include arbitrary languages"
#~ " -- **including right-to-left** "
#~ "languages."
#~ msgstr ""
Expand Down Expand Up @@ -6218,7 +6218,7 @@ msgstr ""
#~ "locations where to find images or "
#~ "non-standard fonts. If `text` refers "
#~ "to images, this parameter is always "
#~ "reqired. Ignored if `text` is a "
#~ "required. Ignored if `text` is a "
#~ "Story."
#~ msgstr ""

Expand Down
2 changes: 1 addition & 1 deletion docs/locales/ja/LC_MESSAGES/recipes-optional-content.po
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ msgstr "画像からOCGを削除するには、 `doc.set_oc(img_xref, 0)` を行

#: ../../recipes-optional-content.rst:45 fdd9ff2041064cf1896e01be1b5f2a33
msgid ""
"One single OCG can be assigned to mutiple PDF objects to control their "
"One single OCG can be assigned to multiple PDF objects to control their "
"visibility."
msgstr "1つのOCGは複数のPDFオブジェクトに割り当てて、それらの可視性を制御することができます。"

Expand Down
2 changes: 1 addition & 1 deletion docs/locales/ja/LC_MESSAGES/recipes-stories.po
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ msgstr "行の高さは、行のコンテンツに基づいて自動的に計算
msgid ""
"The potentially multiple lines of a table row will always be kept "
"together on one page (respectively \"where\" rectangle) and not be "
"splitted."
"split."
msgstr "テーブルの行の潜在的に複数行は、常に1つのページ(または “where” 矩形)にまとめて表示され、分割されることはありません。"

#: ../../recipes-stories.rst:339 de42a46ba1aa49ca96c4df690d752869
Expand Down
2 changes: 1 addition & 1 deletion docs/locales/ja/LC_MESSAGES/the-basics.po
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ msgid ""
"document page to denote an area on the page which should be securely "
"removed. After marking an area with a rectangle then this area will be "
"marked for *redaction*, once the redaction is *applied* then the content "
"is securly removed."
"is securely removed."
msgstr "マーキングされた領域に矩形を使用して、ページ上の削除されるべき領域を示すために、赤字が付けられる特別なアノテーションです。領域に矩形をマークした後、その領域は赤字としてマークされ、赤字が適用されると、そのコンテンツは安全に削除されます。"

#: ../../the-basics.rst:1006 a52332e215d34f1d9476e8384fea523b
Expand Down
2 changes: 1 addition & 1 deletion docs/locales/ja/LC_MESSAGES/vars.po
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ msgstr "3 – 別のファイル(任意の「実行可能」タイプ)を開

#: ../../vars.rst:277 e30d8ee2f8c9484eaa1de892c496a67f
msgid ""
"|PyMuPDF| treats any external link that starts wth `file:` or doesn't "
"|PyMuPDF| treats any external link that starts with `file:` or doesn't "
"contain a colon, as `LINK_LAUNCH`."
msgstr "PyMuPDFは、 `file:` で始まるかコロンを含まない外部リンクを `LINK_LAUNCH` として扱います。"

Expand Down
2 changes: 1 addition & 1 deletion docs/page.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1546,7 +1546,7 @@ In a nutshell, this is what you can do with PyMuPDF:

Specifying `extended=True` significantly alters the output. Most importantly, new dictionary types are present: "clip" and "group". All paths will now be organized in a hierarchic structure which is encoded by the new integer key "level", the hierarchy level. Each group or clip establishes a new hierarchy, which applies to all subsequent paths having a *larger* level value. (New in v1.22.0)

Any path with a smaller level value than its predecessor will end the scope of (at least) the preceeding hierarchy level. A "clip" path with the same level as the preceding clip will end the scope of that clip. Same is true for groups. This is best explained by an example::
Any path with a smaller level value than its predecessor will end the scope of (at least) the preceding hierarchy level. A "clip" path with the same level as the preceding clip will end the scope of that clip. Same is true for groups. This is best explained by an example::

+------+------+--------+------+--------+
| line | lvl0 | lvl1 | lvl2 | lvl3 |
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes-optional-content.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ If you want to put an **existing** image under the control of an OCG, you must f

To **remove** an OCG from an image, do `doc.set_oc(img_xref, 0)`.

One single OCG can be assigned to mutiple PDF objects to control their visibility.
One single OCG can be assigned to multiple PDF objects to control their visibility.

How to Define Complex Optional Content Conditions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes-stories.rst
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ Outputting HTML tables is supported as follows:
* Column widths are computed automatically based on column content. They cannot be directly set.
* Table **cells may contain images** which will be considered in the column width calculation magic.
* Row heights are computed automatically based on row content - leading to multi-line rows where needed.
* The potentially multiple lines of a table row will always be kept together on one page (respectively "where" rectangle) and not be splitted.
* The potentially multiple lines of a table row will always be kept together on one page (respectively "where" rectangle) and not be split.
* Table header rows are only **shown on the first page / "where" rectangle.**
* The "style" attribute is ignored when given directly in HTML table elements. Styling for a table and its elements must happen separately, in CSS source or within the :htmlTag:`style` tag.
* Styling for :htmlTag:`tr` elements is not supported and ignored. Therefore, a table-wide grid or alternating row background colors are not supported. One of the following example scripts however shows an easy way to deal with this limitation.
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes-text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ As these four font files are located in the system's folder `C:/Windows/Fonts` t

# These statements define which font file to use for regular, bold,
# italic and bold-italic text.
# We assign an arbitary common font-family for all 4 font files.
# We assign an arbitrary common font-family for all 4 font files.
# The Story algorithm will select the right file as required.
# We request to use "comic" throughout the text.
css = """
Expand Down
2 changes: 1 addition & 1 deletion docs/the-basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ Annotations (:ref:`Annot`) on pages can be retrieved with the `page.annots()` me
Redacting content from a **PDF**
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Redactions are special types of annotations which can be marked onto a document page to denote an area on the page which should be securely removed. After marking an area with a rectangle then this area will be marked for *redaction*, once the redaction is *applied* then the content is securly removed.
Redactions are special types of annotations which can be marked onto a document page to denote an area on the page which should be securely removed. After marking an area with a rectangle then this area will be marked for *redaction*, once the redaction is *applied* then the content is securely removed.

For example if we wanted to redact all instances of the name "Jane Doe" from a document we could do the following:

Expand Down
2 changes: 1 addition & 1 deletion docs/vars.rst
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ Possible values of :attr:`linkDest.kind` (link destination kind).

3 -- Launch (open) another file (of any "executable" type).

* |PyMuPDF| treats any external link that starts wth `file:` or doesn't
* |PyMuPDF| treats any external link that starts with `file:` or doesn't
contain a colon, as `LINK_LAUNCH`.

:type: int
Expand Down
8 changes: 4 additions & 4 deletions pipcl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ def build_extension(
debug2 = ''
if debug:
debug2 = '/Zi' # Generate .pdb.
# debug2 = '/Z7' # Embded debug info in .obj files.
# debug2 = '/Z7' # Embedded debug info in .obj files.

# As of 2023-08-23, it looks like VS tools create slightly
# .dll's each time, even with identical inputs.
Expand All @@ -1493,7 +1493,7 @@ def build_extension(

# Input/output files:
{T}{path_cpp} # /Tp specifies C++ source file.
/Fo{path_obj} # Output file.
/Fo{path_obj} # Output file. codespell:ignore

# Include paths:
{includes_text}
Expand Down Expand Up @@ -1786,7 +1786,7 @@ def git_items( directory, submodules=False):
ret = []
for path in text.decode('utf8').strip().split( '\n'):
path2 = os.path.join(directory, path)
# Sometimes git ls-files seems to list empty/non-existant directories
# Sometimes git ls-files seems to list empty/non-existent directories
# within submodules.
#
if not os.path.exists(path2):
Expand Down Expand Up @@ -1832,7 +1832,7 @@ def run( command, capture=False, check=1, verbose=1):
nl = '\n'
if verbose:
log1( f'Running: {nl.join(lines)}')
sep = ' ' if windows() else '\\\n'
sep = ' ' if windows() else ' \\\n'
command2 = sep.join( lines)
cp = subprocess.run(
command2,
Expand Down
2 changes: 1 addition & 1 deletion scripts/gh_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ def platform_tag():
assert 0, f'Unrecognised: {platform.system()=}'


test_packages = 'pytest fontTools pymupdf-fonts flake8 pylint'
test_packages = 'pytest fontTools pymupdf-fonts flake8 pylint codespell'
if platform.system() == 'Windows' and cpu_bits() == 32:
# No pillow wheel available, and doesn't build easily.
pass
Expand Down
6 changes: 3 additions & 3 deletions scripts/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
Location of local mupdf/ directory or 'git:...' to be used
when building PyMuPDF. [This sets environment variable
PYMUPDF_SETUP_MUPDF_BUILD, which is used by PyMuPDF/setup.py. If not
specifed PyMuPDF will download its default mupdf .tgz.]
specified PyMuPDF will download its default mupdf .tgz.]
-p <pytest-options>
Set pytest options; default is ''.
-t <names>
Expand Down Expand Up @@ -363,7 +363,7 @@ def build(
env_extra['PYMUPDF_SETUP_MUPDF_REBUILD'] = '0'
if build_type:
env_extra['PYMUPDF_SETUP_MUPDF_BUILD_TYPE'] = build_type
gh_release.run(f'pip install{build_isolation_text} -vv {pymupdf_dir}', env_extra=env_extra)
gh_release.run(f'pip install{build_isolation_text} -v {pymupdf_dir}', env_extra=env_extra)


def test(
Expand Down Expand Up @@ -440,7 +440,7 @@ def test(
elif gdb:
command = f'{python} {pymupdf_dir_rel}/tests/run_compound.py{run_compound_args} gdb --args {python} -m pytest {pytest_options} {pytest_arg}'
elif platform.system() == 'Windows':
# `python -m pytest` doesn' seem to work.
# `python -m pytest` doesn't seem to work.
command = f'{python} {pymupdf_dir_rel}/tests/run_compound.py{run_compound_args} pytest {pytest_options} {pytest_arg}'
else:
# On OpenBSD `pip install pytest` doesn't seem to install the pytest
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,8 @@ def get_mupdf_internal(out, location=None, sha=None, local_tgz=None):
location:
First, if None we set to hard-coded default URL or git location.
If starts with 'git:', should be remote git location.
Otherwise if containg '://' should be URL for .tgz.
Otherwise shuld path of local mupdf checkout.
Otherwise if containing '://' should be URL for .tgz.
Otherwise should path of local mupdf checkout.
sha:
If not None and we use git clone, we checkout this sha.
local_tgz:
Expand Down Expand Up @@ -658,7 +658,7 @@ def env_add(env, name, value, sep=' ', prepend=False, verbose=False):
'''
Appends/prepends `<value>` to `env[name]`.

If `name` is not in `env`, we use os.environ[nane] if it exists.
If `name` is not in `env`, we use os.environ[name] if it exists.
'''
v = env.get(name)
if verbose:
Expand Down Expand Up @@ -822,7 +822,7 @@ def get_mupdf_version(mupdf_dir):
v0 = re.search('#define FZ_VERSION_MAJOR ([0-9]+)', text)
v1 = re.search('#define FZ_VERSION_MINOR ([0-9]+)', text)
v2 = re.search('#define FZ_VERSION_PATCH ([0-9]+)', text)
assert v0 and v1 and v2, f'Cannot find MuPDF version numers in {path=}.'
assert v0 and v1 and v2, f'Cannot find MuPDF version numbers in {path=}.'
v0 = int(v0.group(1))
v1 = int(v1.group(1))
v2 = int(v2.group(1))
Expand Down Expand Up @@ -1245,7 +1245,7 @@ def platform_release_tuple():
print(f'MacOS/arm64: forcing use of libclang 16.0.6 because 18.1.1 known to fail with `clang.cindex.TranslationUnitLoadError: Error parsing translation unit.`')
ret.append('libclang==16.0.6')
elif darwin and platform_release_tuple() < (18,):
# There are still of ptoblems when building on old macos.
# There are still of problems when building on old macos.
ret.append('libclang==14.0.6')
else:
ret.append('libclang')
Expand Down
Loading
Loading