From 45bc882f5d9fa13dce6da201fd44385fb6849e06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Tue, 2 May 2017 16:00:24 +0200 Subject: [PATCH] px_process_params: fix scope when script is called from repo root If called with ./Tools/px_process_params.py, the path would start with src/, and thus not match the regex "^.*/src/" --- Tools/px4params/srcscanner.py | 2 +- Tools/px_process_params.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Tools/px4params/srcscanner.py b/Tools/px4params/srcscanner.py index addea845ee..4db9d01ba7 100644 --- a/Tools/px4params/srcscanner.py +++ b/Tools/px4params/srcscanner.py @@ -34,7 +34,7 @@ class SourceScanner(object): Scans provided file and passes its contents to the parser using parser.Parse method. """ - prefix = "^.*" + os.path.sep + "src" + os.path.sep + prefix = "^(|.*" + os.path.sep + ")src" + os.path.sep scope = re.sub(prefix.replace("\\", "/"), "", os.path.dirname(os.path.relpath(path)).replace("\\", "/")) with codecs.open(path, 'r', 'utf-8') as f: diff --git a/Tools/px_process_params.py b/Tools/px_process_params.py index 76eb02b4be..d8c8f7c2ff 100755 --- a/Tools/px_process_params.py +++ b/Tools/px_process_params.py @@ -1,7 +1,7 @@ #!/usr/bin/env python ############################################################################ # -# Copyright (C) 2013-2014 PX4 Development Team. All rights reserved. +# Copyright (C) 2013-2017 PX4 Development Team. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -41,6 +41,7 @@ # Currently supported formats are: # * XML for the parametric UI generator # * Human-readable description in DokuWiki page format +# * Human-readable description in Markdown page format for the PX4 dev guide # # This tool also allows to automatically upload the human-readable version # to the DokuWiki installation via XML-RPC.