Skip to content

Commit

Permalink
Merge pull request #21 from vroncevic/dev
Browse files Browse the repository at this point in the history
[gen_coap_service] Updated ATS CLI mechanism, docs
  • Loading branch information
vroncevic authored Jul 8, 2024
2 parents 9fa54ba + 906e5ae commit f6e9dac
Show file tree
Hide file tree
Showing 30 changed files with 349 additions and 70 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
global-exclude *.py[cod]
global-exclude *.editorconfig
global-exclude *.editorconfig
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ Generator structure
16 directories, 46 files
```

### Code coverage

| Name | Stmts | Miss | Cover |
|------|-------|------|-------|
| `gen_coap_service/__init__.py` | 75 | 14 | 81% |
| `gen_coap_service/pro/__init__.py` | 85 | 3 | 96% |
| `gen_coap_service/pro/read_template.py` | 38 | 2 | 95% |
| `gen_coap_service/pro/write_template.py` | 40 | 2 | 95% |
| **Total** | 238 | 21 | 91% |

### Docs

[![Documentation Status](https://readthedocs.org/projects/gen_coap_service/badge/?version=latest)](https://gen-coap-service.readthedocs.io/projects/gen_coap_service/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_coap_service.doctree
Binary file not shown.
33 changes: 18 additions & 15 deletions docs/build/html/_modules/gen_coap_service.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/build/html/_modules/gen_coap_service/pro.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h1>Source code for gen_coap_service.pro</h1><div class="highlight"><pre>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://vroncevic.github.io/gen_coap_service&#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/vroncevic/gen_coap_service/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.1.4&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.1.5&#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;[email protected]&#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 @@ -76,7 +76,7 @@ <h1>Source code for gen_coap_service.pro.read_template</h1><div class="highlight
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://vroncevic.github.io/gen_coap_service&#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/vroncevic/gen_coap_service/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.1.4&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.1.5&#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;[email protected]&#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 @@ -78,7 +78,7 @@ <h1>Source code for gen_coap_service.pro.write_template</h1><div class="highligh
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://vroncevic.github.io/gen_coap_service&#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/vroncevic/gen_coap_service/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.1.4&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.1.5&#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;[email protected]&#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_coap_service.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_coap_service.GenCoAPService">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">gen_coap_service.</span></span><span class="sig-name descname"><span class="pre">GenCoAPService</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_coap_service.html#GenCoAPService"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#gen_coap_service.GenCoAPService" 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 GenCoAPService with attribute(s) and method(s).
Loads a base info, creates a CLI interface and runs operations.</p>
<p>It Definess:</p>
Expand Down
Binary file modified docs/build/html/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/build/html/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
project: str = 'gen_coap_service'
project_copyright: str = '2024, Vladimir Roncevic <[email protected]>'
author: str = 'Vladimir Roncevic <[email protected]>'
version: str = '1.1.4'
version: str = '1.1.5'
release: str = 'https://github.com/vroncevic/gen_coap_service/releases'
extensions: List[str] = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path: List[str] = ['_templates']
Expand Down
31 changes: 17 additions & 14 deletions gen_coap_service/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
'''

import sys
from typing import List
from typing import List, Optional
from os.path import exists, dirname, realpath
from os import getcwd
from argparse import Namespace

try:
from ats_utilities.splash import Splash
from ats_utilities.logging import ATSLogger
from ats_utilities.cli.cfg_cli import CfgCLI
from ats_utilities.cli import ATSCli
from ats_utilities.console_io.error import error_message
from ats_utilities.console_io.verbose import verbose_message
from ats_utilities.console_io.success import success_message
Expand All @@ -44,13 +44,13 @@
__copyright__ = '(C) 2024, https://vroncevic.github.io/gen_coap_service'
__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
__license__ = 'https://github.com/vroncevic/gen_coap_service/blob/dev/LICENSE'
__version__ = '1.1.4'
__version__ = '1.1.5'
__maintainer__ = 'Vladimir Roncevic'
__email__ = '[email protected]'
__status__ = 'Updated'


class GenCoAPService(CfgCLI):
class GenCoAPService(ATSCli):
'''
Defines class GenCoAPService with attribute(s) and method(s).
Loads a base info, creates a CLI interface and runs operations.
Expand Down Expand Up @@ -97,9 +97,9 @@ def __init__(self, verbose: bool = False) -> None:
verbose, [f'{self._GEN_VERBOSE.lower()} init tool info']
)
self._logger: ATSLogger = ATSLogger(
self._GEN_VERBOSE.lower(), f'{current_dir}{self._LOG}', verbose
self._GEN_VERBOSE.lower(), True, None, True, verbose
)
if self.tool_operational:
if self.is_operational():
self.add_new_option(
self._OPS[0], self._OPS[1], dest='name',
help='generate project (provide name)'
Expand All @@ -125,15 +125,15 @@ def process(self, verbose: bool = False) -> bool:
:exceptions: None
'''
status: bool = False
if self.tool_operational:
if self.is_operational():
try:
args: Namespace = self.parse_args(sys.argv)
if not bool(getattr(args, "name")):
args: Optional[Namespace] = self.parse_args(sys.argv)
if not bool(getattr(args, 'name')):
error_message(
[f'{self._GEN_VERBOSE.lower()} missing name argument']
)
return status
if not bool(getattr(args, "type")):
if not bool(getattr(args, 'type')):
error_message(
[f'{self._GEN_VERBOSE.lower()} missing type argument']
)
Expand All @@ -149,13 +149,13 @@ def process(self, verbose: bool = False) -> bool:
" ".join([
f'[{self._GEN_VERBOSE.lower()}]',
'generate CoAP project skeleton',
str(getattr(args, "type")),
str(getattr(args, "name"))
str(getattr(args, 'type')),
str(getattr(args, 'name'))
])
)
try:
status = gen.project_setup(
getattr(args, "name"), getattr(args, "type"),
getattr(args, 'name'), getattr(args, 'type'),
getattr(args, "verbose") or verbose
)
except (ATSTypeError, ATSValueError) as e:
Expand All @@ -174,7 +174,10 @@ def process(self, verbose: bool = False) -> bool:
)
except SystemExit:
error_message(
[f'{self._GEN_VERBOSE.lower()} expected argument -n']
[
f'{self._GEN_VERBOSE.lower()}',
'expected arguments name and type'
]
)
return status
else:
Expand Down
2 changes: 1 addition & 1 deletion gen_coap_service/conf/gen_coap_service.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ats_name = gen_coap_service
ats_version = 1.1.4
ats_version = 1.1.5
ats_build_date = 9 Jun 2020
ats_licence = https://github.com/vroncevic/gen_coap_service/blob/dev/LICENSE
2 changes: 1 addition & 1 deletion gen_coap_service/log/.editorconfig
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[ **.log]
[**.log]
indent_style = tab
tab_width = 4
8 changes: 0 additions & 8 deletions gen_coap_service/log/gen_coap_service.log
Original file line number Diff line number Diff line change
@@ -1,8 +0,0 @@
07/03/2024 10:26:02 PM - INFO - generation simple_project done
07/03/2024 10:26:03 PM - INFO - generation simple_project done
07/03/2024 10:26:06 PM - INFO - generation simple_project done
07/03/2024 10:26:08 PM - ERROR - tool is not operational
07/03/2024 10:28:40 PM - INFO - generation simple_project done
07/03/2024 10:28:41 PM - INFO - generation simple_project done
07/03/2024 10:28:44 PM - INFO - generation simple_project done
07/03/2024 10:28:46 PM - ERROR - tool is not operational
2 changes: 1 addition & 1 deletion gen_coap_service/pro/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
__copyright__ = '(C) 2024, https://vroncevic.github.io/gen_coap_service'
__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
__license__ = 'https://github.com/vroncevic/gen_coap_service/blob/dev/LICENSE'
__version__ = '1.1.4'
__version__ = '1.1.5'
__maintainer__ = 'Vladimir Roncevic'
__email__ = '[email protected]'
__status__ = 'Updated'
Expand Down
2 changes: 1 addition & 1 deletion gen_coap_service/pro/read_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
__copyright__ = '(C) 2024, https://vroncevic.github.io/gen_coap_service'
__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
__license__ = 'https://github.com/vroncevic/gen_coap_service/blob/dev/LICENSE'
__version__ = '1.1.4'
__version__ = '1.1.5'
__maintainer__ = 'Vladimir Roncevic'
__email__ = '[email protected]'
__status__ = 'Updated'
Expand Down
2 changes: 1 addition & 1 deletion gen_coap_service/pro/write_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
__copyright__ = '(C) 2024, https://vroncevic.github.io/gen_coap_service'
__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
__license__ = 'https://github.com/vroncevic/gen_coap_service/blob/dev/LICENSE'
__version__ = '1.1.4'
__version__ = '1.1.5'
__maintainer__ = 'Vladimir Roncevic'
__email__ = '[email protected]'
__status__ = 'Updated'
Expand Down
2 changes: 1 addition & 1 deletion gen_coap_service/run/gen_coap_service_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
__copyright__ = '(C) 2024, https://vroncevic.github.io/gen_coap_service'
__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
__license__ = 'https://github.com/vroncevic/gen_coap_service/blob/dev/LICENSE'
__version__ = '1.1.4'
__version__ = '1.1.5'
__maintainer__ = 'Vladimir Roncevic'
__email__ = '[email protected]'
__status__ = 'Updated'
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

[metadata]
name = gen_coap_service
version = 1.1.4
version = 1.1.5
author = Vladimir Roncevic
author_email = [email protected]
description = Generating CoAP Modules
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
__copyright__ = '(C) 2024, https://vroncevic.github.io/gen_coap_service'
__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
__license__ = 'https://github.com/vroncevic/gen_coap_service/blob/dev/LICENSE'
__version__ = '1.1.4'
__version__ = '1.1.5'
__maintainer__ = 'Vladimir Roncevic'
__email__ = '[email protected]'
__status__ = 'Updated'
Expand Down Expand Up @@ -61,7 +61,7 @@
PYP_CLASSIFIERS: List[str] = SUPPORTED_PY_VERSIONS + APPROVED_LICENSES
setup(
name='gen_coap_service',
version='1.1.4',
version='1.1.5',
description='Generating CoAP Modules',
author='Vladimir Roncevic',
author_email='[email protected]',
Expand Down
Binary file modified tests/.coverage
Binary file not shown.
1 change: 1 addition & 0 deletions tests/gen_coap_service_coverage.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"meta": {"format": 2, "version": "7.5.3", "timestamp": "2024-07-08T18:09:50.934573", "branch_coverage": false, "show_contexts": false}, "files": {"/data/dev/python/3_tools/gen_coap_service/github/gen_coap_service/gen_coap_service/__init__.py": {"executed_lines": [3, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 43, 44, 45, 46, 47, 48, 49, 50, 53, 54, 71, 72, 73, 74, 75, 77, 85, 86, 93, 94, 95, 96, 99, 102, 103, 107, 111, 117, 127, 128, 129, 130, 131, 132, 135, 136, 137, 140, 141, 147, 148, 156, 157, 164, 165, 166, 190], "summary": {"covered_lines": 61, "num_statements": 75, "percent_covered": 81.33333333333333, "percent_covered_display": "81", "missing_lines": 14, "excluded_lines": 0}, "missing_lines": [39, 41, 142, 146, 161, 162, 163, 171, 172, 175, 176, 182, 184, 187], "excluded_lines": []}, "/data/dev/python/3_tools/gen_coap_service/github/gen_coap_service/gen_coap_service/pro/__init__.py": {"executed_lines": [3, 23, 24, 25, 26, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 42, 43, 44, 45, 46, 47, 48, 49, 52, 53, 71, 72, 74, 82, 83, 84, 85, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 99, 107, 109, 117, 119, 138, 139, 140, 143, 144, 145, 146, 147, 148, 149, 152, 153, 154, 160, 161, 162, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 185, 186, 187, 188, 189, 192, 193, 194], "summary": {"covered_lines": 82, "num_statements": 85, "percent_covered": 96.47058823529412, "percent_covered_display": "96", "missing_lines": 3, "excluded_lines": 0}, "missing_lines": [38, 40, 150], "excluded_lines": []}, "/data/dev/python/3_tools/gen_coap_service/github/gen_coap_service/gen_coap_service/pro/read_template.py": {"executed_lines": [3, 23, 24, 26, 27, 28, 29, 30, 35, 36, 37, 38, 39, 40, 41, 42, 45, 46, 59, 61, 69, 70, 72, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100], "summary": {"covered_lines": 36, "num_statements": 38, "percent_covered": 94.73684210526316, "percent_covered_display": "95", "missing_lines": 2, "excluded_lines": 0}, "missing_lines": [31, 33], "excluded_lines": []}, "/data/dev/python/3_tools/gen_coap_service/github/gen_coap_service/gen_coap_service/pro/write_template.py": {"executed_lines": [3, 23, 24, 25, 26, 28, 29, 30, 31, 32, 37, 38, 39, 40, 41, 42, 43, 44, 47, 48, 61, 63, 71, 72, 76, 88, 89, 90, 91, 92, 93, 94, 95, 98, 99, 100, 101, 104, 105, 106], "summary": {"covered_lines": 38, "num_statements": 40, "percent_covered": 95.0, "percent_covered_display": "95", "missing_lines": 2, "excluded_lines": 0}, "missing_lines": [33, 35], "excluded_lines": []}}, "totals": {"covered_lines": 217, "num_statements": 238, "percent_covered": 91.17647058823529, "percent_covered_display": "91", "missing_lines": 21, "excluded_lines": 0}}
Loading

0 comments on commit f6e9dac

Please sign in to comment.