sort function in tiramisu file
This commit is contained in:
parent
d48a288004
commit
c05a695b81
1 changed files with 8 additions and 3 deletions
|
@ -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
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
"""
|
"""
|
||||||
from json import dumps
|
from json import dumps
|
||||||
from os.path import isfile
|
from os.path import isfile, basename
|
||||||
|
|
||||||
from .i18n import _
|
from .i18n import _
|
||||||
from .annotator import CONVERT_OPTION
|
from .annotator import CONVERT_OPTION
|
||||||
|
@ -44,6 +44,12 @@ class BaseElt: # pylint: disable=R0903
|
||||||
path = '.'
|
path = '.'
|
||||||
|
|
||||||
|
|
||||||
|
def sorted_func_name(func_name):
|
||||||
|
s_func_name = func_name.split('/')
|
||||||
|
s_func_name.reverse()
|
||||||
|
return '/'.join(s_func_name)
|
||||||
|
|
||||||
|
|
||||||
class TiramisuReflector:
|
class TiramisuReflector:
|
||||||
"""Convert object to tiramisu representation
|
"""Convert object to tiramisu representation
|
||||||
"""
|
"""
|
||||||
|
@ -76,7 +82,7 @@ class TiramisuReflector:
|
||||||
" continue",
|
" continue",
|
||||||
" setattr(func, function, getattr(func_, function))",
|
" 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):
|
if not isfile(funcs_path):
|
||||||
continue
|
continue
|
||||||
self.text['header'].append(f"_load_functions('{funcs_path}')")
|
self.text['header'].append(f"_load_functions('{funcs_path}')")
|
||||||
|
@ -295,7 +301,6 @@ class Common:
|
||||||
continue
|
continue
|
||||||
if isinstance(value, str):
|
if isinstance(value, str):
|
||||||
value = self.convert_str(value)
|
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})")
|
self.text['option'].append(f"{self.option_name}.impl_set_information('{key}', {value})")
|
||||||
|
|
||||||
def populate_param(self,
|
def populate_param(self,
|
||||||
|
|
Loading…
Reference in a new issue