gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r22630 - in gnunet-planetlab/gplmt: . contrib


From: gnunet
Subject: [GNUnet-SVN] r22630 - in gnunet-planetlab/gplmt: . contrib
Date: Fri, 13 Jul 2012 14:46:38 +0200

Author: wachs
Date: 2012-07-13 14:46:38 +0200 (Fri, 13 Jul 2012)
New Revision: 22630

Added:
   gnunet-planetlab/gplmt/tasklist_schema.xsd
Modified:
   gnunet-planetlab/gplmt/Tasks.py
   gnunet-planetlab/gplmt/contrib/tasks.xml
   gnunet-planetlab/gplmt/contrib/test.conf
Log:
- xml schema for task files


Modified: gnunet-planetlab/gplmt/Tasks.py
===================================================================
--- gnunet-planetlab/gplmt/Tasks.py     2012-07-13 11:55:05 UTC (rev 22629)
+++ gnunet-planetlab/gplmt/Tasks.py     2012-07-13 12:46:38 UTC (rev 22630)
@@ -35,28 +35,7 @@
         self.filename = filename
     def load (self):        
         self.logger.log ("Loading nodes file '" + self.filename + "'")
-        
-        config = ConfigParser.RawConfigParser()
         try:
-            config.read(self.filename)
-        except ConfigParser.Error as e:
-            print "Error parsing configuration: " + str (e)
-            return False
-        
-        for i in config:
-            print i
-        return True
-#        try:
-#            dom = xml.dom.minidom.parse (self.filename)
-#        except ExpatError as e:
-#            print e
-                
-#        try:
-#            fobj = open (self.filename, "r") 
-#            for line in fobj: 
-#                line = line.strip() 
-#            fobj.close()
-#        except IOError:
-#            print "File " + self.filename + " not found"
-#            return False
-
+            dom = xml.dom.minidom.parse (self.filename)
+        except ExpatError as e:
+            print e
\ No newline at end of file

Modified: gnunet-planetlab/gplmt/contrib/tasks.xml
===================================================================
--- gnunet-planetlab/gplmt/contrib/tasks.xml    2012-07-13 11:55:05 UTC (rev 
22629)
+++ gnunet-planetlab/gplmt/contrib/tasks.xml    2012-07-13 12:46:38 UTC (rev 
22630)
@@ -1,13 +1,45 @@
-<?xml version="1.0" encoding="UTF-8"?> 
-<taskfile> 
-    <task> 
-        <type typ="str">run</type> 
-        <command typ="str">cat</command> 
-        <arguments typ="str"></arguments> 
-        <result>
-                       <returncode typ="int">0</returncode>
-                       <output></output>
-                       <stop_on_fail typ="int">0</stop_on_fail>
-               <result>                        
+<?xml version="1.0" encoding="UTF-8"?>
+<tasklist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:noNamespaceSchemaLocation="../tasklist_schema.xsd">
+  <task>
+        <id>0</id>
+        <name>run 1</name>
+        <type>run</type> 
+        <command>cat</command> 
+        <arguments></arguments> 
+        <expected_return_code>0</expected_return_code>
+        <expected_output></expected_output>
+        <stop_on_fail>0</stop_on_fail>
     </task> 
-</taskfile>
+    <parallel>
+      <task>
+        <id>0</id>
+        <name>run 1</name>
+        <type>run</type> 
+        <command>cat</command> 
+        <arguments></arguments> 
+        <expected_return_code>0</expected_return_code>
+        <expected_output></expected_output>
+        <stop_on_fail>0</stop_on_fail>
+    </task> 
+      <task>
+        <id>0</id>
+        <name>run 1</name>
+        <type>run</type> 
+        <command>cat</command> 
+        <arguments></arguments> 
+        <expected_return_code>0</expected_return_code>
+        <expected_output></expected_output>
+        <stop_on_fail>0</stop_on_fail>
+    </task>     
+    </parallel>
+      <task>
+        <id>0</id>
+        <name>run 1</name>
+        <type>run</type> 
+        <command>cat</command> 
+        <arguments></arguments> 
+        <expected_return_code>0</expected_return_code>
+        <expected_output></expected_output>
+        <stop_on_fail>0</stop_on_fail>
+    </task> 
+</tasklist>

Modified: gnunet-planetlab/gplmt/contrib/test.conf
===================================================================
--- gnunet-planetlab/gplmt/contrib/test.conf    2012-07-13 11:55:05 UTC (rev 
22629)
+++ gnunet-planetlab/gplmt/contrib/test.conf    2012-07-13 12:46:38 UTC (rev 
22630)
@@ -1,4 +1,4 @@
 [planetlab]
 slice = tum_dht_testing
 nodes = contrib/current.nodes
-tasks = contrib/tasks.conf
+tasks = contrib/tasks.xml

Added: gnunet-planetlab/gplmt/tasklist_schema.xsd
===================================================================
--- gnunet-planetlab/gplmt/tasklist_schema.xsd                          (rev 0)
+++ gnunet-planetlab/gplmt/tasklist_schema.xsd  2012-07-13 12:46:38 UTC (rev 
22630)
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
elementFormDefault="qualified">
+<xs:element name="tasklist" type="tasklist" />
+
+<xs:complexType name="tasklist">
+  <xs:sequence>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element name="sequence" type="sequence" />
+      <xs:element name="parallel" type="parallel" />
+      <xs:element name="task" type="task" />
+    </xs:choice>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="sequence">
+  <xs:sequence>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element name="sequence" type="sequence" />
+      <xs:element name="parallel" type="parallel" />
+      <xs:element name="task" type="task" />
+    </xs:choice>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="parallel">
+  <xs:sequence>
+    <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element name="sequence" type="sequence" />
+      <xs:element name="parallel" type="parallel" />
+      <xs:element name="task" type="task" />
+    </xs:choice>
+  </xs:sequence>
+</xs:complexType>
+
+<xs:complexType name="task">
+  <xs:sequence>
+    <xs:element name="id" type="xs:integer"/>
+    <xs:element name="name" type="xs:string"/>
+    <xs:element name="type" type="xs:string"/>
+    <xs:element name="command" type="xs:string"/>
+    <xs:element name="arguments" type="xs:string"/>
+    <xs:element name="expected_return_code"  type="xs:integer"/>
+    <xs:element name="expected_output" type="xs:string"/>
+    <xs:element name="stop_on_fail" type="xs:boolean"/>
+  </xs:sequence>
+</xs:complexType>
+
+
+</xs:schema>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]