2021-01-18 17:46:21 +01:00
|
|
|
"""Redefine Tiramisu object
|
2021-01-30 08:15:26 +01:00
|
|
|
|
|
|
|
Created by:
|
|
|
|
EOLE (http://eole.orion.education.fr)
|
|
|
|
Copyright (C) 2005-2018
|
|
|
|
|
|
|
|
Forked by:
|
|
|
|
Cadoles (http://www.cadoles.com)
|
|
|
|
Copyright (C) 2019-2021
|
|
|
|
|
|
|
|
distribued with GPL-2 or later license
|
|
|
|
|
|
|
|
This program 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 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program 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, write to the Free Software
|
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2021-01-18 17:46:21 +01:00
|
|
|
"""
|
2020-08-07 17:17:42 +02:00
|
|
|
try:
|
|
|
|
from tiramisu3 import DynOptionDescription
|
2020-12-26 17:06:56 +01:00
|
|
|
except ModuleNotFoundError:
|
2020-08-08 11:03:06 +02:00
|
|
|
from tiramisu import DynOptionDescription
|
2020-07-20 18:13:53 +02:00
|
|
|
from .utils import normalize_family
|
|
|
|
|
|
|
|
|
|
|
|
class ConvertDynOptionDescription(DynOptionDescription):
|
2021-01-18 17:46:21 +01:00
|
|
|
"""Suffix could be an integer, we should convert it in str
|
|
|
|
Suffix could also contain invalid character, so we should "normalize" it
|
|
|
|
"""
|
2020-07-20 18:13:53 +02:00
|
|
|
def convert_suffix_to_path(self, suffix):
|
2022-03-05 11:17:33 +01:00
|
|
|
if suffix is None:
|
|
|
|
return suffix
|
2020-07-20 18:13:53 +02:00
|
|
|
if not isinstance(suffix, str):
|
|
|
|
suffix = str(suffix)
|
2020-12-23 11:28:43 +01:00
|
|
|
return normalize_family(suffix)
|