本文整理汇总了Python中ecohydrolib.metadata.GenericMetadata.readGRASSEntries方法的典型用法代码示例。如果您正苦于以下问题:Python GenericMetadata.readGRASSEntries方法的具体用法?Python GenericMetadata.readGRASSEntries怎么用?Python GenericMetadata.readGRASSEntries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ecohydrolib.metadata.GenericMetadata
的用法示例。
在下文中一共展示了GenericMetadata.readGRASSEntries方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkMetadata
# 需要导入模块: from ecohydrolib.metadata import GenericMetadata [as 别名]
# 或者: from ecohydrolib.metadata.GenericMetadata import readGRASSEntries [as 别名]
def checkMetadata(self, *args, **kwargs):
""" Check to make sure the project directory has the necessary metadata to run this command.
@note Concrete commands must call this super class method in their own
implementation of checkMetadata(), and must call their implementation
near the beginning of their run method.
"""
super(GrassCommand, self).checkMetadata()
self.grassMetadata = GenericMetadata.readGRASSEntries(self.context)
if not "grass_dbase" in self.metadata:
raise MetadataException(
"Metadata in project directory %s does not contain a GRASS Dbase" % (self.context.projectDir,)
)
if not "grass_location" in self.metadata:
raise MetadataException(
"Metadata in project directory %s does not contain a GRASS location" % (self.context.projectDir,)
)
if not "grass_mapset" in self.metadata:
raise MetadataException(
"Metadata in project directory %s does not contain a GRASS mapset" % (self.context.projectDir,)
)
self.setupGrassEnv()