summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authoryaxing.chen <[email protected]>2021-01-26 19:35:30 +0800
committeryaxing.chen <[email protected]>2021-01-26 19:35:30 +0800
commit25147060dd8d28542edeb6b996114712c66287a7 (patch)
treef17398a50b422457bc33e24d97159e0f35974d74 /tools
parent822e825c8f0fe8f3b7150deb6a11fa5608287fa0 (diff)
format code
Diffstat (limited to 'tools')
-rw-r--r--tools/rt_studio.py82
1 files changed, 41 insertions, 41 deletions
diff --git a/tools/rt_studio.py b/tools/rt_studio.py
index c918ca1f2c..c60d9fc1c9 100644
--- a/tools/rt_studio.py
+++ b/tools/rt_studio.py
@@ -273,50 +273,50 @@ def gen_org_eclipse_core_runtime_prefs(output_file_path):
def gen_cproject_file(output_file_path):
- template_file_path = os.path.join(os.path.dirname(output_file_path),"template.cproject")
- if os.path.exists(template_file_path):
- try:
- shutil.copy(template_file_path, output_file_path)
- except Exception as e:
- print(e)
- return True
- else:
- CFLAGS = rtconfig.CFLAGS
- AFLAGS = rtconfig.AFLAGS
- LFLAGS = rtconfig.LFLAGS
- if 'CXXFLAGS' in dir(rtconfig):
- CXXFLAGS = rtconfig.CXXFLAGS
- else:
- CXXFLAGS = ""
+ template_file_path = os.path.join(os.path.dirname(output_file_path), "template.cproject")
+ if os.path.exists(template_file_path):
+ try:
+ shutil.copy(template_file_path, output_file_path)
+ except Exception as e:
+ print(e)
+ return True
+ else:
+ CFLAGS = rtconfig.CFLAGS
+ AFLAGS = rtconfig.AFLAGS
+ LFLAGS = rtconfig.LFLAGS
+ if 'CXXFLAGS' in dir(rtconfig):
+ CXXFLAGS = rtconfig.CXXFLAGS
+ else:
+ CXXFLAGS = ""
- if "-T" in LFLAGS:
- items = str(LFLAGS).split()
- t_index = items.index("-T")
- items[t_index] = ""
- items[t_index + 1] = ""
- LFLAGS = " ".join(items)
+ if "-T" in LFLAGS:
+ items = str(LFLAGS).split()
+ t_index = items.index("-T")
+ items[t_index] = ""
+ items[t_index + 1] = ""
+ LFLAGS = " ".join(items)
- try:
- w_str = cproject_temp
- if "a_misc_flag" in w_str:
- w_str = w_str.replace("a_misc_flag", AFLAGS)
- if "c_misc_flag" in w_str:
- w_str = w_str.replace("c_misc_flag", CFLAGS)
- if "cpp_misc_flag" in w_str:
- w_str = w_str.replace("cpp_misc_flag", CXXFLAGS)
- if "c_link_misc_flag" in w_str:
- w_str = w_str.replace("c_link_misc_flag", LFLAGS)
- if "cpp_link_misc_flag" in w_str:
- w_str = w_str.replace("cpp_link_misc_flag", LFLAGS)
+ try:
+ w_str = cproject_temp
+ if "a_misc_flag" in w_str:
+ w_str = w_str.replace("a_misc_flag", AFLAGS)
+ if "c_misc_flag" in w_str:
+ w_str = w_str.replace("c_misc_flag", CFLAGS)
+ if "cpp_misc_flag" in w_str:
+ w_str = w_str.replace("cpp_misc_flag", CXXFLAGS)
+ if "c_link_misc_flag" in w_str:
+ w_str = w_str.replace("c_link_misc_flag", LFLAGS)
+ if "cpp_link_misc_flag" in w_str:
+ w_str = w_str.replace("cpp_link_misc_flag", LFLAGS)
- dir_name = os.path.dirname(output_file_path)
- if not os.path.exists(dir_name):
- os.makedirs(dir_name)
- with open(output_file_path, 'w') as f:
- f.write(w_str)
- return True
- except Exception as e:
- return False
+ dir_name = os.path.dirname(output_file_path)
+ if not os.path.exists(dir_name):
+ os.makedirs(dir_name)
+ with open(output_file_path, 'w') as f:
+ f.write(w_str)
+ return True
+ except Exception as e:
+ return False
def gen_project_file(output_file_path):