Associate an identifier function with a specific data type.
Parameters: | data_format : str
data_class : classobj
identifier : function
force : bool
|
---|
Examples
To set the identifier based on extensions, for formats that take a filename as a first argument, you can do for example:
>>> def my_identifier(*args, **kwargs):
... return (isinstance(args[0], basestring) and
... args[0].endswith('.tbl'))
>>> register_identifier('ipac', Table, my_identifier)