Skip to content

Commit

Permalink
[gen_efi_app] Updated ATS CLI mechanism, docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vroncevic committed Jul 8, 2024
1 parent b890d72 commit 6a119f2
Show file tree
Hide file tree
Showing 29 changed files with 341 additions and 54 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ RUN DEBIAN_FRONTEND=noninteractive \
openssl \
python3 \
python3-dev \
libyaml-dev
libyaml-dev \
build-essential \
uuid-dev \
iasl \
nasm

RUN wget https://bootstrap.pypa.io/get-pip.py
RUN python3 get-pip.py
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ Generator structure
6 directories, 17 files
```

### Code coverage

| Name | Stmts | Miss | Cover |
|------|-------|------|-------|
| `gen_efi_app/__init__.py` | 71 | 12 | 83% |
| `gen_efi_app/pro/__init__.py` | 59 | 2 | 97% |
| `gen_efi_app/pro/read_template.py` | 53 | 2 | 96% |
| `gen_efi_app/pro/write_template.py` | 59 | 4 | 93% |
| **Total** | 242 | 20 | 92% |

### Docs

[![Documentation Status](https://readthedocs.org/projects/gen_efi_app/badge/?version=latest)](https://gen-efi-app.readthedocs.io/en/latest/?badge=latest)
Expand Down
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/gen_efi_app.doctree
Binary file not shown.
20 changes: 10 additions & 10 deletions docs/build/html/_modules/gen_efi_app.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ <h1>Source code for gen_efi_app</h1><div class="highlight"><pre>
<span class="sd">&#39;&#39;&#39;</span>

<span class="kn">import</span> <span class="nn">sys</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">List</span><span class="p">,</span> <span class="n">Dict</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">List</span><span class="p">,</span> <span class="n">Dict</span><span class="p">,</span> <span class="n">Optional</span>
<span class="kn">from</span> <span class="nn">os.path</span> <span class="kn">import</span> <span class="n">exists</span><span class="p">,</span> <span class="n">dirname</span><span class="p">,</span> <span class="n">realpath</span>
<span class="kn">from</span> <span class="nn">os</span> <span class="kn">import</span> <span class="n">getcwd</span>
<span class="kn">from</span> <span class="nn">argparse</span> <span class="kn">import</span> <span class="n">Namespace</span>

<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">ats_utilities.splash</span> <span class="kn">import</span> <span class="n">Splash</span>
<span class="kn">from</span> <span class="nn">ats_utilities.cli.cfg_cli</span> <span class="kn">import</span> <span class="n">CfgCLI</span>
<span class="kn">from</span> <span class="nn">ats_utilities.cli</span> <span class="kn">import</span> <span class="n">ATSCli</span>
<span class="kn">from</span> <span class="nn">ats_utilities.logging</span> <span class="kn">import</span> <span class="n">ATSLogger</span>
<span class="kn">from</span> <span class="nn">ats_utilities.console_io.error</span> <span class="kn">import</span> <span class="n">error_message</span>
<span class="kn">from</span> <span class="nn">ats_utilities.console_io.verbose</span> <span class="kn">import</span> <span class="n">verbose_message</span>
Expand All @@ -82,15 +82,15 @@ <h1>Source code for gen_efi_app</h1><div class="highlight"><pre>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://electux.github.io/gen_efi_app&#39;</span>
<span class="n">__credits__</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Vladimir Roncevic&#39;</span><span class="p">,</span> <span class="s1">&#39;Python Software Foundation&#39;</span><span class="p">]</span>
<span class="n">__license__</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/electux/gen_efi_app/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.3.3&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.3.4&#39;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s1">&#39;elektron.ronca@gmail.com&#39;</span>
<span class="n">__status__</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>


<div class="viewcode-block" id="GenEfiApp">
<a class="viewcode-back" href="../gen_efi_app.html#gen_efi_app.GenEfiApp">[docs]</a>
<span class="k">class</span> <span class="nc">GenEfiApp</span><span class="p">(</span><span class="n">CfgCLI</span><span class="p">):</span>
<span class="k">class</span> <span class="nc">GenEfiApp</span><span class="p">(</span><span class="n">ATSCli</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&#39;&#39;&#39;</span>
<span class="sd"> Defines class GenEfiApp with attribute(s) and method(s).</span>
<span class="sd"> Loads a base info, creates a CLI interface and runs operations.</span>
Expand Down Expand Up @@ -138,9 +138,9 @@ <h1>Source code for gen_efi_app</h1><div class="highlight"><pre>
<span class="n">verbose</span><span class="p">,</span> <span class="p">[</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1"> init tool info&#39;</span><span class="p">]</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_logger</span><span class="p">:</span> <span class="n">ATSLogger</span> <span class="o">=</span> <span class="n">ATSLogger</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">(),</span> <span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">current_dir</span><span class="si">}{</span><span class="bp">self</span><span class="o">.</span><span class="n">_LOG</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">,</span> <span class="n">verbose</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">(),</span> <span class="kc">True</span><span class="p">,</span> <span class="kc">None</span><span class="p">,</span> <span class="kc">True</span><span class="p">,</span> <span class="n">verbose</span>
<span class="p">)</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">tool_operational</span><span class="p">:</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_operational</span><span class="p">():</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_new_option</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_OPS</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">_OPS</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">dest</span><span class="o">=</span><span class="s1">&#39;name&#39;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;generate project (provide name)&#39;</span>
Expand All @@ -164,10 +164,10 @@ <h1>Source code for gen_efi_app</h1><div class="highlight"><pre>
<span class="sd"> :exceptions: None</span>
<span class="sd"> &#39;&#39;&#39;</span>
<span class="n">status</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">tool_operational</span><span class="p">:</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_operational</span><span class="p">():</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">args</span><span class="p">:</span> <span class="n">Namespace</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parse_args</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">bool</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">)):</span>
<span class="n">args</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Namespace</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parse_args</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">bool</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span><span class="p">)):</span>
<span class="n">error_message</span><span class="p">(</span>
<span class="p">[</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1"> missing name argument&#39;</span><span class="p">]</span>
<span class="p">)</span>
Expand Down Expand Up @@ -207,7 +207,7 @@ <h1>Source code for gen_efi_app</h1><div class="highlight"><pre>
<span class="p">)</span>
<span class="k">except</span> <span class="ne">SystemExit</span><span class="p">:</span>
<span class="n">error_message</span><span class="p">(</span>
<span class="p">[</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1"> expected argument -n&#39;</span><span class="p">]</span>
<span class="p">[</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1"> expected argument name&#39;</span><span class="p">]</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">status</span>
<span class="k">else</span><span class="p">:</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/_modules/gen_efi_app/pro.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h1>Source code for gen_efi_app.pro</h1><div class="highlight"><pre>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://electux.github.io/gen_efi_app&#39;</span>
<span class="n">__credits__</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Vladimir Roncevic&#39;</span><span class="p">,</span> <span class="s1">&#39;Python Software Foundation&#39;</span><span class="p">]</span>
<span class="n">__license__</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/electux/gen_efi_app/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.3.3&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.3.4&#39;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s1">&#39;elektron.ronca@gmail.com&#39;</span>
<span class="n">__status__</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h1>Source code for gen_efi_app.pro.read_template</h1><div class="highlight"><pr
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://electux.github.io/gen_efi_app&#39;</span>
<span class="n">__credits__</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Vladimir Roncevic&#39;</span><span class="p">,</span> <span class="s1">&#39;Python Software Foundation&#39;</span><span class="p">]</span>
<span class="n">__license__</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/electux/gen_efi_app/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.3.3&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.3.4&#39;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s1">&#39;elektron.ronca@gmail.com&#39;</span>
<span class="n">__status__</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ <h1>Source code for gen_efi_app.pro.write_template</h1><div class="highlight"><p
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://electux.github.io/gen_efi_app&#39;</span>
<span class="n">__credits__</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Vladimir Roncevic&#39;</span><span class="p">,</span> <span class="s1">&#39;Python Software Foundation&#39;</span><span class="p">]</span>
<span class="n">__license__</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/electux/gen_efi_app/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.3.3&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.3.4&#39;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s1">&#39;elektron.ronca@gmail.com&#39;</span>
<span class="n">__status__</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/build/html/gen_efi_app.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ <h2>Subpackages<a class="headerlink" href="#subpackages" title="Link to this hea
<dl class="py class">
<dt class="sig sig-object py" id="gen_efi_app.GenEfiApp">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">gen_efi_app.</span></span><span class="sig-name descname"><span class="pre">GenEfiApp</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">verbose</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/gen_efi_app.html#GenEfiApp"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#gen_efi_app.GenEfiApp" title="Link to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">CfgCLI</span></code></p>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">ATSCli</span></code></p>
<p>Defines class GenEfiApp with attribute(s) and method(s).
Loads a base info, creates a CLI interface and runs operations.</p>
<p>It defines:</p>
Expand Down
Binary file modified docs/build/html/objects.inv
Binary file not shown.
Loading

0 comments on commit 6a119f2

Please sign in to comment.