Skip to content
Open
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
1 change: 0 additions & 1 deletion stubs/reportlab/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.EVEN_ODD
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.FILL_EVEN_ODD
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.FILL_NON_ZERO
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.NON_ZERO_WINDING
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.STATE_DEFAULTS
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.decimalSymbol
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.pi
reportlab\.graphics\.render(base|PDF|PM|PS|SVG)\.shapeChecking
Expand Down
2 changes: 1 addition & 1 deletion stubs/reportlab/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "5.0.0"
version = "5.1.0"
# GitHub mirror of https://hg.reportlab.com/hg-public/reportlab/file
upstream-repository = "https://github.com/MrBitBucket/reportlab-mirror"

Expand Down
2 changes: 1 addition & 1 deletion stubs/reportlab/reportlab/graphics/charts/legends.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class TotalAnnotator(LegendColEndCallout):
self,
lText: str = "Total",
rText: str = "0.0",
fontName="Times-Roman",
fontName: str | None = None,
fontSize: int = 10,
fillColor=...,
strokeWidth: float = 0.5,
Expand Down
7 changes: 6 additions & 1 deletion stubs/reportlab/reportlab/graphics/shapes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,12 @@ __version__: Final[str]
isOpacity: NoneOr
NON_ZERO_WINDING: Final[str]
EVEN_ODD: Final[str]
STATE_DEFAULTS: Final[Incomplete]

class RL_STATE_DEFAULTS(dict[str, Any]):
def get(self, x: str, default: Any = None) -> Any: ... # type: ignore[override]
def copy(self) -> dict[str, Any]: ...

STATE_DEFAULTS: Final[RL_STATE_DEFAULTS]

class _DrawTimeResizeable: ...

Expand Down
2 changes: 1 addition & 1 deletion stubs/reportlab/reportlab/graphics/utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def text2Path(
text,
x: int = 0,
y: int = 0,
fontName="Times-Roman",
fontName: str | None = None,
fontSize: int = 1000,
anchor: str = "start",
truncate: int = 1,
Expand Down
9 changes: 0 additions & 9 deletions stubs/reportlab/reportlab/lib/extformat.pyi

This file was deleted.

51 changes: 48 additions & 3 deletions stubs/reportlab/reportlab/lib/rl_safe_eval.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,24 @@ import ast
import math
import re
import time
import types
from _typeshed import Incomplete
from collections.abc import Generator
from collections.abc import Generator, Iterable
from typing import Any, type_check_only
from typing_extensions import Never, Self

eval_debug: int
strTypes: tuple[type[bytes], type[str]]
isPy39: bool
isPy313: bool

class FilteredModule:
def __init__(
self, m: types.ModuleType, mnames: str | tuple[str, ...] = (), mpattern: re.Pattern[str] | None = None
) -> None: ...
def __getattr__(self, a: str) -> Any: ...
def __eq__(self, other: object) -> bool: ...

class BadCode(ValueError): ...

augOps: dict[ast.operator, str]
Expand Down Expand Up @@ -164,6 +173,7 @@ def safer_globals(g=None): ...

math_log10 = math.log10
__rl_undef__: Incomplete
GenericAlias: Incomplete

class __RL_SAFE_ENV__:
__time_time__ = time.time
Expand All @@ -176,6 +186,7 @@ class __RL_SAFE_ENV__:
real_bi: Incomplete
bi_replace: Incomplete
__rl_builtins__: Incomplete
__rl_mpattern__: re.Pattern[str] | None
def __init__(self, timeout=None, allowed_magic_methods=None, allowed_magic_names=None) -> None: ...
def __rl_type__(self, *args): ...
def __rl_check__(self) -> None: ...
Expand All @@ -198,9 +209,12 @@ class __RL_SAFE_ENV__:
def __rl_frozenset__(self, it=()): ...
def __rl_iter_unpack_sequence__(self, it, spec, _getiter_) -> Generator[Incomplete]: ...
def __rl_unpack_sequence__(self, it, spec, _getiter_): ...
def __rl_allowed_obj__(self, obj) -> None: ...
def __rl_is_allowed_name__(self, name, crash: bool = True) -> bool: ...
def __rl_getattr__(self, obj, a, *args): ...
def __rl_getitem__(self, obj, a): ...
def __inner_rl_getitem__(self, obj, a): ...
def __rl_setattr__(self, obj, a, v, *args): ...
__rl_tmax__: int
__rl_max_len__: int
__rl_max_pow_digits__: int
Expand All @@ -216,14 +230,34 @@ class __RL_SAFE_ENV__:
): ...
__rl_limit__: Incomplete
def __rl_safe_eval__(
self, expr, g, l, mode, timeout=None, allowed_magic_methods=None, __frame_depth__: int = 3, allowed_magic_names=None
self,
expr,
g,
l,
mode,
timeout=None,
allowed_magic_methods=None,
__frame_depth__: int = 3,
allowed_magic_names=None,
mnames: str | tuple[str, ...] = (),
excluded_names: Iterable[str] | None = None,
): ...

class __rl_safe_eval__:
mode: str
env: Incomplete
def __init__(self) -> None: ...
def __call__(self, expr, g=None, l=None, timeout=None, allowed_magic_methods=None, allowed_magic_names=None): ...
def __call__(
self,
expr,
g=None,
l=None,
timeout=None,
allowed_magic_methods=None,
allowed_magic_names=None,
mnames: str | tuple[str, ...] = (),
excluded_names: Iterable[str] | None = None,
): ...

class __rl_safe_exec__(__rl_safe_eval__):
mode: str
Expand All @@ -235,3 +269,14 @@ rl_safe_eval: __rl_safe_eval__

def __fix_set__(value, default=...): ...
def rl_less_safe_eval(expr, NS): ...

@type_check_only
class _DefaultNamespace:
class ModuleChangeDetector(types.ModuleType):
def __setattr__(self, a: str, v: object) -> None: ...
def __delattr__(self, a: str) -> None: ...

def __call__(self, warn: bool = False) -> dict[str, Any]: ...
def check(self, strict: bool = False) -> None: ...

DefaultNamespace: _DefaultNamespace
3 changes: 1 addition & 2 deletions stubs/reportlab/reportlab/lib/rltempfile.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
def get_rl_tempdir(*subdirs: str) -> str: ...
def get_rl_tempfile(fn: str | None = None) -> str: ...

# The duplicate entry matches the runtime __all__.
__all__ = ("get_rl_tempdir", "get_rl_tempdir") # ruff: ignore[duplicate-entry-in-dunder-all]
__all__ = ("get_rl_tempdir", "get_rl_tempfile")
2 changes: 1 addition & 1 deletion stubs/reportlab/reportlab/lib/utils.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ArgvDictValue:
def getArgvDict(**kw): ...
def getHyphenater(hDict=None): ...
def open_for_read_by_name(name, mode: str = "b"): ...
def rlUrlRead(name: str, headers: MutableMapping[str, str] | None = None) -> _UrlopenRet: ...
def rlUrlRead(url: str, headers: MutableMapping[str, str] | None = None) -> _UrlopenRet: ...
def open_for_read(name, mode: str = "b"): ...
def open_and_read(name, mode: str = "b"): ...
def open_and_readlines(name, mode: str = "t"): ...
Expand Down
21 changes: 18 additions & 3 deletions stubs/reportlab/reportlab/pdfbase/pdfmetrics.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
from _typeshed import Incomplete, StrOrBytesPath
from typing import Final, Literal
from typing import ClassVar, Final, Literal

from reportlab.lib.rl_accel import unicode2T1 as unicode2T1
from reportlab.pdfbase.pdfdoc import PDFDictionary

__version__: Final[str]
standardFonts: Incomplete
standardEncodings: Incomplete
reportlab_fonts_dir: str
font2fnrMap: dict[str, str]

def __standardFontsChange__() -> None: ...

class FontError(Exception): ...
class FontNotFoundError(Exception): ...
Expand Down Expand Up @@ -67,14 +71,16 @@ class EmbeddedType1Face(TypeFace):
afmFileName: Incomplete
pfbFileName: Incomplete
requiredEncoding: Incomplete
def __init__(self, afmFileName, pfbFileName) -> None: ...
def __init__(self, afmFileName, pfbFileName, faceName: str | None = None) -> None: ...
def getFontFiles(self) -> list[Incomplete]: ...
def addObjects(self, doc): ...

def registerTypeFace(face) -> None: ...
def registerEncoding(enc) -> None: ...
def registerFontFamily(family, normal=None, bold=None, italic=None, boldItalic=None) -> None: ...
def registerFontFamily(family, normal=None, bold=None, italic=None, boldItalic=None, baseFontFor: str = "") -> None: ...
def registerFont(font) -> None: ...
def faceFromAFM(afm: str, faceName: str | None = None) -> EmbeddedType1Face: ...
def faceFromRLFD(fnr: str, faceName: str) -> EmbeddedType1Face: ...
def getTypeFace(faceName) -> TypeFace: ...
def getEncoding(encName) -> Encoding: ...
def findFontAndRegister(fontName: str) -> Font: ...
Expand All @@ -86,5 +92,14 @@ def getRegisteredFontNames() -> list[Incomplete]: ...
def stringWidth(text: str | bytes, fontName: str, fontSize: float, encoding: str = "utf8") -> float: ...
def dumpFontData() -> None: ...
def test3widths(texts) -> None: ...

class BaseFontName:
__k2t__: ClassVar[tuple[tuple[tuple[str, ...], tuple[int, int]], ...]]
def __init__(self, bfna: str) -> None: ...
def __call__(self, kind: str = "normal", default: str | None = None) -> str: ...

baseGFont: BaseFontName
baseCFont: BaseFontName

def testStringWidthAlgorithms() -> None: ...
def test() -> None: ...
3 changes: 2 additions & 1 deletion stubs/reportlab/reportlab/platypus/flowables.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ class KeepTogetherSplitAtTop(KeepTogether):

class Macro(Flowable):
command: str
def __init__(self, command: str) -> None: ...
g: dict[str, Any] | None
def __init__(self, command: str, g: dict[str, Any] | None = None) -> None: ...
def draw(self) -> None: ...

class CallerMacro(Flowable):
Expand Down
1 change: 1 addition & 0 deletions stubs/reportlab/reportlab/rl_config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ textPaths: str
toColorCanUse: str
defCWRF: float
unShapedFontGlob: list[str] | None
std14Embed: bool
T1SearchPath: list[str]
TTFSearchPath: list[str]
CMapSearchPath: list[str]
2 changes: 2 additions & 0 deletions stubs/reportlab/reportlab/rl_settings.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ textPaths: Final[str]
toColorCanUse: Final[str]
defCWRF: Final[float]
unShapedFontGlob: list[str] | None
std14Embed: Final[bool]
T1SearchPath: Final[tuple[str, ...]]
TTFSearchPath: Final[tuple[str, ...]]
CMapSearchPath: Final[tuple[str, ...]]
Expand Down Expand Up @@ -137,4 +138,5 @@ __all__ = (
"toColorCanUse",
"defCWRF",
"unShapedFontGlob",
"std14Embed",
)
Loading