Package archipelagentvirtualmachinestorage :: Module magic :: Class Magic
[hide private]
[frames] | no frames]

Class Magic

source code

Magic is a wrapper around the libmagic C library.

Instance Methods [hide private]
 
__init__(self, mime=False, magic_file=None, mime_encoding=False, keep_going=False)
Create a new libmagic wrapper.
source code
 
from_buffer(self, buf)
Identify the contents of `buf`
source code
 
from_file(self, filename)
Identify the contents of file `filename` raises IOError if the file does not exist
source code
 
_handle509Bug(self, e) source code
 
_thread_check(self) source code
 
__del__(self) source code
Method Details [hide private]

__init__(self, mime=False, magic_file=None, mime_encoding=False, keep_going=False)
(Constructor)

source code 

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 keep_going - don't stop at the first match, keep going