GeoEco.Metadata.MethodMetadata

class GeoEco.Metadata.MethodMetadata(name, classMetadata, shortDescription=None, longDescription=None, isExposedToPythonCallers=False, isExposedAsArcGISTool=False, arcGISDisplayName=None, arcGISToolCategory=None, dependencies=[])

Bases: Metadata

Metadata that describes a method of a Python class.

Parameters:
  • name (str) – Name of the method. Minimum length꞉ 1.

  • classMetadata (ClassMetadata) – The ClassMetadata for the class that contains the method.

  • shortDescription (str, optional) – One-line description, ideally as plain text (but reStructuredText is OK). Minimum length꞉ 1.

  • longDescription (str, optional) – Detailed description, formatted as reStructuredText. Minimum length꞉ 1.

  • isExposedToPythonCallers (bool, optional) – If True, the method should be part of GeoEco’s Public API.

  • isExposedAsArcGISTool (bool, optional) – If True, the method should be exposed as a geoprocessing tool in MGET’s ArcGIS toolbox.

  • arcGISDisplayName (str, optional) – Name of the tool, as displayed in MGET’s ArcGIS toolbox. Ignored if isExposedAsArcGISTool is False. Minimum length꞉ 1.

  • arcGISToolCategory (str, optional) – Toolset that the tool appears under in MGET’s ArcGIS toolbox. If not provided, the tool will appear at the root level. Ignored if isExposedAsArcGISTool is False. Minimum length꞉ 1.

  • dependencies (list of object, optional) – list of Dependency objects defining software dependencies that should be checked prior to executing this method.

Returns:

New MethodMetadata instance.

Return type:

MethodMetadata

Properties

property ArcGISDisplayName

(str or None) Name of the tool, as displayed in MGET’s ArcGIS toolbox. Ignored if IsExposedAsArcGISTool is False. Minimum length꞉ 1.

property ArcGISToolCategory

(str or None) Toolset that the tool appears under in MGET’s ArcGIS toolbox. If None, the tool appears at the root level. Ignored if IsExposedAsArcGISTool is False. Minimum length꞉ 1.

property Arguments

(list of ArgumentMetadata) list of ArgumentMetadata objects describing each of this method’s arguments. We recommend using AddArgumentMetadata() to add them, rather than modifying the Arguments property directly.

property Class

(ClassMetadata) ClassMetadata for the class that contains this method. Read only.

property Dependencies

(list of object) list of Dependency objects defining software dependencies that are checked prior to executing this method. The dependencies are checked by ClassMetadata.ValidateMethodInvocation(), which is traditionally placed at the top of the method’s implementation. See ClassMetadata.ValidateMethodInvocation() for an example.

property DocString

(str) Python docstring (the value used for the __doc__ attribute). Read only. Minimum length꞉ 1. The docstring is constructed dynamically from metadata. It uses the format described in Google’s Python Style Guide.

property IsClassMethod

(bool) True if this method is a classmethod(). Read only.

property IsExposedAsArcGISTool

(bool) If True, this method is exposed as a geoprocessing tool in MGET’s ArcGIS toolbox.

property IsExposedToPythonCallers

(bool) If True, this method is part of GeoEco’s Public API. If False, the default, this method is considered part of GeoEco’s Internal API and not recommended for use by external callers.

property IsInstanceMethod

(bool) True if this method is an instance method (not a classmethod() or staticmethod()). Read only.

property IsStaticMethod

(bool) True if this method is a staticmethod(). Read only.

property LongDescription

(str or None) Detailed description, formatted as reStructuredText. Minimum length꞉ 1. LongDescription is optional; if detailed information is not needed, you need only write a ShortDescription.

property Name

(str) Name, as provided to the constructor. Read only. Minimum length꞉ 1.

property Object

(object) Python object to which this metadata applies. Read only. The type the Python object depends on which type of metadata is involved:

Type of metadata

Type of the Object property

ModuleMetadata

ModuleType

ClassMetadata

type

PropertyMetadata

property

MethodMetadata

MethodType

property Results

(list of ResultMetadata) list of ResultMetadata objects describing each of this method’s return values. We recommend using AddResultMetadata() to add them, rather than modifying the Results property directly. If the method does not return a value, leave Results an empty list.

property ShortDescription

(str or None) One-line description, ideally as plain text (but reStructuredText is OK). Minimum length꞉ 1. Keep the ShortDescription as concise as possible, ideally just one sentence. Do not include newline characters in the ShortDescription. Put detailed information in LongDescription (which can contain newlines).

Methods

GetArgumentByName

Returns the ArgumentMetadata for an argument given its name.

GetResultByName

Returns the ResultMetadata for a return value given its name.