Habe mir mal die gimpfu näher betrachtet. Wie in beinahe allen bisher gefundenen Beispielen hatte ich den "Menüpfad plus Label" bei "Label" angegeben und nach "function" nichts mehr.
Aus gimpfu.py:
Code: Alles auswählen
def register(proc_name, blurb, help, author, copyright, date, label,
imagetypes, params, results, function,
menu=None, domain=None, on_query=None, on_run=None):
Und das funktionierte, weil aus den Angaben bei Label dann der Menüeintrag erstellt wird, wobei dann aber nach einen von diesen 3 "<Load>", "<Image>", "<Save>" gefragt wird und params zugeordnet werden. Da könnten über menü = "" noch weitere Möglichkeiten sich eröffnen.
Aus gimpfu.py:
Code: Alles auswählen
# if menu is not given, derive it from label
need_compat_params = False
if menu is None and label:
fields = label.split("/")
if fields:
label = fields.pop()
menu = "/".join(fields)
need_compat_params = True
import warnings
message = ("%s: passing the full menu path for the menu label is "
"deprecated, use the 'menu' parameter instead"
% (proc_name))
warnings.warn(message, DeprecationWarning, 3)
if need_compat_params and plugin_type == PLUGIN:
file_params = [(PDB_STRING, "filename", "The name of the file", ""),
(PDB_STRING, "raw-filename", "The name of the file", "")]
if menu is None:
pass
elif menu.startswith("<Load>"):
params[0:0] = file_params
elif menu.startswith("<Image>") or menu.startswith("<Save>"):
params.insert(0, (PDB_IMAGE, "image", "Input image", None))
params.insert(1, (PDB_DRAWABLE, "drawable", "Input drawable", None))
if menu.startswith("<Save>"):
params[2:2] = file_params
_registered_plugins_[proc_name] = (blurb, help, author, copyright,
date, label, imagetypes,
plugin_type, params, results,
function, menu, domain,
on_query, on_run)