GeoEco.Metadata.CopyArgumentMetadata

GeoEco.Metadata.CopyArgumentMetadata(fromMethod, fromArgumentName, toMethod, toArgumentName, fromClass=None, fromModule=None, toClass=None, toModule=None)

Copies the ArgumentMetadata for a specified parameter from one methods’s MethodMetadata to another’s.

Use this function to duplicate an ArgumentMetadata when two classes have an identical or very similar parameter. If they are not exactly the same, you can modify the second methods’s ArgumentMetadata for the parameter after it has been copied.

Parameters:
  • fromMethod (MethodType or str) – The method or name of the method to copy the ArgumentMetadata from. If the name is given, fromClass must also be given.

  • fromArgumentName (str) – The name of the parameter in fromMethod for which the ArgumentMetadata should be copied.

  • toMethod (MethodType or str) – The method or name of the method to copy the ArgumentMetadata to. If the name is given, toClass must also be given.

  • toArgumentName (str) – The name of the parameter in toMethod that should receive the copied ArgumentMetadata.

  • fromClass (type or str, 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 (ModuleType or str, 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 (type or str, 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 (ModuleType or str, 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 an ArgumentMetadata for fromArgumentName and add it to the MethodMetadata of fromMethod.