diff --git a/.editorconfig b/.editorconfig index e856098..f228d58 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,3 +1,3 @@ [**.py] indent_style = tab -tab_width = 4 +tab_width = 4 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6e4266f..0e4f7f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ __pycache__/ *.py[cod] -*$py.class +*$py.class \ No newline at end of file diff --git a/LICENSE b/LICENSE index f288702..e72bfdd 100644 --- a/LICENSE +++ b/LICENSE @@ -671,4 +671,4 @@ into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 615e36d..08e203f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,2 @@ global-exclude *.py[cod] -global-exclude *.editorconfig +global-exclude *.editorconfig \ No newline at end of file diff --git a/README.md b/README.md index 0083005..3b20fd1 100644 --- a/README.md +++ b/README.md @@ -107,118 +107,128 @@ gen_stm32 is based on OOP. Generator structure ```bash -gen_stm32/ - ├── conf/ - │ ├── gen_stm32.logo - │   ├── gen_stm32.cfg - │   ├── gen_stm32_util.cfg - │   ├── project.yaml - │   └── template/ - │   ├── build/ - │   │   ├── includes/ - │   │   │   └── STM32F4xx_StdPeriph_Driver/ - │   │   │   └── src/ - │   │   │   └── subdir.template - │   │   ├── Makefile.template - │   │   ├── objects.template - │   │   ├── source/ - │   │   │   └── subdir.template - │   │   └── sources.template - │   ├── includes/ - │   │   ├── CMSIS/ - │   │   │   ├── arm_common_tables.template - │   │   │   ├── arm_math.template - │   │   │   ├── core_cm0.template - │   │   │   ├── core_cm3.template - │   │   │   ├── core_cm4_simd.template - │   │   │   ├── core_cm4.template - │   │   │   ├── core_cmFunc.template - │   │   │   └── core_cmInstr.template - │   │   ├── STM32F4xx/ - │   │   │   ├── stm32f4xx_conf.template - │   │   │   ├── stm32f4xx.template - │   │   │   └── system_stm32f4xx.template - │   │   └── STM32F4xx_StdPeriph_Driver/ - │   │   ├── inc/ - │   │   │   ├── misc.template - │   │   │   ├── stm32f4xx_adc.template - │   │   │   ├── stm32f4xx_can.template - │   │   │   ├── stm32f4xx_crc.template - │   │   │   ├── stm32f4xx_cryp.template - │   │   │   ├── stm32f4xx_dac.template - │   │   │   ├── stm32f4xx_dbgmcu.template - │   │   │   ├── stm32f4xx_dcmi.template - │   │   │   ├── stm32f4xx_dma.template - │   │   │   ├── stm32f4xx_exti.template - │   │   │   ├── stm32f4xx_flash.template - │   │   │   ├── stm32f4xx_fsmc.template - │   │   │   ├── stm32f4xx_gpio.template - │   │   │   ├── stm32f4xx_hash.template - │   │   │   ├── stm32f4xx_i2c.template - │   │   │   ├── stm32f4xx_iwdg.template - │   │   │   ├── stm32f4xx_pwr.template - │   │   │   ├── stm32f4xx_rcc.template - │   │   │   ├── stm32f4xx_rng.template - │   │   │   ├── stm32f4xx_rtc.template - │   │   │   ├── stm32f4xx_sdio.template - │   │   │   ├── stm32f4xx_spi.template - │   │   │   ├── stm32f4xx_syscfg.template - │   │   │   ├── stm32f4xx_tim.template - │   │   │   ├── stm32f4xx_usart.template - │   │   │   └── stm32f4xx_wwdg.template - │   │   └── src/ - │   │   ├── misc.template - │   │   ├── stm32f4xx_adc.template - │   │   ├── stm32f4xx_can.template - │   │   ├── stm32f4xx_crc.template - │   │   ├── stm32f4xx_cryp_aes.template - │   │   ├── stm32f4xx_cryp_des.template - │   │   ├── stm32f4xx_cryp_tdes.template - │   │   ├── stm32f4xx_cryp.template - │   │   ├── stm32f4xx_dac.template - │   │   ├── stm32f4xx_dbgmcu.template - │   │   ├── stm32f4xx_dcmi.template - │   │   ├── stm32f4xx_dma.template - │   │   ├── stm32f4xx_exti.template - │   │   ├── stm32f4xx_flash.template - │   │   ├── stm32f4xx_fsmc.template - │   │   ├── stm32f4xx_gpio.template - │   │   ├── stm32f4xx_hash_md5.template - │   │   ├── stm32f4xx_hash_sha1.template - │   │   ├── stm32f4xx_hash.template - │   │   ├── stm32f4xx_i2c.template - │   │   ├── stm32f4xx_iwdg.template - │   │   ├── stm32f4xx_pwr.template - │   │   ├── stm32f4xx_rcc.template - │   │   ├── stm32f4xx_rng.template - │   │   ├── stm32f4xx_rtc.template - │   │   ├── stm32f4xx_sdio.template - │   │   ├── stm32f4xx_spi.template - │   │   ├── stm32f4xx_syscfg.template - │   │   ├── stm32f4xx_tim.template - │   │   ├── stm32f4xx_usart.template - │   │   └── stm32f4xx_wwdg.template - │   ├── scripts/ - │   │   └── arm_cortex_m4_512.template - │   └── source/ - │   ├── main.template - │   ├── startup_stm32f4xx.template - │   ├── syscall.template - │   ├── system_stm32f4xx.template - │   └── tinynew.template - ├── __init__.py - ├── log/ - │   └── gen_stm32.log - ├── pro/ - │   ├── __init__.py - │   ├── read_template.py - │   └── write_template.py - └── run/ - └── gen_stm32_run.py + gen_stm32/ + ├── conf/ + │ ├── gen_stm32.logo + │   ├── gen_stm32.cfg + │   ├── gen_stm32_util.cfg + │   ├── project.yaml + │   └── template/ + │   ├── build/ + │   │   ├── includes/ + │   │   │   └── STM32F4xx_StdPeriph_Driver/ + │   │   │   └── src/ + │   │   │   └── subdir.template + │   │   ├── Makefile.template + │   │   ├── objects.template + │   │   ├── source/ + │   │   │   └── subdir.template + │   │   └── sources.template + │   ├── includes/ + │   │   ├── CMSIS/ + │   │   │   ├── arm_common_tables.template + │   │   │   ├── arm_math.template + │   │   │   ├── core_cm0.template + │   │   │   ├── core_cm3.template + │   │   │   ├── core_cm4_simd.template + │   │   │   ├── core_cm4.template + │   │   │   ├── core_cmFunc.template + │   │   │   └── core_cmInstr.template + │   │   ├── STM32F4xx/ + │   │   │   ├── stm32f4xx_conf.template + │   │   │   ├── stm32f4xx.template + │   │   │   └── system_stm32f4xx.template + │   │   └── STM32F4xx_StdPeriph_Driver/ + │   │   ├── inc/ + │   │   │   ├── misc.template + │   │   │   ├── stm32f4xx_adc.template + │   │   │   ├── stm32f4xx_can.template + │   │   │   ├── stm32f4xx_crc.template + │   │   │   ├── stm32f4xx_cryp.template + │   │   │   ├── stm32f4xx_dac.template + │   │   │   ├── stm32f4xx_dbgmcu.template + │   │   │   ├── stm32f4xx_dcmi.template + │   │   │   ├── stm32f4xx_dma.template + │   │   │   ├── stm32f4xx_exti.template + │   │   │   ├── stm32f4xx_flash.template + │   │   │   ├── stm32f4xx_fsmc.template + │   │   │   ├── stm32f4xx_gpio.template + │   │   │   ├── stm32f4xx_hash.template + │   │   │   ├── stm32f4xx_i2c.template + │   │   │   ├── stm32f4xx_iwdg.template + │   │   │   ├── stm32f4xx_pwr.template + │   │   │   ├── stm32f4xx_rcc.template + │   │   │   ├── stm32f4xx_rng.template + │   │   │   ├── stm32f4xx_rtc.template + │   │   │   ├── stm32f4xx_sdio.template + │   │   │   ├── stm32f4xx_spi.template + │   │   │   ├── stm32f4xx_syscfg.template + │   │   │   ├── stm32f4xx_tim.template + │   │   │   ├── stm32f4xx_usart.template + │   │   │   └── stm32f4xx_wwdg.template + │   │   └── src/ + │   │   ├── misc.template + │   │   ├── stm32f4xx_adc.template + │   │   ├── stm32f4xx_can.template + │   │   ├── stm32f4xx_crc.template + │   │   ├── stm32f4xx_cryp_aes.template + │   │   ├── stm32f4xx_cryp_des.template + │   │   ├── stm32f4xx_cryp_tdes.template + │   │   ├── stm32f4xx_cryp.template + │   │   ├── stm32f4xx_dac.template + │   │   ├── stm32f4xx_dbgmcu.template + │   │   ├── stm32f4xx_dcmi.template + │   │   ├── stm32f4xx_dma.template + │   │   ├── stm32f4xx_exti.template + │   │   ├── stm32f4xx_flash.template + │   │   ├── stm32f4xx_fsmc.template + │   │   ├── stm32f4xx_gpio.template + │   │   ├── stm32f4xx_hash_md5.template + │   │   ├── stm32f4xx_hash_sha1.template + │   │   ├── stm32f4xx_hash.template + │   │   ├── stm32f4xx_i2c.template + │   │   ├── stm32f4xx_iwdg.template + │   │   ├── stm32f4xx_pwr.template + │   │   ├── stm32f4xx_rcc.template + │   │   ├── stm32f4xx_rng.template + │   │   ├── stm32f4xx_rtc.template + │   │   ├── stm32f4xx_sdio.template + │   │   ├── stm32f4xx_spi.template + │   │   ├── stm32f4xx_syscfg.template + │   │   ├── stm32f4xx_tim.template + │   │   ├── stm32f4xx_usart.template + │   │   └── stm32f4xx_wwdg.template + │   ├── scripts/ + │   │   └── arm_cortex_m4_512.template + │   └── source/ + │   ├── main.template + │   ├── startup_stm32f4xx.template + │   ├── syscall.template + │   ├── system_stm32f4xx.template + │   └── tinynew.template + ├── __init__.py + ├── log/ + │   └── gen_stm32.log + ├── pro/ + │   ├── __init__.py + │   ├── read_template.py + │   └── write_template.py + └── run/ + └── gen_stm32_run.py 19 directories, 89 files ``` +### Code coverage + +| Name | Stmts | Miss | Cover | +|------|-------|------|-------| +| `gen_stm32/__init__.py` | 71 | 12 | 83% | +| `gen_stm32/pro/__init__.py` | 59 | 2 | 97% | +| `gen_stm32/pro/read_template.py` | 52 | 2 | 96% | +| `gen_stm32/pro/write_template.py` | 78 | 3 | 96% | +| **Total** | 260 | 19 | 93% | + ### Docs [![Documentation Status](https://readthedocs.org/projects/gen-stm32/badge/?version=latest)](https://gen-stm32.readthedocs.io/en/latest/?badge=latest) diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 2066e27..852da86 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/gen_stm32.doctree b/docs/build/doctrees/gen_stm32.doctree index b3b81c2..df1a548 100644 Binary files a/docs/build/doctrees/gen_stm32.doctree and b/docs/build/doctrees/gen_stm32.doctree differ diff --git a/docs/build/doctrees/gen_stm32.pro.doctree b/docs/build/doctrees/gen_stm32.pro.doctree index 534d3fb..0871539 100644 Binary files a/docs/build/doctrees/gen_stm32.pro.doctree and b/docs/build/doctrees/gen_stm32.pro.doctree differ diff --git a/docs/build/doctrees/gen_stm32.pro.write_template.doctree b/docs/build/doctrees/gen_stm32.pro.write_template.doctree index fb24b69..dabe21e 100644 Binary files a/docs/build/doctrees/gen_stm32.pro.write_template.doctree and b/docs/build/doctrees/gen_stm32.pro.write_template.doctree differ diff --git a/docs/build/html/_modules/gen_stm32.html b/docs/build/html/_modules/gen_stm32.html index 6f68f16..b75a28f 100644 --- a/docs/build/html/_modules/gen_stm32.html +++ b/docs/build/html/_modules/gen_stm32.html @@ -59,7 +59,7 @@

Source code for gen_stm32

 '''
 
 import sys
-from typing import Any, List, Dict
+from typing import List, Dict, Optional
 from os.path import exists, dirname, realpath
 from os import getcwd
 from argparse import Namespace
@@ -67,7 +67,7 @@ 

Source code for gen_stm32

 try:
     from ats_utilities.splash import Splash
     from ats_utilities.logging import ATSLogger
-    from ats_utilities.cli.cfg_cli import CfgCLI
+    from ats_utilities.cli import ATSCli
     from ats_utilities.console_io.error import error_message
     from ats_utilities.console_io.verbose import verbose_message
     from ats_utilities.console_io.success import success_message
@@ -82,7 +82,7 @@ 

Source code for gen_stm32

 __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32'
 __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
 __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE'
-__version__ = '1.2.3'
+__version__ = '1.2.4'
 __maintainer__ = 'Vladimir Roncevic'
 __email__ = 'elektron.ronca@gmail.com'
 __status__ = 'Updated'
@@ -90,7 +90,7 @@ 

Source code for gen_stm32

 
 
[docs] -class GenSTM32(CfgCLI): +class GenSTM32(ATSCli): ''' Defines class GenSTM32 with attribute(s) and method(s). Loads a base info, creates a CLI interface and runs operations. @@ -136,9 +136,9 @@

Source code for gen_stm32

         super().__init__(base_info, verbose)
         verbose_message(verbose, [f'{self._GEN_VERBOSE} init tool info'])
         self._logger = ATSLogger(
-            self._GEN_VERBOSE.lower(), f'{current_dir}{self._LOG}', verbose
+            self._GEN_VERBOSE.lower(), True, None, True, verbose
         )
-        if self.tool_operational:
+        if self.is_operational():
             self.add_new_option(
                 self._OPS[0], self._OPS[1], dest='name',
                 help='generate STM32 project skeleton'
@@ -162,10 +162,10 @@ 

Source code for gen_stm32

             :exceptions: None
         '''
         status = False
-        if self.tool_operational:
+        if self.is_operational():
             try:
-                args: Any | Namespace = self.parse_args(sys.argv)
-                if not bool(getattr(args, "name")):
+                args: Optional[Namespace] = self.parse_args(sys.argv)
+                if not bool(getattr(args, 'name')):
                     error_message(
                         [f'{self._GEN_VERBOSE.lower()} missing name argument']
                     )
@@ -207,7 +207,7 @@ 

Source code for gen_stm32

                     )
             except SystemExit:
                 error_message(
-                    [f'{self._GEN_VERBOSE.lower()} expected argument -n']
+                    [f'{self._GEN_VERBOSE.lower()} expected argument name']
                 )
                 return status
         else:
diff --git a/docs/build/html/_modules/gen_stm32/pro.html b/docs/build/html/_modules/gen_stm32/pro.html
index 30025c4..5057751 100644
--- a/docs/build/html/_modules/gen_stm32/pro.html
+++ b/docs/build/html/_modules/gen_stm32/pro.html
@@ -60,7 +60,7 @@ 

Source code for gen_stm32.pro

 '''
 
 import sys
-from typing import List, Dict
+from typing import List, Dict, Optional
 from os.path import dirname, realpath
 
 try:
@@ -81,7 +81,7 @@ 

Source code for gen_stm32.pro

 __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32'
 __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
 __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE'
-__version__ = '1.2.3'
+__version__ = '1.2.4'
 __maintainer__ = 'Vladimir Roncevic'
 __email__ = 'elektron.ronca@gmail.com'
 __status__ = 'Updated'
@@ -123,8 +123,8 @@ 

Source code for gen_stm32.pro

         ProConfig.__init__(self, verbose)
         ProName.__init__(self, verbose)
         verbose_message(verbose, [f'{self._GEN_VERBOSE} init generator'])
-        self._reader: ReadTemplate | None = ReadTemplate(verbose)
-        self._writer: WriteTemplate | None = WriteTemplate(verbose)
+        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)
@@ -136,12 +136,12 @@ 

Source code for gen_stm32.pro

 
 
[docs] - def get_reader(self) -> ReadTemplate | None: + def get_reader(self) -> Optional[ReadTemplate]: ''' Gets template reader. :return: Template reader object | None - :rtype: <ReadTemplate> | <NoneType> + :rtype: <Optional[ReadTemplate]> :exceptions: None ''' return self._reader
@@ -149,12 +149,12 @@

Source code for gen_stm32.pro

 
 
[docs] - def get_writer(self) -> WriteTemplate | None: + def get_writer(self) -> Optional[WriteTemplate]: ''' Gets template writer. :return: Template writer object | none - :rtype: <WriteTemplate> | <NoneType + :rtype: <Optional[WriteTemplate]> :exceptions: None ''' return self._writer
@@ -163,21 +163,21 @@

Source code for gen_stm32.pro

 
[docs] def gen_pro_setup( - self, pro_name: str | None, verbose: bool = False + self, pro_name: Optional[str], verbose: bool = False ) -> bool: ''' Generates STM32 project structure. :param pro_name: Project name | None - :type pro_name: <str> | <NoneType> + :type pro_name: <Optional[str]> :param verbose: Enable/Disable verbose option :type verbose: <bool> :return: True (success operation) | False :rtype: <bool> :exceptions: ATSBadCallError | ATSValueError ''' - error_msg: str | None = None - error_id: int | None = None + error_msg: Optional[str] = None + error_id: Optional[int] = None error_msg, error_id = self.check_params([ ('str:pro_name', pro_name) ]) diff --git a/docs/build/html/_modules/gen_stm32/pro/read_template.html b/docs/build/html/_modules/gen_stm32/pro/read_template.html index 1f3642b..fda9434 100644 --- a/docs/build/html/_modules/gen_stm32/pro/read_template.html +++ b/docs/build/html/_modules/gen_stm32/pro/read_template.html @@ -61,7 +61,7 @@

Source code for gen_stm32.pro.read_template

 '''
 
 import sys
-from typing import Any, List, Dict
+from typing import Any, List, Dict, Optional
 from os.path import isdir, dirname, realpath
 
 try:
@@ -79,7 +79,7 @@ 

Source code for gen_stm32.pro.read_template

 __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32'
 __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
 __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE'
-__version__ = '1.2.3'
+__version__ = '1.2.4'
 __maintainer__ = 'Vladimir Roncevic'
 __email__ = 'elektron.ronca@gmail.com'
 __status__ = 'Updated'
@@ -137,8 +137,8 @@ 

Source code for gen_stm32.pro.read_template

             :rtype: <List[Dict[str, str]]>
             :exceptions: ATSTypeError | ATSValueError
         '''
-        error_msg: str | None = None
-        error_id: int | None = None
+        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)
diff --git a/docs/build/html/_modules/gen_stm32/pro/write_template.html b/docs/build/html/_modules/gen_stm32/pro/write_template.html
index 61c4eaa..546d44a 100644
--- a/docs/build/html/_modules/gen_stm32/pro/write_template.html
+++ b/docs/build/html/_modules/gen_stm32/pro/write_template.html
@@ -61,7 +61,7 @@ 

Source code for gen_stm32.pro.write_template

'''
 
 import sys
-from typing import List, Dict
+from typing import List, Dict, Optional
 from os import getcwd, chmod, makedirs
 from os.path import exists
 from string import Template
@@ -79,7 +79,7 @@ 

Source code for gen_stm32.pro.write_template

__copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32'
 __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation']
 __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE'
-__version__ = '1.2.3'
+__version__ = '1.2.4'
 __maintainer__ = 'Vladimir Roncevic'
 __email__ = 'elektron.ronca@gmail.com'
 __status__ = 'Updated'
@@ -119,7 +119,7 @@ 

Source code for gen_stm32.pro.write_template

def write(
         self,
         templates: List[Dict[str, str]],
-        pro_name: str | None,
+        pro_name: Optional[str],
         verbose: bool = False
     ) -> bool:
         '''
@@ -128,15 +128,15 @@ 

Source code for gen_stm32.pro.write_template

            :param templates: Templates with params
             :type templates: <List[Dict[str, str]]>
             :param pro_name: Project name | None
-            :type pro_name: <str> | <NoneType>
+            :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: str | None = None
-        error_id: int | None = None
+        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)
         ])
diff --git a/docs/build/html/gen_stm32.html b/docs/build/html/gen_stm32.html
index dd85983..45fa6db 100644
--- a/docs/build/html/gen_stm32.html
+++ b/docs/build/html/gen_stm32.html
@@ -102,7 +102,7 @@ 

Subpackages
class gen_stm32.GenSTM32(verbose: bool = False)[source]
-

Bases: CfgCLI

+

Bases: ATSCli

Defines class GenSTM32 with attribute(s) and method(s). Loads a base info, creates a CLI interface and runs operations.

It defines:

diff --git a/docs/build/html/gen_stm32.pro.html b/docs/build/html/gen_stm32.pro.html index e94c6f8..844b948 100644 --- a/docs/build/html/gen_stm32.pro.html +++ b/docs/build/html/gen_stm32.pro.html @@ -136,7 +136,7 @@

Submodules
Parameters:
    -
  • pro_name (<str> | <NoneType>) – Project name | None

  • +
  • pro_name (<Optional[str]>) – Project name | None

  • verbose (<bool>) – Enable/Disable verbose option

@@ -161,7 +161,7 @@

Submodules

Template reader object | None

Return type:
-

<ReadTemplate> | <NoneType>

+

<Optional[ReadTemplate]>

Exceptions:

None

@@ -178,7 +178,7 @@

Submodules

Template writer object | none

Return type:
-

<WriteTemplate> | <NoneType

+

<Optional[WriteTemplate]>

Exceptions:

None

diff --git a/docs/build/html/gen_stm32.pro.write_template.html b/docs/build/html/gen_stm32.pro.write_template.html index 8ddaa9a..afb5beb 100644 --- a/docs/build/html/gen_stm32.pro.write_template.html +++ b/docs/build/html/gen_stm32.pro.write_template.html @@ -98,7 +98,7 @@

Navigation

Parameters:
  • templates (<List[Dict[str, str]]>) – Templates with params

  • -
  • pro_name (<str> | <NoneType>) – Project name | None

  • +
  • pro_name (<Optional[str]>) – Project name | None

  • verbose (<bool>) – Enable/Disable verbose option

diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index 9dce28c..2adb4a3 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 7da95cd..cad01ab 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["gen_stm32", "gen_stm32.pro", "gen_stm32.pro.read_template", "gen_stm32.pro.write_template", "index", "modules"], "filenames": ["gen_stm32.rst", "gen_stm32.pro.rst", "gen_stm32.pro.read_template.rst", "gen_stm32.pro.write_template.rst", "index.rst", "modules.rst"], "titles": ["gen_stm32 package", "gen_stm32.pro package", "gen_stm32.pro.read_template module", "gen_stm32.pro.write_template module", "STM32 project skeleton generator", "gen_stm32"], "terms": {"pro": [0, 4, 5], "submodul": [0, 5], "read_templ": [0, 1, 4], "readtempl": [0, 1, 2], "write_templ": [0, 1, 4], "writetempl": [0, 1, 3], "stm32setup": [0, 1], "_gen_verbos": [0, 1, 2, 3, 5], "_pro_structur": [0, 1], "gen_pro_setup": [0, 1], "get_read": [0, 1], "get_writ": [0, 1], "__init__": [0, 1, 2, 3, 4], "py": [0, 1, 2, 3, 4], "copyright": [0, 1, 2, 3], "c": [0, 1, 2, 3, 4], "2018": [0, 1, 2, 3, 4], "2024": [0, 1, 2, 3, 4], "vladimir": [0, 1, 2, 3], "roncev": [0, 1, 2, 3], "elektron": [0, 1, 2, 3], "ronca": [0, 1, 2, 3], "gmail": [0, 1, 2, 3], "com": [0, 1, 2, 3], "i": [0, 1, 2, 3, 4], "free": [0, 1, 2, 3, 4], "softwar": [0, 1, 2, 3, 4], "you": [0, 1, 2, 3, 4], "can": [0, 1, 2, 3, 4], "redistribut": [0, 1, 2, 3, 4], "modifi": [0, 1, 2, 3, 4], "under": [0, 1, 2, 3, 4], "term": [0, 1, 2, 3, 4], "gnu": [0, 1, 2, 3], "gener": [0, 1, 2, 3], "public": [0, 1, 2, 3], "licens": [0, 1, 2, 3], "publish": [0, 1, 2, 3], "foundat": [0, 1, 2, 3], "either": [0, 1, 2, 3, 4], "version": [0, 1, 2, 3, 4], "3": [0, 1, 2, 3, 4], "your": [0, 1, 2, 3, 4], "option": [0, 1, 2, 3, 4], "ani": [0, 1, 2, 3, 4], "later": [0, 1, 2, 3, 4], "distribut": [0, 1, 2, 3], "hope": [0, 1, 2, 3], "us": [0, 1, 2, 3, 4], "without": [0, 1, 2, 3], "warranti": [0, 1, 2, 3], "even": [0, 1, 2, 3], "impli": [0, 1, 2, 3], "merchant": [0, 1, 2, 3], "fit": [0, 1, 2, 3], "FOR": [0, 1, 2, 3], "A": [0, 1, 2, 3], "particular": [0, 1, 2, 3], "purpos": [0, 1, 2, 3], "see": [0, 1, 2, 3], "more": [0, 1, 2, 3], "detail": [0, 1, 2, 3], "should": [0, 1, 2, 3, 4], "have": [0, 1, 2, 3, 4], "receiv": [0, 1, 2, 3], "copi": [0, 1, 2, 3], "along": [0, 1, 2, 3], "thi": [0, 1, 2, 3], "program": [0, 1, 2, 3], "If": [0, 1, 2, 3], "http": [0, 1, 2, 3, 4], "www": [0, 1, 2, 3], "org": [0, 1, 2, 3], "info": [0, 1, 2, 3], "defin": [0, 1, 2, 3], "class": [0, 1, 2, 3], "genstm32": [0, 4, 5], "attribut": [0, 1, 2, 3], "": [0, 1, 2, 3, 4], "method": [0, 1, 2, 3], "load": 0, "base": [0, 1, 2, 3, 4], "creat": [0, 1, 2, 3, 4], "cli": 0, "interfac": 0, "run": [0, 4], "oper": [0, 1, 3], "verbos": [0, 1, 2, 3], "bool": [0, 1, 2, 3], "fals": [0, 1, 2, 3], "sourc": [0, 1, 2, 3, 4], "cfgcli": 0, "It": [0, 1, 2, 3], "consol": [0, 1, 2, 3], "text": [0, 1, 2, 3], "indic": [0, 1, 2, 3], "process": [0, 1, 2, 3, 5], "phase": [0, 1, 2, 3], "_config": [0, 5], "configur": [0, 2], "file": [0, 2, 4], "path": [0, 2], "_log": [0, 5], "tool": 0, "log": [0, 4], "_logo": [0, 5], "logo": [0, 4], "splash": 0, "screen": 0, "_op": [0, 5], "list": [0, 2, 3], "_logger": 0, "logger": 0, "object": [0, 1, 4], "api": [0, 1, 2, 3], "initi": [0, 1, 2, 3], "constructor": [0, 1, 2, 3], "str": [0, 1, 2, 3], "conf": [0, 1, 2, 4], "cfg": [0, 4], "n": 0, "name": [0, 1, 3], "v": 0, "paramet": [0, 1, 2, 3], "enabl": [0, 1, 2, 3], "disabl": [0, 1, 2, 3], "return": [0, 1, 2, 3], "true": [0, 1, 3], "success": [0, 1, 3], "type": [0, 1, 2, 3, 4], "except": [0, 1, 2, 3], "none": [0, 1, 3, 4], "_template_dir": [1, 2], "read": [1, 2], "write": [1, 3], "an": [1, 2, 3], "stm32": 1, "project": [1, 2, 3], "skeleton": 1, "filecheck": [1, 2, 3], "proconfig": 1, "pronam": 1, "setup": 1, "templat": [1, 2, 3, 4], "_reader": 1, "reader": 1, "_writer": 1, "writer": 1, "get": [1, 4], "structur": 1, "yaml": [1, 4], "pro_nam": [1, 3], "nonetyp": [1, 3], "atsbadcallerror": 1, "atsvalueerror": [1, 2, 3], "templatedir": 2, "prefix": 2, "config": 2, "dict": [2, 3], "pico": 2, "content": [2, 5], "atstypeerror": [2, 3], "build": [3, 4], "param": 3, "gen_stm32": 4, "toolset": 4, "develop": 4, "embed": 4, "applic": 4, "python": 4, "code": 4, "The": 4, "readm": 4, "introduc": 4, "provid": 4, "instruct": 4, "how": 4, "machin": 4, "mai": 4, "other": 4, "inform": 4, "befor": 4, "packag": [4, 5], "subpackag": [4, 5], "modul": [4, 5], "navig": 4, "releas": 4, "page": 4, "download": 4, "extract": 4, "archiv": 4, "To": 4, "follow": 4, "tar": 4, "xvzf": 4, "x": 4, "y": 4, "z": 4, "gz": 4, "cd": 4, "python3": 4, "wget": 4, "bootstrap": 4, "pypa": 4, "io": 4, "pip": 4, "m": 4, "upgrad": 4, "setuptool": 4, "pip3": 4, "r": 4, "requir": 4, "txt": 4, "isol": 4, "wheel": 4, "dist": 4, "py3": 4, "whl": 4, "rm": 4, "f": 4, "chmod": 4, "755": 4, "usr": 4, "local": 4, "lib": 4, "10": 4, "bin": 4, "gen_stm32_run": 4, "ln": 4, "docker": 4, "imag": 4, "contain": 4, "pyton3": 4, "gen": 4, "next": 4, "librari": 4, "ats": 4, "util": 4, "app": 4, "script": 4, "oop": 4, "gen_stm32_util": 4, "includ": 4, "stm32f4xx_stdperiph_driv": 4, "src": 4, "subdir": 4, "makefil": 4, "cmsi": 4, "arm_common_t": 4, "arm_math": 4, "core_cm0": 4, "core_cm3": 4, "core_cm4_simd": 4, "core_cm4": 4, "core_cmfunc": 4, "core_cminstr": 4, "stm32f4xx": 4, "stm32f4xx_conf": 4, "system_stm32f4xx": 4, "inc": 4, "misc": 4, "stm32f4xx_adc": 4, "stm32f4xx_can": 4, "stm32f4xx_crc": 4, "stm32f4xx_cryp": 4, "stm32f4xx_dac": 4, "stm32f4xx_dbgmcu": 4, "stm32f4xx_dcmi": 4, "stm32f4xx_dma": 4, "stm32f4xx_exti": 4, "stm32f4xx_flash": 4, "stm32f4xx_fsmc": 4, "stm32f4xx_gpio": 4, "stm32f4xx_hash": 4, "stm32f4xx_i2c": 4, "stm32f4xx_iwdg": 4, "stm32f4xx_pwr": 4, "stm32f4xx_rcc": 4, "stm32f4xx_rng": 4, "stm32f4xx_rtc": 4, "stm32f4xx_sdio": 4, "stm32f4xx_spi": 4, "stm32f4xx_syscfg": 4, "stm32f4xx_tim": 4, "stm32f4xx_usart": 4, "stm32f4xx_wwdg": 4, "stm32f4xx_cryp_a": 4, "stm32f4xx_cryp_d": 4, "stm32f4xx_cryp_td": 4, "stm32f4xx_hash_md5": 4, "stm32f4xx_hash_sha1": 4, "arm_cortex_m4_512": 4, "main": 4, "startup_stm32f4xx": 4, "syscal": 4, "tinynew": 4, "19": 4, "directori": 4, "89": 4, "vroncev": 4, "github": 4, "same": 4, "itself": 4, "avail": 4, "let": 4, "help": 4, "support": 4, "psf": 4, "index": 4, "search": 4}, "objects": {"": [[0, 0, 0, "-", "gen_stm32"]], "gen_stm32": [[0, 1, 1, "", "GenSTM32"], [1, 0, 0, "-", "pro"]], "gen_stm32.GenSTM32": [[0, 2, 1, "", "_CONFIG"], [0, 2, 1, "", "_GEN_VERBOSE"], [0, 2, 1, "", "_LOG"], [0, 2, 1, "", "_LOGO"], [0, 2, 1, "", "_OPS"], [0, 3, 1, "", "process"]], "gen_stm32.pro": [[1, 1, 1, "", "STM32Setup"], [2, 0, 0, "-", "read_template"], [3, 0, 0, "-", "write_template"]], "gen_stm32.pro.STM32Setup": [[1, 2, 1, "", "_GEN_VERBOSE"], [1, 2, 1, "", "_PRO_STRUCTURE"], [1, 3, 1, "", "gen_pro_setup"], [1, 3, 1, "", "get_reader"], [1, 3, 1, "", "get_writer"]], "gen_stm32.pro.read_template": [[2, 1, 1, "", "ReadTemplate"]], "gen_stm32.pro.read_template.ReadTemplate": [[2, 2, 1, "", "_GEN_VERBOSE"], [2, 2, 1, "", "_TEMPLATE_DIR"], [2, 3, 1, "", "read"]], "gen_stm32.pro.write_template": [[3, 1, 1, "", "WriteTemplate"]], "gen_stm32.pro.write_template.WriteTemplate": [[3, 2, 1, "", "_GEN_VERBOSE"], [3, 3, 1, "", "write"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:method"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "method", "Python method"]}, "titleterms": {"gen_stm32": [0, 1, 2, 3, 5], "packag": [0, 1], "subpackag": 0, "modul": [0, 1, 2, 3], "content": [0, 1, 4], "pro": [1, 2, 3], "submodul": 1, "read_templ": 2, "write_templ": 3, "stm32": 4, "project": 4, "skeleton": 4, "gener": 4, "instal": 4, "depend": 4, "tool": 4, "structur": 4, "copyright": 4, "licenc": 4, "indic": 4, "tabl": 4}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"gen_stm32 package": [[0, "gen-stm32-package"]], "Subpackages": [[0, "subpackages"]], "Module contents": [[0, "module-gen_stm32"], [1, "module-gen_stm32.pro"]], "gen_stm32.pro package": [[1, "gen-stm32-pro-package"]], "Submodules": [[1, "submodules"]], "gen_stm32.pro.read_template module": [[2, "module-gen_stm32.pro.read_template"]], "gen_stm32.pro.write_template module": [[3, "module-gen_stm32.pro.write_template"]], "STM32 project skeleton generator": [[4, "stm32-project-skeleton-generator"]], "Contents": [[4, null]], "Installation": [[4, "installation"]], "Dependencies": [[4, "dependencies"]], "Tool structure": [[4, "tool-structure"]], "Copyright and licence": [[4, "copyright-and-licence"]], "Indices and tables": [[4, "indices-and-tables"]], "gen_stm32": [[5, "gen-stm32"]]}, "indexentries": {"genstm32 (class in gen_stm32)": [[0, "gen_stm32.GenSTM32"]], "_config (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._CONFIG"]], "_gen_verbose (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._GEN_VERBOSE"]], "_log (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._LOG"]], "_logo (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._LOGO"]], "_ops (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._OPS"]], "gen_stm32": [[0, "module-gen_stm32"]], "module": [[0, "module-gen_stm32"], [1, "module-gen_stm32.pro"], [2, "module-gen_stm32.pro.read_template"], [3, "module-gen_stm32.pro.write_template"]], "process() (gen_stm32.genstm32 method)": [[0, "gen_stm32.GenSTM32.process"]], "stm32setup (class in gen_stm32.pro)": [[1, "gen_stm32.pro.STM32Setup"]], "_gen_verbose (gen_stm32.pro.stm32setup attribute)": [[1, "gen_stm32.pro.STM32Setup._GEN_VERBOSE"]], "_pro_structure (gen_stm32.pro.stm32setup attribute)": [[1, "gen_stm32.pro.STM32Setup._PRO_STRUCTURE"]], "gen_pro_setup() (gen_stm32.pro.stm32setup method)": [[1, "gen_stm32.pro.STM32Setup.gen_pro_setup"]], "gen_stm32.pro": [[1, "module-gen_stm32.pro"]], "get_reader() (gen_stm32.pro.stm32setup method)": [[1, "gen_stm32.pro.STM32Setup.get_reader"]], "get_writer() (gen_stm32.pro.stm32setup method)": [[1, "gen_stm32.pro.STM32Setup.get_writer"]], "readtemplate (class in gen_stm32.pro.read_template)": [[2, "gen_stm32.pro.read_template.ReadTemplate"]], "_gen_verbose (gen_stm32.pro.read_template.readtemplate attribute)": [[2, "gen_stm32.pro.read_template.ReadTemplate._GEN_VERBOSE"]], "_template_dir (gen_stm32.pro.read_template.readtemplate attribute)": [[2, "gen_stm32.pro.read_template.ReadTemplate._TEMPLATE_DIR"]], "gen_stm32.pro.read_template": [[2, "module-gen_stm32.pro.read_template"]], "read() (gen_stm32.pro.read_template.readtemplate method)": [[2, "gen_stm32.pro.read_template.ReadTemplate.read"]], "writetemplate (class in gen_stm32.pro.write_template)": [[3, "gen_stm32.pro.write_template.WriteTemplate"]], "_gen_verbose (gen_stm32.pro.write_template.writetemplate attribute)": [[3, "gen_stm32.pro.write_template.WriteTemplate._GEN_VERBOSE"]], "gen_stm32.pro.write_template": [[3, "module-gen_stm32.pro.write_template"]], "write() (gen_stm32.pro.write_template.writetemplate method)": [[3, "gen_stm32.pro.write_template.WriteTemplate.write"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["gen_stm32", "gen_stm32.pro", "gen_stm32.pro.read_template", "gen_stm32.pro.write_template", "index", "modules"], "filenames": ["gen_stm32.rst", "gen_stm32.pro.rst", "gen_stm32.pro.read_template.rst", "gen_stm32.pro.write_template.rst", "index.rst", "modules.rst"], "titles": ["gen_stm32 package", "gen_stm32.pro package", "gen_stm32.pro.read_template module", "gen_stm32.pro.write_template module", "STM32 project skeleton generator", "gen_stm32"], "terms": {"pro": [0, 4, 5], "submodul": [0, 5], "read_templ": [0, 1, 4], "readtempl": [0, 1, 2], "write_templ": [0, 1, 4], "writetempl": [0, 1, 3], "stm32setup": [0, 1], "_gen_verbos": [0, 1, 2, 3, 5], "_pro_structur": [0, 1], "gen_pro_setup": [0, 1], "get_read": [0, 1], "get_writ": [0, 1], "__init__": [0, 1, 2, 3, 4], "py": [0, 1, 2, 3, 4], "copyright": [0, 1, 2, 3], "c": [0, 1, 2, 3, 4], "2018": [0, 1, 2, 3, 4], "2024": [0, 1, 2, 3, 4], "vladimir": [0, 1, 2, 3], "roncev": [0, 1, 2, 3], "elektron": [0, 1, 2, 3], "ronca": [0, 1, 2, 3], "gmail": [0, 1, 2, 3], "com": [0, 1, 2, 3], "i": [0, 1, 2, 3, 4], "free": [0, 1, 2, 3, 4], "softwar": [0, 1, 2, 3, 4], "you": [0, 1, 2, 3, 4], "can": [0, 1, 2, 3, 4], "redistribut": [0, 1, 2, 3, 4], "modifi": [0, 1, 2, 3, 4], "under": [0, 1, 2, 3, 4], "term": [0, 1, 2, 3, 4], "gnu": [0, 1, 2, 3], "gener": [0, 1, 2, 3], "public": [0, 1, 2, 3], "licens": [0, 1, 2, 3], "publish": [0, 1, 2, 3], "foundat": [0, 1, 2, 3], "either": [0, 1, 2, 3, 4], "version": [0, 1, 2, 3, 4], "3": [0, 1, 2, 3, 4], "your": [0, 1, 2, 3, 4], "option": [0, 1, 2, 3, 4], "ani": [0, 1, 2, 3, 4], "later": [0, 1, 2, 3, 4], "distribut": [0, 1, 2, 3], "hope": [0, 1, 2, 3], "us": [0, 1, 2, 3, 4], "without": [0, 1, 2, 3], "warranti": [0, 1, 2, 3], "even": [0, 1, 2, 3], "impli": [0, 1, 2, 3], "merchant": [0, 1, 2, 3], "fit": [0, 1, 2, 3], "FOR": [0, 1, 2, 3], "A": [0, 1, 2, 3], "particular": [0, 1, 2, 3], "purpos": [0, 1, 2, 3], "see": [0, 1, 2, 3], "more": [0, 1, 2, 3], "detail": [0, 1, 2, 3], "should": [0, 1, 2, 3, 4], "have": [0, 1, 2, 3, 4], "receiv": [0, 1, 2, 3], "copi": [0, 1, 2, 3], "along": [0, 1, 2, 3], "thi": [0, 1, 2, 3], "program": [0, 1, 2, 3], "If": [0, 1, 2, 3], "http": [0, 1, 2, 3, 4], "www": [0, 1, 2, 3], "org": [0, 1, 2, 3], "info": [0, 1, 2, 3], "defin": [0, 1, 2, 3], "class": [0, 1, 2, 3], "genstm32": [0, 4, 5], "attribut": [0, 1, 2, 3], "": [0, 1, 2, 3, 4], "method": [0, 1, 2, 3], "load": 0, "base": [0, 1, 2, 3, 4], "creat": [0, 1, 2, 3, 4], "cli": 0, "interfac": 0, "run": [0, 4], "oper": [0, 1, 3], "verbos": [0, 1, 2, 3], "bool": [0, 1, 2, 3], "fals": [0, 1, 2, 3], "sourc": [0, 1, 2, 3, 4], "atscli": 0, "It": [0, 1, 2, 3], "consol": [0, 1, 2, 3], "text": [0, 1, 2, 3], "indic": [0, 1, 2, 3], "process": [0, 1, 2, 3, 5], "phase": [0, 1, 2, 3], "_config": [0, 5], "configur": [0, 2], "file": [0, 2, 4], "path": [0, 2], "_log": [0, 5], "tool": 0, "log": [0, 4], "_logo": [0, 5], "logo": [0, 4], "splash": 0, "screen": 0, "_op": [0, 5], "list": [0, 2, 3], "_logger": 0, "logger": 0, "object": [0, 1, 4], "api": [0, 1, 2, 3], "initi": [0, 1, 2, 3], "constructor": [0, 1, 2, 3], "str": [0, 1, 2, 3], "conf": [0, 1, 2, 4], "cfg": [0, 4], "n": 0, "name": [0, 1, 3], "v": 0, "paramet": [0, 1, 2, 3], "enabl": [0, 1, 2, 3], "disabl": [0, 1, 2, 3], "return": [0, 1, 2, 3], "true": [0, 1, 3], "success": [0, 1, 3], "type": [0, 1, 2, 3, 4], "except": [0, 1, 2, 3], "none": [0, 1, 3, 4], "_template_dir": [1, 2], "read": [1, 2], "write": [1, 3], "an": [1, 2, 3], "stm32": 1, "project": [1, 2, 3], "skeleton": 1, "filecheck": [1, 2, 3], "proconfig": 1, "pronam": 1, "setup": 1, "templat": [1, 2, 3, 4], "_reader": 1, "reader": 1, "_writer": 1, "writer": 1, "get": [1, 4], "structur": 1, "yaml": [1, 4], "pro_nam": [1, 3], "atsbadcallerror": 1, "atsvalueerror": [1, 2, 3], "templatedir": 2, "prefix": 2, "config": 2, "dict": [2, 3], "pico": 2, "content": [2, 5], "atstypeerror": [2, 3], "build": [3, 4], "param": 3, "gen_stm32": 4, "toolset": 4, "develop": 4, "embed": 4, "applic": 4, "python": 4, "code": 4, "The": 4, "readm": 4, "introduc": 4, "provid": 4, "instruct": 4, "how": 4, "machin": 4, "mai": 4, "other": 4, "inform": 4, "befor": 4, "packag": [4, 5], "subpackag": [4, 5], "modul": [4, 5], "navig": 4, "releas": 4, "page": 4, "download": 4, "extract": 4, "archiv": 4, "To": 4, "follow": 4, "tar": 4, "xvzf": 4, "x": 4, "y": 4, "z": 4, "gz": 4, "cd": 4, "python3": 4, "wget": 4, "bootstrap": 4, "pypa": 4, "io": 4, "pip": 4, "m": 4, "upgrad": 4, "setuptool": 4, "pip3": 4, "r": 4, "requir": 4, "txt": 4, "isol": 4, "wheel": 4, "dist": 4, "py3": 4, "whl": 4, "rm": 4, "f": 4, "chmod": 4, "755": 4, "usr": 4, "local": 4, "lib": 4, "10": 4, "bin": 4, "gen_stm32_run": 4, "ln": 4, "docker": 4, "imag": 4, "contain": 4, "pyton3": 4, "gen": 4, "next": 4, "librari": 4, "ats": 4, "util": 4, "app": 4, "script": 4, "oop": 4, "gen_stm32_util": 4, "includ": 4, "stm32f4xx_stdperiph_driv": 4, "src": 4, "subdir": 4, "makefil": 4, "cmsi": 4, "arm_common_t": 4, "arm_math": 4, "core_cm0": 4, "core_cm3": 4, "core_cm4_simd": 4, "core_cm4": 4, "core_cmfunc": 4, "core_cminstr": 4, "stm32f4xx": 4, "stm32f4xx_conf": 4, "system_stm32f4xx": 4, "inc": 4, "misc": 4, "stm32f4xx_adc": 4, "stm32f4xx_can": 4, "stm32f4xx_crc": 4, "stm32f4xx_cryp": 4, "stm32f4xx_dac": 4, "stm32f4xx_dbgmcu": 4, "stm32f4xx_dcmi": 4, "stm32f4xx_dma": 4, "stm32f4xx_exti": 4, "stm32f4xx_flash": 4, "stm32f4xx_fsmc": 4, "stm32f4xx_gpio": 4, "stm32f4xx_hash": 4, "stm32f4xx_i2c": 4, "stm32f4xx_iwdg": 4, "stm32f4xx_pwr": 4, "stm32f4xx_rcc": 4, "stm32f4xx_rng": 4, "stm32f4xx_rtc": 4, "stm32f4xx_sdio": 4, "stm32f4xx_spi": 4, "stm32f4xx_syscfg": 4, "stm32f4xx_tim": 4, "stm32f4xx_usart": 4, "stm32f4xx_wwdg": 4, "stm32f4xx_cryp_a": 4, "stm32f4xx_cryp_d": 4, "stm32f4xx_cryp_td": 4, "stm32f4xx_hash_md5": 4, "stm32f4xx_hash_sha1": 4, "arm_cortex_m4_512": 4, "main": 4, "startup_stm32f4xx": 4, "syscal": 4, "tinynew": 4, "19": 4, "directori": 4, "89": 4, "vroncev": 4, "github": 4, "same": 4, "itself": 4, "avail": 4, "let": 4, "help": 4, "support": 4, "psf": 4, "index": 4, "search": 4}, "objects": {"": [[0, 0, 0, "-", "gen_stm32"]], "gen_stm32": [[0, 1, 1, "", "GenSTM32"], [1, 0, 0, "-", "pro"]], "gen_stm32.GenSTM32": [[0, 2, 1, "", "_CONFIG"], [0, 2, 1, "", "_GEN_VERBOSE"], [0, 2, 1, "", "_LOG"], [0, 2, 1, "", "_LOGO"], [0, 2, 1, "", "_OPS"], [0, 3, 1, "", "process"]], "gen_stm32.pro": [[1, 1, 1, "", "STM32Setup"], [2, 0, 0, "-", "read_template"], [3, 0, 0, "-", "write_template"]], "gen_stm32.pro.STM32Setup": [[1, 2, 1, "", "_GEN_VERBOSE"], [1, 2, 1, "", "_PRO_STRUCTURE"], [1, 3, 1, "", "gen_pro_setup"], [1, 3, 1, "", "get_reader"], [1, 3, 1, "", "get_writer"]], "gen_stm32.pro.read_template": [[2, 1, 1, "", "ReadTemplate"]], "gen_stm32.pro.read_template.ReadTemplate": [[2, 2, 1, "", "_GEN_VERBOSE"], [2, 2, 1, "", "_TEMPLATE_DIR"], [2, 3, 1, "", "read"]], "gen_stm32.pro.write_template": [[3, 1, 1, "", "WriteTemplate"]], "gen_stm32.pro.write_template.WriteTemplate": [[3, 2, 1, "", "_GEN_VERBOSE"], [3, 3, 1, "", "write"]]}, "objtypes": {"0": "py:module", "1": "py:class", "2": "py:attribute", "3": "py:method"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "class", "Python class"], "2": ["py", "attribute", "Python attribute"], "3": ["py", "method", "Python method"]}, "titleterms": {"gen_stm32": [0, 1, 2, 3, 5], "packag": [0, 1], "subpackag": 0, "modul": [0, 1, 2, 3], "content": [0, 1, 4], "pro": [1, 2, 3], "submodul": 1, "read_templ": 2, "write_templ": 3, "stm32": 4, "project": 4, "skeleton": 4, "gener": 4, "instal": 4, "depend": 4, "tool": 4, "structur": 4, "copyright": 4, "licenc": 4, "indic": 4, "tabl": 4}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"gen_stm32 package": [[0, "gen-stm32-package"]], "Subpackages": [[0, "subpackages"]], "Module contents": [[0, "module-gen_stm32"], [1, "module-gen_stm32.pro"]], "gen_stm32.pro package": [[1, "gen-stm32-pro-package"]], "Submodules": [[1, "submodules"]], "gen_stm32.pro.read_template module": [[2, "module-gen_stm32.pro.read_template"]], "gen_stm32.pro.write_template module": [[3, "module-gen_stm32.pro.write_template"]], "STM32 project skeleton generator": [[4, "stm32-project-skeleton-generator"]], "Contents": [[4, null]], "Installation": [[4, "installation"]], "Dependencies": [[4, "dependencies"]], "Tool structure": [[4, "tool-structure"]], "Copyright and licence": [[4, "copyright-and-licence"]], "Indices and tables": [[4, "indices-and-tables"]], "gen_stm32": [[5, "gen-stm32"]]}, "indexentries": {"genstm32 (class in gen_stm32)": [[0, "gen_stm32.GenSTM32"]], "_config (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._CONFIG"]], "_gen_verbose (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._GEN_VERBOSE"]], "_log (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._LOG"]], "_logo (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._LOGO"]], "_ops (gen_stm32.genstm32 attribute)": [[0, "gen_stm32.GenSTM32._OPS"]], "gen_stm32": [[0, "module-gen_stm32"]], "module": [[0, "module-gen_stm32"], [1, "module-gen_stm32.pro"], [2, "module-gen_stm32.pro.read_template"], [3, "module-gen_stm32.pro.write_template"]], "process() (gen_stm32.genstm32 method)": [[0, "gen_stm32.GenSTM32.process"]], "stm32setup (class in gen_stm32.pro)": [[1, "gen_stm32.pro.STM32Setup"]], "_gen_verbose (gen_stm32.pro.stm32setup attribute)": [[1, "gen_stm32.pro.STM32Setup._GEN_VERBOSE"]], "_pro_structure (gen_stm32.pro.stm32setup attribute)": [[1, "gen_stm32.pro.STM32Setup._PRO_STRUCTURE"]], "gen_pro_setup() (gen_stm32.pro.stm32setup method)": [[1, "gen_stm32.pro.STM32Setup.gen_pro_setup"]], "gen_stm32.pro": [[1, "module-gen_stm32.pro"]], "get_reader() (gen_stm32.pro.stm32setup method)": [[1, "gen_stm32.pro.STM32Setup.get_reader"]], "get_writer() (gen_stm32.pro.stm32setup method)": [[1, "gen_stm32.pro.STM32Setup.get_writer"]], "readtemplate (class in gen_stm32.pro.read_template)": [[2, "gen_stm32.pro.read_template.ReadTemplate"]], "_gen_verbose (gen_stm32.pro.read_template.readtemplate attribute)": [[2, "gen_stm32.pro.read_template.ReadTemplate._GEN_VERBOSE"]], "_template_dir (gen_stm32.pro.read_template.readtemplate attribute)": [[2, "gen_stm32.pro.read_template.ReadTemplate._TEMPLATE_DIR"]], "gen_stm32.pro.read_template": [[2, "module-gen_stm32.pro.read_template"]], "read() (gen_stm32.pro.read_template.readtemplate method)": [[2, "gen_stm32.pro.read_template.ReadTemplate.read"]], "writetemplate (class in gen_stm32.pro.write_template)": [[3, "gen_stm32.pro.write_template.WriteTemplate"]], "_gen_verbose (gen_stm32.pro.write_template.writetemplate attribute)": [[3, "gen_stm32.pro.write_template.WriteTemplate._GEN_VERBOSE"]], "gen_stm32.pro.write_template": [[3, "module-gen_stm32.pro.write_template"]], "write() (gen_stm32.pro.write_template.writetemplate method)": [[3, "gen_stm32.pro.write_template.WriteTemplate.write"]]}}) \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index d898d27..2208076 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -29,7 +29,7 @@ project: str = 'gen_stm32' project_copyright: str = '2024, Vladimir Roncevic ' author: str = 'Vladimir Roncevic ' -version: str = '1.2.3' +version: str = '1.2.4' release: str = 'https://github.com/vroncevic/gen_stm32/releases' extensions: List[str] = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] templates_path: List[str] = ['_templates'] diff --git a/gen_stm32/.editorconfig b/gen_stm32/.editorconfig index e856098..f228d58 100644 --- a/gen_stm32/.editorconfig +++ b/gen_stm32/.editorconfig @@ -1,3 +1,3 @@ [**.py] indent_style = tab -tab_width = 4 +tab_width = 4 \ No newline at end of file diff --git a/gen_stm32/__init__.py b/gen_stm32/__init__.py index b45143f..ded833d 100644 --- a/gen_stm32/__init__.py +++ b/gen_stm32/__init__.py @@ -21,7 +21,7 @@ ''' import sys -from typing import Any, List, Dict +from typing import List, Dict, Optional from os.path import exists, dirname, realpath from os import getcwd from argparse import Namespace @@ -29,7 +29,7 @@ try: from ats_utilities.splash import Splash from ats_utilities.logging import ATSLogger - from ats_utilities.cli.cfg_cli import CfgCLI + from ats_utilities.cli import ATSCli from ats_utilities.console_io.error import error_message from ats_utilities.console_io.verbose import verbose_message from ats_utilities.console_io.success import success_message @@ -44,13 +44,13 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' -class GenSTM32(CfgCLI): +class GenSTM32(ATSCli): ''' Defines class GenSTM32 with attribute(s) and method(s). Loads a base info, creates a CLI interface and runs operations. @@ -96,9 +96,9 @@ def __init__(self, verbose: bool = False) -> None: super().__init__(base_info, verbose) verbose_message(verbose, [f'{self._GEN_VERBOSE} init tool info']) self._logger = ATSLogger( - self._GEN_VERBOSE.lower(), f'{current_dir}{self._LOG}', verbose + self._GEN_VERBOSE.lower(), True, None, True, verbose ) - if self.tool_operational: + if self.is_operational(): self.add_new_option( self._OPS[0], self._OPS[1], dest='name', help='generate STM32 project skeleton' @@ -120,10 +120,10 @@ def process(self, verbose: bool = False) -> bool: :exceptions: None ''' status = False - if self.tool_operational: + if self.is_operational(): try: - args: Any | Namespace = self.parse_args(sys.argv) - if not bool(getattr(args, "name")): + args: Optional[Namespace] = self.parse_args(sys.argv) + if not bool(getattr(args, 'name')): error_message( [f'{self._GEN_VERBOSE.lower()} missing name argument'] ) @@ -165,7 +165,7 @@ def process(self, verbose: bool = False) -> bool: ) except SystemExit: error_message( - [f'{self._GEN_VERBOSE.lower()} expected argument -n'] + [f'{self._GEN_VERBOSE.lower()} expected argument name'] ) return status else: diff --git a/gen_stm32/conf/gen_stm32.cfg b/gen_stm32/conf/gen_stm32.cfg index fcfbc08..f318b47 100644 --- a/gen_stm32/conf/gen_stm32.cfg +++ b/gen_stm32/conf/gen_stm32.cfg @@ -1,4 +1,4 @@ ats_name = gen_stm32 -ats_version = 1.2.3 +ats_version = 1.2.4 ats_build_date = 26 May 2021 ats_licence = https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE diff --git a/gen_stm32/log/gen_stm32.log b/gen_stm32/log/gen_stm32.log index e1b12fa..e69de29 100644 --- a/gen_stm32/log/gen_stm32.log +++ b/gen_stm32/log/gen_stm32.log @@ -1,2 +0,0 @@ -06/13/2024 10:18:22 PM - INFO - generation project latest done -06/13/2024 10:18:24 PM - ERROR - tool is not operational diff --git a/gen_stm32/pro/__init__.py b/gen_stm32/pro/__init__.py index 60c4a23..b14ad36 100644 --- a/gen_stm32/pro/__init__.py +++ b/gen_stm32/pro/__init__.py @@ -21,7 +21,7 @@ ''' import sys -from typing import List, Dict +from typing import List, Dict, Optional from os.path import dirname, realpath try: @@ -42,7 +42,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' @@ -82,8 +82,8 @@ def __init__(self, verbose: bool = False) -> None: ProConfig.__init__(self, verbose) ProName.__init__(self, verbose) verbose_message(verbose, [f'{self._GEN_VERBOSE} init generator']) - self._reader: ReadTemplate | None = ReadTemplate(verbose) - self._writer: WriteTemplate | None = WriteTemplate(verbose) + 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) @@ -93,42 +93,42 @@ def __init__(self, verbose: bool = False) -> None: yml2obj = Yaml2Object(pro_structure) self.config = yml2obj.read_configuration() - def get_reader(self) -> ReadTemplate | None: + def get_reader(self) -> Optional[ReadTemplate]: ''' Gets template reader. :return: Template reader object | None - :rtype: | + :rtype: :exceptions: None ''' return self._reader - def get_writer(self) -> WriteTemplate | None: + def get_writer(self) -> Optional[WriteTemplate]: ''' Gets template writer. :return: Template writer object | none - :rtype: | :exceptions: None ''' return self._writer def gen_pro_setup( - self, pro_name: str | None, verbose: bool = False + self, pro_name: Optional[str], verbose: bool = False ) -> bool: ''' Generates STM32 project structure. :param pro_name: Project name | None - :type pro_name: | + :type pro_name: :param verbose: Enable/Disable verbose option :type verbose: :return: True (success operation) | False :rtype: :exceptions: ATSBadCallError | ATSValueError ''' - error_msg: str | None = None - error_id: int | None = None + error_msg: Optional[str] = None + error_id: Optional[int] = None error_msg, error_id = self.check_params([ ('str:pro_name', pro_name) ]) diff --git a/gen_stm32/pro/read_template.py b/gen_stm32/pro/read_template.py index 34bb9ff..5dfe71d 100644 --- a/gen_stm32/pro/read_template.py +++ b/gen_stm32/pro/read_template.py @@ -21,7 +21,7 @@ ''' import sys -from typing import Any, List, Dict +from typing import Any, List, Dict, Optional from os.path import isdir, dirname, realpath try: @@ -39,7 +39,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' @@ -93,8 +93,8 @@ def read( :rtype: :exceptions: ATSTypeError | ATSValueError ''' - error_msg: str | None = None - error_id: int | None = None + 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) diff --git a/gen_stm32/pro/write_template.py b/gen_stm32/pro/write_template.py index db92e0a..5a2aae4 100644 --- a/gen_stm32/pro/write_template.py +++ b/gen_stm32/pro/write_template.py @@ -21,7 +21,7 @@ ''' import sys -from typing import List, Dict +from typing import List, Dict, Optional from os import getcwd, chmod, makedirs from os.path import exists from string import Template @@ -39,7 +39,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' @@ -75,7 +75,7 @@ def __init__(self, verbose: bool = False) -> None: def write( self, templates: List[Dict[str, str]], - pro_name: str | None, + pro_name: Optional[str], verbose: bool = False ) -> bool: ''' @@ -84,15 +84,15 @@ def write( :param templates: Templates with params :type templates: :param pro_name: Project name | None - :type pro_name: | + :type pro_name: :param verbose: Enable/Disable verbose option :type verbose: :return: True (success operation) | False :rtype: :exceptions: ATSTypeError | ATSValueError ''' - error_msg: str | None = None - error_id: int | None = None + 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) ]) diff --git a/gen_stm32/run/gen_stm32_run.py b/gen_stm32/run/gen_stm32_run.py index a3f9543..0ca8b5d 100644 --- a/gen_stm32/run/gen_stm32_run.py +++ b/gen_stm32/run/gen_stm32_run.py @@ -33,7 +33,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' diff --git a/pyproject.toml b/pyproject.toml index 9787c3b..07de284 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,3 @@ [build-system] requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" +build-backend = "setuptools.build_meta" \ No newline at end of file diff --git a/setup.cfg b/setup.cfg index a60d79c..764f93e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -19,7 +19,7 @@ [metadata] name = gen_stm32 -version = 1.2.3 +version = 1.2.4 author = Vladimir Roncevic author_email = elektron.ronca@gmail.com description = STM32 Code Generator diff --git a/setup.py b/setup.py index 1078f1b..104da7a 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ ''' from __future__ import print_function -from typing import List +from typing import List, Optional from os.path import abspath, dirname, join from setuptools import setup @@ -29,7 +29,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm32' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm32/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' @@ -47,7 +47,7 @@ SOURCE: str = 'conf/template/source/' LOG: str = 'log' THIS_DIR: str = abspath(dirname(__file__)) -long_description: str | None = None +long_description: Optional[str] = None with open(join(THIS_DIR, 'README.md'), encoding='utf-8') as readme: long_description = readme.read() PROGRAMMING_LANG: str = 'Programming Language :: Python ::' @@ -69,7 +69,7 @@ PYP_CLASSIFIERS: List[str] = SUPPORTED_PY_VERSIONS + APPROVED_LICENSES setup( name='gen_stm32', - version='1.2.3', + version='1.2.4', description='STM32 project skeleton generator', author='Vladimir Roncevic', author_email='elektron.ronca@gmail.com', diff --git a/tests/.coverage b/tests/.coverage index 7e5ca27..3c047ad 100644 Binary files a/tests/.coverage and b/tests/.coverage differ diff --git a/tests/gen_stm32_coverage.json b/tests/gen_stm32_coverage.json new file mode 100644 index 0000000..167b91a --- /dev/null +++ b/tests/gen_stm32_coverage.json @@ -0,0 +1 @@ +{"meta": {"format": 2, "version": "7.5.3", "timestamp": "2024-07-09T21:01:42.066248", "branch_coverage": false, "show_contexts": false}, "files": {"/data/dev/python/3_tools/gen_stm32/github/gen_stm32/gen_stm32/__init__.py": {"executed_lines": [3, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 43, 44, 45, 46, 47, 48, 49, 50, 53, 54, 72, 73, 74, 75, 76, 78, 86, 87, 94, 95, 96, 97, 98, 101, 102, 106, 112, 122, 123, 124, 125, 126, 127, 130, 131, 132, 136, 137, 140, 141, 148, 155, 156, 157, 176], "summary": {"covered_lines": 59, "num_statements": 71, "percent_covered": 83.09859154929578, "percent_covered_display": "83", "missing_lines": 12, "excluded_lines": 0}, "missing_lines": [39, 41, 152, 153, 154, 162, 163, 166, 167, 170, 172, 173], "excluded_lines": []}, "/data/dev/python/3_tools/gen_stm32/github/gen_stm32/gen_stm32/pro/__init__.py": {"executed_lines": [3, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 41, 42, 43, 44, 45, 46, 47, 48, 51, 52, 70, 71, 73, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 96, 104, 106, 114, 116, 130, 131, 132, 135, 136, 137, 138, 139, 140, 141, 144, 145, 146], "summary": {"covered_lines": 57, "num_statements": 59, "percent_covered": 96.61016949152543, "percent_covered_display": "97", "missing_lines": 2, "excluded_lines": 0}, "missing_lines": [37, 39], "excluded_lines": []}, "/data/dev/python/3_tools/gen_stm32/github/gen_stm32/gen_stm32/pro/read_template.py": {"executed_lines": [3, 23, 24, 25, 27, 28, 29, 30, 31, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 63, 64, 66, 74, 75, 76, 77, 78, 79, 80, 82, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 115, 116, 117], "summary": {"covered_lines": 50, "num_statements": 52, "percent_covered": 96.15384615384616, "percent_covered_display": "96", "missing_lines": 2, "excluded_lines": 0}, "missing_lines": [34, 36], "excluded_lines": []}, "/data/dev/python/3_tools/gen_stm32/github/gen_stm32/gen_stm32/pro/write_template.py": {"executed_lines": [3, 23, 24, 25, 26, 27, 29, 30, 31, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 48, 49, 62, 64, 72, 73, 75, 94, 95, 96, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 145, 146, 149, 150, 151, 152, 153, 154, 156, 159, 160, 163], "summary": {"covered_lines": 75, "num_statements": 78, "percent_covered": 96.15384615384616, "percent_covered_display": "96", "missing_lines": 3, "excluded_lines": 0}, "missing_lines": [34, 36, 162], "excluded_lines": []}}, "totals": {"covered_lines": 241, "num_statements": 260, "percent_covered": 92.6923076923077, "percent_covered_display": "93", "missing_lines": 19, "excluded_lines": 0}} \ No newline at end of file diff --git a/tests/gen_stm32_coverage.xml b/tests/gen_stm32_coverage.xml new file mode 100644 index 0000000..ab15229 --- /dev/null +++ b/tests/gen_stm32_coverage.xml @@ -0,0 +1,298 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/gen_stm32_setup_test.py b/tests/gen_stm32_setup_test.py index 977685c..3f85a8c 100644 --- a/tests/gen_stm32_setup_test.py +++ b/tests/gen_stm32_setup_test.py @@ -38,7 +38,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm8' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm8/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' diff --git a/tests/gen_stm32_test.py b/tests/gen_stm32_test.py index e444dec..b54e61a 100644 --- a/tests/gen_stm32_test.py +++ b/tests/gen_stm32_test.py @@ -37,7 +37,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm8' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm8/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' @@ -60,7 +60,6 @@ class GenSTM32TestCase(TestCase): | test_missing_args - Test missing args. | test_wrong_arg - Test wrong arg. | test_process - Generate project structure. - | test_tool_not_operational - Test not operational. | test_pro_already_exists - Test pro already exists. ''' @@ -97,15 +96,6 @@ def test_process(self) -> None: generator: GenSTM32 = GenSTM32() self.assertTrue(generator.process()) - def test_tool_not_operational(self) -> None: - '''Test not operational''' - sys.argv.clear() - sys.argv.insert(0, '-n') - sys.argv.insert(1, 'fresh') - generator: GenSTM32 = GenSTM32() - generator.tool_operational = False - self.assertFalse(generator.process()) - def test_pro_already_exists(self) -> None: '''Test pro already exists''' sys.argv.clear() diff --git a/tests/read_template_test.py b/tests/read_template_test.py index ccfdf29..3ed9378 100644 --- a/tests/read_template_test.py +++ b/tests/read_template_test.py @@ -40,7 +40,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm8' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm8/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated' diff --git a/tests/run_coverage.sh b/tests/run_coverage.sh index 26d69bc..dc09fc1 100755 --- a/tests/run_coverage.sh +++ b/tests/run_coverage.sh @@ -7,6 +7,12 @@ # @author Vladimir Roncevic # +rm -rf htmlcov gen_stm32_coverage.xml gen_stm32_coverage.json .coverage +rm -rf new_simple_test/ full_simple/ latest/ +ats_coverage_run.py -n gen_stm32 -p ../README.md rm -rf new_simple_test/ full_simple/ latest/ python3 -m coverage run -m --source=../gen_stm32 unittest discover -s ./ -p '*_test.py' -vvv -python3 -m coverage html \ No newline at end of file +python3 -m coverage html -d htmlcov +python3 -m coverage xml -o gen_stm32_coverage.xml +python3 -m coverage json -o gen_stm32_coverage.json +python3 -m coverage report --format=markdown -m diff --git a/tests/write_template_test.py b/tests/write_template_test.py index f65296a..bb3e314 100644 --- a/tests/write_template_test.py +++ b/tests/write_template_test.py @@ -41,7 +41,7 @@ __copyright__ = '(C) 2024, https://vroncevic.github.io/gen_stm8' __credits__: List[str] = ['Vladimir Roncevic', 'Python Software Foundation'] __license__ = 'https://github.com/vroncevic/gen_stm8/blob/dev/LICENSE' -__version__ = '1.2.3' +__version__ = '1.2.4' __maintainer__ = 'Vladimir Roncevic' __email__ = 'elektron.ronca@gmail.com' __status__ = 'Updated'