Skip to content

Commit

Permalink
[gen_gtkmm] Added support for generating gtkmm v3 & v4
Browse files Browse the repository at this point in the history
  • Loading branch information
vroncevic committed Jul 21, 2024
1 parent 78a210b commit 0c06aa6
Show file tree
Hide file tree
Showing 174 changed files with 5,538 additions and 436 deletions.
68 changes: 52 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,50 @@ Generator structure
│   ├── gen_gtkmm_util.cfg
│   ├── project.yaml
│   └── template/
│   ├── ccflags.template
│   ├── header_module.template
│   ├── ldflags.template
│   ├── main_module.template
│   ├── Makefile.template
│   ├── objects.template
│   ├── source_module.template
│   └── sources.template
│   ├── gtkmm3/
│   │   ├── about_header.template
│   │   ├── about_source.template
│   │   ├── application_header.template
│   │   ├── application_source.template
│   │   ├── csflags.template
│   │   ├── cxxflags.template
│   │   ├── help_header.template
│   │   ├── help_source.template
│   │   ├── home_header.template
│   │   ├── home_source.template
│   │   ├── imodel_header.template
│   │   ├── main_source.template
│   │   ├── Makefile.template
│   │   ├── model_header.template
│   │   ├── model_source.template
│   │   ├── objects.template
│   │   ├── odflags.template
│   │   ├── settings_header.template
│   │   ├── settings_source.template
│   │   ├── sources.template
│   │   └── toolchain.template
│   └── gtkmm4/
│   ├── about_header.template
│   ├── about_source.template
│   ├── application_header.template
│   ├── application_source.template
│   ├── csflags.template
│   ├── cxxflags.template
│   ├── help_header.template
│   ├── help_source.template
│   ├── home_header.template
│   ├── home_source.template
│   ├── imodel_header.template
│   ├── main_source.template
│   ├── Makefile.template
│   ├── model_header.template
│   ├── model_source.template
│   ├── objects.template
│   ├── odflags.template
│   ├── settings_header.template
│   ├── settings_source.template
│   ├── sources.template
│   └── toolchain.template
├── __init__.py
├── log/
│   └── gen_gtkmm.log
Expand All @@ -132,23 +168,23 @@ Generator structure
├── py.typed
└── run/
└── gen_gtkmm_run.py
6 directories, 19 files

8 directories, 53 files
```

### Code coverage

| Name | Stmts | Miss | Cover |
|------|-------|------|-------|
| `gen_gtkmm/__init__.py` | 71 | 12 | 83% |
| `gen_gtkmm/pro/__init__.py` | 59 | 2 | 97% |
| `gen_gtkmm/pro/read_template.py` | 54 | 2 | 96% |
| `gen_gtkmm/pro/write_template.py` | 72 | 4 | 94% |
| **Total** | 256 | 20 | 92% |
| `gen_gtkmm/__init__.py` | 75 | 14 | 81% |
| `gen_gtkmm/pro/__init__.py` | 61 | 3 | 95% |
| `gen_gtkmm/pro/read_template.py` | 57 | 3 | 95% |
| `gen_gtkmm/pro/write_template.py` | 86 | 4 | 95% |
| **Total** | 279 | 24 | 91% |

### Docs

[![Documentation Status](https://readthedocs.org/projects/gen-esp/badge/?version=latest)](https://gen-esp.readthedocs.io/en/latest/?badge=latest)
[![Documentation Status](https://readthedocs.org/projects/gen-gtkmm/badge/?version=latest)](https://gen-gtkmm.readthedocs.io/en/latest/?badge=latest)

More documentation and info at

Expand Down
Binary file modified docs/build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/doctrees/gen_gtkmm.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/gen_gtkmm.pro.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/gen_gtkmm.pro.read_template.doctree
Binary file not shown.
Binary file modified docs/build/doctrees/index.doctree
Binary file not shown.
26 changes: 20 additions & 6 deletions docs/build/html/_modules/gen_gtkmm.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ <h1>Source code for gen_gtkmm</h1><div class="highlight"><pre>
<span class="n">__copyright__</span> <span class="o">=</span> <span class="s1">&#39;(C) 2024, https://electux.github.io/gen_gtkmm&#39;</span>
<span class="n">__credits__</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;Vladimir Roncevic&#39;</span><span class="p">,</span> <span class="s1">&#39;Python Software Foundation&#39;</span><span class="p">]</span>
<span class="n">__license__</span> <span class="o">=</span> <span class="s1">&#39;https://github.com/electux/gen_gtkmm/blob/dev/LICENSE&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.1.5&#39;</span>
<span class="n">__version__</span> <span class="o">=</span> <span class="s1">&#39;1.1.6&#39;</span>
<span class="n">__maintainer__</span> <span class="o">=</span> <span class="s1">&#39;Vladimir Roncevic&#39;</span>
<span class="n">__email__</span> <span class="o">=</span> <span class="s1">&#39;elektron.ronca@gmail.com&#39;</span>
<span class="n">__status__</span> <span class="o">=</span> <span class="s1">&#39;Updated&#39;</span>
Expand Down Expand Up @@ -113,7 +113,9 @@ <h1>Source code for gen_gtkmm</h1><div class="highlight"><pre>
<span class="n">_CONFIG</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;/conf/gen_gtkmm.cfg&#39;</span>
<span class="n">_LOG</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;/log/gen_gtkmm.log&#39;</span>
<span class="n">_LOGO</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s1">&#39;/conf/gen_gtkmm.logo&#39;</span>
<span class="n">_OPS</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s1">&#39;-n&#39;</span><span class="p">,</span> <span class="s1">&#39;--name&#39;</span><span class="p">,</span> <span class="s1">&#39;-v&#39;</span><span class="p">,</span> <span class="s1">&#39;--verbose&#39;</span><span class="p">]</span>
<span class="n">_OPS</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
<span class="s1">&#39;-n&#39;</span><span class="p">,</span> <span class="s1">&#39;--name&#39;</span><span class="p">,</span> <span class="s1">&#39;-t&#39;</span><span class="p">,</span> <span class="s1">&#39;--type&#39;</span><span class="p">,</span> <span class="s1">&#39;-v&#39;</span><span class="p">,</span> <span class="s1">&#39;--verbose&#39;</span>
<span class="p">]</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">verbose</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">False</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="w"> </span><span class="sd">&#39;&#39;&#39;</span>
Expand Down Expand Up @@ -146,7 +148,11 @@ <h1>Source code for gen_gtkmm</h1><div class="highlight"><pre>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;generate project (provide name)&#39;</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_new_option</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_OPS</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">_OPS</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_OPS</span><span class="p">[</span><span class="mi">2</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">_OPS</span><span class="p">[</span><span class="mi">3</span><span class="p">],</span> <span class="n">dest</span><span class="o">=</span><span class="s1">&#39;type&#39;</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;set type of project (gtkmm3 | gtkmm4)&#39;</span>
<span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">add_new_option</span><span class="p">(</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_OPS</span><span class="p">[</span><span class="mi">4</span><span class="p">],</span> <span class="bp">self</span><span class="o">.</span><span class="n">_OPS</span><span class="p">[</span><span class="mi">5</span><span class="p">],</span>
<span class="n">action</span><span class="o">=</span><span class="s1">&#39;store_true&#39;</span><span class="p">,</span> <span class="n">default</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span>
<span class="n">help</span><span class="o">=</span><span class="s1">&#39;activate verbose mode for generation&#39;</span>
<span class="p">)</span>
Expand All @@ -167,11 +173,16 @@ <h1>Source code for gen_gtkmm</h1><div class="highlight"><pre>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">is_operational</span><span class="p">():</span>
<span class="k">try</span><span class="p">:</span>
<span class="n">args</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Namespace</span><span class="p">]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">parse_args</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">)</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">bool</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="s2">&quot;name&quot;</span><span class="p">)):</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">bool</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span><span class="p">)):</span>
<span class="n">error_message</span><span class="p">(</span>
<span class="p">[</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1"> missing name argument&#39;</span><span class="p">]</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">status</span>
<span class="k">if</span> <span class="ow">not</span> <span class="nb">bool</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="s1">&#39;type&#39;</span><span class="p">)):</span>
<span class="n">error_message</span><span class="p">(</span>
<span class="p">[</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1"> missing type argument&#39;</span><span class="p">]</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">status</span>
<span class="k">if</span> <span class="n">exists</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="n">getcwd</span><span class="p">()</span><span class="si">}</span><span class="s1">/</span><span class="si">{</span><span class="nb">str</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;name&quot;</span><span class="p">))</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">):</span>
<span class="n">error_message</span><span class="p">([</span>
<span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">,</span>
Expand All @@ -190,7 +201,7 @@ <h1>Source code for gen_gtkmm</h1><div class="highlight"><pre>
<span class="p">])</span>
<span class="p">)</span>
<span class="n">status</span> <span class="o">=</span> <span class="n">gen</span><span class="o">.</span><span class="n">gen_pro_setup</span><span class="p">(</span>
<span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span><span class="w"> </span><span class="s2">&quot;name&quot;</span><span class="p">)</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">,</span>
<span class="nb">str</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="s1">&#39;name&#39;</span><span class="p">)),</span> <span class="nb">str</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="s1">&#39;type&#39;</span><span class="p">)),</span>
<span class="nb">getattr</span><span class="p">(</span><span class="n">args</span><span class="p">,</span> <span class="s1">&#39;verbose&#39;</span><span class="p">)</span> <span class="ow">or</span> <span class="n">verbose</span>
<span class="p">)</span>
<span class="k">except</span> <span class="p">(</span><span class="n">ATSTypeError</span><span class="p">,</span> <span class="n">ATSValueError</span><span class="p">)</span> <span class="k">as</span> <span class="n">e</span><span class="p">:</span>
Expand All @@ -209,7 +220,10 @@ <h1>Source code for gen_gtkmm</h1><div class="highlight"><pre>
<span class="p">)</span>
<span class="k">except</span> <span class="ne">SystemExit</span><span class="p">:</span>
<span class="n">error_message</span><span class="p">(</span>
<span class="p">[</span><span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1"> expected argument name&#39;</span><span class="p">]</span>
<span class="p">[</span>
<span class="sa">f</span><span class="s1">&#39;</span><span class="si">{</span><span class="bp">self</span><span class="o">.</span><span class="n">_GEN_VERBOSE</span><span class="o">.</span><span class="n">lower</span><span class="p">()</span><span class="si">}</span><span class="s1"> expected arguments&#39;</span><span class="p">,</span>
<span class="s1">&#39;name of project and type of project&#39;</span>
<span class="p">]</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">status</span>
<span class="k">else</span><span class="p">:</span>
Expand Down
Loading

0 comments on commit 0c06aa6

Please sign in to comment.