Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Tests whether the file could be opened and removes the temporary file at the end
[simgrid.git] / docs / find-missing.py
index 4546b37..4000532 100755 (executable)
@@ -30,8 +30,6 @@ xml_files = [
     'build/xml/classsimgrid_1_1s4u_1_1ConditionVariable.xml',
     'build/xml/classsimgrid_1_1s4u_1_1Disk.xml',
     'build/xml/classsimgrid_1_1s4u_1_1Engine.xml',
-    'build/xml/classsimgrid_1_1s4u_1_1ExecPar.xml',
-    'build/xml/classsimgrid_1_1s4u_1_1ExecSeq.xml',
     'build/xml/classsimgrid_1_1s4u_1_1Exec.xml',
     'build/xml/classsimgrid_1_1s4u_1_1Host.xml',
     'build/xml/classsimgrid_1_1s4u_1_1Io.xml',
@@ -41,9 +39,20 @@ xml_files = [
     'build/xml/classsimgrid_1_1s4u_1_1NetZone.xml',
     'build/xml/classsimgrid_1_1s4u_1_1Semaphore.xml',
     'build/xml/classsimgrid_1_1s4u_1_1VirtualMachine.xml',
+    'build/xml/namespacesimgrid_1_1s4u_1_1this__actor.xml',
     'build/xml/actor_8h.xml',
+    'build/xml/barrier_8h.xml',
+    'build/xml/cond_8h.xml',
     'build/xml/engine_8h.xml',
-    'build/xml/vm_8h.xml'
+    'build/xml/forward_8h.xml',
+    'build/xml/host_8h.xml',
+    'build/xml/link_8h.xml',
+    'build/xml/mailbox_8h.xml',
+    'build/xml/msg_8h.xml',
+    'build/xml/mutex_8h.xml',
+    'build/xml/semaphore_8h.xml',
+    'build/xml/vm_8h.xml',
+    'build/xml/zone_8h.xml'
 ]
 
 python_modules = [
@@ -100,8 +109,17 @@ for name in python_modules:
     try:
         module = __import__(name)
     except Exception:
-        print("Cannot import {}. Did you set PYTHONPATH=../lib accordingly?".format(name))
-        sys.exit(1)
+        if os.path.exists("../lib") and "../lib" not in sys.path:
+            print("Adding ../lib to PYTHONPATH as {} cannot be imported".format(name))
+            sys.path.append("../lib")
+            try:
+                module = __import__(name)
+            except Exception:
+                print("Cannot import {}, even with PYTHONPATH=../lib".format(name))
+                sys.exit(1)
+        else:
+            print("Cannot import {}".format(name))
+            sys.exit(1)
     for sub in dir(module):
         if sub[0] == '_':
             continue
@@ -143,6 +161,8 @@ for arg in xml_files:
             #print ("compoundname {}".format(compoundname))
         elif elem.attrib["kind"] == "file":
             compoundname = ""
+        elif elem.attrib["kind"] == "namespace":
+            compoundname = elem.find("compoundname").text
         else:
             print("Element {} is of kind {}".format(elem.attrib["id"], elem.attrib["kind"]))
 
@@ -171,7 +191,7 @@ for arg in xml_files:
                 print ("member {}::{} is of kind {}".format(compoundname, name, kind))
 
 # Forget about the declarations that are done in the RST
-with os.popen('grep autodoxymethod:: source/*rst|sed \'s/^.*autodoxymethod:: //\'') as pse:
+with os.popen('grep autodoxymethod:: find-missing.ignore source/*rst|sed \'s/^.*autodoxymethod:: //\'') as pse:
     for line in (l.strip() for l in pse):
         (klass, obj, args) = (None, None, None)
         if "(" in line:
@@ -198,7 +218,7 @@ with os.popen('grep autodoxymethod:: source/*rst|sed \'s/^.*autodoxymethod:: //\
             doxy_funs[klass][obj].remove(args)
             if len(doxy_funs[klass][obj]) == 0:
                 del doxy_funs[klass][obj]
-with os.popen('grep autodoxyvar:: source/*rst|sed \'s/^.*autodoxyvar:: //\'') as pse:
+with os.popen('grep autodoxyvar:: find-missing.ignore source/*rst|sed \'s/^.*autodoxyvar:: //\'') as pse:
     for line in (l.strip() for l in pse):
         (klass, var) = line.rsplit('::', 1)