Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improve lib.py. #790

Merged
merged 28 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
db41c34
Improve `contour.py`.
knutnergaard Nov 20, 2024
28991cc
Change `test_segments_empty` to accomodate change in `BaseContour._ge…
knutnergaard Nov 20, 2024
f0f9961
Add improve remaining documentation.
knutnergaard Nov 21, 2024
592bf55
Format fixes by ruff
knutnergaard Nov 21, 2024
39e60b1
erge branch 'v1' into contour
knutnergaard Nov 21, 2024
ac2adee
Solve mypy errors.
knutnergaard Nov 22, 2024
5800ca8
Resolve `mypy` errors.
knutnergaard Nov 22, 2024
0f4f2ee
Format fixes by ruff
knutnergaard Nov 22, 2024
58aa027
Resolve `tox` errors.
knutnergaard Nov 22, 2024
78198df
Format fixes by ruff
knutnergaard Nov 22, 2024
310acb8
Solve merge conflict.
knutnergaard Nov 22, 2024
b574876
Add documentation to `bPoints`.
knutnergaard Nov 22, 2024
7faeb09
Merge branch 'v1' into lib
knutnergaard Nov 22, 2024
e7ba875
Merge branch 'v1' into lib
knutnergaard Nov 22, 2024
afecbe3
Add type annotations.
knutnergaard Nov 24, 2024
c6051e3
Add/imporove documentation and annotation.
knutnergaard Nov 25, 2024
ae7328f
Solve mypy errors.
knutnergaard Nov 25, 2024
ae1dcbb
Format fixes by ruff
knutnergaard Nov 25, 2024
077277a
Revert changes to `contour.py`.
knutnergaard Nov 25, 2024
63c0aa9
Revert changes to `test_contour.py`.
knutnergaard Nov 25, 2024
8139d20
Handle specific lib value types and imporve `normalizers.py`.
knutnergaard Nov 27, 2024
e05b343
Delete unused `TypeVar`.
knutnergaard Nov 27, 2024
b62d436
Format fixes by ruff
knutnergaard Nov 27, 2024
ef2ce35
Resolve tox errors.
knutnergaard Nov 27, 2024
2bc3c0e
Merge branch 'lib' of https://github.com/knutnergaard/fontParts into lib
knutnergaard Nov 27, 2024
6f3323c
Add cross reference to `plistlib` in `normalizeLibValue` docstring.
knutnergaard Nov 27, 2024
6dff7c5
Tweaks based on review
benkiel Nov 29, 2024
9fd1734
Backing out one change I rethought
benkiel Nov 29, 2024
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
13 changes: 13 additions & 0 deletions Lib/fontParts/base/annotations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# pylint: disable=C0103, C0114
from __future__ import annotations
from typing import Dict, List, Protocol, Tuple, TypeVar, Union
import datetime

from fontTools.pens.basePen import AbstractPen
from fontTools.pens.pointPen import AbstractPointPen
Expand Down Expand Up @@ -31,6 +32,18 @@
# Kerning
KerningDictType = Dict[PairType[str], PairType[str]]

# Lib
LibValueType = Union[
str,
IntFloatType,
bool,
CollectionType["LibValueType"],
Dict[str, "LibValueType"],
bytes,
bytearray,
datetime.datetime,
]

# Transformation
TransformationType = Union[IntFloatType, List[IntFloatType], PairType[IntFloatType]]

Expand Down
Loading