1- # vim: sw=4:expandtab:foldmethod=marker
2- #
31# Copyright (c) 2006, Mathieu Fenniak
42# All rights reserved.
53#
@@ -114,7 +112,7 @@ def readFromStream(stream):
114112 if nulltxt != b_ ("null" ):
115113 raise utils .PdfReadError ("Could not read Null object" )
116114 return NullObject ()
117- readFromStream = staticmethod (readFromStream )
115+ readFromStream = staticmethod (readFromStream ) # type: ignore
118116
119117
120118class BooleanObject (PdfObject ):
@@ -136,7 +134,7 @@ def readFromStream(stream):
136134 return BooleanObject (False )
137135 else :
138136 raise utils .PdfReadError ('Could not read Boolean object' )
139- readFromStream = staticmethod (readFromStream )
137+ readFromStream = staticmethod (readFromStream ) # type: ignore
140138
141139
142140class ArrayObject (list , PdfObject ):
@@ -166,7 +164,7 @@ def readFromStream(stream, pdf):
166164 # read and append obj
167165 arr .append (readObject (stream , pdf ))
168166 return arr
169- readFromStream = staticmethod (readFromStream )
167+ readFromStream = staticmethod (readFromStream ) # type: ignore
170168
171169
172170class IndirectObject (PdfObject ):
@@ -219,7 +217,7 @@ def readFromStream(stream, pdf):
219217 if r != b_ ("R" ):
220218 raise utils .PdfReadError ("Error reading indirect object reference at byte %s" % utils .hexStr (stream .tell ()))
221219 return IndirectObject (int (idnum ), int (generation ), pdf )
222- readFromStream = staticmethod (readFromStream )
220+ readFromStream = staticmethod (readFromStream ) # type: ignore
223221
224222
225223class FloatObject (decimal .Decimal , PdfObject ):
@@ -270,7 +268,7 @@ def readFromStream(stream):
270268 return FloatObject (num )
271269 else :
272270 return NumberObject (num )
273- readFromStream = staticmethod (readFromStream )
271+ readFromStream = staticmethod (readFromStream ) # type: ignore
274272
275273
276274def createStringObject (string ):
@@ -391,7 +389,7 @@ def readStringFromStream(stream):
391389 return createStringObject (txt )
392390
393391
394- class ByteStringObject (utils .bytes_type , PdfObject ):
392+ class ByteStringObject (utils .bytes_type , PdfObject ): # type: ignore
395393 """
396394 Represents a string object where the text encoding could not be determined.
397395 This occurs quite often, as the PDF spec doesn't provide an alternate way to
@@ -413,7 +411,7 @@ def writeToStream(self, stream, encryption_key):
413411 stream .write (b_ (">" ))
414412
415413
416- class TextStringObject (utils .string_type , PdfObject ):
414+ class TextStringObject (utils .string_type , PdfObject ): # type: ignore
417415 """
418416 Represents a string object that has been decoded into a real unicode string.
419417 If read from a PDF document, this string appeared to match the
@@ -497,7 +495,7 @@ def readFromStream(stream, pdf):
497495 else :
498496 raise utils .PdfReadError ("Illegal character in Name Object" )
499497
500- readFromStream = staticmethod (readFromStream )
498+ readFromStream = staticmethod (readFromStream ) # type: ignore
501499
502500
503501class DictionaryObject (dict , PdfObject ):
@@ -642,7 +640,7 @@ def readFromStream(stream, pdf):
642640 retval = DictionaryObject ()
643641 retval .update (data )
644642 return retval
645- readFromStream = staticmethod (readFromStream )
643+ readFromStream = staticmethod (readFromStream ) # type: ignore
646644
647645
648646class TreeObject (DictionaryObject ):
@@ -802,7 +800,7 @@ def initializeFromDictionary(data):
802800 del data ["/Length" ]
803801 retval .update (data )
804802 return retval
805- initializeFromDictionary = staticmethod (initializeFromDictionary )
803+ initializeFromDictionary = staticmethod (initializeFromDictionary ) # type: ignore
806804
807805 def flateEncode (self ):
808806 if "/Filter" in self :
0 commit comments