Skip to content

Commit

Permalink
perform proposed renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan6419846 committed Jan 9, 2024
1 parent 316471c commit 8ed9a9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pypdf/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _is_reserved(cls, name: str) -> bool:
return name.startswith("R") and name[1:].isdigit()

@classmethod
def _defaults_to_one(cls, name: str) -> bool:
def _is_active(cls, name: str) -> bool:
"""Check if the given reserved name defaults to 1 = active."""
return name not in {"R1", "R2"}

Expand All @@ -112,7 +112,7 @@ def from_dict(cls, value: Dict[str, bool]) -> "UserAccessPermissions":
for name, flag in cls.__members__.items():
if cls._is_reserved(name):
# Reserved names have a required value. Use it.
if cls._defaults_to_one(name):
if cls._is_active(name):
result |= flag
continue
is_active = value_copy.pop(name.lower(), False)
Expand Down

0 comments on commit 8ed9a9f

Please sign in to comment.