mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 23:33:34 +08:00
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/<module>, and thus not match the regex "^.*/src/"
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user