summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Green <martin.speleo@gmail.com>2023-07-08 17:56:49 +0200
committerMartin Green <martin.speleo@gmail.com>2023-07-08 17:56:49 +0200
commit3359889d97d5c165a10a4576a3ee40e3fc9f1d7d (patch)
treeb6c32f32bdbb08acddb70ff3176b01a5d7765e5f
parent66ee96cd63aa7f6afd5e941247abf92185548edd (diff)
downloadtroggle-3359889d97d5c165a10a4576a3ee40e3fc9f1d7d.tar.gz
troggle-3359889d97d5c165a10a4576a3ee40e3fc9f1d7d.tar.bz2
troggle-3359889d97d5c165a10a4576a3ee40e3fc9f1d7d.zip
Better attempt at creating a default url for caves created by svx files
-rw-r--r--parsers/caves.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/parsers/caves.py b/parsers/caves.py
index 5c6b5ac..b376801 100644
--- a/parsers/caves.py
+++ b/parsers/caves.py
@@ -146,10 +146,13 @@ def create_new_cave(svxpath):
# double check
if a[0:3] == "162":
areanum = a[0:4]
- url = f"{areanum}/{a[5:]}.html" # Note we are appending the .html as we are believe in backwards compatability.
- else:
+ url = f"{areanum}/{caveid}.html" # Note we are appending the .html as we are believe in backwards compatability.
+ #url = f"{areanum}/{a[5:]}.html" # This is original code, but a above is only defined as being 4 characters long, so it did not make sense and produced non unique urls
+ else:
+ print(f"WARNING: parsers/caves/create_new_cave called with svxpath '{svxpath}'. Surely it should start 'caves-162*'?")
areanum = "1623"
- url = f"1623/{k}.html"
+ url = f"1623/{caveid}.html"
+ #url = f"1623/{k}.html" # This is original code, but a above is only defined as being 4 characters long, so it did not make sense and produced non unique urls
k = f"{areanum}-{caveid}"
area = get_area(areanum)