sort function in tiramisu file

This commit is contained in:
egarette@silique.fr 2023-01-07 16:01:12 +01:00
parent d48a288004
commit c05a695b81

View file

@ -29,7 +29,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
from json import dumps
from os.path import isfile
from os.path import isfile, basename
from .i18n import _
from .annotator import CONVERT_OPTION
@ -44,6 +44,12 @@ class BaseElt: # pylint: disable=R0903
path = '.'
def sorted_func_name(func_name):
s_func_name = func_name.split('/')
s_func_name.reverse()
return '/'.join(s_func_name)
class TiramisuReflector:
"""Convert object to tiramisu representation
"""
@ -76,7 +82,7 @@ class TiramisuReflector:
" continue",
" setattr(func, function, getattr(func_, function))",
])
for funcs_path in funcs_paths:
for funcs_path in sorted(funcs_paths, key=sorted_func_name):
if not isfile(funcs_path):
continue
self.text['header'].append(f"_load_functions('{funcs_path}')")
@ -295,7 +301,6 @@ class Common:
continue
if isinstance(value, str):
value = self.convert_str(value)
#pouet self.text['optiondescription'].append(f"{self.option_name}.impl_set_information('{key}', {value})")
self.text['option'].append(f"{self.option_name}.impl_set_information('{key}', {value})")
def populate_param(self,