-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Update fpdf2 stubs to 2.6.1 #9546
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
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
eaaab5b
Update fpdf2 stubs to 2.6.1
srittau 2a98699
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1e0a195
Move stubtest dependency to correct path
srittau 2bbf381
Merge branch 'main' into fpdf2-2.6.1
AlexWaygood ccb8268
Remove obsolete noqas
srittau ce0bf38
Add fpdf.image_parsing.RESAMPLE
srittau 73a5a81
Update comment about FPDF.set_encryption()
srittau bebe274
Remove string literal defaults
srittau 95db1e4
Replace string defaults
srittau 4a81e0e
Apply suggestions from code review
srittau c35a6df
Fix PDFXrefAndTrailer.serialize() annotation
srittau File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cryptography |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
version = "2.6.0" | ||
requires = ["types-Pillow"] | ||
version = "2.6.1" | ||
requires = ["types-Pillow>=9.2.0"] | ||
|
||
[tool.stubtest] | ||
ignore_missing_stub = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
from _typeshed import Incomplete, SupportsLenAndGetItem | ||
from collections.abc import Generator, Iterable | ||
from typing import ClassVar, Protocol, TypeVar | ||
from typing_extensions import TypeAlias | ||
|
||
from .enums import EncryptionMethod | ||
from .fpdf import FPDF | ||
from .syntax import Name, PDFObject | ||
|
||
_Key: TypeAlias = SupportsLenAndGetItem[int] | ||
_T_co = TypeVar("_T_co", covariant=True) | ||
|
||
import_error: ImportError | None | ||
|
||
class _SupportsGetItem(Protocol[_T_co]): | ||
def __getitem__(self, __k: int) -> _T_co: ... | ||
|
||
class ARC4: | ||
MOD: ClassVar[int] | ||
def KSA(self, key: _Key) -> list[int]: ... | ||
def PRGA(self, S: _SupportsGetItem[int]) -> Generator[int, None, None]: ... | ||
def encrypt(self, key: _Key, text: Iterable[int]) -> list[int]: ... | ||
|
||
class CryptFilter: | ||
type: Name | ||
c_f_m: Name | ||
length: int | ||
def __init__(self, mode, length) -> None: ... | ||
def serialize(self) -> str: ... | ||
|
||
class EncryptionDictionary(PDFObject): | ||
filter: Name | ||
length: int | ||
r: int | ||
o: str | ||
u: str | ||
v: int | ||
p: int | ||
encrypt_metadata: str # not always defined | ||
c_f: str # not always defined | ||
stm_f: Name | ||
str_f: Name | ||
def __init__(self, security_handler: StandardSecurityHandler) -> None: ... | ||
|
||
class StandardSecurityHandler: | ||
DEFAULT_PADDING: ClassVar[bytes] | ||
fpdf: FPDF | ||
access_permission: int | ||
owner_password: str | ||
user_password: str | ||
encryption_method: EncryptionMethod | None | ||
cf: CryptFilter | None | ||
key_length: int | ||
v: int | ||
r: int | ||
srittau marked this conversation as resolved.
Show resolved
Hide resolved
|
||
encrypt_metadata: bool | ||
|
||
# The following fields are only defined after a call to generate_passwords(). | ||
file_id: Incomplete | ||
info_id: Incomplete | ||
o: str | ||
k: str | ||
u: str | ||
|
||
def __init__( | ||
self, | ||
fpdf: FPDF, | ||
owner_password: str, | ||
user_password: str | None = None, | ||
permission: Incomplete | None = None, | ||
encryption_method: EncryptionMethod | None = None, | ||
encrypt_metadata: bool = False, | ||
) -> None: ... | ||
def generate_passwords(self, file_id) -> None: ... | ||
def get_encryption_obj(self) -> EncryptionDictionary: ... | ||
def encrypt(self, text: str | bytes | bytearray, obj_id) -> bytes: ... | ||
def encrypt_string(self, string, obj_id): ... | ||
def encrypt_stream(self, stream, obj_id): ... | ||
def is_aes_algorithm(self) -> bool: ... | ||
def encrypt_bytes(self, data, obj_id) -> list[int]: ... | ||
def encrypt_AES_cryptography(self, key, data): ... | ||
def get_initialization_vector(self, size: int) -> bytearray: ... | ||
def padded_password(self, password: str) -> bytearray: ... | ||
def generate_owner_password(self) -> str: ... | ||
def generate_user_password(self) -> str: ... | ||
def generate_encryption_key(self) -> bytes: ... | ||
|
||
def md5(data: bytes) -> bytes: ... | ||
def int32(n: int) -> int: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.