iarcmd.py 625 B

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