-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bad1ceb
commit 6fcd6a5
Showing
3 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains 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,14 +1,27 @@ | ||
from abc import ABC | ||
|
||
from ..constants import AnnotationFlag | ||
from ..generic import NameObject | ||
from ..generic._data_structures import DictionaryObject | ||
|
||
NO_FLAGS = AnnotationFlag(0) | ||
|
||
|
||
class AnnotationDictionary(DictionaryObject, ABC): | ||
def __init__(self) -> None: | ||
from ..generic._base import NameObject | ||
|
||
# "rect" should not be added here as PolyLine can automatically set it | ||
self[NameObject("/Type")] = NameObject("/Annot") | ||
# The flags was NOT added to the constructor on purpose: We expect that | ||
# most users don't want to change the default. If they want, they | ||
# can use the property. The default is 0. | ||
|
||
@property | ||
def flags(self) -> AnnotationFlag: | ||
return self.get(NameObject("/F"), AnnotationFlag(0)) | ||
|
||
@flags.setter | ||
def flags(self, value: AnnotationFlag) -> None: | ||
self[NameObject("/F")] = value | ||
|
||
|
||
NO_FLAGS = AnnotationFlag(0) |
This file contains 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 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