mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-16 09:57:22 +00:00
fixing cave slug <caveslug> issues
This commit is contained in:
@@ -749,11 +749,14 @@ def read_cave(filename, mvf=None, cave=None):
|
||||
# New 2024 June 28th.
|
||||
slugs = getXML(cavecontents, "caveslug", maxItems=1, context=context)
|
||||
if len(slugs) > 1:
|
||||
message = f" ! - More than one slug for a cave: {cave}, slugs: {slugs}. Ignoring all except first."
|
||||
message = f" ! - More than one slug for a cave: {cave}, slugs: {slugs}."
|
||||
DataIssue.objects.create(parser="caves", message=message, url=context)
|
||||
print(message)
|
||||
# slug = slugs[0]
|
||||
|
||||
# but ignore <caveslug> read from the file
|
||||
slug = filename[:-5] # strip off the ".html" at the end of the filename
|
||||
slugs = [slug]
|
||||
#print(f"{filename=} {slug=}")
|
||||
|
||||
|
||||
@@ -926,7 +929,7 @@ def readcaves():
|
||||
|
||||
with transaction.atomic():
|
||||
print(" - Reading Caves from cave descriptions xml files")
|
||||
mvscript = "mvscript.sh"
|
||||
mvscript = "mvscript.sh" # in .gitignore so no problem creating it on server in /troggle/
|
||||
with open(mvscript, "w") as mvf: # overwrite
|
||||
mvf.write(f"cd {CAVEDESCRIPTIONS}\n")
|
||||
for filename in next(os.walk(CAVEDESCRIPTIONS))[2]: # Should be a better way of getting a list of files
|
||||
|
||||
Reference in New Issue
Block a user