Skip to content

Commit 9174136

Browse files
committed
replace "get_core_package_dir" for piohome and pioremote
1 parent 24cb2e6 commit 9174136

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

platformio/home/cli.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,18 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
import os
1516
import mimetypes
1617
import socket
1718

1819
import click
1920

2021
from platformio.compat import IS_WINDOWS
2122
from platformio.home.run import run_server
22-
from platformio.package.manager.core import get_core_package_dir
23+
from platformio.project.config import ProjectConfig
2324

2425

25-
@click.command("home", short_help="GUI to manage PlatformIO")
26+
@click.command("home", short_help="GUI to manage PIO")
2627
@click.option("--port", type=int, default=8008, help="HTTP port, default=8008")
2728
@click.option(
2829
"--host",
@@ -53,7 +54,7 @@ def cli(port, host, no_open, shutdown_timeout, session_id):
5354
# hook for `platformio-node-helpers`
5455
if host == "__do_not_start__":
5556
# download all dependent packages
56-
get_core_package_dir("contrib-piohome")
57+
os.path.join(ProjectConfig.get_instance().get("platformio","packages_dir"),"contrib-piohome")
5758
return
5859

5960
# Ensure PIO Home mimetypes are known
@@ -71,19 +72,19 @@ def cli(port, host, no_open, shutdown_timeout, session_id):
7172
[
7273
"",
7374
" ___I_",
74-
" /\\-_--\\ PlatformIO Home",
75+
" /\\-_--\\ PIO Home",
7576
"/ \\_-__\\",
7677
"|[]| [] | %s" % home_url,
7778
"|__|____|__%s" % ("_" * len(home_url)),
7879
]
7980
)
8081
)
8182
click.echo("")
82-
click.echo("Open PlatformIO Home in your browser by this URL => %s" % home_url)
83+
click.echo("Open PIO Home in your browser by this URL => %s" % home_url)
8384

8485
if is_port_used(host, port):
8586
click.secho(
86-
"PlatformIO Home server is already started in another process.", fg="yellow"
87+
"PIO Home server is already started in another process.", fg="yellow"
8788
)
8889
if not no_open:
8990
click.launch(home_url)

platformio/home/run.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
from platformio.home.rpc.handlers.project import ProjectRPC
3737
from platformio.home.rpc.handlers.registry import RegistryRPC
3838
from platformio.home.rpc.server import WebSocketJSONRPCServerFactory
39-
from platformio.package.manager.core import get_core_package_dir
39+
from platformio.project.config import ProjectConfig
4040
from platformio.proc import force_exit
4141

4242

@@ -62,7 +62,7 @@ async def protected_page(_):
6262

6363

6464
def run_server(host, port, no_open, shutdown_timeout, home_url):
65-
contrib_dir = get_core_package_dir("contrib-piohome")
65+
contrib_dir = os.path.join(ProjectConfig.get_instance().get("platformio","packages_dir"),"contrib-piohome")
6666
if not os.path.isdir(contrib_dir):
6767
raise PlatformioException("Invalid path to PIO Home Contrib")
6868

platformio/remote/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
device_monitor_cmd,
3232
get_project_options,
3333
)
34-
from platformio.package.manager.core import get_core_package_dir
34+
from platformio.project.config import ProjectConfig
3535
from platformio.project.exception import NotPlatformIOProjectError
3636
from platformio.project.options import ProjectOptions
3737
from platformio.run.cli import cli as cmd_run
@@ -44,7 +44,7 @@
4444
def cli(ctx, agent):
4545
ctx.obj = agent
4646
# inject twisted dependencies
47-
contrib_dir = get_core_package_dir("contrib-pioremote")
47+
contrib_dir = os.path.join(ProjectConfig.get_instance().get("platformio","packages_dir"),"contrib-pioremote")
4848
if contrib_dir not in sys.path:
4949
addsitedir(contrib_dir)
5050
sys.path.insert(0, contrib_dir)

0 commit comments

Comments
 (0)