Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved config handling #46

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions docker_overlay/etc/neon/neon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,12 @@ location:
name: Pacific Standard Time
dstOffset: 3600000
offset: -28800000

logs:
name: iris
level: INFO
level_overrides:
error:
- pika
warning:
- filelock
7 changes: 7 additions & 0 deletions neon_iris/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from os import environ
from neon_utils.log_utils import init_log

environ.setdefault("OVOS_CONFIG_BASE_FOLDER", "neon")
environ.setdefault("OVOS_CONFIG_FILENAME", "diana.yaml")
init_log(log_name="iris")
5 changes: 0 additions & 5 deletions neon_iris/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import click

from os import environ
from os.path import expanduser, isfile
from time import sleep
from click_default_group import DefaultGroup
Expand All @@ -38,10 +37,6 @@
from neon_iris.util import load_config_file
from neon_iris.version import __version__

environ.setdefault("OVOS_CONFIG_BASE_FOLDER", "neon")
environ.setdefault("OVOS_CONFIG_FILENAME", "diana.yaml")
# TODO: Define default config file from this package


def _print_config():
from ovos_config.config import Configuration
Expand Down
2 changes: 0 additions & 2 deletions neon_iris/web_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ def __init__(self, lang: str = None):
makedirs(self._audio_path)
self.default_lang = lang or self.config.get('default_lang')
self.chat_ui = gradio.Blocks()
LOG.name = "iris"
LOG.init(self.config.get("logs"))

def get_lang(self, session_id: str):
if session_id and session_id in self._profiles:
Expand Down
Loading