Skip to content

Commit

Permalink
Support self restart on Linux OS
Browse files Browse the repository at this point in the history
Move helper functions to dedicated module
Rearrange runbook and README.md
  • Loading branch information
dormant-user committed May 11, 2023
1 parent 288c1da commit cae586b
Show file tree
Hide file tree
Showing 17 changed files with 531 additions and 414 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ if __name__ == '__main__':
jarvis_ui.start()
```

### Mandatory Env Vars
### Environment Variables
#### Mandatory
- **REQUEST_URL**: URL to which the API call has to be made. Can be `localhost` or a `tunneled` URL behind a reverse proxy/CDN.
- **TOKEN**: Authentication token.

### Optional Env Vars
#### Optional
- **HEART_BEAT**: Defaults to `None` - _If # of seconds is set, background health check with the server will be enabled_
- **DEBUG**: Defaults to `False` - _Enable debug level logging_
<br><br>
Expand Down Expand Up @@ -68,13 +69,13 @@ Sample settings (formatted as JSON object)

Refer Jarvis' [README](https://github.com/thevickypedia/Jarvis/blob/master/README.md) for more information on setting up the backend server.

#### Coding Standards
### Coding Standards
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
Clean code with pre-commit hooks: [`flake8`](https://flake8.pycqa.org/en/latest/) and
[`isort`](https://pycqa.github.io/isort/)

#### [Release Notes](https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst)
### [Release Notes](https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst)
**Requirement**
```shell
python -m pip install changelog-generator
Expand All @@ -85,7 +86,7 @@ python -m pip install changelog-generator
changelog reverse -f release_notes.rst -t 'Release Notes'
```

#### Linting
### Linting
`PreCommit` will ensure linting, and the doc creation are run on every commit.

**Requirement**
Expand All @@ -100,12 +101,12 @@ pip install --no-cache sphinx==5.1.1 pre-commit recommonmark
pre-commit run --all-files
```

#### Pypi Package
### Pypi Package
[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)](https://packaging.python.org/tutorials/packaging-projects/)

[https://pypi.org/project/jarvis-ui/](https://pypi.org/project/jarvis-ui/)

#### Runbook
### Runbook
[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)

[https://thevickypedia.github.io/Jarvis_UI/](https://thevickypedia.github.io/Jarvis_UI/)
Expand Down
80 changes: 47 additions & 33 deletions doc_generator/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,30 @@ Jarvis
:members:
:undoc-members:

Executables
===========

API Handler
===========

.. automodule:: jarvis_ui.executables.api_handler
:members:
:undoc-members:

Config

Display
=======

.. automodule:: jarvis_ui.executables.display
:members:
:undoc-members:

Helper
======

.. autoclass:: jarvis_ui.modules.config.Config(BaseConfig)
.. automodule:: jarvis_ui.executables.helper
:members:
:exclude-members:
:undoc-members:

Listener
========
Expand All @@ -40,50 +51,60 @@ Listener
:members:
:undoc-members:

Logger
======
Speaker
=======

.. automodule:: jarvis_ui.modules.logger
.. automodule:: jarvis_ui.executables.speaker
:members:
:undoc-members:

Models
======
Starter
=======

.. autoclass:: jarvis_ui.modules.models.EnvConfig(BaseSettings)
.. automodule:: jarvis_ui.executables.starter
:members:
:undoc-members:

.. autoclass:: jarvis_ui.modules.models.FileIO(BaseSettings)
Modules
=======

Config
======

.. autoclass:: jarvis_ui.modules.config.Config(BaseConfig)
:members:
:undoc-members:
:exclude-members:

.. autoclass:: jarvis_ui.modules.models.Settings(BaseSettings)
Exceptions
==========

.. automodule:: jarvis_ui.modules.exceptions
:members:
:undoc-members:

.. autoclass:: jarvis_ui.modules.models.Sensitivity(float or PositiveInt, Enum)
Logger
======

.. automodule:: jarvis_ui.modules.logger
:members:
:undoc-members:

Repeated Timer
==============
Models
======

.. automodule:: jarvis_ui.modules.timer
.. autoclass:: jarvis_ui.modules.models.EnvConfig(BaseSettings)
:members:
:undoc-members:

Speaker
=======

.. automodule:: jarvis_ui.executables.speaker
.. autoclass:: jarvis_ui.modules.models.FileIO(BaseSettings)
:members:
:undoc-members:

Starter
=======
.. autoclass:: jarvis_ui.modules.models.Settings(BaseSettings)
:members:
:undoc-members:

.. automodule:: jarvis_ui.executables.starter
.. autoclass:: jarvis_ui.modules.models.Sensitivity(float or PositiveInt, Enum)
:members:
:undoc-members:

Expand All @@ -94,17 +115,10 @@ Peripherals
:members:
:undoc-members:

Exceptions
==========

.. automodule:: jarvis_ui.modules.exceptions
:members:
:undoc-members:

Display
=======
Repeated Timer
==============

.. automodule:: jarvis_ui.executables.display
.. automodule:: jarvis_ui.modules.timer
:members:
:undoc-members:

Expand Down
32 changes: 18 additions & 14 deletions docs/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,17 @@ <h2>Kick off<a class="headerlink" href="#kick-off" title="Permalink to this head
</pre></div>
</div>
</section>
<section id="mandatory-env-vars">
<h2>Mandatory Env Vars<a class="headerlink" href="#mandatory-env-vars" title="Permalink to this heading"></a></h2>
<section id="environment-variables">
<h2>Environment Variables<a class="headerlink" href="#environment-variables" title="Permalink to this heading"></a></h2>
<section id="mandatory">
<h3>Mandatory<a class="headerlink" href="#mandatory" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><strong>REQUEST_URL</strong>: URL to which the API call has to be made. Can be <code class="docutils literal notranslate"><span class="pre">localhost</span></code> or a <code class="docutils literal notranslate"><span class="pre">tunneled</span></code> URL behind a reverse proxy/CDN.</p></li>
<li><p><strong>TOKEN</strong>: Authentication token.</p></li>
</ul>
</section>
<section id="optional-env-vars">
<h2>Optional Env Vars<a class="headerlink" href="#optional-env-vars" title="Permalink to this heading"></a></h2>
<section id="optional">
<h3>Optional<a class="headerlink" href="#optional" title="Permalink to this heading"></a></h3>
<ul class="simple">
<li><p><strong>HEART_BEAT</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code> - <em>If # of seconds is set, background health check with the server will be enabled</em></p></li>
<li><p><strong>DEBUG</strong>: Defaults to <code class="docutils literal notranslate"><span class="pre">False</span></code> - <em>Enable debug level logging</em>
Expand Down Expand Up @@ -115,15 +117,17 @@ <h2>Optional Env Vars<a class="headerlink" href="#optional-env-vars" title="Perm
<li><p><strong>non_speaking_duration</strong>: Seconds of non-speaking audio to keep on both sides of the recording.</p></li>
</ul>
<p>Refer Jarvis’ <a class="reference external" href="https://github.com/thevickypedia/Jarvis/blob/master/README.md">README</a> for more information on setting up the backend server.</p>
</section>
</section>
<section id="coding-standards">
<h3>Coding Standards<a class="headerlink" href="#coding-standards" title="Permalink to this heading"></a></h3>
<h2>Coding Standards<a class="headerlink" href="#coding-standards" title="Permalink to this heading"></a></h2>
<p>Docstring format: <a class="reference external" href="https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings"><code class="docutils literal notranslate"><span class="pre">Google</span></code></a> <br>
Styling conventions: <a class="reference external" href="https://www.python.org/dev/peps/pep-0008/"><code class="docutils literal notranslate"><span class="pre">PEP</span> <span class="pre">8</span></code></a> <br>
Clean code with pre-commit hooks: <a class="reference external" href="https://flake8.pycqa.org/en/latest/"><code class="docutils literal notranslate"><span class="pre">flake8</span></code></a> and
<a class="reference external" href="https://pycqa.github.io/isort/"><code class="docutils literal notranslate"><span class="pre">isort</span></code></a></p>
</section>
<section id="release-notes">
<h3><a class="reference external" href="https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst">Release Notes</a><a class="headerlink" href="#release-notes" title="Permalink to this heading"></a></h3>
<h2><a class="reference external" href="https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst">Release Notes</a><a class="headerlink" href="#release-notes" title="Permalink to this heading"></a></h2>
<p><strong>Requirement</strong></p>
<div class="highlight-shell notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>changelog-generator
</pre></div>
Expand All @@ -134,7 +138,7 @@ <h3><a class="reference external" href="https://github.com/thevickypedia/Jarvis_
</div>
</section>
<section id="linting">
<h3>Linting<a class="headerlink" href="#linting" title="Permalink to this heading"></a></h3>
<h2>Linting<a class="headerlink" href="#linting" title="Permalink to this heading"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">PreCommit</span></code> will ensure linting, and the doc creation are run on every commit.</p>
<p><strong>Requirement</strong>
<br></p>
Expand All @@ -148,16 +152,15 @@ <h3>Linting<a class="headerlink" href="#linting" title="Permalink to this headin
</div>
</section>
<section id="pypi-package">
<h3>Pypi Package<a class="headerlink" href="#pypi-package" title="Permalink to this heading"></a></h3>
<h2>Pypi Package<a class="headerlink" href="#pypi-package" title="Permalink to this heading"></a></h2>
<p><a class="reference external" href="https://packaging.python.org/tutorials/packaging-projects/"><img alt="pypi-module" src="https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg" /></a></p>
<p><a class="reference external" href="https://pypi.org/project/jarvis-ui/">https://pypi.org/project/jarvis-ui/</a></p>
</section>
<section id="runbook">
<h3>Runbook<a class="headerlink" href="#runbook" title="Permalink to this heading"></a></h3>
<h2>Runbook<a class="headerlink" href="#runbook" title="Permalink to this heading"></a></h2>
<p><a class="reference external" href="https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html"><img alt="made-with-sphinx-doc" src="https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg" /></a></p>
<p><a class="reference external" href="https://thevickypedia.github.io/Jarvis_UI/">https://thevickypedia.github.io/Jarvis_UI/</a></p>
</section>
</section>
<section id="license-copyright">
<h2>License &amp; copyright<a class="headerlink" href="#license-copyright" title="Permalink to this heading"></a></h2>
<p>© Vignesh Sivanandha Rao</p>
Expand All @@ -177,15 +180,16 @@ <h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Jarvis UI</a><ul>
<li><a class="reference internal" href="#kick-off">Kick off</a></li>
<li><a class="reference internal" href="#mandatory-env-vars">Mandatory Env Vars</a></li>
<li><a class="reference internal" href="#optional-env-vars">Optional Env Vars</a><ul>
<li><a class="reference internal" href="#environment-variables">Environment Variables</a><ul>
<li><a class="reference internal" href="#mandatory">Mandatory</a></li>
<li><a class="reference internal" href="#optional">Optional</a></li>
</ul>
</li>
<li><a class="reference internal" href="#coding-standards">Coding Standards</a></li>
<li><a class="reference internal" href="#release-notes">Release Notes</a></li>
<li><a class="reference internal" href="#linting">Linting</a></li>
<li><a class="reference internal" href="#pypi-package">Pypi Package</a></li>
<li><a class="reference internal" href="#runbook">Runbook</a></li>
</ul>
</li>
<li><a class="reference internal" href="#license-copyright">License &amp; copyright</a></li>
</ul>
</li>
Expand Down
15 changes: 8 additions & 7 deletions docs/_sources/README.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@ if __name__ == '__main__':
jarvis_ui.start()
```

### Mandatory Env Vars
### Environment Variables
#### Mandatory
- **REQUEST_URL**: URL to which the API call has to be made. Can be `localhost` or a `tunneled` URL behind a reverse proxy/CDN.
- **TOKEN**: Authentication token.

### Optional Env Vars
#### Optional
- **HEART_BEAT**: Defaults to `None` - _If # of seconds is set, background health check with the server will be enabled_
- **DEBUG**: Defaults to `False` - _Enable debug level logging_
<br><br>
Expand Down Expand Up @@ -68,13 +69,13 @@ Sample settings (formatted as JSON object)

Refer Jarvis' [README](https://github.com/thevickypedia/Jarvis/blob/master/README.md) for more information on setting up the backend server.

#### Coding Standards
### Coding Standards
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
Clean code with pre-commit hooks: [`flake8`](https://flake8.pycqa.org/en/latest/) and
[`isort`](https://pycqa.github.io/isort/)

#### [Release Notes](https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst)
### [Release Notes](https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst)
**Requirement**
```shell
python -m pip install changelog-generator
Expand All @@ -85,7 +86,7 @@ python -m pip install changelog-generator
changelog reverse -f release_notes.rst -t 'Release Notes'
```

#### Linting
### Linting
`PreCommit` will ensure linting, and the doc creation are run on every commit.

**Requirement**
Expand All @@ -100,12 +101,12 @@ pip install --no-cache sphinx==5.1.1 pre-commit recommonmark
pre-commit run --all-files
```

#### Pypi Package
### Pypi Package
[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)](https://packaging.python.org/tutorials/packaging-projects/)

[https://pypi.org/project/jarvis-ui/](https://pypi.org/project/jarvis-ui/)

#### Runbook
### Runbook
[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)

[https://thevickypedia.github.io/Jarvis_UI/](https://thevickypedia.github.io/Jarvis_UI/)
Expand Down
Loading

0 comments on commit cae586b

Please sign in to comment.