aboutsummaryrefslogtreecommitdiff
path: root/tools/gen-config-doc.py
diff options
context:
space:
mode:
authorSun Howwrongbum <sun@libermatic.com>2021-12-31 16:50:32 +0530
committerSun Howwrongbum <sun@libermatic.com>2021-12-31 16:50:32 +0530
commit9e3e63d00857fa297b4e882bdcf6ee06f27c6054 (patch)
treef8577c4315076520952148cf9e83edbb68e228e6 /tools/gen-config-doc.py
parentb25eb46b1b5a2e1633f994f3478d237a190f9f02 (diff)
downloadtrackermap-server-9e3e63d00857fa297b4e882bdcf6ee06f27c6054.tar.gz
trackermap-server-9e3e63d00857fa297b4e882bdcf6ee06f27c6054.tar.bz2
trackermap-server-9e3e63d00857fa297b4e882bdcf6ee06f27c6054.zip
docs: fix config file path
Diffstat (limited to 'tools/gen-config-doc.py')
-rw-r--r--tools/gen-config-doc.py7
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