12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
+ import os
15
16
import mimetypes
16
17
import socket
17
18
18
19
import click
19
20
20
21
from platformio .compat import IS_WINDOWS
21
22
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
23
24
24
25
25
- @click .command ("home" , short_help = "GUI to manage PlatformIO " )
26
+ @click .command ("home" , short_help = "GUI to manage PIO " )
26
27
@click .option ("--port" , type = int , default = 8008 , help = "HTTP port, default=8008" )
27
28
@click .option (
28
29
"--host" ,
@@ -53,7 +54,7 @@ def cli(port, host, no_open, shutdown_timeout, session_id):
53
54
# hook for `platformio-node-helpers`
54
55
if host == "__do_not_start__" :
55
56
# download all dependent packages
56
- get_core_package_dir ( "contrib-piohome" )
57
+ os . path . join ( ProjectConfig . get_instance (). get ( "platformio" , "packages_dir" ), "contrib-piohome" )
57
58
return
58
59
59
60
# Ensure PIO Home mimetypes are known
@@ -71,19 +72,19 @@ def cli(port, host, no_open, shutdown_timeout, session_id):
71
72
[
72
73
"" ,
73
74
" ___I_" ,
74
- " /\\ -_--\\ PlatformIO Home" ,
75
+ " /\\ -_--\\ PIO Home" ,
75
76
"/ \\ _-__\\ " ,
76
77
"|[]| [] | %s" % home_url ,
77
78
"|__|____|__%s" % ("_" * len (home_url )),
78
79
]
79
80
)
80
81
)
81
82
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 )
83
84
84
85
if is_port_used (host , port ):
85
86
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"
87
88
)
88
89
if not no_open :
89
90
click .launch (home_url )
0 commit comments