From 725c5ad0cde2dc610781ab033c723f8de9e996b7 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 17 Nov 2022 01:24:39 +0000 Subject: Updating comments --- parsers/caves.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'parsers/caves.py') diff --git a/parsers/caves.py b/parsers/caves.py index 478eb71..361d950 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -88,7 +88,7 @@ def do_pending_cave(k, url, area): ''' def get_survex_file(k): '''Guesses at and finds a survex file for this pending cave. - Convoluted. Sorry. Needs rewriting + Convoluted. Needs rewriting ''' if k[0:3] == "162": id = Path(k[5:]) @@ -199,6 +199,9 @@ def do_pending_cave(k, url, area): def readentrance(filename): + '''Reads an enrance description from the .html file + Convoluted. Sorry.This is as I inherited it and I haven't fiddled with it. Needs rewriting + ''' global entrances_xslug global caves_xslug global areas_xslug @@ -296,7 +299,9 @@ def readentrance(filename): # print(message) def readcave(filename): - '''Assumes any area it hasn't seen before is a subarea of 1623 + '''Reads an enrance description from the .html file + Convoluted. Sorry.This is as I inherited it and I haven't fiddled with it. Needs rewriting + Assumes any area it hasn't seen before is a subarea of 1623 ''' global entrances_xslug global caves_xslug @@ -447,6 +452,8 @@ def readcave(filename): print(message) def getXML(text, itemname, minItems = 1, maxItems = None, printwarnings = True, context = ""): + """Reads a single XML tag + """ items = re.findall("<%(itemname)s>(.*?)" % {"itemname": itemname}, text, re.S) if len(items) < minItems and printwarnings: message = " ! %(count)i x %(itemname)s found, at least %(min)i expected. Load ABORT. " % {"count": len(items), -- cgit v1.2.3