← Back to team overview

mlhim-specs-dev team mailing list archive

[Branch ~cdd-dev/cdd/trunk] Rev 256: Removed .xhtml generation (for now).

 

------------------------------------------------------------
revno: 256
committer: Timothy W. Cook <timothywayne.cook@xxxxxxxxx>
branch nick: cdd
timestamp: Fri 2012-09-14 11:58:51 -0300
message:
  Removed .xhtml generation (for now).
modified:
  src/xls2ccd/xls2ccd.py


--
lp:cdd
https://code.launchpad.net/~cdd-dev/cdd/trunk

Your team MLHIM Specifications Developers is subscribed to branch lp:cdd.
To unsubscribe from this branch go to https://code.launchpad.net/~cdd-dev/cdd/trunk/+edit-subscription
=== modified file 'src/xls2ccd/xls2ccd.py'
--- src/xls2ccd/xls2ccd.py	2012-09-14 12:44:18 +0000
+++ src/xls2ccd/xls2ccd.py	2012-09-14 14:58:51 +0000
@@ -71,7 +71,6 @@
     ect = "ct-"+str(uuid.uuid4())
     dct = "ct-"+str(uuid.uuid4())
     schema = ccd_id + ".xsd"
-    xform = ccd_id + ".xhtml"
 
     #/ccd setup
     title = ccd_dict[k][0]
@@ -79,7 +78,7 @@
     print "Generating: "+ title +" --  CCD ID = " + ccd_id
     print ccd_dict[k][5]
     ccd_catalog.write('{0:<40}'.format(title) + ccd_id +'\n')
-    description = ccd_dict[k][1] + "\n" +"          CDE Version: "+ccd_dict[k][3] + "\n" + "           Datatype: "+ccd_dict[k][5] + "\n"+ "           UOM: "+ccd_dict[k][6] + "\n" + "           Format: "+ccd_dict[k][7]
+    description = ccd_dict[k][1] + "\n" +"          CDE Version: "+ccd_dict[k][3] + "\n" + "           Datatype: "+ccd_dict[k][5] + "\n"+ "           UOM: "+ccd_dict[k][6] + "\n" + "           Format: "+ccd_dict[k][7] + "\n"
     date = str(now)
     creator = "Generated by MLHIM xls2ccd.py"
     contributor = ""
@@ -98,18 +97,7 @@
     dt = ccd_dict[k][5]
 
     xsd = open(schema,'w')
-    xhtml = open(xform, 'w')
-    xfModel= """
-    <xf:model>"""
-    xfBind = ""
-    xfBody = """
-    </head>
-    <body>
-      <h1>"""+title+"""</h1>
-      <p>Enter the CCD data.</p>
-    """
-    pre = ccd_id + """/definition/DvElement_dv/"""
-    #pre = ""
+
     xsd.write("""<?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
            xmlns:mlhim2="http://www.mlhim.org/xmls/mlhim2/2_4_0";
@@ -121,14 +109,6 @@
     <xs:annotation>
         <xs:appinfo>
         """)
-    xhtml.write("""<?xml version="1.0" encoding="UTF-8"?>
-<html
-   xmlns="http://www.w3.org/1999/xhtml";
-   xmlns:mlhim2="http://www.mlhim.org/xmls/mlhim2/2_4_0";
-   xmlns:ev="http://www.w3.org/2001/xml-events";
-   xmlns:xs="http://www.w3.org/2001/XMLSchema";
-   xmlns:xf="http://www.w3.org/2002/xforms";>
-   <head>""")
 
     xsd.write("""
        <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
@@ -180,19 +160,6 @@
     </xs:complexType>
     """)
 
-    xhtml.write("""
-      <title>"""+title+"""</title>
-      <style type="text/css">
-         @namespace xf url("http://www.w3.org/2002/xforms";);
-         body {font-family:Helvetica, sans-serif;}
-      </style>""")
-
-    xfModel += ("""
-        <xf:instance xmlns="">
-          <"""+ccd_id+""">
-             <definition>
-                <DvElement_dv>\n""")
-
 
     if dt == "DATE":
         xsd.write("""
@@ -207,12 +174,6 @@
       </xs:complexContent>
     </xs:complexType>
         """)
-        xfModel += ("""                   <data_name>"""+data_name+"""</data_name>\n""")
-        xfModel += ("""                   <DvDate_dv></DvDate_dv>\n""")
-        xfBody += ("""  <xf:input ref='"""+pre+"""DvDate_dv'>
-        <xf:label>Date: </xf:label>
-     </xf:input>
-     """)
 
     elif dt == "TIME":
         xsd.write("""
@@ -228,13 +189,6 @@
     </xs:complexType>
         """)
 
-        xfModel += ("""                   <data_name>"""+data_name+"""</data_name>\n""")
-        xfModel += ("""                   <DvTime_dv></DvTime_dv>\n""")
-        xfBody += ("""  <xf:input ref='"""+pre+"""DvTime_dv'>
-        <xf:label>Time: </xf:label>
-     </xf:input>
-     """)
-
     elif dt == "NUMBER":
         xsd.write("""
     <xs:complexType name='"""+dct+"""'>
@@ -250,23 +204,6 @@
       </xs:complexContent>
     </xs:complexType>
         """)
-        xfModel += ("""                   <data_name>"""+data_name+"""</data_name>\n""")
-        xfModel += ("""                   <magnitude></magnitude>\n""")
-        xfModel += ("""                   <error></error>\n""")
-        xfModel += ("""                   <DvCount_units></DvCount_units>\n""")
-        xfBody += ("""  <xf:input ref='"""+pre+"""DvCount_units'>
-        <xf:label>Units Counted: </xf:label>
-     </xf:input>
-     """)
-        xfBody += ("""  <xf:input ref='"""+pre+"""magnitude'>
-        <xf:label>Quantity: </xf:label>
-     </xf:input>
-     """)
-        xfBody += ("""  <xf:input ref='"""+pre+"""error'>
-        <xf:label>Error: </xf:label>
-        <xf:hint>An integer representing the % of error.</xf:hint>
-     </xf:input>
-     """)
 
     elif len(ccd_dict[k]) > 8:
         xsd.write("""
@@ -300,12 +237,6 @@
     </xs:complexType>
         """)
 
-        xfModel += ("""                   <data_name>"""+data_name+"""</data_name>\n""")
-        xfModel += ("""                   <DvString_dv></DvString_dv>\n""")
-        xfBody += ("""  <xf:input ref='"""+pre+"""DvString_dv'>
-        <xf:label>String: </xf:label>
-     </xf:input>
-     """)
 
     else:
 
@@ -321,34 +252,11 @@
       </xs:complexContent>
     </xs:complexType>
         """)
-        xfModel += ("""                   <data_name>"""+data_name+"""</data_name>\n""")
-        xfModel += ("""                   <DvString_dv></DvString_dv>\n""")
-        xfBody += ("""  <xf:input ref='"""+pre+"""DvString_dv'>
-        <xf:label>String: </xf:label>
-     </xf:input>
-     """)
 
     xsd.write("""
 </xs:schema>""")
 
-    xfModel += ("""              </DvElement_dv>
-           </definition>
-        </"""+ccd_id+""">
-      </xf:instance>\n""")
-    xfModel += xfBind
-    xfModel += ("""    </xf:model>""")
-
-    xfBody += ("""
-    </body>
-</html>
-        """)
-
-    xhtml.write(xfModel)
-    xhtml.write(xfBody)
-
     xsd.close()
-    xhtml.close()
-
 
 print "\nDone.\n"
 ccd_catalog.close()