Better parsing of F_CPU

This commit is contained in:
Ivan Kravets
2017-09-17 01:33:04 +03:00
parent c9e1ae2548
commit 16c242e7fa
2 changed files with 26 additions and 13 deletions

View File

@ -651,19 +651,32 @@ class PlatformBoardConfig(object):
def get_brief_data(self): def get_brief_data(self):
return { return {
"id": self.id, "id":
"name": self._manifest['name'], self.id,
"platform": self._manifest.get("platform"), "name":
"mcu": self._manifest.get("build", {}).get("mcu", "").upper(), self._manifest['name'],
"platform":
self._manifest.get("platform"),
"mcu":
self._manifest.get("build", {}).get("mcu", "").upper(),
"fcpu": "fcpu":
int(self._manifest.get("build", {}).get("f_cpu", "0L")[:-1]), int(
"ram": self._manifest.get("upload", {}).get("maximum_ram_size", 0), re.sub(r"[^\d]+", "",
"rom": self._manifest.get("upload", {}).get("maximum_size", 0), self._manifest.get("build", {}).get("f_cpu", ""))),
"connectivity": self._manifest.get("connectivity"), "ram":
"frameworks": self._manifest.get("frameworks"), self._manifest.get("upload", {}).get("maximum_ram_size", 0),
"debug": self.get_debug_data(), "rom":
"vendor": self._manifest['vendor'], self._manifest.get("upload", {}).get("maximum_size", 0),
"url": self._manifest['url'] "connectivity":
self._manifest.get("connectivity"),
"frameworks":
self._manifest.get("frameworks"),
"debug":
self.get_debug_data(),
"vendor":
self._manifest['vendor'],
"url":
self._manifest['url']
} }
def get_debug_data(self): def get_debug_data(self):

View File

@ -21,7 +21,7 @@ usedevelop = True
deps = deps =
isort isort
flake8 flake8
yapf<0.17 yapf<0.18
pylint pylint
pytest pytest
commands = python --version commands = python --version