forked from platformio/platformio-core
Use current Python interpreter for the all subprocess platformio
calls
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
VERSION = (2, 7, "2.dev3")
|
VERSION = (2, 7, "2.dev4")
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@@ -19,10 +19,11 @@ from glob import glob
|
|||||||
from os import getenv, listdir, sep, walk
|
from os import getenv, listdir, sep, walk
|
||||||
from os.path import basename, dirname, isdir, isfile, join, normpath, realpath
|
from os.path import basename, dirname, isdir, isfile, join, normpath, realpath
|
||||||
|
|
||||||
from platformio.util import pioversion_to_intstr
|
|
||||||
from SCons.Script import COMMAND_LINE_TARGETS, DefaultEnvironment, SConscript
|
from SCons.Script import COMMAND_LINE_TARGETS, DefaultEnvironment, SConscript
|
||||||
from SCons.Util import case_sensitive_suffixes
|
from SCons.Util import case_sensitive_suffixes
|
||||||
|
|
||||||
|
from platformio.util import pioversion_to_intstr
|
||||||
|
|
||||||
SRC_BUILD_EXT = ["c", "cpp", "S", "spp", "SPP", "sx", "s", "asm", "ASM"]
|
SRC_BUILD_EXT = ["c", "cpp", "S", "spp", "SPP", "sx", "s", "asm", "ASM"]
|
||||||
SRC_HEADER_EXT = ["h", "hpp"]
|
SRC_HEADER_EXT = ["h", "hpp"]
|
||||||
SRC_DEFAULT_FILTER = " ".join([
|
SRC_DEFAULT_FILTER = " ".join([
|
||||||
|
@@ -15,12 +15,14 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
from os.path import abspath, basename, expanduser, isdir, join, relpath
|
import sys
|
||||||
|
from os.path import (abspath, basename, expanduser, isdir, join, normpath,
|
||||||
|
relpath)
|
||||||
|
|
||||||
import bottle
|
import bottle
|
||||||
import click # pylint: disable=wrong-import-order
|
import click # pylint: disable=wrong-import-order
|
||||||
|
|
||||||
from platformio import exception, util
|
from platformio import app, exception, util
|
||||||
|
|
||||||
|
|
||||||
class ProjectGenerator(object):
|
class ProjectGenerator(object):
|
||||||
@@ -64,10 +66,12 @@ class ProjectGenerator(object):
|
|||||||
envdata = self.get_project_env()
|
envdata = self.get_project_env()
|
||||||
if "env_name" not in envdata:
|
if "env_name" not in envdata:
|
||||||
return data
|
return data
|
||||||
result = util.exec_command(
|
cmd = [normpath(sys.executable), "-m", "platformio", "-f"]
|
||||||
["platformio", "-f", "run", "-t", "idedata",
|
if app.get_session_var("caller_id"):
|
||||||
"-e", envdata['env_name'], "-d", self.project_dir]
|
cmd.extend(["-c", app.get_session_var("caller_id")])
|
||||||
)
|
cmd.extend(["run", "-t", "idedata", "-e", envdata['env_name']])
|
||||||
|
cmd.extend(["-d", self.project_dir])
|
||||||
|
result = util.exec_command(cmd)
|
||||||
|
|
||||||
if result['returncode'] != 0 or '"includes":' not in result['out']:
|
if result['returncode'] != 0 or '"includes":' not in result['out']:
|
||||||
raise exception.PlatformioException(
|
raise exception.PlatformioException(
|
||||||
|
@@ -18,9 +18,9 @@ import json
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from os.path import (abspath, basename, dirname, expanduser, isdir, isfile,
|
from os.path import abspath, basename, dirname, expanduser, isdir, isfile, join
|
||||||
join, realpath)
|
|
||||||
from platform import system, uname
|
from platform import system, uname
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
|
|
||||||
@@ -175,7 +175,13 @@ def get_lib_dir():
|
|||||||
|
|
||||||
|
|
||||||
def get_source_dir():
|
def get_source_dir():
|
||||||
return dirname(realpath(__file__))
|
curpath = abspath(__file__)
|
||||||
|
if not isfile(curpath):
|
||||||
|
for p in sys.path:
|
||||||
|
if isfile(join(p, __file__)):
|
||||||
|
curpath = join(p, __file__)
|
||||||
|
break
|
||||||
|
return dirname(curpath)
|
||||||
|
|
||||||
|
|
||||||
def get_project_dir():
|
def get_project_dir():
|
||||||
|
Reference in New Issue
Block a user