| 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) |