Coverage report: - 95% -
- - -- Files - Functions - Classes -
-- coverage.py v7.6.10, - created at 2025-11-26 00:34 +0100 -
-diff --git a/.github/workflows/gen_efi_app_interface_checker.yml b/.github/workflows/gen_efi_app_interface_checker.yml
new file mode 100644
index 0000000..cf799c8
--- /dev/null
+++ b/.github/workflows/gen_efi_app_interface_checker.yml
@@ -0,0 +1,29 @@
+name: gen_efi_app_interface_checker
+
+permissions:
+ contents: read
+
+on:
+ push:
+ branches: [ master, main ]
+ paths:
+ - 'gen_efi_app/**/*.py'
+ - 'setup.py'
+ pull_request:
+ branches: [ master, main ]
+ paths:
+ - 'gen_efi_app/**/*.py'
+ - 'setup.py'
+
+jobs:
+ interface_gate:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository code
+ uses: actions/checkout@v4
+ with:
+ submodules: true
+
+ - name: Verify that each concrete class implements a valid interface
+ run: |
+ python3 gates/gates/interfaces_checker.py gen_efi_app
diff --git a/.github/workflows/gen_efi_app_isp_checker.yml b/.github/workflows/gen_efi_app_isp_checker.yml
new file mode 100644
index 0000000..4f38982
--- /dev/null
+++ b/.github/workflows/gen_efi_app_isp_checker.yml
@@ -0,0 +1,29 @@
+name: gen_efi_app_isp_checker
+
+permissions:
+ contents: read
+
+on:
+ push:
+ branches: [ master, main ]
+ paths:
+ - 'gen_efi_app/**/*.py'
+ - 'setup.py'
+ pull_request:
+ branches: [ master, main ]
+ paths:
+ - 'gen_efi_app/**/*.py'
+ - 'setup.py'
+
+jobs:
+ isp_gate:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository code
+ uses: actions/checkout@v4
+ with:
+ submodules: true
+
+ - name: Check Interface Segregation Principle violations
+ run: |
+ python3 gates/gates/isp_checker.py gen_efi_app
diff --git a/.github/workflows/gen_efi_app_package_checker.yml b/.github/workflows/gen_efi_app_package_checker.yml
index 610f869..6ff7384 100755
--- a/.github/workflows/gen_efi_app_package_checker.yml
+++ b/.github/workflows/gen_efi_app_package_checker.yml
@@ -1,33 +1,35 @@
name: gen_efi_app_package_checker
on:
push:
- branches: [ main ]
+ branches: [ master, main ]
paths:
- 'gen_efi_app/**'
- - 'tests/**'
- 'setup.py'
pull_request:
- branches: [ main ]
+ branches: [ master, main ]
paths:
- 'gen_efi_app/**'
- - 'tests/**'
- 'setup.py'
+permissions:
+ contents: read
+
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
- python-version: ['3.10', '3.11', '3.12']
+ python-version: ['3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v4
- - name: Set up python ${{ matrix.python-version }}
+ - name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- - name: Install dependencies
+ - name: install dependencies
run: |
- pip install flake8
- - name: Lint with flake8
+ python -m pip install --upgrade pip
+ pip install -r requirements.txt
+ - name: lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
diff --git a/.github/workflows/gen_efi_app_python3_build.yml b/.github/workflows/gen_efi_app_python3_build.yml
index 373c702..78f031d 100755
--- a/.github/workflows/gen_efi_app_python3_build.yml
+++ b/.github/workflows/gen_efi_app_python3_build.yml
@@ -1,19 +1,22 @@
name: gen_efi_app_python3_build
on:
push:
- branches: [ main ]
+ branches: [ master, main ]
paths:
- 'gen_efi_app/**'
- 'MANIFEST.in'
- 'pyproject.toml'
- 'setup.py'
pull_request:
- branches: [ main ]
+ branches: [ master, main ]
paths:
- 'gen_efi_app/**'
- 'MANIFEST.in'
- 'pyproject.toml'
- 'setup.py'
+permissions:
+ contents: read
+
jobs:
deploy:
runs-on: ubuntu-latest
@@ -22,7 +25,7 @@ jobs:
- name: Set up python3
uses: actions/setup-python@v5
with:
- python-version: '3.10'
+ python-version: '3.12'
- name: Install dependencies
run: |
python3 -m pip install --upgrade setuptools
diff --git a/.github/workflows/gen_efi_app_python_checker.yml b/.github/workflows/gen_efi_app_python_checker.yml
index 989f45a..f321204 100644
--- a/.github/workflows/gen_efi_app_python_checker.yml
+++ b/.github/workflows/gen_efi_app_python_checker.yml
@@ -1,33 +1,28 @@
name: gen_efi_app_python_checker
+
on:
push:
- branches: [ main ]
+ branches: [ master, main ]
paths:
- - 'gen_efi_app/**'
- - 'tests/**'
+ - 'gen_efi_app/**/*.py'
- 'setup.py'
pull_request:
- branches: [ main ]
+ branches: [ master, main ]
paths:
- - 'gen_efi_app/**'
- - 'tests/**'
+ - 'gen_efi_app/**/*.py'
- 'setup.py'
+
+permissions:
+ contents: read
+
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - name: Check max length of lines in modules
- id: long_line_checker
+ with:
+ submodules: true
+
+ - name: Check module length and line limits
run: |
- modules_ok=0
- modules=($(find gen_efi_app/ tests/ -type f -name '*.py' -exec echo '{}' \;))
- for mod in "${modules[@]}"; do line_length=$(wc -L < "${mod}"); [[ $line_length -gt 127 ]] && modules_ok=1; done
- [[ $modules_ok -eq 0 ]] && echo ok || exit 1
- - name: Check max number of lines in modules
- id: num_line_checker
- run: |
- modules_ok=0
- modules=($(find gen_efi_app/ tests/ -type f -name '*.py' -exec echo '{}' \;))
- for mod in "${modules[@]}"; do line_numbers=$(wc -l < "${mod}"); [[ $line_numbers -gt 300 ]] && modules_ok=1; done
- [[ $modules_ok -eq 0 ]] && echo ok || exit 1
\ No newline at end of file
+ python3 gates/gates/limits_checker.py gen_efi_app
diff --git a/.github/workflows/gen_efi_app_release.yml b/.github/workflows/gen_efi_app_release.yml
new file mode 100644
index 0000000..e4a6011
--- /dev/null
+++ b/.github/workflows/gen_efi_app_release.yml
@@ -0,0 +1,39 @@
+name: gen_efi_app_release
+
+on:
+ push:
+ tags:
+ - '*'
+
+permissions:
+ contents: write
+
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up python3
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.12'
+
+ - name: Install dependencies
+ run: |
+ python3 -m pip install --upgrade setuptools
+ python3 -m pip install --upgrade pip
+ python3 -m pip install --upgrade build
+ python3 -m pip install --upgrade wheel
+ pip3 install -r requirements.txt
+
+ - name: Build python3 package
+ run: |
+ python3 -m build
+
+ - name: Create Release
+ uses: softprops/action-gh-release@v2
+ with:
+ name: Release ${{ github.ref_name }}
+ files: dist/*
+ generate_release_notes: true
diff --git a/.github/workflows/gen_efi_app_srp_checker.yml b/.github/workflows/gen_efi_app_srp_checker.yml
new file mode 100644
index 0000000..2598e27
--- /dev/null
+++ b/.github/workflows/gen_efi_app_srp_checker.yml
@@ -0,0 +1,29 @@
+name: gen_efi_app_srp_checker
+
+permissions:
+ contents: read
+
+on:
+ push:
+ branches: [ master, main ]
+ paths:
+ - 'gen_efi_app/**/*.py'
+ - 'setup.py'
+ pull_request:
+ branches: [ master, main ]
+ paths:
+ - 'gen_efi_app/**/*.py'
+ - 'setup.py'
+
+jobs:
+ srp_gate:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout repository code
+ uses: actions/checkout@v4
+ with:
+ submodules: true
+
+ - name: Check Single Responsibility Principle violations
+ run: |
+ python3 gates/gates/srp_checker.py gen_efi_app
diff --git a/.github/workflows/gen_efi_app_toc.yaml b/.github/workflows/gen_efi_app_toc.yaml
deleted file mode 100755
index 0cbe6fa..0000000
--- a/.github/workflows/gen_efi_app_toc.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-name: gen_efi_app_toc
-on:
- push:
- branches: [ master ]
- paths:
- - '**.md'
-jobs:
- generateTOC:
- name: gen_efi_app_toc
- runs-on: ubuntu-latest
- steps:
- - uses: technote-space/toc-generator@v4
\ No newline at end of file
diff --git a/.github/workflows/gen_efi_app_toc.yml b/.github/workflows/gen_efi_app_toc.yml
new file mode 100644
index 0000000..a9b9225
--- /dev/null
+++ b/.github/workflows/gen_efi_app_toc.yml
@@ -0,0 +1,20 @@
+name: gen_efi_app_toc
+
+on:
+ push:
+ paths:
+ - '**.md'
+
+permissions:
+ contents: write
+
+jobs:
+ generateTOC:
+ name: gen_efi_app_toc
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - name: Generate TOC
+ uses: technote-space/toc-generator@v4
+ with:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 0e4f7f4..002206e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,11 @@
__pycache__/
*.py[cod]
-*$py.class
\ No newline at end of file
+*$py.class
+
+# Reports
+*.report
+*.xml
+*.json
+.coverage
+htmlcov/
+.coverage.gen_efi_app
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..cc75b2b
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "gates"]
+ path = gates
+ url = git@github.com:vroncevic/quality-gates-py.git
+[submodule "coverage"]
+ path = coverage
+ url = git@github.com:vroncevic/ats_coverage.git
diff --git a/.pylintrc b/.pylintrc
new file mode 100644
index 0000000..5847e39
--- /dev/null
+++ b/.pylintrc
@@ -0,0 +1,25 @@
+[SIMILARITIES]
+
+# Minimum lines of a similarity.
+min-similarity-lines=15
+
+# Ignore comments when computing similarities.
+ignore-comments=yes
+
+# Ignore docstrings when computing similarities.
+ignore-docstrings=yes
+
+# Ignore imports when computing similarities.
+ignore-imports=yes
+
+[FORMAT]
+# Maximum number of characters on a single line.
+max-line-length=150
+
+[DESIGN]
+# Maximum number of lines in a module.
+max-module-lines=500
+
+[MESSAGES CONTROL]
+# Disable specific pylint warnings.
+disable=broad-exception-caught
diff --git a/.readthedocs.yml b/.readthedocs.yml
index 54e6559..7405213 100644
--- a/.readthedocs.yml
+++ b/.readthedocs.yml
@@ -2,6 +2,10 @@ version: 2
build:
os: ubuntu-22.04
tools:
- python: "3.11"
+ python: "3.12"
+python:
+ install:
+ - method: pip
+ path: .
sphinx:
configuration: docs/source/conf.py
\ No newline at end of file
diff --git a/README.md b/README.md
index 1147235..ccedd46 100644
--- a/README.md
+++ b/README.md
@@ -10,27 +10,29 @@ The README is used to introduce the modules and provide instructions on
how to install the modules, any machine dependencies it may have and any
other information that should be provided before the modules are installed.
-[](https://github.com/electux/gen_efi_app/actions/workflows/gen_efi_app_python_checker.yml) [](https://github.com/electux/gen_efi_app/actions/workflows/gen_efi_app_package.yml) [](https://github.com/electux/gen_efi_app/issues) [](https://github.com/electux/gen_efi_app/graphs/contributors)
+[](https://github.com/electux/gen_efi_app/actions/workflows/gen_efi_app_python_checker.yml) [](https://github.com/electux/gen_efi_app/actions/workflows/gen_efi_app_package.yml) [](https://github.com/electux/gen_efi_app/actions/workflows/gen_efi_app_interface_checker.yml) [](https://github.com/electux/gen_efi_app/actions/workflows/gen_efi_app_isp_checker.yml) [](https://github.com/electux/gen_efi_app/actions/workflows/gen_efi_app_srp_checker.yml) [](https://github.com/electux/gen_efi_app/issues) [](https://github.com/electux/gen_efi_app/graphs/contributors)
**Table of Contents**
-- [Installation](#installation)
+- [🚀 Installation](#-installation)
- [Install using pip](#install-using-pip)
- [Install using build](#install-using-build)
- [Install using py setup](#install-using-py-setup)
- [Install using docker](#install-using-docker)
-- [Dependencies](#dependencies)
-- [Tool structure](#tool-structure)
-- [Code coverage](#code-coverage)
-- [Docs](#docs)
-- [Contributing](#contributing)
-- [Copyright and Licence](#copyright-and-licence)
+- [📦 Dependencies](#-dependencies)
+- [📁 Tool structure](#-tool-structure)
+ - [✨ Features](#-features)
+- [📊 Code coverage](#-code-coverage)
+- [🛠 Usage](#-usage)
+- [📚 Docs](#-docs)
+- [👥 Contributing](#-contributing)
+- [📄 Copyright and licence](#-copyright-and-licence)
-### Installation
+### 🚀 Installation
Used next development environment
@@ -74,8 +76,8 @@ pip3 install -r requirements.txt
python3 -m build --no-isolation --wheel
pip3 install ./dist/gen_efi_app-*-py3-none-any.whl
rm -f get-pip.py
-chmod 755 /usr/local/lib/python3.9/dist-packages/usr/local/bin/gen_efi_app_run.py
-ln -s /usr/local/lib/python3.9/dist-packages/usr/local/bin/gen_efi_app_run.py /usr/local/bin/gen_efi_app_run.py
+chmod 755 /usr/local/lib/python3.10/dist-packages/usr/local/bin/gen_efi_app_run.py
+ln -s /usr/local/lib/python3.10/dist-packages/usr/local/bin/gen_efi_app_run.py /usr/local/bin/gen_efi_app_run.py
```
##### Install using py setup
@@ -97,74 +99,181 @@ python3 setup.py install_egg_info
You can use Dockerfile to create image/container.
-### Dependencies
+### 📦 Dependencies
**gen_efi_app** requires next modules and libraries
-* [ats-utilities - Python App/Tool/Script Utilities](https://electux.github.io/ats-utilities)
+* [ats-utilities - Python App/Tool/Script Utilities](https://pypi.org/project/ats-utilities/)
-### Tool structure
+### 📁 Tool structure
-**gen_efi_app** is based on OOP
+**gen_efi_app** is based on OOP.
-Generator structure
+Tool structure
+
+Click to expand framework structure
```bash
gen_efi_app/
- ├── conf/
- │ ├── gen_efi_app.cfg
- │ ├── gen_efi_app.logo
- │ ├── gen_efi_app_util.cfg
- │ ├── project.yaml
- │ └── template/
- │ ├── cflags.template
- │ ├── ldflags.template
- │ ├── main.template
- │ ├── makefile.template
- │ ├── objects.template
- │ └── ocflags.template
- ├── __init__.py
- ├── log/
- │ └── gen_efi_app.log
- ├── pro/
+ ├── core/
+ │ ├── __init__.py
+ │ ├── model/
+ │ │ ├── __init__.py
+ │ │ └── project_setup.py
+ │ └── service/
+ │ ├── engine.py
+ │ ├── __init__.py
+ │ ├── iservice.py
+ │ └── isubprocessor.py
+ ├── engine.py
+ ├── infrastructure/
+ │ ├── cli/
+ │ │ ├── engine.py
+ │ │ ├── icli.py
+ │ │ ├── __init__.py
+ │ │ └── setup/
+ │ │ ├── bundle.py
+ │ │ ├── dep_validator.py
+ │ │ ├── dependencies.py
+ │ │ ├── factory.py
+ │ │ ├── __init__.py
+ │ │ ├── keys.py
+ │ │ ├── opt_validator.py
+ │ │ ├── options.py
+ │ │ ├── registry.py
+ │ │ └── validator.py
+ │ ├── command/
+ │ │ ├── command.py
+ │ │ ├── gen_efi_command_definition.py
+ │ │ ├── gen_efi_command_executor.py
+ │ │ ├── icommand_definition.py
+ │ │ ├── icommand_executor.py
+ │ │ └── __init__.py
+ │ ├── config/
+ │ │ ├── gen_efi_app.cfg
+ │ │ ├── gen_efi_app.logo
+ │ │ ├── scheme.json
+ │ │ └── templates.tgz
│ ├── __init__.py
- │ ├── read_template.py
- │ └── write_template.py
+ │ └── subprocessor.py
+ ├── __init__.py
├── py.typed
- └── run/
- └── gen_efi_app_run.py
-
- 6 directories, 17 files
+ └── setup/
+ ├── bundle.py
+ ├── dep_validator.py
+ ├── dependencies.py
+ ├── factory.py
+ ├── __init__.py
+ ├── keys.py
+ ├── opt_validator.py
+ ├── options.py
+ ├── registry.py
+ └── validator.py
+
+ 10 directories, 45 files
```
+Click to expand code coverage
| Name | Stmts | Miss | Cover |
|------|-------|------|-------|
-| `gen_efi_app/__init__.py` | 69 | 10 | 86%|
-| `gen_efi_app/pro/__init__.py` | 57 | 0 | 100%|
-| `gen_efi_app/pro/read_template.py` | 51 | 0 | 100%|
-| `gen_efi_app/pro/write_template.py` | 57 | 2 | 96%|
-| **Total** | 234 | 12 | 95% |
+| `gen_efi_app/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/core/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/core/model/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/core/model/project_setup.py` | 14 | 0 | 100%|
+| `gen_efi_app/core/service/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/core/service/engine.py` | 27 | 0 | 100%|
+| `gen_efi_app/core/service/iservice.py` | 14 | 0 | 100%|
+| `gen_efi_app/core/service/isubprocessor.py` | 14 | 0 | 100%|
+| `gen_efi_app/engine.py` | 57 | 0 | 100%|
+| `gen_efi_app/infrastructure/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/engine.py` | 39 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/icli.py` | 15 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/bundle.py` | 22 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/dep_validator.py` | 36 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/dependencies.py` | 18 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/factory.py` | 35 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/keys.py` | 26 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/opt_validator.py` | 36 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/options.py` | 15 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/registry.py` | 24 | 0 | 100%|
+| `gen_efi_app/infrastructure/cli/setup/validator.py` | 43 | 0 | 100%|
+| `gen_efi_app/infrastructure/command/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/infrastructure/command/command.py` | 16 | 0 | 100%|
+| `gen_efi_app/infrastructure/command/gen_efi_command_definition.py` | 24 | 0 | 100%|
+| `gen_efi_app/infrastructure/command/gen_efi_command_executor.py` | 23 | 0 | 100%|
+| `gen_efi_app/infrastructure/command/icommand_definition.py` | 14 | 0 | 100%|
+| `gen_efi_app/infrastructure/command/icommand_executor.py` | 14 | 0 | 100%|
+| `gen_efi_app/infrastructure/subprocessor.py` | 55 | 0 | 100%|
+| `gen_efi_app/setup/__init__.py` | 9 | 0 | 100%|
+| `gen_efi_app/setup/bundle.py` | 23 | 0 | 100%|
+| `gen_efi_app/setup/dep_validator.py` | 36 | 0 | 100%|
+| `gen_efi_app/setup/dependencies.py` | 19 | 0 | 100%|
+| `gen_efi_app/setup/factory.py` | 48 | 0 | 100%|
+| `gen_efi_app/setup/keys.py` | 27 | 0 | 100%|
+| `gen_efi_app/setup/opt_validator.py` | 34 | 0 | 100%|
+| `gen_efi_app/setup/options.py` | 12 | 0 | 100%|
+| `gen_efi_app/setup/registry.py` | 32 | 0 | 100%|
+| `gen_efi_app/setup/validator.py` | 48 | 0 | 100%|
+| **Total** | 941 | 0 | 100% |
+
+
-# -*- coding: UTF-8 -*-
-
-'''
-Module
- __init__.py
-Copyright
- Copyright (C) 2020 - 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
- gen_efi_app is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- gen_efi_app is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program. If not, see <http://www.gnu.org/licenses/>.
-Info
- Defines class GenEfiApp with attribute(s) and method(s).
- Loads a base info, creates a CLI interface and runs operations.
-'''
-
-import sys
-from typing import List, Dict, 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.cli import ATSCli
- from ats_utilities.logging import ATSLogger
- 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
- from ats_utilities.exceptions.ats_type_error import ATSTypeError
- from ats_utilities.exceptions.ats_value_error import ATSValueError
- from gen_efi_app.pro import GenEfi
-except ImportError as ats_error_message: # pragma: no cover
- # Force exit python #######################################################
- sys.exit(f'\n{__file__}\n{ats_error_message}\n') # pragma: no cover
-
-__author__: str = 'Vladimir Roncevic'
-__copyright__: str = '(C) 2026, https://electux.github.io/gen_efi_app'
-__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
-__license__: str = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
-__version__: str = '1.3.6'
-__maintainer__: str = 'Vladimir Roncevic'
-__email__: str = 'elektron.ronca@gmail.com'
-__status__: str = 'Updated'
-
-
-
-[docs]
-class GenEfiApp(ATSCli):
- '''
- Defines class GenEfiApp with attribute(s) and method(s).
- Loads a base info, creates a CLI interface and runs operations.
-
- It defines:
-
- :attributes:
- | _GEN_VERBOSE - Console text indicator for process-phase.
- | _CONFIG - Tool info file path.
- | _LOG - Tool log file path.
- | _LOGO - Logo for splash screen.
- | _OPS - List of tool options.
- | _logger - Logger object API.
- :methods:
- | __init__ - Initials GenEfiApp constructor.
- | process - Processes and runs operations.
- '''
-
- _GEN_VERBOSE: str = 'GEN_EFI_APP'
- _CONFIG: str = '/conf/gen_efi_app.cfg'
- _LOG: str = '/log/gen_efi_app.log'
- _LOGO: str = '/conf/gen_efi_app.logo'
- _OPS: List[str] = ['-n', '--name', '-v', '--verbose']
-
- def __init__(self, verbose: bool = False) -> None:
- '''
- Initials GenEfiApp constructor.
-
- :param verbose: Enable/Disable verbose option
- :type verbose: <bool>
- :exceptions: None
- '''
- current_dir: str = dirname(realpath(__file__))
- gen_efi_app_property: Dict[str, str | bool] = {
- 'ats_organization': 'electux',
- 'ats_repository': f'{self._GEN_VERBOSE.lower()}',
- 'ats_name': f'{self._GEN_VERBOSE.lower()}',
- 'ats_logo_path': f'{current_dir}{self._LOGO}',
- 'ats_use_github_infrastructure': True
- }
- Splash(gen_efi_app_property, verbose)
- base_info: str = f'{current_dir}{self._CONFIG}'
- super().__init__(base_info, verbose)
- verbose_message(
- verbose, [f'{self._GEN_VERBOSE.lower()} init tool info']
- )
- self._logger: ATSLogger = ATSLogger(
- self._GEN_VERBOSE.lower(), True, None, True, verbose
- )
- if self.is_operational():
- self.add_new_option(
- self._OPS[0], self._OPS[1], dest='name',
- help='generate project (provide name)'
- )
- self.add_new_option(
- self._OPS[2], self._OPS[3],
- action='store_true', default=False,
- help='activate verbose mode for generation'
- )
-
-
-[docs]
- def process(self, verbose: bool = False) -> bool:
- '''
- Processes and runs operations.
-
- :param verbose: Enable/Disable verbose option
- :type verbose: <bool>
- :return: True (success operation) | False
- :rtype: <bool>
- :exceptions: None
- '''
- status: bool = False
- if self.is_operational():
- try:
- 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 exists(f'{getcwd()}/{str(getattr(args, "name"))}'):
- error_message([
- f'{self._GEN_VERBOSE.lower()}',
- f'project with name [{getattr(args, "name")}] exists'
- ])
- return status
- gen: GenEfi = GenEfi(getattr(args, 'verbose') or verbose)
- try:
- print(
- " ".join([
- f'[{self._GEN_VERBOSE.lower()}]',
- 'gen autoconf project skeleton',
- str(getattr(args, 'name'))
- ])
- )
- status = gen.gen_project(
- f'{getattr(args, "name")}',
- getattr(args, 'verbose') or verbose
- )
- except (ATSTypeError, ATSValueError) as e:
- error_message([f'{self._GEN_VERBOSE.lower()} {str(e)}'])
- self._logger.write_log(f'{str(e)}', self._logger.ATS_ERROR)
- if status:
- success_message([f'{self._GEN_VERBOSE.lower()} done\n'])
- self._logger.write_log(
- f'generation {getattr(args, "name")} done',
- self._logger.ATS_INFO
- )
- else:
- error_message([f'{self._GEN_VERBOSE.lower()} failed'])
- self._logger.write_log(
- 'generation failed', self._logger.ATS_ERROR
- )
- except SystemExit:
- error_message(
- [f'{self._GEN_VERBOSE.lower()} expected argument name']
- )
- return status
- else:
- error_message(
- [f'{self._GEN_VERBOSE.lower()} tool is not operational']
- )
- self._logger.write_log(
- 'tool is not operational', self._logger.ATS_ERROR
- )
- return status
-
-
-
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ project_setup.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines domain model for a project setup.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from dataclasses import dataclass
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@dataclass(frozen=True, slots=True, kw_only=True)
+class ProjectSetup:
+ '''
+ Defines domain model for a project setup.
+
+ It defines:
+
+ :attributes:
+ | project_config - Mapping with project configuration.
+ '''
+
+ project_config: Mapping[str, object]
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ engine.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines application service for file generation.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+
+from gen_efi_app.core.model.project_setup import ProjectSetup
+from gen_efi_app.core.service.isubprocessor import ISubProcessor
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class Service:
+ '''
+ Service for orchestrating the file generation process.
+
+ It defines:
+
+ :attributes:
+ | _subprocessor - Adapter for subprocessing.
+ :methods:
+ | __init__ - Initializes the service.
+ | execute - Generates and writes user files.
+ | is_initialized - Checks if the service is initialized.
+ '''
+
+ _subprocessor: ISubProcessor
+
+ def __init__(self, subprocessor: ISubProcessor) -> None:
+ '''
+ Initializes the service.
+
+ :param subprocessor: The subprocessor.
+ :exceptions:
+ | ValueError: The subprocessor must be provided.
+ | TypeError: The subprocessor must be of type ISubProcessor.
+ '''
+ ctx: str = 'service::init(...)'
+ msg_subprocessor_none: str = 'the subprocessor must be provided'
+ msg_subprocessor_istype: str = f'the subprocessor must be of type {ISubProcessor.__name__}'
+
+ if subprocessor is None:
+ raise ValueError(f'{ctx} - {msg_subprocessor_none}')
+
+ if not isinstance(subprocessor, ISubProcessor):
+ raise TypeError(f'{ctx} - {msg_subprocessor_istype}')
+
+ self._subprocessor = subprocessor
+
+
+[docs]
+ def execute(self, *, params: ProjectSetup) -> Mapping[str, object]:
+ '''
+ Generates EFI application configuration files.
+
+ :param params: The ProjectSetup object.
+ :return: The result of the execution (return code, stdout, stderr).
+ :exceptions: None.
+ '''
+ return self._subprocessor.run(params=params)
+
+
+
+[docs]
+ def is_initialized(self) -> bool:
+ '''
+ Checks if the service is initialized.
+
+ :return: True if the service is initialized, False otherwise.
+ :exceptions: None.
+ '''
+ return self._subprocessor.is_initialized()
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ iservice.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines the abstract interface for services.
+ Provides an interface for the service factory.
+'''
+
+from __future__ import annotations
+
+from typing import Protocol, runtime_checkable
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@runtime_checkable
+class IService[ServiceParamsType, ExecuteResultType](Protocol):
+ '''
+ Defines the abstract interface for services.
+ Provides an interface for the service factory.
+
+ It defines:
+
+ :methods:
+ | execute - Executes the service.
+ | is_initialized - Checks if the service is initialized.
+ '''
+
+
+[docs]
+ def execute(self, *, params: ServiceParamsType) -> ExecuteResultType:
+ '''
+ Executes the service.
+
+ :param params: The parameters for the service execution.
+ :return: The result of the execution.
+ '''
+
+
+
+[docs]
+ def is_initialized(self) -> bool:
+ '''
+ Checks if the service is initialized.
+
+ :return: True if the service is initialized, False otherwise.
+ '''
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ isubprocessor.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines the abstract interface for sub-process execution.
+ Provides an interface for the sub-process factory.
+'''
+
+from __future__ import annotations
+
+from typing import Protocol, runtime_checkable
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@runtime_checkable
+class ISubProcessor[SubProcessorParamsType, SubProcessorResultType](Protocol):
+ '''
+ Defines the abstract interface for sub-process execution.
+ Provides an interface for the sub-process factory.
+
+ It defines:
+
+ :methods:
+ | run - Runs a sub-process.
+ | is_initialized - Checks if the subprocessor is initialized.
+ '''
+
+
+[docs]
+ def run(self, *, params: SubProcessorParamsType) -> SubProcessorResultType:
+ '''
+ Runs a sub-process.
+
+ :param params: The parameters for the sub-process execution.
+ :return: The result of the execution.
+ '''
+
+
+
+[docs]
+ def is_initialized(self) -> bool:
+ '''
+ Checks if the subprocessor is initialized.
+
+ :return: True if the subprocessor is initialized, False otherwise.
+ '''
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ engine.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Engine orchestrating the initialization and execution of gen_efi_app.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from logging import INFO, ERROR
+from sys import stdout
+
+from ats_utilities.base.engine import Base
+from ats_utilities.logger.ilogger import ILogger
+from ats_utilities.exceptions import ATSValueError, ATSTypeError
+
+from gen_efi_app.setup.bundle import GenEfiAppBundle
+from gen_efi_app.setup.validator import GenEfiAppBundleValidator
+from gen_efi_app.infrastructure.cli.icli import ICLI
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiApp(Base):
+ '''
+ Engine orchestrating the initialization and execution of gen_efi_app.
+
+ It defines:
+
+ :attributes:
+ | _is_initialized - The flag indicating whether the engine is initialized.
+ | _logger - The logger for logging messages during initialization and execution.
+ | _cli - The adapter for the command line interface.
+ :methods:
+ | __init__ - Initializes the gen_efi_app engine with adapters and services.
+ | process - Processes the gen_efi_app commands.
+ '''
+
+ _is_initialized: bool
+ _logger: ILogger
+ _cli: ICLI
+
+ def __init__(self, bundle: GenEfiAppBundle) -> None:
+ '''
+ Initializes the gen_efi_app engine with adapters and services.
+
+ :param bundle: GenEfiApp bundle containing adapters and services.
+ :exceptions: None.
+ '''
+ self._is_initialized = False
+
+ try:
+ GenEfiAppBundleValidator.validate(bundle)
+
+ # Initialize base engine
+ super().__init__(bundle.base)
+
+ # Mark as not initialized (waiting for other components to be initialized)
+ self._is_initialized = False
+
+ # Setting up primary inbound adapter (CLI interface)
+ self._cli = bundle.cli
+
+ # Mark as initialized (all components initialized)
+ self._is_initialized = all(
+ component.is_initialized() for component in [
+ bundle.base.option_manager,
+ bundle.service,
+ bundle.subprocessor,
+ self._cli
+ ] if component
+ )
+
+ # Setting up logger for tool engine
+ self._logger = self.get_context().logger
+ self._logger.write_log(INFO, '✅ gen_efi_app: engine initialized successfully!')
+
+ except (ATSValueError, ATSTypeError) as exc:
+ stdout.write(f'❌ gen_efi_app: {exc}!\n')
+
+ except Exception as exc:
+ stdout.write(f'❌ gen_efi_app unexpected exception: {exc}!\n')
+
+
+[docs]
+ def process(self, verbose: bool = False) -> bool:
+ '''
+ Processes the gen_efi_app commands.
+
+ :param verbose: Enable verbose output.
+ :return: True if successful, False otherwise.
+ :exceptions: None.
+ '''
+ result: Mapping[str, object] = {}
+
+ try:
+ if self.is_initialized():
+ self._logger.write_log(INFO, '🔥 Starting execution command...')
+ result = self._cli.run()
+ self._logger.write_log(INFO, '✅ Execution finished!')
+
+ if result.get('returncode') != 0:
+ self._logger.write_log(ERROR, f'❌ gen_efi_app: {result.get("stderr") or "failed!"}')
+ return False
+
+ self._logger.write_log(INFO, '✅ gen_efi_app: done!')
+ self._logger.write_log(INFO, '✅ gen_efi_app: exiting successfully!')
+ return True
+
+ self._logger.write_log(ERROR, '❌ gen_efi_app: engine not initialized!')
+ return False
+
+ except (ATSValueError, ATSTypeError) as exc:
+ self._logger.write_log(ERROR, f'❌ gen_efi_app: {exc}!')
+ return False
+
+ except Exception as exc:
+ self._logger.write_log(ERROR, f'❌ gen_efi_app unexpected exception: {exc}!')
+ return False
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ engine.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines CLI class implementing inbound CLI port.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+
+from ats_utilities.option.imanager import IOptionManager
+from ats_utilities.exceptions import ATSRuntimeError, ATSValueError, ATSTypeError
+from ats_utilities.utils.reflection import to_str
+
+from gen_efi_app.infrastructure.cli.setup.bundle import CLIBundle
+from gen_efi_app.infrastructure.cli.setup.validator import CLIBundleValidator
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.infrastructure.command.icommand_definition import ICommandDefinition
+from gen_efi_app.infrastructure.command.icommand_executor import ICommandExecutor
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLI:
+ '''
+ Adapter that implements CLI commands for the code generator.
+
+ It defines:
+
+ :attributes:
+ | _service - File generation orchestrator service.
+ | _parser - Argument parser for parsing CLI command args.
+ | _executors - Map of command names to command executor instances.
+ :methods:
+ | __init__ - Initializes the CLI with service, parser and commands list.
+ | run - Parses command line arguments and runs selected command strategy.
+ | is_initialized - Checks if the CLI is initialized.
+ | __str__ - Returns the CLI as string representation.
+ '''
+
+ _service: IService
+ _parser: IOptionManager
+ _executors: Mapping[str, ICommandExecutor[ICommandDefinition, object, object, object]]
+
+ def __init__(self, bundle: CLIBundle) -> None:
+ '''
+ Initializes the CLI with service, parser and commands list.
+
+ :param bundle: Bundle containing CLI adapters.
+ :exceptions:
+ | ATSValueError: The CLI bundle must be provided and have proper values.
+ | ATSTypeError: The CLI bundle must be an instance of CLIBundle and
+ | its attributes must be instances of their respective types.
+ '''
+ CLIBundleValidator.validate(bundle)
+ self._service = bundle.service
+ self._parser = bundle.parser
+ self._executors = {pair.definition.name: pair.executor for pair in bundle.commands}
+ self._parser.register_commands([pair.definition for pair in bundle.commands])
+
+
+[docs]
+ def run(self) -> Mapping[str, object]:
+ '''
+ Parses command line arguments and runs selected command strategy.
+
+ Note: returncode is 0 for success, 1 for exception or if command is not found,
+ None if process timed out or failed to start, otherwise it is the integer exit code of the process.
+
+ :return: The execution result (return code, stdout, and stderr).
+ :exceptions: None.
+ '''
+ try:
+ command_name, params = self._parser.parse_command()
+ executor: ICommandExecutor[ICommandDefinition, object, object, object] | None = self._executors.get(command_name)
+
+ return executor.execute(params=params, service=self._service) if executor else {
+ 'returncode': 1, 'stdout': '', 'stderr': 'cli::run - command not found'
+ }
+
+ except (ATSRuntimeError, ATSValueError, ATSTypeError) as exc:
+ return {'returncode': 1, 'stdout': '', 'stderr': f'cli::run - {exc}'}
+
+
+
+[docs]
+ def is_initialized(self) -> bool:
+ '''
+ Checks if the CLI is initialized.
+
+ :return: True if CLI is initialized, False otherwise.
+ :exceptions: None.
+ '''
+ return True
+
+
+ def __str__(self) -> str:
+ '''
+ Returns the CLI as string representation.
+
+ :return: The CLI as string representation.
+ :exceptions: None.
+ '''
+ return to_str(self)
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ icli.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines the abstract interface for the CLI.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from typing import Protocol, runtime_checkable
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@runtime_checkable
+class ICLI(Protocol):
+ '''
+ Defines the abstract interface for the CLI.
+
+ It defines:
+
+ :methods:
+ | run - Runs the CLI.
+ | is_initialized - Checks if the CLI is initialized.
+ '''
+
+
+[docs]
+ def run(self) -> Mapping[str, object]:
+ '''
+ Runs the CLI.
+
+ :return: The result of the execution.
+ '''
+
+
+
+[docs]
+ def is_initialized(self) -> bool:
+ '''
+ Checks if the CLI is initialized.
+
+ :return: True if the CLI is initialized, False otherwise.
+ '''
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ bundle.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines the CLI bundle.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Sequence
+from dataclasses import dataclass
+
+from ats_utilities.option.imanager import IOptionManager
+from ats_utilities.utils.reflection import instance_to_dict
+
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.infrastructure.command.command import CommandBundle
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@dataclass(slots=True, frozen=True, kw_only=True)
+class CLIBundle:
+ '''
+ Defines the CLI bundle.
+
+ It defines:
+
+ :attributes:
+ | service - The service orchestrating the generator.
+ | parser - The argument parser for parsing CLI command arguments.
+ | commands - The sequence of command pairs.
+ :methods:
+ | to_dict - Converts the CLI bundle to a dictionary.
+ '''
+
+ service: IService
+ parser: IOptionManager
+ commands: Sequence[CommandBundle]
+
+
+[docs]
+ def to_dict(self) -> dict[str, object]:
+ '''
+ Converts the CLI bundle to a dictionary.
+
+ :return: Dictionary representation of the CLI bundle.
+ :exceptions: None.
+ '''
+ return instance_to_dict(self)
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ dep_validator.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Validator for the CLI bundle dependencies.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from ats_utilities.exceptions import ATSValueError, ATSTypeError
+
+from ats_utilities.validation.check_type import istype
+from ats_utilities.validation.check_value import not_none
+
+from gen_efi_app.infrastructure.cli.setup.keys import CLIBundleKeys
+from gen_efi_app.infrastructure.cli.setup.dependencies import CLIBundleDependencies
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLIBundleDependenciesValidator:
+ '''
+ Validator for the CLI bundle dependencies.
+
+ It defines:
+
+ :methods:
+ | validate - Validates the CLI bundle dependencies.
+ | is_valid - Checks if the CLI bundle dependencies is valid.
+ '''
+
+
+[docs]
+ @classmethod
+ def validate(cls, dependencies: CLIBundleDependencies) -> None:
+ '''
+ Validates the CLI bundle dependencies.
+
+ :param dependencies: The CLI bundle dependencies to be validated.
+ :exceptions:
+ | ATSValueError: The CLI bundle dependencies must be provided and have proper values.
+ | ATSTypeError: The CLI bundle dependencies must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ '''
+ ctx: str = 'cli_bundle_dependencies_validator::validate(...)'
+ msg_dependencies_none: str = 'the cli bundle dependencies must be provided'
+ msg_dependencies_istype: str = 'the cli bundle dependencies must be a Mapping'
+
+ not_none(dependencies, ctx, msg_dependencies_none)
+ istype(dependencies, Mapping, ctx, msg_dependencies_istype)
+
+ for attr_name, expected_type in CLIBundleKeys.get_dependency_to_type().items():
+ msg_attr_name_none: str = f'the {attr_name.replace("_", " ")} must be provided'
+ msg_attr_name_istype: str = f'the {attr_name.replace("_", " ")} must be an instance of {expected_type.__name__}'
+
+ attribute = dependencies.get(attr_name)
+
+ not_none(attribute, ctx, msg_attr_name_none)
+ istype(attribute, expected_type, ctx, msg_attr_name_istype)
+
+
+
+[docs]
+ @classmethod
+ def is_valid(cls, dependencies: CLIBundleDependencies) -> bool:
+ '''
+ Checks if the CLI bundle dependencies is valid.
+
+ :param dependencies: The CLI bundle dependencies to be checked.
+ :return: True if valid, False otherwise.
+ '''
+ try:
+ cls.validate(dependencies)
+ return True
+
+ except (ATSValueError, ATSTypeError):
+ return False
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ dependencies.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Encapsulates core CLI components for simplification of CLI bundle.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Sequence
+from typing import TypedDict
+
+from ats_utilities.option.imanager import IOptionManager
+
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.infrastructure.command.command import CommandBundle
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLIBundleDependencies(TypedDict):
+ '''
+ Encapsulates core CLI components for simplification of CLI bundle.
+
+ It defines:
+
+ :attributes:
+ | service - The service for gen execution.
+ | parser - The parser for command line options.
+ | commands - The sequence of command pairs.
+ '''
+
+ service: IService
+ parser: IOptionManager
+ commands: Sequence[CommandBundle]
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ factory.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Encapsulates core CLI components for simplification of CLI bundle.
+'''
+
+from __future__ import annotations
+
+from ats_utilities.option.imanager import IOptionManager
+
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.infrastructure.cli.setup.options import CLIBundleOptions
+from gen_efi_app.infrastructure.cli.setup.opt_validator import CLIBundleOptionsValidator
+from gen_efi_app.infrastructure.cli.setup.bundle import CLIBundle
+from gen_efi_app.infrastructure.cli.setup.keys import CLIBundleKeys
+from gen_efi_app.infrastructure.cli.setup.registry import CLIBundleRegistry
+from gen_efi_app.infrastructure.cli.setup.dependencies import CLIBundleDependencies
+from gen_efi_app.infrastructure.command.command import CommandBundle
+from gen_efi_app.infrastructure.command.icommand_definition import ICommandDefinition
+from gen_efi_app.infrastructure.command.icommand_executor import ICommandExecutor
+from gen_efi_app.infrastructure.command.gen_efi_command_definition import GenEfiCommandDefinition
+from gen_efi_app.infrastructure.command.gen_efi_command_executor import GenEfiCommandExecutor
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLIBundleFactory:
+ '''
+ Factory for creating the CLI bundle.
+
+ It defines:
+
+ :methods:
+ | create_bundle - Creates the CLI bundle with optional pre-configured options.
+ | get_version - Returns the factory version.
+ '''
+
+
+[docs]
+ @classmethod
+ def create_bundle(cls, options: CLIBundleOptions) -> CLIBundle:
+ '''
+ Creates the CLI bundle with optional pre-configured options.
+
+ :param options: The CLI bundle options.
+ :return: The CLI bundle.
+ :exceptions:
+ | ATSValueError: The CLI bundle options must be provided and have proper values.
+ | ATSTypeError: The CLI bundle options must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ | ATSValueError: The CLI bundle dependencies must be provided and have proper values.
+ | ATSTypeError: The CLI bundle dependencies must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ | ATSValueError: The CLI bundle must be provided and have proper values.
+ | ATSTypeError: The CLI bundle must be an instance of CLIBundle and
+ | its attributes must be instances of their respective types.
+ '''
+ CLIBundleOptionsValidator.validate(options)
+
+ service: IService | None = options.get(CLIBundleKeys.OPTION_SERVICE) if options else None
+ parser: IOptionManager | None = options.get(CLIBundleKeys.OPTION_PARSER) if options else None
+
+ service_definition: ICommandDefinition = GenEfiCommandDefinition()
+ service_executor: ICommandExecutor = GenEfiCommandExecutor(definition=service_definition)
+ service_cmd: CommandBundle = CommandBundle(definition=service_definition, executor=service_executor)
+
+ return CLIBundleRegistry.create_bundle(
+ dependencies=CLIBundleDependencies(service=service, parser=parser, commands=[service_cmd])
+ )
+
+
+
+[docs]
+ @classmethod
+ def get_version(cls) -> str:
+ '''
+ Returns the factory version.
+
+ :return: The factory version.
+ :exceptions: None.
+ '''
+ return __version__
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ keys.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Runtime components and interface constraints for the CLI bundle.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Sequence
+from typing import ClassVar
+from types import MappingProxyType
+
+from ats_utilities.option.imanager import IOptionManager
+
+from gen_efi_app.core.service.iservice import IService
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLIBundleKeys:
+ '''
+ Runtime components and interface constraints for the CLI bundle.
+
+ It defines:
+
+ :attributes:
+ | DEPENDENCY_SERVICE - The service interface constant of the CLI bundle.
+ | DEPENDENCY_PARSER - The parser interface constant of the CLI bundle.
+ | DEPENDENCY_COMMANDS - The commands constant of the CLI bundle.
+ | OPTION_SERVICE - The service option constant of the CLI bundle.
+ | OPTION_PARSER - The parser option constant of the CLI bundle.
+ :methods:
+ | get_dependency_to_type - Returns the mapping of the CLI bundle dependencies to their types.
+ | get_option_to_type - Returns the mapping of the CLI bundle options to their types.
+ '''
+
+ # Dependency Keys
+ DEPENDENCY_SERVICE: ClassVar[str] = 'service'
+ DEPENDENCY_PARSER: ClassVar[str] = 'parser'
+ DEPENDENCY_COMMANDS: ClassVar[str] = 'commands'
+
+ # Option Keys
+ OPTION_SERVICE: ClassVar[str] = 'service'
+ OPTION_PARSER: ClassVar[str] = 'parser'
+
+
+[docs]
+ @classmethod
+ def get_dependency_to_type(cls) -> MappingProxyType[str, type]:
+ '''
+ Returns the mapping of the CLI bundle dependencies to their types.
+
+ :return: The mapping of the CLI bundle dependencies to their types.
+ :exceptions: None.
+ '''
+ return MappingProxyType({
+ cls.DEPENDENCY_SERVICE: IService,
+ cls.DEPENDENCY_PARSER: IOptionManager,
+ cls.DEPENDENCY_COMMANDS: Sequence,
+ })
+
+
+
+[docs]
+ @classmethod
+ def get_option_to_type(cls) -> MappingProxyType[str, type]:
+ '''
+ Returns the mapping of the CLI bundle options to their types.
+
+ :return: The mapping of the CLI bundle options to their types.
+ :exceptions: None.
+ '''
+ return MappingProxyType({
+ cls.OPTION_SERVICE: IService,
+ cls.OPTION_PARSER: IOptionManager,
+ })
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ opt_validator.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Validator for the CLI bundle options.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from ats_utilities.exceptions import ATSValueError, ATSTypeError
+
+from ats_utilities.validation.check_type import istype
+from ats_utilities.validation.check_value import not_none
+
+from gen_efi_app.infrastructure.cli.setup.keys import CLIBundleKeys
+from gen_efi_app.infrastructure.cli.setup.options import CLIBundleOptions
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLIBundleOptionsValidator:
+ '''
+ Validator for the CLI bundle options.
+
+ It defines:
+
+ :methods:
+ | validate - Validates the CLI bundle options.
+ | is_valid - Checks if the CLI bundle options is valid.
+ '''
+
+
+[docs]
+ @classmethod
+ def validate(cls, options: CLIBundleOptions) -> None:
+ '''
+ Validates the CLI bundle options.
+
+ :param options: The CLI bundle options to be validated.
+ :exceptions:
+ | ATSValueError: The CLI bundle options must be provided and have proper values.
+ | ATSTypeError: The CLI bundle options must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ '''
+ ctx: str = 'cli_bundle_options_validator::validate(...)'
+ msg_options_none: str = 'the cli bundle options must be provided'
+ msg_options_istype: str = 'the cli bundle options must be a Mapping'
+
+ not_none(options, ctx, msg_options_none)
+ istype(options, Mapping, ctx, msg_options_istype)
+
+ for attr_name, expected_type in CLIBundleKeys.get_option_to_type().items():
+ msg_attr_name_none: str = f'the {attr_name.replace("_", " ")} must be provided'
+ msg_attr_name_istype: str = f'the {attr_name.replace("_", " ")} must be an instance of {expected_type.__name__}'
+
+ attribute = options.get(attr_name)
+
+ not_none(attribute, ctx, msg_attr_name_none)
+ istype(attribute, expected_type, ctx, msg_attr_name_istype)
+
+
+
+[docs]
+ @classmethod
+ def is_valid(cls, options: CLIBundleOptions) -> bool:
+ '''
+ Checks if the CLI bundle options is valid.
+
+ :param options: The CLI bundle options to be checked.
+ :return: True if valid, False otherwise.
+ '''
+ try:
+ cls.validate(options)
+ return True
+
+ except (ATSValueError, ATSTypeError):
+ return False
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ options.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Encapsulates core CLI components for simplification of CLI bundle.
+'''
+
+from __future__ import annotations
+
+from typing import TypedDict
+
+from ats_utilities.option.imanager import IOptionManager
+
+from gen_efi_app.core.service.iservice import IService
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLIBundleOptions(TypedDict):
+ '''
+ Encapsulates core CLI components for simplification of CLI bundle.
+
+ It defines:
+
+ :attributes:
+ | service - The service for gen execution.
+ | parser - The parser for command line options.
+ '''
+
+ service: IService
+ parser: IOptionManager
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ registry.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Encapsulates core CLI components for simplification of CLI bundle.
+'''
+
+from __future__ import annotations
+
+from gen_efi_app.infrastructure.cli.setup.bundle import CLIBundle
+from gen_efi_app.infrastructure.cli.setup.validator import CLIBundleValidator
+from gen_efi_app.infrastructure.cli.setup.keys import CLIBundleKeys
+from gen_efi_app.infrastructure.cli.setup.dependencies import CLIBundleDependencies
+from gen_efi_app.infrastructure.cli.setup.dep_validator import CLIBundleDependenciesValidator
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLIBundleRegistry:
+ '''
+ Encapsulates core CLI components for simplification of CLI bundle.
+
+ It defines:
+
+ :methods:
+ | create_bundle - Creates a CLI bundle.
+ | get_version - Returns the registry version.
+ '''
+
+
+[docs]
+ @classmethod
+ def create_bundle(cls, dependencies: CLIBundleDependencies) -> CLIBundle:
+ '''
+ Creates a CLI bundle.
+
+ :param dependencies: The CLI bundle dependencies.
+ :return: CLI bundle.
+ :exceptions:
+ | ATSValueError: The CLI bundle dependencies must be provided and have proper values.
+ | ATSTypeError: The CLI bundle dependencies must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ | ATSValueError: The CLI bundle must be provided and have proper values.
+ | ATSTypeError: The CLI bundle must be an instance of CLIBundle and
+ | its attributes must be instances of their respective types.
+ '''
+ CLIBundleDependenciesValidator.validate(dependencies)
+
+ bundle: CLIBundle = CLIBundle(
+ service=dependencies.get(CLIBundleKeys.DEPENDENCY_SERVICE) if dependencies else None,
+ parser=dependencies.get(CLIBundleKeys.DEPENDENCY_PARSER) if dependencies else None,
+ commands=dependencies.get(CLIBundleKeys.DEPENDENCY_COMMANDS) if dependencies else None
+ )
+
+ CLIBundleValidator.validate(bundle)
+
+ return bundle
+
+
+
+[docs]
+ @classmethod
+ def get_version(cls) -> str:
+ '''
+ Returns the registry version.
+
+ :return: The registry version.
+ :exceptions: None.
+ '''
+ return __version__
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ validator.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Validator for the CLI bundle.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Sequence
+from ats_utilities.exceptions import ATSValueError, ATSTypeError
+
+from ats_utilities.option.imanager import IOptionManager
+from ats_utilities.validation.check_value import not_none
+from ats_utilities.validation.check_type import istype
+
+from gen_efi_app.infrastructure.cli.setup.bundle import CLIBundle
+from gen_efi_app.core.service.iservice import IService
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class CLIBundleValidator:
+ '''
+ Validator for the CLI bundle.
+
+ It defines:
+
+ :methods:
+ | validate - Validates the CLI bundle.
+ | is_valid - Checks if the CLI bundle is valid.
+ '''
+
+
+[docs]
+ @classmethod
+ def validate(cls, bundle: CLIBundle) -> None:
+ '''
+ Validates the CLI bundle.
+
+ :param bundle: The CLI bundle to be validated.
+ :exceptions:
+ | ATSValueError: The CLI bundle must be provided and have proper values.
+ | ATSTypeError: The CLI bundle must be an instance of CLIBundle and
+ | its attributes must be instances of their respective types.
+ '''
+ ctx: str = 'cli_bundle_validator::validate(...)'
+ msg_bundle_none: str = 'the cli bundle must be provided'
+ msg_bundle_istype: str = 'the cli bundle must be an instance of CLIBundle'
+ msg_service_none: str = 'the service must be provided'
+ msg_parser_none: str = 'the parser must be provided'
+ msg_commands_none: str = 'the commands sequence must be provided'
+ msg_service_istype: str = 'the service must be an instance of IService'
+ msg_parser_istype: str = 'the parser must be an instance of IOptionManager'
+ msg_commands_istype: str = 'the commands sequence must be an instance of CommandBundle'
+
+ not_none(bundle, ctx, msg_bundle_none)
+ istype(bundle, CLIBundle, ctx, msg_bundle_istype)
+
+ not_none(bundle.service, ctx, msg_service_none)
+ not_none(bundle.parser, ctx, msg_parser_none)
+ not_none(bundle.commands, ctx, msg_commands_none)
+
+ istype(bundle.service, IService, ctx, msg_service_istype)
+ istype(bundle.parser, IOptionManager, ctx, msg_parser_istype)
+ istype(bundle.commands, Sequence, ctx, msg_commands_istype)
+
+
+
+[docs]
+ @classmethod
+ def is_valid(cls, bundle: CLIBundle) -> bool:
+ '''
+ Checks if the CLI bundle is valid.
+
+ :param bundle: The CLI bundle to be checked.
+ :return: True if valid, False otherwise.
+ '''
+ try:
+ cls.validate(bundle)
+ return True
+
+ except (ATSValueError, ATSTypeError):
+ return False
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ command.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines command bundle dataclass combining command definition and executor.
+'''
+
+from __future__ import annotations
+
+from dataclasses import dataclass
+
+from gen_efi_app.infrastructure.command.icommand_definition import ICommandDefinition
+from gen_efi_app.infrastructure.command.icommand_executor import ICommandExecutor
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@dataclass(slots=True, frozen=True)
+class CommandBundle:
+ '''
+ Command bundle holding command definition and command executor.
+
+ It defines:
+
+ :attributes:
+ | definition - The command CLI metadata definition.
+ | executor - The command execution strategy.
+ '''
+
+ definition: ICommandDefinition
+ executor: ICommandExecutor[ICommandDefinition, object, object, object]
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ gen_efi_command_definition.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines GenEfiCommandDefinition class.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Sequence
+
+from ats_utilities.option.command.data import OptionData
+from ats_utilities.utils.reflection import to_str
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiCommandDefinition:
+ '''
+ CLI subcommand metadata definition for EFI application configuration files generation.
+
+ It defines:
+
+ :methods:
+ | name - Returns the command name.
+ | help_text - Returns the command help text.
+ | options - Returns the sequence of command options.
+ | __str__ - Returns the command definition as string representation.
+ '''
+
+ @property
+ def name(self) -> str:
+ '''
+ Returns the command name.
+
+ :return: The command name.
+ '''
+ return 'create'
+
+ @property
+ def help_text(self) -> str:
+ '''
+ Returns the command help text.
+
+ :return: The command help text.
+ '''
+ return 'Generate EFI application project files'
+
+ @property
+ def options(self) -> Sequence[OptionData]:
+ '''
+ Returns the command options.
+
+ :return: Sequence of command options.
+ '''
+ return [
+ OptionData(
+ name="--name",
+ help_text="EFI application project name",
+ action=None,
+ default="mytool",
+ required=True,
+ choices=None,
+ nargs=None
+ ),
+ OptionData(
+ name="--output",
+ help_text="Path to the output directory",
+ action=None,
+ default="./",
+ required=True,
+ choices=None,
+ nargs=None
+ )
+ ]
+
+ def __str__(self) -> str:
+ '''
+ Returns the command definition as string representation.
+
+ :return: The command definition as string representation.
+ '''
+ return to_str(self)
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ gen_efi_command_executor.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines GenEfiCommandExecutor class.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+
+from ats_utilities.utils.reflection import to_str
+
+from gen_efi_app.infrastructure.command.icommand_definition import ICommandDefinition
+from gen_efi_app.core.service.iservice import IService
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiCommandExecutor:
+ '''
+ Command executor strategy for generating EFI application configuration files.
+
+ It defines:
+
+ :attributes:
+ | definition - The command CLI metadata definition.
+ :methods:
+ | execute - Executes the subcommand.
+ | get_definition - Returns the command definition metadata.
+ | __str__ - Returns the GenEfiCommandExecutor as string representation.
+ '''
+
+ definition: ICommandDefinition
+
+ def __init__(self, definition: ICommandDefinition) -> None:
+ '''
+ Initializes the command executor.
+
+ :param definition: The command definition metadata.
+ '''
+ self.definition = definition
+
+
+[docs]
+ def execute(self, *, params: Mapping[str, object], service: IService) -> Mapping[str, object]:
+ '''
+ Executes the subcommand.
+
+ :param params: Subcommand parameters from CLI parser.
+ :param service: Command orchestrator service instance.
+ :return: The result of the subcommand execution.
+ '''
+ return service.execute(params=params) if service.is_initialized() else {
+ 'returncode': 1, 'stdout': '', 'stderr': 'service not initialized'
+ }
+
+
+
+[docs]
+ def get_definition(self) -> ICommandDefinition:
+ '''
+ Returns the command definition metadata.
+
+ :return: The command definition metadata.
+ :exceptions: None.
+ '''
+ return self.definition
+
+
+ def __str__(self) -> str:
+ '''
+ Returns the GenEfiCommandExecutor as string representation.
+
+ :return: The GenEfiCommandExecutor as string representation.
+ '''
+ return to_str(self)
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ icommand_definition.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines abstract ICommandDefinition strategy interface.
+'''
+
+from __future__ import annotations
+
+from typing import Protocol, runtime_checkable
+
+from ats_utilities.option.command.ioption_command import IOptionCommand
+from ats_utilities.option.command.ioption import IOption
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@runtime_checkable
+class ICommandDefinition(IOptionCommand[IOption], Protocol):
+ '''Abstract ICommandDefinition strategy interface.'''
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ icommand_executor.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines abstract ICommandExecutor strategy interface.
+'''
+
+from __future__ import annotations
+
+from typing import Protocol, runtime_checkable
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@runtime_checkable
+class ICommandExecutor[DefinitionType, ParametersType, ReturnType, ServiceType](Protocol):
+ '''
+ Abstract ICommandExecutor strategy interface.
+
+ It defines:
+
+ :methods:
+ | execute - Executes the command strategy.
+ | get_definition - Returns the command definition metadata.
+ '''
+
+
+[docs]
+ def execute(self, *, params: ParametersType, service: ServiceType) -> ReturnType:
+ '''
+ Executes this command strategy.
+
+ :param params: The command parameters parsed from CLI.
+ :param service: The service instance.
+ :return: The execution result.
+ '''
+
+
+
+[docs]
+ def get_definition(self) -> DefinitionType:
+ '''
+ Returns the command definition metadata.
+
+ :return: The command definition metadata.
+ '''
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ subprocessor.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines sub-processor adapter implementing ISubProcessor.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from logging import INFO
+from os import walk
+from os.path import dirname, realpath, relpath
+
+from ats_utilities.generation.imanager import IGeneratorManager
+from ats_utilities.generation.data import GeneratorData
+from ats_utilities.logger.ilogger import ILogger
+from ats_utilities.validation.check_value import not_none
+from ats_utilities.validation.check_type import istype
+from ats_utilities.utils.reflection import to_str
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class SubProcessor:
+ '''
+ Adapter that executes sub-processes.
+
+ It defines:
+
+ :attributes:
+ | _scheme - Path to the scheme json file.
+ | _templates - Path to the templates tgz file.
+ | _generator - Generator manager used to generate code from templates.
+ | _logger - Logger used to log messages.
+ :methods:
+ | run - Executes a sub-process.
+ | is_initialized - Checks if the subprocessor is initialized.
+ | __str__ - Returns the SubProcessor as string representation.
+ '''
+
+ _scheme: str = 'config/scheme.json'
+ _templates: str = 'config/templates.tgz'
+ _generator: IGeneratorManager
+ _logger: ILogger
+
+ def __init__(self, generator: IGeneratorManager) -> None:
+ '''
+ Initializes the SubProcessor adapter.
+
+ :param generator: The generator manager.
+ :exceptions:
+ | ATSValueError: The generator must be provided.
+ | ATSTypeError: The generator must be an instance of IGeneratorManager.
+ '''
+ ctx: str = 'subprocessor::init(...)'
+ msg_generator_none: str = 'the generator must be provided'
+ msg_generator_istype: str = f'the generator must be an instance of {IGeneratorManager.__name__}'
+
+ not_none(generator, ctx, msg_generator_none)
+ istype(generator, IGeneratorManager, ctx, msg_generator_istype)
+
+ self._generator = generator
+ self._logger = generator.get_context().logger
+
+
+[docs]
+ def run(self, *, params: Mapping[str, object]) -> Mapping[str, object]:
+ '''
+ Executes the generator.
+
+ :param params: The command parameters for generator.
+ :return: Return code, stdout and stderr messages.
+ :exceptions: None.
+ '''
+ try:
+ current_dir: str = dirname(realpath(__file__))
+ output_dir: str = params.get('output')
+ project_name: str = params.get('name')
+ scheme: str = f'{current_dir}/{self._scheme}'
+ templates: str = f'{current_dir}/{self._templates}'
+
+ success = self._generator.generate(
+ data=GeneratorData(
+ archive_path=templates,
+ target_dir=output_dir,
+ template_key='base',
+ scheme=scheme,
+ template_values={'project_name': project_name}
+ )
+ )
+
+ if success:
+ self._logger.write_log(INFO, ' Generated files:')
+
+ for root, _, files in walk(output_dir):
+ for file in files:
+ rel_dir = relpath(root, output_dir)
+
+ if rel_dir == '.':
+ self._logger.write_log(INFO, f' {file}')
+ else:
+ self._logger.write_log(INFO, f' {rel_dir}/{file}')
+
+ return {
+ 'returncode': 0 if success else 1,
+ 'stdout': f'project {project_name} successfully generated.' if success else '',
+ 'stderr': f'failed to generate {project_name} project.' if not success else ''
+ }
+
+ except Exception as exc:
+ return {'returncode': 1, 'stdout': '', 'stderr': f'failed to generate {project_name} project {exc}'}
+
+
+
+[docs]
+ def is_initialized(self) -> bool:
+ '''
+ Checks if the subprocessor is initialized.
+
+ :return: True if the subprocessor is initialized, False otherwise.
+ :exceptions: None.
+ '''
+ return self._generator.is_initialized()
+
+
+ def __str__(self) -> str:
+ '''
+ Returns the SubProcessor as string representation.
+
+ :return: The SubProcessor as string representation.
+ :exceptions: None.
+ '''
+ return to_str(self)
+
+
-# -*- coding: UTF-8 -*-
-
-'''
-Module
- __init__.py
-Copyright
- Copyright (C) 2020 - 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
- gen_efi_app is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- gen_efi_app is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program. If not, see <http://www.gnu.org/licenses/>.
-Info
- Defines class GenEfi with attribute(s) and method(s).
- Generates an EFI project structure.
-'''
-
-import sys
-from typing import List, Dict, Optional
-from os.path import dirname, realpath
-
-try:
- from ats_utilities.pro_config import ProConfig
- from ats_utilities.pro_config.pro_name import ProName
- from ats_utilities.config_io.file_check import FileCheck
- from ats_utilities.console_io.verbose import verbose_message
- from ats_utilities.config_io.yaml.yaml2object import Yaml2Object
- from ats_utilities.exceptions.ats_type_error import ATSTypeError
- from ats_utilities.exceptions.ats_value_error import ATSValueError
- from gen_efi_app.pro.read_template import ReadTemplate
- from gen_efi_app.pro.write_template import WriteTemplate
-except ImportError as ats_error_message: # pragma: no cover
- # Force exit python #######################################################
- sys.exit(f'\n{__file__}\n{ats_error_message}\n') # pragma: no cover
-
-__author__: str = 'Vladimir Roncevic'
-__copyright__: str = '(C) 2026, https://electux.github.io/gen_efi_app'
-__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
-__license__: str = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
-__version__: str = '1.3.6'
-__maintainer__: str = 'Vladimir Roncevic'
-__email__: str = 'elektron.ronca@gmail.com'
-__status__: str = 'Updated'
-
-
-
-[docs]
-class GenEfi(FileCheck, ProConfig, ProName):
- '''
- Defined class GenPro with attribute(s) and method(s).
- Generates an EFI project structure.
-
- It defines:
-
- :attributes:
- | _GEN_VERBOSE - Console text indicator for process-phase.
- | _PRO_STRUCTURE - Project setup (template, module).
- | _reader - Reader API.
- | _writer - Writer API.
- :methods:
- | __init__ - Initials GenPro constructor.
- | get_reader - Gets template reader.
- | get_writer - Gets template writer.
- | gen_project - Generates EFI project structure.
- '''
-
- _GEN_VERBOSE: str = 'GEN_EFI_APP::PRO::GEN_EFI'
- _PRO_STRUCTURE: str = '/../conf/project.yaml'
-
- def __init__(self, verbose: bool = False) -> None:
- '''
- Initial constructor.
-
- :param verbose: Enable/Disable verbose option
- :type verbose: <bool>
- :exceptions: None
- '''
- FileCheck.__init__(self, verbose)
- ProConfig.__init__(self, verbose)
- ProName.__init__(self, verbose)
- verbose_message(verbose, [f'{self._GEN_VERBOSE} init generator'])
- self._reader: Optional[ReadTemplate] = ReadTemplate(verbose)
- self._writer: Optional[WriteTemplate] = WriteTemplate(verbose)
- current_dir: str = dirname(realpath(__file__))
- pro_structure: str = f'{current_dir}{self._PRO_STRUCTURE}'
- self.check_path(pro_structure, verbose)
- self.check_mode('r', verbose)
- self.check_format(pro_structure, 'yaml', verbose)
- if self.is_file_ok():
- yml2obj: Optional[Yaml2Object] = Yaml2Object(pro_structure)
- self.config = yml2obj.read_configuration()
-
-
-[docs]
- def get_reader(self) -> Optional[ReadTemplate]:
- '''
- Gets template reader.
-
- :return: Template reader object | None
- :rtype: <Optional[ReadTemplate]>
- :exceptions: None
- '''
- return self._reader
-
-
-
-[docs]
- def get_writer(self) -> Optional[WriteTemplate]:
- '''
- Gets template writer.
-
- :return: Template writer object | none
- :rtype: <Optional[WriteTemplate]>
- :exceptions: None
- '''
- return self._writer
-
-
-
-[docs]
- def gen_project(self, pro_name: str, verbose: bool = False) -> bool:
- '''
- Generates EFI project structure.
-
- :param pro_name: Project name | None
- :type pro_name: <Optional[str]>
- :param verbose: Enable/Disable verbose option
- :type verbose: <bool>
- :return: True (success operation) | False
- :rtype: <bool>
- :exceptions: ATSTypeError | ATSValueError
- '''
- error_msg: Optional[str] = None
- error_id: Optional[int] = None
- error_msg, error_id = self.check_params([
- ('str:pro_name', pro_name)
- ])
- if error_id == self.TYPE_ERROR:
- raise ATSTypeError(error_msg)
- if not bool(pro_name):
- raise ATSValueError('missing project name')
- status: bool = False
- if bool(self.config) and self._reader and self._writer:
- templates: List[Dict[str, str]] = self._reader.read(
- self.config, verbose
- )
- if bool(templates):
- status = self._writer.write(templates, pro_name, verbose)
- return status
-
-
-
-# -*- coding: UTF-8 -*-
-
-'''
-Module
- read_template.py
-Copyright
- Copyright (C) 2020 - 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
- gen_efi_app is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- gen_efi_app is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program. If not, see <http://www.gnu.org/licenses/>.
-Info
- Defines class ReadTemplate with attribute(s) and method(s).
- Creates an API for reading a template files.
-'''
-
-import sys
-from typing import Any, List, Dict, Optional
-from os.path import dirname, realpath, isdir
-
-try:
- from ats_utilities.config_io.file_check import FileCheck
- from ats_utilities.console_io.verbose import verbose_message
- from ats_utilities.pro_config import ProConfig
- from ats_utilities.pro_config.template_dir import TemplateDir
- from ats_utilities.exceptions.ats_type_error import ATSTypeError
- from ats_utilities.exceptions.ats_value_error import ATSValueError
-except ImportError as ats_error_message: # pragma: no cover
- # Force exit python #######################################################
- sys.exit(f'\n{__file__}\n{ats_error_message}\n') # pragma: no cover
-
-__author__: str = 'Vladimir Roncevic'
-__copyright__: str = '(C) 2026, https://electux.github.io/gen_efi_app'
-__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
-__license__: str = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
-__version__: str = '1.3.6'
-__maintainer__: str = 'Vladimir Roncevic'
-__email__: str = 'elektron.ronca@gmail.com'
-__status__: str = 'Updated'
-
-
-
-[docs]
-class ReadTemplate(FileCheck, TemplateDir):
- '''
- Defines class ReadTemplate with attribute(s) and method(s).
- Creates an API for reading a templatee files.
-
- It defines:
-
- :attributes:
- | _GEN_VERBOSE - Console text indicator for process-phase.
- | _TEMPLATE_DIR - Prefix path to templates.
- :methods:
- | __init__ - Initials ReadTemplate constructor.
- | read - Reads a templates.
- '''
-
- _GEN_VERBOSE: str = 'GEN_AUTOCONF::PRO::READ_TEMPLATE'
- _TEMPLATE_DIR: str = '/../conf/template/'
-
- def __init__(self, verbose: bool = False) -> None:
- '''
- Initials ReadTemplate constructor.
-
- :param verbose: Enable/Disable verbose option
- :type verbose: <bool>
- :exceptions: None
- '''
- FileCheck.__init__(self, verbose)
- TemplateDir.__init__(self, verbose)
- verbose_message(verbose, [f'{self._GEN_VERBOSE.lower()} init reader'])
- current_dir: str = dirname(realpath(__file__))
- pro_template_dir: str = f'{current_dir}{self._TEMPLATE_DIR}'
- if isdir(pro_template_dir):
- self.template_dir = pro_template_dir
-
-
-[docs]
- def read(
- self, config: Dict[Any, Any], verbose: bool = False
- ) -> List[Dict[str, str]]:
- '''
- Reads a templates.
-
- :param config: Project configuration
- :type config: <Dict[Any, Any]>
- :param verbose: Enable/Disable verbose option
- :type verbose: <bool>
- :return: List with templates
- :rtype: <List[Dict[str, str]]>
- :exceptions: ATSTypeError | ATSValueError
- '''
- error_msg: Optional[str] = None
- error_id: Optional[int] = None
- error_msg, error_id = self.check_params([('dict:config', config)])
- if error_id == self.TYPE_ERROR:
- raise ATSTypeError(error_msg)
- if not bool(config):
- raise ATSValueError('missing templates')
- templates: List[str] = config[ProConfig.TEMPLATES]
- modules: List[str] = config[ProConfig.MODULES]
- loaded_templates: List[Dict[str, str]] = []
- for template_file, module_file in zip(templates, modules):
- template_content: Optional[str] = None
- template_file_path: str = f'{self.template_dir}{template_file}'
- self.check_path(template_file_path, verbose)
- self.check_mode('r', verbose)
- self.check_format(template_file_path, ProConfig.FORMAT, verbose)
- if self.is_file_ok():
- with open(
- template_file_path, 'r', encoding='utf-8'
- ) as template_module:
- template_content = template_module.read()
- loaded_templates.append({module_file: template_content})
- return loaded_templates
-
-
-
-# -*- coding: UTF-8 -*-
-
-'''
-Module
- write_template.py
-Copyright
- Copyright (C) 2020 - 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
- gen_efi_app is free software: you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the
- Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- gen_efi_app is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program. If not, see <http://www.gnu.org/licenses/>.
-Info
- Defines class WriteTemplate with attribute(s) and method(s).
- Creates an API for writing source and build modules.
-'''
-
-import sys
-from typing import List, Dict, Optional
-from os import getcwd, chmod, mkdir
-from os.path import exists
-from string import Template
-from datetime import date
-
-try:
- from ats_utilities.config_io.file_check import FileCheck
- from ats_utilities.console_io.verbose import verbose_message
- from ats_utilities.exceptions.ats_type_error import ATSTypeError
- from ats_utilities.exceptions.ats_value_error import ATSValueError
-except ImportError as ats_error_message: # pragma: no cover
- # Force exit python #######################################################
- sys.exit(f'\n{__file__}\n{ats_error_message}\n') # pragma: no cover
-
-__author__: str = 'Vladimir Roncevic'
-__copyright__: str = '(C) 2026, https://electux.github.io/gen_efi_app'
-__credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
-__license__: str = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
-__version__: str = '1.3.6'
-__maintainer__: str = 'Vladimir Roncevic'
-__email__: str = 'elektron.ronca@gmail.com'
-__status__: str = 'Updated'
-
-
-
-[docs]
-class WriteTemplate(FileCheck):
- '''
- Defines class WriteTemplate with attribute(s) and method(s).
- Creates an API for writing source and build modules.
-
- It defines:
-
- :attributes:
- | _GEN_VERBOSE - Console text indicator for process-phase.
- :methods:
- | __init__ - Initials WriteTemplate constructor.
- | write - Writes a templates with parameters.
- '''
-
- _GEN_VERBOSE: str = 'GEN_EFI_APP::PRO::WRITE_TEMPLATE'
-
- def __init__(self, verbose: bool = False) -> None:
- '''
- Initial constructor.
-
- :param verbose: Enable/Disable verbose option
- :type verbose: <bool>
- :exceptions: None
- '''
- super().__init__(verbose)
- verbose_message(verbose, [f'{self._GEN_VERBOSE.lower()} init writer'])
-
-
-[docs]
- def write(
- self,
- templates: List[Dict[str, str]],
- pro_name: Optional[str],
- verbose: bool = False
- ) -> bool:
- '''
- Writes a templates with parameters.
-
- :param templates: List of templates
- :type templates: <List[Dict[str, str]]>
- :param pro_name: Project name | None
- :type pro_name: <Optional[str]>
- :param verbose: Enable/Disable verbose option
- :type verbose: <bool>
- :return: True (templates written) | False
- :rtype: <bool>
- :exceptions: ATSTypeError | ATSValueError
- '''
- error_msg: Optional[str] = None
- error_id: Optional[int] = None
- error_msg, error_id = self.check_params([
- ('list:templates', templates), ('str:pro_name', pro_name)
- ])
- if error_id == self.TYPE_ERROR:
- raise ATSTypeError(error_msg)
- if not bool(templates):
- raise ATSValueError('missing templates')
- if not bool(pro_name):
- raise ATSValueError('missing project name')
- all_stat: List[bool] = []
- pro_dir: str = f'{getcwd()}/{pro_name}/'
- num_of_modules: int = len(templates)
- if not exists(pro_dir):
- mkdir(pro_dir)
- for template_content in templates:
- module_name: str = list(template_content.keys())[0]
- template = Template(template_content[module_name])
- module_path: str = f'{pro_dir}{module_name}'
- module_dict: Dict[str, str] = {
- 'PRO': f'{pro_name}', 'YEAR': f'{date.today().year}'
- }
- with open(module_path, 'w', encoding='utf-8') as module_file:
- module_content: str = template.substitute(module_dict)
- module_file.write(module_content)
- chmod(module_path, 0o666)
- self.check_path(module_path, verbose)
- self.check_mode('w', verbose)
- if 'makefile'.capitalize() in module_path:
- self.check_format(module_path, 'makefile', verbose)
- else:
- self.check_format(
- module_path, module_path.split('.')[1], verbose
- )
- if self.is_file_ok():
- all_stat.append(True)
- else:
- all_stat.append(False)
- return all([
- bool(all_stat), all(all_stat), len(all_stat) == num_of_modules
- ])
-
-
-
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ bundle.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Defines the gen_efi_app bundle.
+'''
+
+from __future__ import annotations
+
+from dataclasses import dataclass
+
+from ats_utilities.base.setup.bundle import BaseBundle
+from ats_utilities.utils.reflection import instance_to_dict
+
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.core.service.isubprocessor import ISubProcessor
+from gen_efi_app.infrastructure.cli.icli import ICLI
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+@dataclass(slots=True, frozen=True, kw_only=True)
+class GenEfiAppBundle:
+ '''
+ GenEfiApp bundle holding the components of the gen_efi_app.
+
+ It defines:
+
+ :attributes:
+ | base - The base bundle with the base components.
+ | service - The service orchestrating the gen_efi_app execution.
+ | subprocessor - The adapter executing the gen_efi_app sub-processes.
+ | cli - The command-line interface adapter.
+ :methods:
+ | to_dict - Converts the gen_efi_app bundle to a dictionary.
+ '''
+
+ base: BaseBundle
+ service: IService
+ subprocessor: ISubProcessor
+ cli: ICLI
+
+
+[docs]
+ def to_dict(self) -> dict[str, object]:
+ '''
+ Converts the gen_efi_app bundle to a dictionary.
+
+ :return: Dictionary representation of the gen_efi_app bundle.
+ :exceptions: None.
+ '''
+ return instance_to_dict(self)
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ dep_validator.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Validator for the gen_efi_app bundle dependencies.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from ats_utilities.exceptions import ATSValueError, ATSTypeError
+
+from ats_utilities.validation.check_type import istype
+from ats_utilities.validation.check_value import not_none
+
+from gen_efi_app.setup.dependencies import GenEfiAppBundleDependencies
+from gen_efi_app.setup.keys import GenEfiAppBundleKeys
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiAppBundleDependenciesValidator:
+ '''
+ Validator for the gen_efi_app bundle dependencies.
+
+ It defines:
+
+ :methods:
+ | validate - Validates the gen_efi_app bundle dependencies.
+ | is_valid - Checks if the gen_efi_app bundle dependencies is valid.
+ '''
+
+
+[docs]
+ @classmethod
+ def validate(cls, dependencies: GenEfiAppBundleDependencies) -> None:
+ '''
+ Validates the gen_efi_app bundle dependencies.
+
+ :param dependencies: The gen_efi_app bundle dependencies to be validated.
+ :exceptions:
+ | ATSValueError: The gen_efi_app bundle dependencies must be provided and have proper values.
+ | ATSTypeError: The gen_efi_app bundle dependencies must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ '''
+ ctx: str = 'gen_efi_app_bundle_dependencies_validator::validate(...)'
+ msg_dependencies_none: str = 'the gen_efi_app bundle dependencies must be provided'
+ msg_dependencies_istype: str = 'the gen_efi_app bundle dependencies must be a Mapping'
+
+ not_none(dependencies, ctx, msg_dependencies_none)
+ istype(dependencies, Mapping, ctx, msg_dependencies_istype)
+
+ for attr_name, expected_type in GenEfiAppBundleKeys.get_dependency_to_type().items():
+ msg_attr_name_none: str = f'the {attr_name.replace("_", " ")} must be provided'
+ msg_attr_name_istype: str = (
+ f'the {attr_name.replace("_", " ")} must be an instance of {expected_type.__name__}'
+ )
+
+ attribute = dependencies.get(attr_name)
+
+ not_none(attribute, ctx, msg_attr_name_none)
+ istype(attribute, expected_type, ctx, msg_attr_name_istype)
+
+
+
+[docs]
+ @classmethod
+ def is_valid(cls, dependencies: GenEfiAppBundleDependencies) -> bool:
+ '''
+ Checks if the gen_efi_app bundle dependencies is valid.
+
+ :param dependencies: The gen_efi_app bundle dependencies to be checked.
+ :return: True if valid, False otherwise.
+ '''
+ try:
+ cls.validate(dependencies)
+ return True
+
+ except (ATSValueError, ATSTypeError):
+ return False
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ dependencies.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ GenEfiApp bundle dependencies for the gen_efi_app bundle.
+'''
+
+from __future__ import annotations
+
+from typing import TypedDict
+
+from ats_utilities.base.setup.bundle import BaseBundle
+
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.core.service.isubprocessor import ISubProcessor
+from gen_efi_app.infrastructure.cli.icli import ICLI
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiAppBundleDependencies(TypedDict):
+ '''
+ GenEfiApp bundle dependencies for the gen_efi_app bundle.
+
+ It defines:
+
+ :attributes:
+ | base - The base bundle with the base components for the gen_efi_app bundle.
+ | service - The service orchestrating the gen_efi_app execution for the bundle.
+ | subprocessor - The adapter executing the gen_efi_app sub-processes for the bundle.
+ | cli - The command-line interface adapter for the gen_efi_app bundle.
+ '''
+
+ base: BaseBundle
+ service: IService
+ subprocessor: ISubProcessor
+ cli: ICLI
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ factory.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Factory for creating the gen_efi_app bundle.
+'''
+
+from __future__ import annotations
+
+from ats_utilities.base.setup.factory import BaseBundleFactory
+from ats_utilities.base.setup.bundle import BaseBundle
+from ats_utilities.base.setup.options import BaseBundleOptions
+from ats_utilities.context.bundle import ContextBundle
+from ats_utilities.context.factory import ContextBundleFactory
+
+from gen_efi_app.setup.bundle import GenEfiAppBundle
+from gen_efi_app.setup.options import GenEfiAppBundleOptions
+from gen_efi_app.setup.registry import GenEfiAppBundleRegistry
+from gen_efi_app.setup.dependencies import GenEfiAppBundleDependencies
+from gen_efi_app.setup.opt_validator import GenEfiAppBundleOptionsValidator
+from gen_efi_app.setup.keys import GenEfiAppBundleKeys
+from gen_efi_app.core.service.engine import Service
+from gen_efi_app.infrastructure.subprocessor import SubProcessor
+from gen_efi_app.infrastructure.cli.engine import CLI
+from gen_efi_app.infrastructure.cli.setup.bundle import CLIBundle
+from gen_efi_app.infrastructure.cli.setup.dependencies import CLIBundleDependencies
+from gen_efi_app.infrastructure.cli.setup.registry import CLIBundleRegistry
+from gen_efi_app.infrastructure.command.command import CommandBundle
+from gen_efi_app.infrastructure.command.gen_efi_command_definition import GenEfiCommandDefinition
+from gen_efi_app.infrastructure.command.gen_efi_command_executor import GenEfiCommandExecutor
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiAppBundleFactory:
+ '''
+ Factory for creating the gen_efi_app bundle.
+
+ It defines:
+
+ :attributes:
+ | _info_file - Path to the gen_efi_app info file.
+ :methods:
+ | create_bundle - Creates the gen_efi_app bundle with optional pre-configured options.
+ | get_version - Returns the factory version.
+ '''
+
+ _info_file: str = 'gen_efi_app/infrastructure/config/gen_efi_app.cfg'
+
+
+[docs]
+ @classmethod
+ def create_bundle(cls, options: GenEfiAppBundleOptions | None = None) -> GenEfiAppBundle:
+ '''
+ Creates the gen_efi_app bundle with optional pre-configured options.
+
+ :param options: The pre-configured options for the gen_efi_app bundle.
+ :return: The gen_efi_app bundle.
+ :exceptions:
+ | ATSValueError: The gen_efi_app bundle options must be provided and have proper values.
+ | ATSTypeError: The gen_efi_app bundle options must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ | ATSValueError: The gen_efi_app bundle dependencies must be provided and have proper values.
+ | ATSTypeError: The gen_efi_app bundle dependencies must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ | ATSValueError: The gen_efi_app bundle must be provided and have proper values.
+ | ATSTypeError: The gen_efi_app bundle must be an instance of GenEfiAppBundle and
+ | its attributes must be instances of their respective types.
+ '''
+ if options is not None:
+ GenEfiAppBundleOptionsValidator.validate(options)
+
+ info_file = options.get(GenEfiAppBundleKeys.OPTION_INFO_FILE) if options else cls._info_file
+
+ context_bundle: ContextBundle = ContextBundleFactory.create_bundle()
+
+ base_bundle: BaseBundle = BaseBundleFactory.create_bundle(
+ options=BaseBundleOptions(
+ info_file=info_file,
+ use_generator=True,
+ context_bundle=context_bundle
+ )
+ )
+
+ subprocessor: SubProcessor = SubProcessor(generator=base_bundle.generation_manager)
+
+ service: Service = Service(subprocessor=subprocessor)
+
+ gen_efi_definition: GenEfiCommandDefinition = GenEfiCommandDefinition()
+
+ gen_efi_bundle: CommandBundle = CommandBundle(
+ definition=gen_efi_definition,
+ executor=GenEfiCommandExecutor(gen_efi_definition)
+ )
+
+ cli_bundle: CLIBundle = CLIBundleRegistry.create_bundle(
+ dependencies=CLIBundleDependencies(
+ service=service,
+ parser=base_bundle.option_manager,
+ commands=[gen_efi_bundle]
+ )
+ )
+
+ cli: CLI = CLI(cli_bundle)
+
+ return GenEfiAppBundleRegistry.create_bundle(
+ dependencies=GenEfiAppBundleDependencies(
+ base=base_bundle,
+ service=service,
+ subprocessor=subprocessor,
+ cli=cli
+ )
+ )
+
+
+
+[docs]
+ @classmethod
+ def get_version(cls) -> str:
+ '''
+ Returns the factory version.
+
+ :return: The factory version.
+ :exceptions: None.
+ '''
+ return __version__
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ keys.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Runtime components and interface constraints for the gen_efi_app bundle.
+'''
+
+from __future__ import annotations
+
+from typing import ClassVar
+from types import MappingProxyType
+
+from ats_utilities.base.setup.bundle import BaseBundle
+
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.core.service.isubprocessor import ISubProcessor
+from gen_efi_app.infrastructure.cli.icli import ICLI
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiAppBundleKeys:
+ '''
+ Runtime components and interface constraints for the gen_efi_app bundle.
+
+ It defines:
+
+ :attributes:
+ | DEPENDENCY_BASE - The base bundle constant for the gen_efi_app bundle.
+ | DEPENDENCY_SERVICE - The service interface constant for the gen_efi_app bundle.
+ | DEPENDENCY_SUBPROCESSOR - The subprocessor interface constant for the gen_efi_app bundle.
+ | DEPENDENCY_CLI - The cli interface constant for the gen_efi_app bundle.
+ | OPTION_INFO_FILE - The info file option constant for the gen_efi_app bundle.
+ :methods:
+ | get_dependency_to_type - Returns the mapping of the bundle dependencies to their types.
+ | get_option_to_type - Returns the mapping of the bundle options to their types.
+ '''
+
+ # Dependency Keys
+ DEPENDENCY_BASE: ClassVar[str] = 'base'
+ DEPENDENCY_SERVICE: ClassVar[str] = 'service'
+ DEPENDENCY_SUBPROCESSOR: ClassVar[str] = 'subprocessor'
+ DEPENDENCY_CLI: ClassVar[str] = 'cli'
+
+ # Option Keys
+ OPTION_INFO_FILE: ClassVar[str] = 'info_file'
+
+
+[docs]
+ @classmethod
+ def get_dependency_to_type(cls) -> MappingProxyType[str, type]:
+ '''
+ Returns the mapping of the gen_efi_app bundle dependencies to their types.
+
+ :return: The mapping of the gen_efi_app bundle dependencies to their types.
+ :exceptions: None.
+ '''
+ return MappingProxyType({
+ cls.DEPENDENCY_BASE: BaseBundle,
+ cls.DEPENDENCY_SERVICE: IService,
+ cls.DEPENDENCY_SUBPROCESSOR: ISubProcessor,
+ cls.DEPENDENCY_CLI: ICLI,
+ })
+
+
+
+[docs]
+ @classmethod
+ def get_option_to_type(cls) -> MappingProxyType[str, type]:
+ '''
+ Returns the mapping of the gen_efi_app bundle options to their types.
+
+ :return: The mapping of the gen_efi_app bundle options to their types.
+ :exceptions: None.
+ '''
+ return MappingProxyType({
+ cls.OPTION_INFO_FILE: str,
+ })
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ opt_validator.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Validator for the gen_efi_app bundle options.
+'''
+
+from __future__ import annotations
+
+from collections.abc import Mapping
+from ats_utilities.exceptions import ATSValueError, ATSTypeError
+
+from ats_utilities.validation.check_type import istype
+from ats_utilities.validation.check_value import not_none
+
+from gen_efi_app.setup.options import GenEfiAppBundleOptions
+from gen_efi_app.setup.keys import GenEfiAppBundleKeys
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiAppBundleOptionsValidator:
+ '''
+ Validator for the gen_efi_app bundle options.
+
+ It defines:
+
+ :methods:
+ | validate - Validates the gen_efi_app bundle options.
+ | is_valid - Checks if the gen_efi_app bundle options is valid.
+ '''
+
+
+[docs]
+ @classmethod
+ def validate(cls, options: GenEfiAppBundleOptions) -> None:
+ '''
+ Validates the gen_efi_app bundle options.
+
+ :param options: The gen_efi_app bundle options to be validated.
+ :exceptions:
+ | ATSValueError: The gen_efi_app bundle options must be provided and have proper values.
+ | ATSTypeError: The gen_efi_app bundle options must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ '''
+ ctx: str = 'gen_efi_app_bundle_options_validator::validate(...)'
+ msg_options_none: str = 'the gen_efi_app bundle options must be provided'
+ msg_options_istype: str = 'the gen_efi_app bundle options must be a Mapping'
+
+ not_none(options, ctx, msg_options_none)
+ istype(options, Mapping, ctx, msg_options_istype)
+
+ for attr_name, expected_type in GenEfiAppBundleKeys.get_option_to_type().items():
+ msg_attr_name_istype: str = (
+ f'the {attr_name.replace("_", " ")} must be an instance of {expected_type.__name__}'
+ )
+
+ attribute = options.get(attr_name)
+
+ istype(attribute, expected_type, ctx, msg_attr_name_istype)
+
+
+
+[docs]
+ @classmethod
+ def is_valid(cls, options: GenEfiAppBundleOptions) -> bool:
+ '''
+ Checks if the gen_efi_app bundle options is valid.
+
+ :param options: The gen_efi_app bundle options to be checked.
+ :return: True if valid, False otherwise.
+ '''
+ try:
+ cls.validate(options)
+ return True
+
+ except (ATSValueError, ATSTypeError):
+ return False
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ options.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ GenEfiApp bundle options for the gen_efi_app bundle.
+'''
+
+from __future__ import annotations
+
+from typing import TypedDict
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiAppBundleOptions(TypedDict):
+ '''
+ GenEfiApp bundle options for the gen_efi_app bundle.
+
+ It defines:
+
+ :attributes:
+ | info_file - The info file path for the gen_efi_app bundle.
+ '''
+
+ info_file: str
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ registry.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Encapsulates core gen_efi_app components for simplification of bundle.
+'''
+
+from __future__ import annotations
+
+from ats_utilities.base.setup.bundle import BaseBundle
+
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.core.service.isubprocessor import ISubProcessor
+from gen_efi_app.infrastructure.cli.icli import ICLI
+from gen_efi_app.setup.bundle import GenEfiAppBundle
+from gen_efi_app.setup.validator import GenEfiAppBundleValidator
+from gen_efi_app.setup.keys import GenEfiAppBundleKeys
+from gen_efi_app.setup.dependencies import GenEfiAppBundleDependencies
+from gen_efi_app.setup.dep_validator import GenEfiAppBundleDependenciesValidator
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiAppBundleRegistry:
+ '''
+ Encapsulates core gen_efi_app components for simplification of bundle.
+
+ It defines:
+
+ :methods:
+ | create_bundle - Creates the gen_efi_app bundle.
+ | get_version - Returns the registry version.
+ '''
+
+
+[docs]
+ @classmethod
+ def create_bundle(cls, dependencies: GenEfiAppBundleDependencies) -> GenEfiAppBundle:
+ '''
+ Creates the gen_efi_app bundle.
+
+ :param dependencies: The gen_efi_app bundle dependencies.
+ :return: The gen_efi_app bundle.
+ :exceptions:
+ | ATSValueError: The gen_efi_app bundle dependencies must be provided and have proper values.
+ | ATSTypeError: The gen_efi_app bundle dependencies must be an instance of Mapping and its
+ | attributes must be instances of their respective types.
+ | ATSValueError: The gen_efi_app bundle must be provided and have proper values.
+ | ATSTypeError: The gen_efi_app bundle must be an instance of GenEfiAppBundle and
+ | its attributes must be instances of their respective types.
+ '''
+ GenEfiAppBundleDependenciesValidator.validate(dependencies)
+
+ base: BaseBundle | None = dependencies.get(GenEfiAppBundleKeys.DEPENDENCY_BASE) if dependencies else None
+ service: IService | None = dependencies.get(GenEfiAppBundleKeys.DEPENDENCY_SERVICE) if dependencies else None
+ subprocessor: ISubProcessor | None = dependencies.get(
+ GenEfiAppBundleKeys.DEPENDENCY_SUBPROCESSOR
+ ) if dependencies else None
+ cli: ICLI | None = dependencies.get(GenEfiAppBundleKeys.DEPENDENCY_CLI) if dependencies else None
+
+ bundle: GenEfiAppBundle = GenEfiAppBundle(
+ base=base, service=service, subprocessor=subprocessor, cli=cli
+ )
+
+ GenEfiAppBundleValidator.validate(bundle)
+
+ return bundle
+
+
+
+[docs]
+ @classmethod
+ def get_version(cls) -> str:
+ '''
+ Returns the registry version.
+
+ :return: The registry version.
+ :exceptions: None.
+ '''
+ return __version__
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ validator.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ A validator for the gen_efi_app bundle.
+'''
+
+from __future__ import annotations
+
+from ats_utilities.base.setup.bundle import BaseBundle
+from ats_utilities.exceptions import ATSValueError, ATSTypeError
+from ats_utilities.validation.check_value import not_none
+from ats_utilities.validation.check_type import istype
+
+from gen_efi_app.setup.bundle import GenEfiAppBundle
+from gen_efi_app.core.service.iservice import IService
+from gen_efi_app.core.service.isubprocessor import ISubProcessor
+from gen_efi_app.infrastructure.cli.icli import ICLI
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+class GenEfiAppBundleValidator:
+ '''
+ A validator for the gen_efi_app bundle.
+
+ It defines:
+
+ :methods:
+ | validate - Validates the gen_efi_app bundle.
+ | is_valid - Checks if the gen_efi_app bundle is valid.
+ '''
+
+
+[docs]
+ @classmethod
+ def validate(cls, bundle: GenEfiAppBundle) -> None:
+ '''
+ Validates the gen_efi_app bundle.
+
+ :param bundle: The gen_efi_app bundle to be validated.
+ :exceptions:
+ | ATSValueError: The gen_efi_app bundle must be provided and have proper values.
+ | ATSTypeError: The gen_efi_app bundle must be an instance of GenEfiAppBundle and
+ | its attributes must be instances of their respective types.
+ '''
+ ctx: str = 'gen_efi_app_bundle_validator::validate(...)'
+ msg_bundle_none: str = 'the gen_efi_app bundle must be provided'
+ msg_bundle_istype: str = 'the gen_efi_app bundle must be an instance of GenEfiAppBundle'
+ msg_base_none: str = 'the base bundle must be provided'
+ msg_service_none: str = 'the service must be provided'
+ msg_subprocessor_none: str = 'the subprocessor must be provided'
+ msg_cli_none: str = 'the cli must be provided'
+ msg_base_istype: str = 'the base bundle must be an instance of BaseBundle'
+ msg_service_istype: str = 'the service must be an instance of IService'
+ msg_subprocessor_istype: str = 'the subprocessor must be an instance of ISubProcessor'
+ msg_cli_istype: str = 'the cli must be an instance of ICLI'
+
+ not_none(bundle, ctx, msg_bundle_none)
+ istype(bundle, GenEfiAppBundle, ctx, msg_bundle_istype)
+
+ not_none(bundle.base, ctx, msg_base_none)
+ not_none(bundle.service, ctx, msg_service_none)
+ not_none(bundle.subprocessor, ctx, msg_subprocessor_none)
+ not_none(bundle.cli, ctx, msg_cli_none)
+
+ istype(bundle.base, BaseBundle, ctx, msg_base_istype)
+ istype(bundle.service, IService, ctx, msg_service_istype)
+ istype(bundle.subprocessor, ISubProcessor, ctx, msg_subprocessor_istype)
+ istype(bundle.cli, ICLI, ctx, msg_cli_istype)
+
+
+
+[docs]
+ @classmethod
+ def is_valid(cls, bundle: GenEfiAppBundle) -> bool:
+ '''
+ Checks if the gen_efi_app bundle is valid.
+
+ :param bundle: The gen_efi_app bundle to be checked.
+ :return: True if valid, False otherwise.
+ '''
+ try:
+ cls.validate(bundle)
+ return True
+
+ except (ATSValueError, ATSTypeError):
+ return False
+
+
+
+# -*- coding: UTF-8 -*-
+
+'''
+Module
+ main.py
+Copyright
+ Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com>
+ gen_efi_app is free software: you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+ gen_efi_app is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program. If not, see <http://www.gnu.org/licenses/>.
+Info
+ Main entry point for EFI Application Generator CLI.
+'''
+
+from __future__ import annotations
+
+from sys import exit as sys_exit
+
+from gen_efi_app.engine import GenEfiApp
+from gen_efi_app.setup.factory import GenEfiAppBundleFactory
+
+__author__ = 'Vladimir Roncevic'
+__copyright__ = '(C) 2026, https://electux.github.io/gen_efi_app'
+__credits__ = ['Vladimir Roncevic', 'Python Software Foundation']
+__license__ = 'https://github.com/electux/gen_efi_app/blob/dev/LICENSE'
+__version__ = '1.3.7'
+__maintainer__ = 'Vladimir Roncevic'
+__email__ = 'elektron.ronca@gmail.com'
+__status__ = 'Updated'
+
+
+
+[docs]
+def main() -> bool:
+ '''
+ Bootstraps and runs the gen_efi_app with required adapters.
+
+ :return: True if successful, False otherwise.
+ :exceptions: None.
+ '''
+ gen_efi_app: GenEfiApp = GenEfiApp(GenEfiAppBundleFactory.create_bundle())
+
+ return gen_efi_app.process()
+
+
+
+if __name__ == '__main__':
+ '''
+ Entry point for gen_efi_app execution.
+
+ :exit code: 0 if successful, 1 otherwise.
+ :exceptions: None.
+ '''
+ sys_exit(0 if main() else 1)
+__init__.py
+Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> +gen_efi_app is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +gen_efi_app is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>.
+Initializes the core package.
+__init__.py
+Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> +gen_efi_app is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +gen_efi_app is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>.
+Initializes the core model package.
+project_setup.py
+Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> +gen_efi_app is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +gen_efi_app is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>.
+Defines domain model for a project setup.
+Bases: object
Defines domain model for a project setup.
+It defines:
++++
+- attributes:
+- +
++project_config - Mapping with project configuration.+
engine.py
+Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> +gen_efi_app is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +gen_efi_app is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>.
+Defines application service for file generation.
+Bases: object
Service for orchestrating the file generation process.
+It defines:
++++
+- attributes:
+- +
++_subprocessor - Adapter for subprocessing.+- methods:
+- +
++__init__ - Initializes the service.+execute - Generates and writes user files.+is_initialized - Checks if the service is initialized.+
Generates EFI application configuration files.
+params – The ProjectSetup object.
+The result of the execution (return code, stdout, stderr).
+None.
+__init__.py
+Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> +gen_efi_app is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +gen_efi_app is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>.
+Initializes the core service package.
+iservice.py
+Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> +gen_efi_app is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +gen_efi_app is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>.
+Defines the abstract interface for services. +Provides an interface for the service factory.
+Bases: Protocol, Generic
Defines the abstract interface for services. +Provides an interface for the service factory.
+It defines:
++++
+- methods:
+- +
++execute - Executes the service.+is_initialized - Checks if the service is initialized.+
isubprocessor.py
+Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> +gen_efi_app is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +gen_efi_app is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>.
+Defines the abstract interface for sub-process execution. +Provides an interface for the sub-process factory.
+Bases: Protocol, Generic
Defines the abstract interface for sub-process execution. +Provides an interface for the sub-process factory.
+It defines:
++++
+- methods:
+- +
++run - Runs a sub-process.+is_initialized - Checks if the subprocessor is initialized.+
engine.py
+Copyright (C) 2026 Vladimir Roncevic <elektron.ronca@gmail.com> +gen_efi_app is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +gen_efi_app is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +See the GNU General Public License for more details. +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>.
+Engine orchestrating the initialization and execution of gen_efi_app.
+Bases: Base
Engine orchestrating the initialization and execution of gen_efi_app.
+It defines:
+++ + ++
+- attributes:
+- +
++_is_initialized - The flag indicating whether the engine is initialized.+_logger - The logger for logging messages during initialization and execution.+_cli - The adapter for the command line interface.+- methods:
+- +
++__init__ - Initializes the gen_efi_app engine with adapters and services.+process - Processes the gen_efi_app commands.+