Jonatan Antoni | cdd1492 | 2017-09-12 15:14:07 +0200 | [diff] [blame] | 1 | #! python |
| 2 | |
| 3 | from buildcmd import BuildCmd |
| 4 | from string import maketrans |
| 5 | from datetime import datetime |
| 6 | import mmap |
| 7 | |
| 8 | class IarCmd(BuildCmd): |
| 9 | |
| 10 | def __init__(self, project, config): |
| 11 | BuildCmd.__init__(self) |
| 12 | self._project = project |
| 13 | self._config = config |
| 14 | self._log = "iar_{0}.log".format(datetime.now().strftime("%Y%m%d%H%M%S")) |
| 15 | |
| 16 | def getCommand(self): |
| 17 | return "iarbuild.exe" |
| 18 | |
| 19 | def getArguments(self): |
| 20 | return [ self._project, "-build", self._config ] |
| 21 | |
| 22 | def isSuccess(self): |
| 23 | return self._result <= 1 |
| 24 | |
| 25 | def getLog(self): |
| 26 | try: |
| 27 | return open(self._log, "r") |
| 28 | except: |
| 29 | return None |