From c05a695b81a1c8dbdf08a41503b65714264d24d2 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Sat, 7 Jan 2023 16:01:12 +0100 Subject: [PATCH] sort function in tiramisu file --- src/rougail/tiramisureflector.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/rougail/tiramisureflector.py b/src/rougail/tiramisureflector.py index f518babad..118bd9fd2 100644 --- a/src/rougail/tiramisureflector.py +++ b/src/rougail/tiramisureflector.py @@ -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,