feat: can add name for a tiramisu config
This commit is contained in:
parent
656df6068f
commit
bf3396aa59
4 changed files with 12 additions and 5 deletions
|
|
@ -81,6 +81,7 @@ class _RougailConfig:
|
||||||
self.add_extra_options,
|
self.add_extra_options,
|
||||||
)
|
)
|
||||||
if self.root:
|
if self.root:
|
||||||
|
rougailconfig.generate_config()
|
||||||
rougailconfig.config.value.importation(self.config.value.exportation())
|
rougailconfig.config.value.importation(self.config.value.exportation())
|
||||||
rougailconfig.config.property.importation(
|
rougailconfig.config.property.importation(
|
||||||
self.config.property.exportation()
|
self.config.property.exportation()
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ You should have received a copy of the GNU Lesser General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
from tiramisu import Config
|
from tiramisu import Config
|
||||||
from warnings import warn
|
from warnings import warn
|
||||||
|
|
||||||
|
|
@ -47,11 +48,12 @@ class Rougail(UserDatas):
|
||||||
exec(tiram_obj, custom_types, optiondescription) # pylint: disable=W0122
|
exec(tiram_obj, custom_types, optiondescription) # pylint: disable=W0122
|
||||||
return optiondescription["option_0"]
|
return optiondescription["option_0"]
|
||||||
|
|
||||||
def run(self):
|
def run(self, *, name: Optional[str] = None):
|
||||||
"""Get Tiramisu Config"""
|
"""Get Tiramisu Config"""
|
||||||
if not self.config:
|
if not self.config:
|
||||||
self.config = Config(
|
self.config = Config(
|
||||||
self.get_root_option(),
|
self.get_root_option(),
|
||||||
|
name=name,
|
||||||
display_name=tiramisu_display_name,
|
display_name=tiramisu_display_name,
|
||||||
)
|
)
|
||||||
self.config.property.read_write()
|
self.config.property.read_write()
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,10 @@ main_structural_directories:
|
||||||
disabled:
|
disabled:
|
||||||
jinja: >-
|
jinja: >-
|
||||||
{{% if 'directory' not in _.step.structural %}}
|
{{% if 'directory' not in _.step.structural %}}
|
||||||
directory is not in _.step.structural
|
directory is not in _.step.structural
|
||||||
{{% endif %}}
|
{{% endif %}}
|
||||||
{{% if cli is defined and cli.versions is defined and cli.versions %}}
|
{{% if cli is defined and cli.versions is defined and cli.versions %}}
|
||||||
cli.versions is specified
|
cli.versions is specified
|
||||||
{{% endif %}}
|
{{% endif %}}
|
||||||
|
|
||||||
sort_structural_files_all:
|
sort_structural_files_all:
|
||||||
|
|
@ -51,7 +51,7 @@ sort_structural_files_all:
|
||||||
disabled:
|
disabled:
|
||||||
jinja: >-
|
jinja: >-
|
||||||
{{% if 'directory' not in _.step.structural %}}
|
{{% if 'directory' not in _.step.structural %}}
|
||||||
directory is not in _.step.structural
|
directory is not in _.step.structural
|
||||||
{{% endif %}}
|
{{% endif %}}
|
||||||
|
|
||||||
main_namespace:
|
main_namespace:
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,11 @@ class UserDatas:
|
||||||
identifiers.append(config.identifiers()[-1])
|
identifiers.append(config.identifiers()[-1])
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
# try to found the good dynamic family
|
# try to found the good dynamic family
|
||||||
for tconfig in config.list(uncalculated=True):
|
try:
|
||||||
|
lists = config.list(uncalculated=True)
|
||||||
|
except PropertiesOptionError:
|
||||||
|
lists = []
|
||||||
|
for tconfig in []:
|
||||||
if not tconfig.isdynamic(only_self=True):
|
if not tconfig.isdynamic(only_self=True):
|
||||||
# it's not a dynamic variable
|
# it's not a dynamic variable
|
||||||
continue
|
continue
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue