MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / save_setting

Method save_setting

tools/sconsui.py:259–294  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

257 break
258
259 def save_setting(self):
260 import platform
261 import os
262
263 home = ''
264 if platform.system() == 'Windows':
265 driver = os.environ['HOMEDRIVE']
266 home = os.environ['HOMEPATH']
267 home = os.path.join(driver, home)
268 else:
269 home = os.environ['HOME']
270
271 setting = open(os.path.join(home, '.rtt_scons'), 'w+')
272 # current comiler
273 # line = '%s=%s\n' % ('compiler', self.compilers.get()))
274 line = '%s=%s\n' % ('compiler', 'iar')
275 setting.write(line)
276
277 # RTT Root Folder
278 if self.RTTRoot.get_path():
279 line = '%s=%s\n' % ('RTTRoot', self.RTTRoot.get_path())
280 setting.write(line)
281
282 # BSP Root Folder
283 if self.BSPRoot.get_path():
284 line = '%s=%s\n' % ('BSPRoot', self.BSPRoot.get_path())
285 setting.write(line)
286
287 for (compiler, path) in self.CompilersPath.iteritems():
288 if path.get_path():
289 line = '%s=%s\n' % (compiler, path.get_path())
290 setting.write(line)
291
292 setting.close()
293 tkMessageBox.showinfo("RT-Thread SCons UI",
294 "Save setting successfully")
295
296 def setup_building_ui(self, frame):
297 padding = ttk.Frame(frame)

Callers

nothing calls this directly

Calls 4

get_pathMethod · 0.80
openFunction · 0.50
joinMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected