Format code with pep8 style

This commit is contained in:
Ivan Kravets committed 2016-08-03 23:38:20 +03:00
1 parent 0c9d539a92
commit 87d0ead203
27 files changed
+514 -446

No files matched your search

+10 -16
View File
@@ -59,19 +59,14 @@ class ProjectGenerator(object):
@util.memoized
def get_project_build_data(self):
data = {
"defines": [],
"includes": [],
"cxx_path": None
}
data = {"defines": [], "includes": [], "cxx_path": None}
envdata = self.get_project_env()
if "env_name" not in envdata:
return data
cmd = [
normpath(sys.executable), "-m",
"platformio" + (
".__main__" if sys.version_info < (2, 7, 0) else ""),
"-f"
"platformio" + (".__main__"
if sys.version_info < (2, 7, 0) else ""), "-f"
]
if app.get_session_var("caller_id"):
cmd.extend(["-c", app.get_session_var("caller_id")])
@@ -80,8 +75,8 @@ class ProjectGenerator(object):
result = util.exec_command(cmd)
if result['returncode'] != 0 or '"includes":' not in result['out']:
raise exception.PlatformioException(
"\n".join([result['out'], result['err']]))
raise exception.PlatformioException("\n".join([result['out'],
result['err']]))
output = result['out']
start_index = output.index('{"')
@@ -125,8 +120,7 @@ class ProjectGenerator(object):
file_name = basename(tpl_path)[:-4]
self._merge_contents(
join(dst_dir, file_name),
self._render_tpl(tpl_path).encode("utf8")
)
self._render_tpl(tpl_path).encode("utf8"))
def _render_tpl(self, tpl_path):
content = ""
@@ -161,13 +155,13 @@ class ProjectGenerator(object):
"project_dir": self.project_dir,
"project_src_dir": self.project_src_dir,
"systype": util.get_systype(),
"platformio_path": self._fix_os_path(
util.where_is_program("platformio")),
"platformio_path":
self._fix_os_path(util.where_is_program("platformio")),
"env_pathsep": os.pathsep,
"env_path": self._fix_os_path(os.getenv("PATH"))
})
@staticmethod
def _fix_os_path(path):
return (re.sub(r"[\\]+", '\\' * 4, path) if "windows" in
util.get_systype() else path)
return (re.sub(r"[\\]+", '\\' * 4, path)
if "windows" in util.get_systype() else path)