From 69a2c335a560e7683646eadbafaa48f9fba0d82c Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Mon, 10 Jun 2024 19:05:41 +0200 Subject: webmap-import: Rename getFieldTypeCode() to parseFieldType(). And getFieldSubTypeCode() to parseSubFieldType(). --- webmap-import | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'webmap-import') diff --git a/webmap-import b/webmap-import index 6daceee..a3ffd50 100755 --- a/webmap-import +++ b/webmap-import @@ -213,9 +213,9 @@ def parseGeomType(name): return eGType # cf. ogr/ogr_core.h's enum OGRFieldType; -def getFieldTypeCode(name): +def parseFieldType(name): if name is None: - raise Exception('getFieldTypeCode(None)') + raise Exception('parseFieldType(None)') name2 = name.lower() if name2 == 'integer': # simple 32bit integer @@ -257,9 +257,9 @@ def getFieldTypeCode(name): raise Exception(f'Unknown field type "{name}"') # cf. ogr/ogr_core.h's enum OGRFieldSubType; -def getFieldSubTypeCode(name): +def parseSubFieldType(name): if name is None: - raise Exception('getFieldSubTypeCode(None)') + raise Exception('parseSubFieldType(None)') name2 = name.lower() if name2 == 'none': # No subtype. This is the default value. @@ -280,7 +280,7 @@ def getFieldSubTypeCode(name): # UUID string representation. Only valid for OFTString. return ogr.OFSTUUID else: - raise Exception(f'Unknown field subtype "{name2}"') + raise Exception(f'Unknown field subtype "{name}"') # Validate layer creation options and schema. The schema is modified in # place with the parsed result. @@ -336,9 +336,9 @@ def validateSchema(layers, drvo=None, lco_defaults=None): fld_def2['Comment'] = v elif k2 == 'type': - fld_def2['Type'] = getFieldTypeCode(v) + fld_def2['Type'] = parseFieldType(v) elif k2 == 'subtype': - fld_def2['SubType'] = getFieldSubTypeCode(v) + fld_def2['SubType'] = parseSubFieldType(v) elif k2 == 'tzflag': pass # TODO #fld_def2['TZFlag'] = v -- cgit v1.2.3