def __init__(self, _guess=None, filename=None, file=None, bytes=None):
        """
        The constructor expects exactly one keyword argument.
        If you supply a positional argument instead,
        it will guess the input type.
        Choose from the following keyword arguments:

        filename
          Name of input file (a PNG file).
        file
          A file-like object (object with a read() method).
        bytes
          ``bytes`` or ``bytearray`` with PNG data.

        """
        keywords_supplied = (
            (_guess is not None) +
            (filename is not None) +
            (file is not None) +
            (bytes is not None))
        if keywords_supplied != 1:
            raise TypeError("Reader() takes exactly 1 argument")

        # Will be the first 8 bytes, later on.  See validate_signature.
        self.signature = None
        self.transparent = None
        # A pair of (len,type) if a chunk has been read but its data and
        # checksum have not (in other words the file position is just
        # past the 4 bytes that specify the chunk type).
        # See preamble method for how this is used.
        self.atchunk = None

        if _guess is not None:
            if isarray(_guess):
                bytes = _guess
            elif isinstance(_guess, str):
                filename = _guess
            elif hasattr(_guess, 'read'):
                file = _guess

        if bytes is not None:
            self.file = io.BytesIO(bytes)
        elif filename is not None:
            self.file = open(filename, "rb")
        elif file is not None:
            self.file = file
        else:
            raise ProtocolError("expecting filename, file or bytes array")
def __init__ ( self , _guess = None , filename = None , file = None , bytes = None ) : keywords_supplied = ( ( _guess is not None ) + ( filename is not None ) + ( file is not None ) + ( bytes is not None ) ) if keywords_supplied != 1 : raise TypeError ( "Reader() takes exactly 1 argument" ) self . signature = None self . transparent = None self . atchunk = None if _guess is not None : if isarray ( _guess ) : bytes = _guess elif isinstance ( _guess , str ) : filename = _guess elif hasattr ( _guess , 'read' ) : file = _guess if bytes is not None : self . file = io . BytesIO ( bytes ) elif filename is not None : self . file = open ( filename , "rb" ) elif file is not None : self . file = file else : raise ProtocolError ( "expecting filename, file or bytes array" )
The constructor expects exactly one keyword argument.
        If you supply a positional argument instead,
        it will guess the input type.
        Choose from the following keyword arguments:

        filename
          Name of input file (a PNG file).
        file
          A file-like object (object with a read() method).
        bytes
          ``bytes`` or ``bytearray`` with PNG data.