'If plugin is not a built-in, copy the plugin\'s .ui and .py files from
the ZIP file to $TMPDIR.
Tab will be dynamically generated and added to the Catalog Options dialog in
calibre.gui2.dialogs.catalog.py:Catalog'

def initialize(self):

    from calibre.customize.builtins import plugins as builtin_plugins
    from calibre.customize.ui import config
    from calibre.ptempfile import PersistentTemporaryDirectory
    if ((not (type(self) in builtin_plugins)) and (self.name not in config['disabled_plugins'])):
        files_to_copy = [('%s.%s' % (self.name.lower(), ext)) for ext in ['ui', 'py']]
        resources = zipfile.ZipFile(self.plugin_path, 'r')
        if (self.resources_path is None):
            self.resources_path = PersistentTemporaryDirectory('_plugin_resources', prefix='')
        for file in files_to_copy:
            try:
                resources.extract(file, self.resources_path)
            except:
                print ('    customize:__init__.initialize():    %s    not    found    in    %s' % (file, os.path.basename(self.plugin_path)))
                continue
        resources.close()
