From eafcdd0bc2e9f1282d100c5b182698a4c9a00b8c Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Tue, 2 Aug 2022 01:33:29 -0400 Subject: [tools] format python code --- tools/codeblocks.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tools/codeblocks.py') diff --git a/tools/codeblocks.py b/tools/codeblocks.py index 6334f9b7cd..907bd5371a 100644 --- a/tools/codeblocks.py +++ b/tools/codeblocks.py @@ -40,10 +40,10 @@ def CB_AddHeadFiles(program, elem, project_path): utils.source_ext = [] utils.source_ext = ["h"] for item in program: - utils.walk_children(item) + utils.walk_children(item) utils.source_list.sort() # print utils.source_list - + for f in utils.source_list: path = _make_path_relative(project_path, f) Unit = SubElement(elem, 'Unit') @@ -70,14 +70,14 @@ def CBProject(target, script, program): tree = etree.parse('template.cbp') else: tree = etree.parse(os.path.join(os.path.dirname(__file__), 'template.cbp')) - + root = tree.getroot() - + out = open(target, 'w') out.write('\n') - + ProjectFiles = [] - + # SECTION 1. add "*.c|*.h" files group for elem in tree.iter(tag='Project'): # print elem.tag, elem.attrib @@ -88,7 +88,7 @@ def CBProject(target, script, program): # add h files CB_AddHeadFiles(program, elem, project_path) - # SECTION 2. + # SECTION 2. # write head include path if 'CPPPATH' in building.Env: cpp_path = building.Env['CPPPATH'] @@ -96,7 +96,7 @@ def CBProject(target, script, program): for path in cpp_path: inc = _make_path_relative(project_path, os.path.normpath(path)) paths.add(inc) #.replace('\\', '/') - + paths = [i for i in paths] paths.sort() # write include path, definitions @@ -110,10 +110,10 @@ def CBProject(target, script, program): Add = SubElement(elem, 'Add') for d in macro: Add.set('option', "-D"+d) - + # write link flags ''' - # write lib dependence + # write lib dependence if 'LIBS' in building.Env: for elem in tree.iter(tag='Tool'): if elem.attrib['Name'] == 'VCLinkerTool': @@ -121,7 +121,7 @@ def CBProject(target, script, program): libs_with_extention = [i+'.lib' for i in building.Env['LIBS']] libs = ' '.join(libs_with_extention) elem.set('AdditionalDependencies', libs) - + # write lib include path if 'LIBPATH' in building.Env: lib_path = building.Env['LIBPATH'] @@ -129,7 +129,7 @@ def CBProject(target, script, program): for path in lib_path: inc = _make_path_relative(project_path, os.path.normpath(path)) paths.add(inc) #.replace('\\', '/') - + paths = [i for i in paths] paths.sort() lib_paths = ';'.join(paths) -- cgit v1.3.1