fix PLCAPI doc that was whining about duplicate ids in docbook xml output
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 17 Apr 2012 14:33:26 +0000 (16:33 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 17 Apr 2012 14:33:26 +0000 (16:33 +0200)
PLC/Methods/Legacy/AddInterface.py
PLC/Methods/Legacy/AddNode.py
PLC/Methods/Legacy/DeleteInterface.py
PLC/Methods/Legacy/DeleteNode.py
PLC/Methods/Legacy/GetInterfaces.py
PLC/Methods/Legacy/GetNodes.py
PLC/Methods/Legacy/UpdateInterface.py
PLC/Methods/Legacy/UpdateNode.py
doc/DocBook.py

index 5d2774d..d9a245b 100644 (file)
@@ -66,7 +66,9 @@ class AddInterface(Method):
         ]
 
     returns = Parameter(int, 'New interface_id (> 0) if successful')
-
+    
+    # needed for generating the doc and prevent conflicts in the xml ids
+    status = 'legacy'
 
     def call(self, auth, node_id_or_hostname, interface_fields):
 
index 0fc7e5a..1d032e6 100644 (file)
@@ -78,6 +78,9 @@ class AddNode(Method):
 
     returns = Parameter(int, 'New node_id (> 0) if successful')
 
+    # needed for generating the doc and prevent conflicts in the xml ids
+    status = 'legacy'
+
     def call(self, auth, site_id_or_login_base, node_fields):
 
         [native,tags,rejected]=Row.split_fields(node_fields,[legacy_node_fields,Node.tags])
index 82d0f7e..ff58b64 100644 (file)
@@ -27,6 +27,8 @@ class DeleteInterface(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    # needed for generating the doc and prevent conflicts in the xml ids
+    status = 'legacy'
 
     def call(self, auth, interface_id):
 
index 01e382a..cd833f2 100644 (file)
@@ -26,6 +26,9 @@ class DeleteNode(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    # needed for generating the doc and prevent conflicts in the xml ids
+    status = 'legacy'
+
     def call(self, auth, node_id_or_hostname):
         # Get account information
         nodes = Nodes(self.api, [node_id_or_hostname])
index d5938e9..67045f3 100644 (file)
@@ -59,6 +59,9 @@ class GetInterfaces(Method):
 
     returns = [Interface.fields] + ["type", "ip", "netmask", "network", "broadcast"]
 
+    # needed for generating the doc and prevent conflicts in the xml ids
+    status = 'legacy'
+
     def call(self, auth, interface_filter = None, return_fields = None):
          if (return_fields is not None):
              interface_return_fields = return_fields[:]
index 84fddb9..b03e974 100644 (file)
@@ -82,6 +82,8 @@ class GetNodes(Method):
 
     returns = [legacy_node_fields]
 
+    # needed for generating the doc and prevent conflicts in the xml ids
+    status = 'legacy'
 
     def call(self, auth, node_filter = None, return_fields = None):
 
index d2119c9..6ca3fd2 100644 (file)
@@ -70,6 +70,9 @@ class UpdateInterface(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    # needed for generating the doc and prevent conflicts in the xml ids
+    status = 'legacy'
+
     def call(self, auth, interface_id, interface_fields):
 
         [native,tags,rejected] = Row.split_fields(interface_fields,[legacy_interface_fields,Interface.tags])
index a0e8ee4..4aac1af 100644 (file)
@@ -81,6 +81,9 @@ class UpdateNode(Method):
 
     returns = Parameter(int, '1 if successful')
 
+    # needed for generating the doc and prevent conflicts in the xml ids
+    status = 'legacy'
+
     def call(self, auth, node_id_or_hostname, node_fields):
 
         # split provided fields
index 90b384d..832f052 100755 (executable)
@@ -108,16 +108,19 @@ class DocBook:
     def Process (self):
         
         for func in self.functions_list:
-            method = func.name
 
             if func.status == "deprecated":
                 continue
 
+            method = func.name
+            if func.status == 'legacy': 
+                method += "-legacy"
+
             (min_args, max_args, defaults) = func.args()
 
             section = Element('section')
-            section.setAttribute('id', func.name)
-            section.appendChild(simpleElement('title', func.name))
+            section.setAttribute('id', method)
+            section.appendChild(simpleElement('title', method))
 
             prototype = "%s (%s)" % (method, ", ".join(max_args))
             para = paraElement('Prototype:')