>>> pdb.gimp_file_load.nparams
3
>>> pprint.pprint(pdb.gimp_file_load.params)
((0,
'run-mode',
'The run mode { RUN-INTERACTIVE (0), RUN-NONINTERACTIVE (1) }'),
(4, 'filename', 'The name of the file to load'),
(4, 'raw-filename', 'The name as entered by the user'))
>>> fname = 'a filename'
>>> img = pdb.gimp_file_load(gimpfu.RUN_NONINTERACTIVE, fname, fname)
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: wrong number of parameters
So, what am I doing wrong here? According to the method itself, it takes three rather-well documented arguments. I pass it the three things it wants, and I receive a TypeError
. So:
- What am I doing wrong?
- Is there a reference manual for this?
In the tuples for the arguments, there's a 0, a 4, and a 4. What are these magic constants? According to the docs, these appear to be:
a parameter type (one of the PARAM_* constants)
But nowhere in those docs do I find
PARAM_
constants, and I've not found them introspecting any of pdb, gimp or gimpfu.
Just to be complete: the obvious, help(pdb.gimp_file_load)
, isn't really that helpful:
>>> help(pdb.gimp_file_load)
Help on PDBFunction object:
class PDBFunction(__builtin__.object)
| Methods defined here:
|
| __call__(...)
| x.__call__(...) <==> x(...)
|
| __repr__(...)
| x.__repr__() <==> repr(x)
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| nparams
|
| nreturn_vals
|
| params
|
| proc_author
|
| proc_blurb
|
| proc_copyright
|
| proc_date
|
| proc_help
|
| proc_name
|
| proc_type
|
| return_vals
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| __new__ = <built-in method __new__ of type object>
| T.__new__(S, ...) -> a new object with type S, a subtype of T