mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Fix broken Python check for Python 2
This commit is contained in:
parent
fad13beea6
commit
c63a3311f4
@ -9,8 +9,6 @@ import threading
|
|||||||
import time
|
import time
|
||||||
from multiprocessing import Process
|
from multiprocessing import Process
|
||||||
|
|
||||||
import homeassistant.config as config_util
|
|
||||||
from homeassistant import bootstrap
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
__version__,
|
__version__,
|
||||||
EVENT_HOMEASSISTANT_START,
|
EVENT_HOMEASSISTANT_START,
|
||||||
@ -32,6 +30,7 @@ def validate_python():
|
|||||||
|
|
||||||
def ensure_config_path(config_dir):
|
def ensure_config_path(config_dir):
|
||||||
"""Validate the configuration directory."""
|
"""Validate the configuration directory."""
|
||||||
|
import homeassistant.config as config_util
|
||||||
lib_dir = os.path.join(config_dir, 'lib')
|
lib_dir = os.path.join(config_dir, 'lib')
|
||||||
|
|
||||||
# Test if configuration directory exists
|
# Test if configuration directory exists
|
||||||
@ -60,6 +59,7 @@ def ensure_config_path(config_dir):
|
|||||||
|
|
||||||
def ensure_config_file(config_dir):
|
def ensure_config_file(config_dir):
|
||||||
"""Ensure configuration file exists."""
|
"""Ensure configuration file exists."""
|
||||||
|
import homeassistant.config as config_util
|
||||||
config_path = config_util.ensure_config_exists(config_dir)
|
config_path = config_util.ensure_config_exists(config_dir)
|
||||||
|
|
||||||
if config_path is None:
|
if config_path is None:
|
||||||
@ -71,6 +71,7 @@ def ensure_config_file(config_dir):
|
|||||||
|
|
||||||
def get_arguments():
|
def get_arguments():
|
||||||
"""Get parsed passed in arguments."""
|
"""Get parsed passed in arguments."""
|
||||||
|
import homeassistant.config as config_util
|
||||||
parser = argparse.ArgumentParser(
|
parser = argparse.ArgumentParser(
|
||||||
description="Home Assistant: Observe, Control, Automate.")
|
description="Home Assistant: Observe, Control, Automate.")
|
||||||
parser.add_argument('--version', action='version', version=__version__)
|
parser.add_argument('--version', action='version', version=__version__)
|
||||||
@ -225,6 +226,8 @@ def setup_and_run_hass(config_dir, args, top_process=False):
|
|||||||
Block until stopped. Will assume it is running in a subprocess unless
|
Block until stopped. Will assume it is running in a subprocess unless
|
||||||
top_process is set to true.
|
top_process is set to true.
|
||||||
"""
|
"""
|
||||||
|
from homeassistant import bootstrap
|
||||||
|
|
||||||
if args.demo_mode:
|
if args.demo_mode:
|
||||||
config = {
|
config = {
|
||||||
'frontend': {},
|
'frontend': {},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user