Pyolian gendoc: unbreak after recent eolian changes

shiny new generated documentation can be seen at:
www.gurumeditation.it/dokuwiki_efl/
This commit is contained in:
Davide Andreoli 2019-10-03 20:18:54 +02:00
parent bee2586b60
commit b12f07e52b
7 changed files with 18 additions and 17 deletions

View File

@ -33,7 +33,7 @@ enum {
<code>
typedef enum {
<!--(for field in enum.enum_fields)-->
${field.c_name}$ = ${field.value.serialize}$,
${field.c_constant}$ = ${field.value.serialize}$,
<!--(end)-->
} ${enum.name.replace('.', '_')}$;
</code>

View File

@ -178,8 +178,8 @@ interface#!
#!#### FUNC_SCOPE(func) ######################################################
#!##############################################################################
<!--(macro FUNC_SCOPE)-->
<!--(if func.is_class)-->
''class method'' #!
<!--(if func.is_static)-->
''static method'' #!
<!--(end)-->
<!--(if func.type == Eolian_Function_Type.PROPERTY)-->
<!--(if func.getter_scope == Eolian_Object_Scope.PROTECTED)-->

View File

@ -41,7 +41,7 @@ _choices = ['start', 'classes', 'enums', 'structs', 'aliases']
parser.add_argument('--step', '-s', metavar='STEP', default=None,
choices=_choices,
help='A single step to run (default to all), '
'valid choices: '+ ', '.join(_choices))
'valid choices: ' + ', '.join(_choices))
args = parser.parse_args()
@ -64,6 +64,8 @@ if not eolian_db.all_eo_files_parse():
def cleanup_db():
global eolian_db
del eolian_db
atexit.register(cleanup_db)
@ -72,14 +74,14 @@ def page_path_for_object(obj):
path = ['data', 'pages', 'develop', 'api']
for ns in obj.namespaces:
path.append(ns.lower())
output_file = obj.short_name.lower() + '.txt'
return os.path.join(args.root_path, *path, output_file)
output_filename = obj.short_name.lower() + '.txt'
return os.path.join(args.root_path, *path, output_filename)
# render a (temporary) page for analizying the namespaces hierarchy
t = Template('namespaces.template')
nspaces = [ ns for ns in eolian_db.all_namespaces
if ns.name.startswith(args.namespace) ]
nspaces = [ns for ns in eolian_db.all_namespaces
if ns.name.startswith(args.namespace)]
tot_classes = tot_regulars = tot_abstracts = tot_mixins = tot_ifaces = 0
tot_enums = tot_structs = tot_aliases = 0
@ -113,7 +115,7 @@ totals = [
root_ns = eolian_db.namespace_get_by_name(args.namespace)
output_file = os.path.join(args.root_path,'data','pages','develop','api','namespaces.txt')
output_file = os.path.join(args.root_path, 'data', 'pages', 'develop', 'api', 'namespaces.txt')
t.render(output_file, args.verbose, root_ns=root_ns, totals=totals)
@ -121,10 +123,10 @@ t.render(output_file, args.verbose, root_ns=root_ns, totals=totals)
if args.step in ('start', None):
t = Template('doc_start.template')
nspaces = [ ns for ns in eolian_db.all_namespaces
if ns.name.startswith(args.namespace) ]
nspaces = [ns for ns in eolian_db.all_namespaces
if ns.name.startswith(args.namespace)]
output_file = os.path.join(args.root_path,'data','pages','develop','api','start.txt')
output_file = os.path.join(args.root_path, 'data', 'pages', 'develop', 'api', 'start.txt')
t.render(output_file, args.verbose, nspaces=nspaces)

View File

@ -1154,7 +1154,7 @@ class Typedecl(Object):
class Enum_Type_Field(Object):
def __repr__(self):
return "<eolian.Enum_Type_Field '{0.name}', c_name='{0.c_name}'>".format(self)
return "<eolian.Enum_Type_Field '{0.name}', c_constant='{0.c_constant}'>".format(self)
@cached_property
def c_constant(self):

View File

@ -141,7 +141,7 @@ class Template(pyratemp.Template):
'Eolian_Typedecl_Type': eolian.Eolian_Typedecl_Type,
'Eolian_Type_Type': eolian.Eolian_Type_Type,
'Eolian_Type_Builtin_Type': eolian.Eolian_Type_Builtin_Type,
'Eolian_C_Type_Type': eolian.Eolian_C_Type_Type,
# 'Eolian_C_Type_Type': eolian.Eolian_C_Type_Type,
'Eolian_Expression_Type': eolian.Eolian_Expression_Type,
'Eolian_Expression_Mask': eolian.Eolian_Expression_Mask,
'Eolian_Binary_Operator': eolian.Eolian_Binary_Operator,

View File

@ -3,8 +3,7 @@
Class: ${cls.name}$ (${cls.short_name}$)
================================================================================
Class type: ${cls.type}$
Base Class: ${cls.base_class.name if cls.base_class else None}$
Inherits: ${', '.join([i.name for i in cls.inherits])}$
Parent: ${cls.parent.name if cls.parent else None}$
Hierarchy: ${' => '.join([i.name for i in cls.hierarchy])}$
InheritsFull: ${', '.join([i.name for i in cls.inherits_full])}$
Namespace: ${cls.namespace}$

View File

@ -59,7 +59,7 @@ Enums:
<!--(for typedecl in namespace.enums)-->
* ${typedecl.name}$
<!--(for field in typedecl.enum_fields)-->
${field.c_name}$ = ${field.value.serialize}$
${field.c_constant}$ = ${field.value.serialize}$
<!--(end)-->
<!--(else)-->
no enums available