GeoEco.Metadata.CopyArgumentMetadata
- GeoEco.Metadata.CopyArgumentMetadata(fromMethod, fromArgumentName, toMethod, toArgumentName, fromClass=None, fromModule=None, toClass=None, toModule=None)
Copies the
ArgumentMetadatafor a specified parameter from one methods’sMethodMetadatato another’s.Use this function to duplicate an
ArgumentMetadatawhen two classes have an identical or very similar parameter. If they are not exactly the same, you can modify the second methods’sArgumentMetadatafor the parameter after it has been copied.- Parameters:
fromMethod (
MethodTypeorstr) – The method or name of the method to copy theArgumentMetadatafrom. If the name is given, fromClass must also be given.fromArgumentName (
str) – The name of the parameter in fromMethod for which theArgumentMetadatashould be copied.toMethod (
MethodTypeorstr) – The method or name of the method to copy theArgumentMetadatato. If the name is given, toClass must also be given.toArgumentName (
str) – The name of the parameter in toMethod that should receive the copiedArgumentMetadata.fromClass (
typeorstr, optional) – The class containing fromMethod, either as the class itself or the unqualified name of the class (without module or package names). Only needed if fromMethod is given as a name rather than the method itself.fromModule (
ModuleTypeorstr, optional) – The module that contains fromClass, either as the module object itself or the fully qualified name of the module (a.k.a. dotted module name). If not provided, the caller’s module is used.toClass (
typeorstr, optional) – The class containing toMethod, either as the class itself or the unqualified name of the class (without module or package names). Only needed if toMethod is given as a name rather than the method itself.toModule (
ModuleTypeorstr, optional) – The module that contains toClass, either as the module object itself or the fully qualified name of the module (a.k.a. dotted module name). If not provided, the caller’s module is used.
Note
Before calling this function, use
AddArgumentMetadata()to create anArgumentMetadatafor fromArgumentName and add it to theMethodMetadataof fromMethod.