Code review comment for lp:~mhr3/zeitgeist/mimetypes

Revision history for this message
Markus Korn (thekorn) wrote :

This is not a reviewer comment, but I would like to add another possible way to solve this, python applications which would like to use this kind of mapper, could depend on libzeitgeist and use ctypes to access the mapper functions:

from ctypes import CDLL, c_char_p

libzeitgeist = CDLL("libzeitgeist-1.0.so.0")

interpretation_for_mimetype = libzeitgeist.zeitgeist_interpretation_for_mimetype
interpretation_for_mimetype.argtypes = [c_char_p,]
interpretation_for_mimetype.restype = c_char_p

print interpretation_for_mimetype("text/html")
print interpretation_for_mimetype("image/png")

manifestation_for_uri = libzeitgeist.zeitgeist_manifestation_for_uri
manifestation_for_uri.argtypes = [c_char_p,]
manifestation_for_uri.restype = c_char_p

print manifestation_for_uri("file:///home")
print manifestation_for_uri("http://www.google.de")

« Back to merge proposal