GeoEco.Metadata.MethodMetadata
- class GeoEco.Metadata.MethodMetadata(name, classMetadata, shortDescription=None, longDescription=None, isExposedToPythonCallers=False, isExposedAsArcGISTool=False, arcGISDisplayName=None, arcGISToolCategory=None, dependencies=[])
Bases:
MetadataMetadata that describes a method of a Python class.
- Parameters:
name (
str) – Name of the method. Minimum length꞉ 1.classMetadata (
ClassMetadata) – TheClassMetadatafor 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 (
listofobject, optional) –listofDependencyobjects defining software dependencies that should be checked prior to executing this method.
- Returns:
New
MethodMetadatainstance.- Return type:
Properties
- property ArcGISDisplayName
(
strorNone) Name of the tool, as displayed in MGET’s ArcGIS toolbox. Ignored ifIsExposedAsArcGISToolis False. Minimum length꞉ 1.
- property ArcGISToolCategory
(
strorNone) Toolset that the tool appears under in MGET’s ArcGIS toolbox. IfNone, the tool appears at the root level. Ignored ifIsExposedAsArcGISToolis False. Minimum length꞉ 1.
- property Arguments
(
listofArgumentMetadata)listofArgumentMetadataobjects describing each of this method’s arguments. We recommend usingAddArgumentMetadata()to add them, rather than modifying theArgumentsproperty directly.
- property Class
(
ClassMetadata) ClassMetadata for the class that contains this method. Read only.
- property Dependencies
(
listofobject)listofDependencyobjects defining software dependencies that are checked prior to executing this method. The dependencies are checked byClassMetadata.ValidateMethodInvocation(), which is traditionally placed at the top of the method’s implementation. SeeClassMetadata.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 aclassmethod(). 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 aclassmethod()orstaticmethod()). Read only.
- property IsStaticMethod
(
bool) True if this method is astaticmethod(). Read only.
- property LongDescription
(
strorNone) Detailed description, formatted as reStructuredText. Minimum length꞉ 1. LongDescription is optional; if detailed information is not needed, you need only write a ShortDescription.
- 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
Objectproperty
- property Results
(
listofResultMetadata)listofResultMetadataobjects describing each of this method’s return values. We recommend usingAddResultMetadata()to add them, rather than modifying theResultsproperty directly. If the method does not return a value, leaveResultsan empty list.
- property ShortDescription
(
strorNone) 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
Returns the
ArgumentMetadatafor an argument given its name.Returns the
ResultMetadatafor a return value given its name.