# HG changeset patch # User Edouard Tisserant # Date 1301664343 -7200 # Node ID 026ef159e8a2a62db5ed31d3cd373a96b0fd1325 # Parent 40290ddff19c1f5079a2f1325bade4b8cfa6e429 Added POU interface description in library help text for standard function blocks too, not only in standard functions diff -r 40290ddff19c -r 026ef159e8a2 plcopen/structures.py --- a/plcopen/structures.py Thu Mar 31 19:10:47 2011 +0200 +++ b/plcopen/structures.py Fri Apr 01 15:25:43 2011 +0200 @@ -569,18 +569,7 @@ if res != None : # create the copy of decl dict to be appended to section Function_decl_copy = Function_decl.copy() - # Have to generate type description in comment with freshly redefined types - words = Function_decl_copy["comment"].split('"') - if len(words) > 1: - Function_decl_copy["comment"] = words[1] - Function_decl_copy["usage"] = ( - "\n (" + - str([ " " + fctdecl[1]+":"+fctdecl[0] for fctdecl in Function_decl["inputs"]]).strip("[]").replace("'",'') + - " ) => (" + - str([ " " + fctdecl[1]+":"+fctdecl[0] for fctdecl in Function_decl["outputs"]]).strip("[]").replace("'",'') + - " )") Current_section["list"].append(Function_decl_copy) - #pp.pprint(Function_decl_copy) else: raise "First function must be in a category" @@ -590,6 +579,18 @@ BlockTypes.extend(std_decl) +for section in BlockTypes: + for desc in section["list"]: + words = desc["comment"].split('"') + if len(words) > 1: + desc["comment"] = words[1] + desc["usage"] = ( + "\n (" + + str([ " " + fctdecl[1]+":"+fctdecl[0] for fctdecl in desc["inputs"]]).strip("[]").replace("'",'') + + " ) => (" + + str([ " " + fctdecl[1]+":"+fctdecl[0] for fctdecl in desc["outputs"]]).strip("[]").replace("'",'') + + " )") + #------------------------------------------------------------------------------- # Languages Keywords