From 9e3e63d00857fa297b4e882bdcf6ee06f27c6054 Mon Sep 17 00:00:00 2001 From: Sun Howwrongbum Date: Fri, 31 Dec 2021 16:50:32 +0530 Subject: docs: fix config file path --- tools/gen-config-doc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/gen-config-doc.py b/tools/gen-config-doc.py index 62c4c535e..e309da942 100644 --- a/tools/gen-config-doc.py +++ b/tools/gen-config-doc.py @@ -1,15 +1,20 @@ #!/usr/bin/python import re +import os +_KEYS_FILE = os.path.join( + os.path.dirname(__file__), "../src/main/java/org/traccar/config/Keys.java" +) + def get_config_key_descriptions(): desc_re = re.compile(r"(/\*\*\n|\s+\*/|\s+\*)") key_match_re = re.compile(r"\(\n(.+)\);", re.DOTALL) key_split_re = re.compile(r",\s+", re.DOTALL) snippets = [] - with open("../src/main/java/org/traccar/config/Keys.java", "r") as f: + with open(_KEYS_FILE, "r") as f: code = f.read() config = re.findall( r"(/\*\*.*?\*/)\n\s+(public static final Config.*?;)", code, re.DOTALL -- cgit v1.2.3