From d38da07c42c68a900ad328856041bcebef3ba640 Mon Sep 17 00:00:00 2001 From: Letter Date: Sun, 11 Jul 2021 21:05:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E9=81=8D=E5=8E=86=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/shellTools.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/shellTools.py b/tools/shellTools.py index 1054003..a152c22 100644 --- a/tools/shellTools.py +++ b/tools/shellTools.py @@ -18,8 +18,8 @@ import os import sys import re -FILE_PATTERN = r"^.*?\.(c|h)$" -SHELL_EXPORT_PATTERN = r"^\s*SHELL_EXPORT_(CMD|CMD_AGENCY|VAR|USER|KEY|KEY_AGENCY|CMD_GROUP)\s*\(\s*\S+\s*,\s*(\S+)\s*,.*$" +FILE_PATTERN = r"^.*?\.(cpp|c|h)$" +SHELL_EXPORT_PATTERN = r"^\s*SHELL_EXPORT_(CMD|CMD_AGENCY|VAR|USER|KEY|KEY_AGENCY|CMD_GROUP|PASSTROUGH)\s*\(\s*\S+\s*,\s*(\S+)\s*,.*$" def isCodeFile(name): return re.match(FILE_PATTERN, name) != None @@ -28,7 +28,7 @@ def getCodeFiles(path): names = os.listdir(path) files = [] for name in names: - fullName = path + '\\' + name + fullName = os.path.join(path, name) if os.path.isdir(fullName): files = files + getCodeFiles(fullName) else: @@ -80,5 +80,5 @@ if __name__ == "__main__": pass for item in sorted(itemList, key=lambda x:(x[1])): - print("shell export %s, %s in file %s(%d)" + print("shell export %s, %s in file %s:%d" %(item[0], item[1], item[2], item[3]))