From 859d928539db6f48be3c71d44b32d49157365d4f Mon Sep 17 00:00:00 2001 From: TheDevKiller Date: Sun, 11 Nov 2018 16:07:07 +0100 Subject: [PATCH] Converted dms to dd for circles --- fetch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fetch.py b/fetch.py index c69a8a3..02e4a55 100755 --- a/fetch.py +++ b/fetch.py @@ -80,6 +80,8 @@ def fetch(url='https://www.legifrance.gouv.fr/eli/arrete/2018/10/12/PRMD1824595A lst[0] = list(re.search(r"(.{6}) .{0,5}?(\d{1,3},?\d{0,2} ?.{1,2}) .{1,35} ?(\d{3}° \d{1,2}' \d{1,2}” .) ?\/ ?(\d{1,3}° \d{1,2}' \d{1,2}” .)", area["zone"], re.S).groups()) if "km" in lst[0][1]: lst[0][1] = float(re.search("(\d*,?\d*).*", lst[0][1]).groups()[0].replace(",", "."))*100 + lst[0][2] = dms2dd(lst[0][2]) + lst[0][3] = dms2dd(lst[0][3]) area["zone"] = lst del lst # Atolls @@ -95,7 +97,7 @@ if __name__ == '__main__': # Print the dict (keep this code in the end of the file) print("===== Dict =====") for index, area in enumerate(diclist): - if index == 86: + if index == 129: print(f"\n-------------{index}----------------\n") for element in area: print(f" {element}: {diclist[index][element]}")