(self, mime=False, magic_file=None, mime_encoding=False)
Create a new libmagic wrapper.

        mime - if True, mimetypes are returned instead of textual descriptions
        mime_encoding - if True, codec is returned
        magic_file - use a mime database other than the system default
Create a new libmagic wrapper.
Create a new libmagic wrapper .
def __init__(self, mime=False, magic_file=None, mime_encoding=False):
        """
        Create a new libmagic wrapper.

        mime - if True, mimetypes are returned instead of textual descriptions
        mime_encoding - if True, codec is returned
        magic_file - use a mime database other than the system default
        """

        flags = MAGIC_NONE
        if mime:
            flags |= MAGIC_MIME
        elif mime_encoding:
            flags |= MAGIC_MIME_ENCODING

        self.cookie = magic_open(flags)

        magic_load(self.cookie, magic_file)
def __init__ ( self , mime = False , magic_file = None , mime_encoding = False ) : flags = MAGIC_NONE if mime : flags |= MAGIC_MIME elif mime_encoding : flags |= MAGIC_MIME_ENCODING self . cookie = magic_open ( flags ) magic_load ( self . cookie , magic_file )