'Add this plugin to the python path so that it\'s contents become directly importable.
Useful when bundling large python libraries into the plugin. Use it like this::
with plugin:
import something'

def __enter__(self, *args):

    if (self.plugin_path is not None):
        from calibre.utils.zipfile import ZipFile
        zf = ZipFile(self.plugin_path)
        extensions = set([x.rpartition('.')[(-1)].lower() for x in zf.namelist()])
        zip_safe = True
        for ext in ('pyd', 'so', 'dll', 'dylib'):
            if (ext in extensions):
                zip_safe = False
                break
        if zip_safe:
            sys.path.insert(0, self.plugin_path)
            self.sys_insertion_path = self.plugin_path
        else:
            from calibre.ptempfile import TemporaryDirectory
            self._sys_insertion_tdir = TemporaryDirectory('plugin_unzip')
            self.sys_insertion_path = self._sys_insertion_tdir.__enter__(*args)
            zf.extractall(self.sys_insertion_path)
            sys.path.insert(0, self.sys_insertion_path)
        zf.close()
