Skip to content
Browse files

tools: update docs: fix deprecated functions + deuplicated templates …

…constr.
  • Loading branch information...
1 parent 15857d6 commit 22c168cbd16d9c4a9c4a962afab7d26318cc451e @arturoc arturoc committed Dec 11, 2012
Showing with 26 additions and 11 deletions.
  1. +2 −8 _tools/documentation_class.py
  2. +22 −1 _tools/documentation_update.py
  3. +2 −2 _tools/markdown_file.py
View
10 _tools/documentation_class.py
@@ -61,7 +61,6 @@ def function_by_signature(self, name, returns, parameters):
method.syntax = method.syntax + ")"
method.returns = returns
method.new = True
- found = False
for function in self.function_list:
if function.name == name:
dst_parameters_types = self.get_parameter_types(function.parameters.replace('const ',''))
@@ -78,13 +77,8 @@ def function_by_signature(self, name, returns, parameters):
function.new = False
function.parameters = parameters
return function
- found = True
- #print 'found ' + function.name
- break
- if not found:
- #print 'not found ' + method.name
- #clazzmethod = method
- self.function_list.append(method)
+
+ self.function_list.append(method)
return method
def var_by_name(self, name):
View
23 _tools/documentation_update.py
@@ -89,6 +89,13 @@ def serialize_functionsfile(filename):
for function in thisfile_missing_functions:
functionsfile.function_list.remove(function)
+
+ deprecated_functions = []
+ for function in functionsfile.function_list:
+ if function.name.find("OF_DEPRECATED_MSG")!=-1:
+ deprecated_functions.append(function)
+ for function in deprecated_functions:
+ functionsfile.function_list.remove(function);
functionsfile.function_list.sort(key=lambda function: function.name)
setfunctionsfile(functionsfile)
@@ -137,7 +144,7 @@ def serialize_class(filename):
var.type = member.type.ref.text if hasattr(member.type,'ref') else member.type.text
documentation_class.var_list.append(var)
#f.write( str(member.type.text) + " " + str(member.name.text) + "\n" )
- if member.get("kind") == 'function':
+ if member.get("kind") == 'function' and member.name.text.find("OF_DEPRECATED_MSG")==-1:
argstring = str(member.argsstring.text)
params = argstring[argstring.find('(')+1:argstring.rfind(')')]
returns = member.type.ref.text if hasattr(member.type,'ref') else member.type.text
@@ -150,11 +157,25 @@ def serialize_class(filename):
#method.description = method.description.replace("~~~~{.brush: cpp}","~~~~{.cpp}").replace('</pre>',"~~~~")
method.description = method.description.replace('<p>','').replace('</p>','').replace('<code>','').replace('</code>','').replace('<pre>','')
if method.new:
+ print "new method " + method.name + " in " + method.clazz
method.version_started = currentversion
#f.write( str(member.type.text) + " " + str(member.name.text) + str(member.argsstring.text) + "\n" )
+ """if member.name.text.find("OF_DEPRECATED_MSG")!=-1:
+ print "found deprecated function " + member.name.text
+ print "argstring = " + str(member.argsstring.text)
+ print "params = " + member.argsstring.text[member.argsstring.text.find('(')+1:member.argsstring.text.rfind(')')]
+ returns = member.type.ref.text if hasattr(member.type,'ref') else member.type.text
+ print "returns = " + ("" if returns is None else returns)"""
#f.write( "$$/code\n\n\n\n" )
#f.close()
+ deprecated_methods = []
+ for method in documentation_class.function_list:
+ if method.name.find("OF_DEPRECATED_MSG")!=-1:
+ deprecated_methods.append(method)
+ for method in deprecated_methods:
+ documentation_class.function_list.remove(method);
+
documentation_class.function_list.sort(key=lambda function: function.name)
documentation_class.var_list.sort(key=lambda variable: variable.name)
setclass(documentation_class)
View
4 _tools/markdown_file.py
@@ -42,7 +42,7 @@ def list_all_files(module=''):
def addfield(method,line):
field = line.split(':')[0].lstrip('_').rstrip(' ')
- value = line.split(':')[1].lstrip(' ').rstrip('\n').rstrip('\r').rstrip('_')
+ value = line.split(':')[1].lstrip(' ').rstrip('\n').rstrip('\r')[:-1]
if field=='constant' or field=='advanced' or field=='visible' or field=='static':
value = ((value == '1') or (value == 'True') or (value=='true') or (value=='TRUE'))
#print field, "=", value
@@ -266,7 +266,7 @@ def getclass(clazz, getTemplated=False):
documentation_clazz.var_list.extend(templatedClazz.var_list)
documentation_clazz.reference = documentation_clazz.reference + templatedClazz.reference
documentation_clazz.example = documentation_clazz.example + templatedClazz.example
-
+
#documentation_clazz.function_list.sort(key= sort_function)
documentation_clazz.function_list.sort(key=lambda function: function.name)
documentation_clazz.var_list.sort(key=lambda variable: variable.name)

0 comments on commit 22c168c

Please sign in to comment.
Something went wrong with that request. Please try again.