Skip to content

Commit e24e446

Browse files
committed
Fix interactive mode on Windows OS
Update requirements.txt
1 parent 3ed0303 commit e24e446

File tree

9 files changed

+16
-32
lines changed

9 files changed

+16
-32
lines changed

docs/genindex.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,8 +319,6 @@ <h2 id="P">P</h2>
319319
<table style="width: 100%" class="indextable genindextable"><tr>
320320
<td style="width: 33%; vertical-align: top;"><ul>
321321
<li><a href="index.html#jarvis_ui.modules.models.EnvConfig.parse_microphone_index">parse_microphone_index() (jarvis_ui.modules.models.EnvConfig class method)</a>
322-
</li>
323-
<li><a href="index.html#jarvis_ui.modules.models.Settings.pid">pid (jarvis_ui.modules.models.Settings attribute)</a>
324322
</li>
325323
<li><a href="index.html#jarvis_ui.modules.playsound.PlayAudio.play">play() (jarvis_ui.modules.playsound.PlayAudio method)</a>
326324
</li>
@@ -369,8 +367,6 @@ <h2 id="R">R</h2>
369367
<li><a href="index.html#jarvis_ui.modules.models.RestartTimer">RestartTimer (class in jarvis_ui.modules.models)</a>
370368
</li>
371369
<li><a href="index.html#jarvis_ui.modules.playsound.PlayAudio.run">run() (jarvis_ui.modules.playsound.PlayAudio method)</a>
372-
</li>
373-
<li><a href="index.html#jarvis_ui.modules.models.Settings.runenv">runenv (jarvis_ui.modules.models.Settings attribute)</a>
374370
</li>
375371
</ul></td>
376372
</tr></table>

docs/index.html

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -430,16 +430,6 @@ <h1>Models<a class="headerlink" href="#models" title="Permalink to this heading"
430430
<span class="sig-name descname"><span class="pre">operating_system</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">str</span></em><a class="headerlink" href="#jarvis_ui.modules.models.Settings.operating_system" title="Permalink to this definition"></a></dt>
431431
<dd></dd></dl>
432432

433-
<dl class="py attribute">
434-
<dt class="sig sig-object py" id="jarvis_ui.modules.models.Settings.pid">
435-
<span class="sig-name descname"><span class="pre">pid</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">PositiveInt</span></em><a class="headerlink" href="#jarvis_ui.modules.models.Settings.pid" title="Permalink to this definition"></a></dt>
436-
<dd></dd></dl>
437-
438-
<dl class="py attribute">
439-
<dt class="sig sig-object py" id="jarvis_ui.modules.models.Settings.runenv">
440-
<span class="sig-name descname"><span class="pre">runenv</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">str</span></em><a class="headerlink" href="#jarvis_ui.modules.models.Settings.runenv" title="Permalink to this definition"></a></dt>
441-
<dd></dd></dl>
442-
443433
<dl class="py attribute">
444434
<dt class="sig sig-object py" id="jarvis_ui.modules.models.Settings.wake_words">
445435
<span class="sig-name descname"><span class="pre">wake_words</span></span><em class="property"><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span><span class="p"><span class="pre">]</span></span></em><a class="headerlink" href="#jarvis_ui.modules.models.Settings.wake_words" title="Permalink to this definition"></a></dt>

docs/objects.inv

-12 Bytes
Binary file not shown.

docs/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jarvis_ui/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pynotification import pynotifier
44

5-
version = "0.5.3"
5+
version = "0.5.4"
66

77
try:
88
import pvporcupine # noqa

jarvis_ui/executables/helper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def time_converter(second: float) -> str:
7373

7474
def flush_screen() -> NoReturn:
7575
"""Flushes the screen output."""
76-
if models.settings.ide:
77-
sys.stdout.write("\r")
78-
else:
76+
if models.settings.interactive:
7977
sys.stdout.write(f"\r{' '.join(['' for _ in range(os.get_terminal_size().columns)])}")
78+
else:
79+
sys.stdout.write("\r")

jarvis_ui/lib/requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ SpeechRecognition==3.8.1 # Do not upgrade, no functional upgrade in latest vers
33
pyttsx3==2.90
44
inflect==6.0.2
55
requests>=2.28.2
6-
pydantic[dotenv,email]==1.10.6
6+
pydantic[dotenv,email]==1.10.7
77
PyYAML
8-
pynotification
9-
psutil==5.9.4
8+
pynotification

jarvis_ui/modules/models.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,12 @@
55
import os
66
import platform
77
import string
8+
import sys
89
from collections import ChainMap
910
from datetime import datetime
1011
from enum import Enum
11-
from multiprocessing import current_process
1212
from typing import List, Optional, Union
1313

14-
import psutil
1514
import pyttsx3
1615
from packaging.version import parse as parser
1716
from pydantic import (BaseSettings, Field, FilePath, HttpUrl, PositiveFloat,
@@ -64,15 +63,10 @@ class Settings(BaseSettings):
6463
legacy: bool = True if os == "Darwin" and parser(platform.mac_ver()[0]) < parser('10.14') else False
6564
bot: str = "jarvis"
6665
wake_words: Optional[List[str]]
67-
if current_process().name == 'MainProcess':
68-
pid: PositiveInt = os.getpid()
66+
if sys.stdin.isatty():
67+
interactive = True
6968
else:
70-
pid: PositiveInt = os.getppid()
71-
runenv: str = psutil.Process(pid).parent().name()
72-
if runenv.endswith('sh'):
73-
ide = False
74-
else:
75-
ide = True
69+
interactive = False
7670

7771

7872
settings = Settings()

release_notes.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Release Notes
22
=============
33

4+
0.5.4 (03/22/2023)
5+
------------------
6+
- Fix interactive mode on Windows OS
7+
- Update requirements.txt
8+
49
0.5.3 (03/22/2023)
510
------------------
611
- Fix static IDE identifier on child processes

0 commit comments

Comments
 (0)