diff options
-rw-r--r-- | tools/gen-config-doc.py | 7 |
1 files changed, 6 insertions, 1 deletions
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 |