mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
Tools/px4moduledoc: add some comments, describe the regexes
This commit is contained in:
@@ -34,6 +34,9 @@ class SourceScanner(object):
|
||||
Scans provided file and passes its contents to the parser using
|
||||
parser.Parse method.
|
||||
"""
|
||||
# Extract the scope: it is the directory within the repo. Either it
|
||||
# starts directly with 'src/module/abc', or it has the form 'x/y/z/src/module/abc'.
|
||||
# The output is 'module/abc' in both cases.
|
||||
prefix = "^(|.*" + os.path.sep + ")src" + os.path.sep
|
||||
scope = re.sub(prefix.replace("\\", "/"), "", os.path.dirname(os.path.relpath(path)).replace("\\", "/"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user