Commit 5d8de5f2 authored by Salko Jr, Robert's avatar Salko Jr, Robert
Browse files

Fix autodoc tool

Stopped it from over-writing keys with same name and also updated
schema to be more complete.
parent 91cd8451
Loading
Loading
Loading
Loading
+115 −27
Original line number Diff line number Diff line
@@ -6,13 +6,10 @@ solution{
   ChildExactlyOne=[steady, transient]
   steady{
      Description="Specify this group to model a steady-state solution."
      ### Appearance="Optional."
      MinOccurs=0
      MaxOccurs=1
      p_l2_norm{
         Description="Stopping criteria for the l2 norm of relative pressure changes between solution checkpoints."
         ### Appearance="Optional."
         ### Restrictions=">0.0"
         MinOccurs=0
         MaxOccurs=1
         value{
@@ -24,14 +21,13 @@ solution{
      }
      p_linf_norm{
         Description="Stopping criteria for the l:math:`\infty`-norm of relative pressure changes between solution checkpoints."
         ### Appearance="Optional."
         ### Restrictions=">0.0"
         MinOccurs=0
         MaxOccurs=1
         value{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      vl_l2_norm{
@@ -42,6 +38,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      vl_linf_norm{
@@ -52,6 +49,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      vv_l2_norm{
@@ -62,6 +60,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      vv_linf_norm{
@@ -72,6 +71,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      vd_l2_norm{
@@ -82,6 +82,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      vd_linf_norm{
@@ -92,6 +93,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      Tcool_l2_norm{
@@ -102,6 +104,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      Tcool_linf_norm{
@@ -112,6 +115,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      Tsolid_l2_norm{
@@ -122,6 +126,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      Tsolid_linf_norm{
@@ -132,6 +137,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
      dt_ratio{
@@ -142,6 +148,7 @@ solution{
            MinOccurs=1
            MaxOccurs=1
            ValType=Real
            MinValExc=0.0
         }
      }
   }
@@ -151,7 +158,6 @@ solution{
      MaxOccurs=1
      group{
         Description="Declares a transient group within which the transient model parameters are specified."
         ### Appearance="Must be > zero"
         MinOccurs=0
         MaxOccurs=NoLimit
         dtmin{
@@ -170,13 +176,13 @@ solution{
         }
         dtmax{
            Description="The maximum (group) time step for a transient simulation."
            ### Appearance="Must be > zero"
            MinOccurs=0
            MaxOccurs=1
            value{
               MinOccurs=1
               MaxOccurs=1
               ValType=Real
               ### Units="s"
               # Must be > zero
               MinValExc=0.0
               # Must be >= than dtmin
@@ -194,18 +200,20 @@ solution{
               MaxOccurs=1
               ValType=Real
               # Must be <= tend
               ### Units="s"
               MinValExc=0.0
               MinValInc="../../dtmin/value"
               MaxValInc="../../tend/value"
            }
         }
         tend{
            Description="The (group) end time for a transient simulation."
            Description="The end time for this group in the transient."
            MinOccurs=1
            MaxOccurs=1
            value{
               MinOccurs=1
               MaxOccurs=1
               ### Units="s"
               ValType=Real
               MinValExc=0.0
            }
@@ -221,12 +229,14 @@ initial{
   MinOccurs=1
   MaxOccurs=1
   ChildExactlyOne=[mflux, mdot]
   ### Appearance="Can specify mflux or mdot, but not both"
   mflux{
      Description="Initial mass flux for the system."
      MinOccurs=0
      MaxOccurs=1
      value{
         ValType=Real
         ### Units="kg/m**2/s"
         MinOccurs=1
         MaxOccurs=1
      }
@@ -237,18 +247,21 @@ initial{
      MaxOccurs=1
      value{
         ValType=Real
         ### Units="kg/s"
         MinOccurs=1
         MaxOccurs=1
      }
   }
   temp{
      Description="Initial temperature for the system."
      Description="Initial temperature for the system.  Will be applied to both solids and fluids."
      MinOccurs=1
      MaxOccurs=1
      value{
         ValType=Real
         ### Units="C"
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
      }
   }
   enth{
@@ -258,8 +271,10 @@ initial{
      MaxOccurs=1
      value{
         ValType=Real
         ### Units="kJ/kg"
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
      }
   }
   qprime{
@@ -268,8 +283,10 @@ initial{
      MaxOccurs=1
      value{
         ValType=Real
         ### Units="kW/m"
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
      }
   }
   press{
@@ -278,15 +295,18 @@ initial{
      MaxOccurs=1
      value{
         ValType=Real
         ### Units="bar"
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
      }
   }
}

ChildUniqueness="ch_geo/id/value"
ch_geo{
   Description="Use to specify a reference geometry which can be referenced when defining channels."
   Description="Use to specify a reference channel geometry which can be referenced when defining channels."
   ### Appearance="This is a convenience block which can be used so that channel geometry does not need to be explicitly stated for many channels that have the same geometry."
   MinOccurs=0
   MaxOccurs=NoLimit
   id{
@@ -306,10 +326,13 @@ ch_geo{
       Description="A shortcut to writing 'area' and 'pw' separately.  Accepts two values, which should be flow area and wetted perimeter."
       MinOccurs=0
       MaxOccurs=1
       ### Appearance="Must not specify area or pw"
       value{
          ValType="Real"
          ### Units="m**2 and m"
          MinOccurs=2
          MaxOccurs=2
          MinValExc=0.0
      }
    }
    area{
@@ -317,10 +340,13 @@ ch_geo{
       MinOccurs=0
       MaxOccurs=1
       ChildExactlyOne="../pw"
       ### Appearance="Must also specify pw.  Must not specify geo."
       value{
          ValType="Real"
          ### Units="m**2"
          MinOccurs=1
          MaxOccurs=1
          MinValExc=0.0
       }
    }
    pw{
@@ -328,10 +354,13 @@ ch_geo{
       MinOccurs=0
       MaxOccurs=1
       ChildExactlyOne="../area"
       ### Appearance="Must also specify area. Must not specify geo."
       value{
          ValType="Real"
          ### Units="m"
          MinOccurs=1
          MaxOccurs=1
          MinValExc=0.0
       }
    }
}
@@ -348,6 +377,7 @@ ch{
      Description="ID of the channel"
      MinOccurs=1
      MaxOccurs=1
      ### Appearance="Channel IDs must be integer, must inclue a '1' and must not skip values."
      value{
         ValType=Int
         MinValInc=1
@@ -362,10 +392,12 @@ ch{
      ### Units="m**2"
      MinOccurs=0
      MaxOccurs=1
      ### Appearance="Must also specify pw.  Must not specify geo."
      value{
         ValType=Real
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
      }
      ChildExactlyOne="../pw"
   }
@@ -373,10 +405,13 @@ ch{
      Description="Wetted perimeter of the channel."
      MinOccurs=0
      MaxOccurs=1
      ### Appearance="Must also specify area.  Must not specify geo."
      value{
         ### Units="m"
         ValType=Real
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
      }
      ChildExactlyOne="../area"
   }
@@ -384,15 +419,18 @@ ch{
      Description="A shortcut to writing 'area' and 'pw' separately.  Accepts two values, which should be flow area and wetted perimeter."
      MinOccurs=0
      MaxOccurs=1
      ### Appearance="Must not specify area or pw."
      value{
         ValType="Real"
         ### Units="m**2 and m"
         MinValExc=0.0
         MinOccurs=2
         MaxOccurs=2
      }
   }
   geo_ref{
      Description="ID of the channel geometry object defined in the ch_geo block."
      ### Appearance="ID must be defined in the ch_geo block"
      ### Appearance="ID must be defined in the ch_geo block.  Must not specify geo, area, or pw."
      MinOccurs=0
      MaxOccurs=1
      value{
@@ -413,8 +451,10 @@ ch{
      ChildExactlyOne="../y"
      ChildExactlyOne="../xdim"
      ChildExactlyOne="../ydim"
      ### Appearance="Must specify y, xdim, and ydim.  Must not specify 'mesh'."
      value{
         ValType=Real
         ### Units="m"
         MinOccurs=1
         MaxOccurs=1
         }
@@ -426,8 +466,10 @@ ch{
      ChildExactlyOne="../x"
      ChildExactlyOne="../xdim"
      ChildExactlyOne="../ydim"
      ### Appearance="Must specify x, xdim, and ydim.  Must not specify 'mesh'."
      value{
         ValType=Real
         ### Units="m"
         MinOccurs=1
         MaxOccurs=1
         }
@@ -439,8 +481,10 @@ ch{
      ChildExactlyOne="../x"
      ChildExactlyOne="../y"
      ChildExactlyOne="../ydim"
      ### Appearance="Must specify x, y, and ydim.  Must not specify 'mesh'."
      value{
         ValType=Real
         ### Units="m"
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
@@ -453,8 +497,10 @@ ch{
      ChildExactlyOne="../x"
      ChildExactlyOne="../y"
      ChildExactlyOne="../ydim"
      ### Appearance="Must specify x, y, and xdim.  Must not specify 'mesh'."
      value{
         ValType=Real
         ### Units="m"
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
@@ -464,8 +510,10 @@ ch{
      Description="A shortcut to specify the mesh parameters in the following order; x, y, xdim, and ydim"
      MinOccurs=0
      MaxOccurs=1
      ### Appearance="Must not specify x, y, xdim, or ydim."
      value{
         ValType=Real
         ### Units="m, m, m, m"
         MinOccurs=4
         MaxOccurs=4
         }
@@ -474,14 +522,15 @@ ch{
      Description="Specify the boundary conditions for the channel. If the BCs are not specified, the inlet bc is defined as a mass flow rate/temperature bc and the outlet bc is defined as a pressure/temperature bc, using system 'initial' conditions. The mass flow rate/enthalpy bc and pressure/enthalpy bc will implemented in a future release."
      MinOccurs=0
      MaxOccurs=NoLimit
      ### Appearance="Specify this bc as either inlet or outlet.  Valid boundary conditions are: mass flow rate/temperature, mass flux/temperature, mass flow rate, mass flux, and temperature/pressure.  Invalid combinations will cause a parse error."
      ChildExactlyOne=[inlet, outlet]
      inlet{
         Description="Specify the boundary conditions for the channel inlet."
         Description="This boundary condition will be applied to the channel inlet."
         MinOccurs=0
         MaxOccurs=1
      }
      outlet{
         Description="Specify the boundary conditions for the channel outlet."
         Description="This boundary condition will be applied to the channel outlet."
         MinOccurs=0
         MaxOccurs=1
      }
@@ -493,6 +542,7 @@ ch{
         MaxOccurs=1
         value{
            MinOccurs=1
            ### Units="kg/m**2/s"
            MaxOccurs=1
            ValType=Real
         }
@@ -504,6 +554,7 @@ ch{
         value{
            MinOccurs=1
            MaxOccurs=1
            ### Units="kg/s"
            ValType=Real
         }
      }
@@ -514,6 +565,7 @@ ch{
         value{
            MinOccurs=1
            MaxOccurs=1
            ### Units="C"
            ValType=Real
         }
      }
@@ -524,6 +576,7 @@ ch{
         value{
            MinOccurs=1
            MaxOccurs=1
            ### Units="bar"
            ValType=Real
         }
      }
@@ -541,10 +594,15 @@ section{
   MaxOccurs=NoLimit
   id{
      Description="Specify the ID of the section."
      ### Appearance="Must have a section 1 and cannot skip numbers when providing section IDs."
      MinOccurs=1
      MaxOccurs=1
      value{
         MinOccurs=1
         MaxOccurs=1
         ValType=Int
      }
   }
   ChildExactlyOne=[num_levels, dz]
   ChildExactlyOne=[height, dz]
   num_levels{
@@ -569,6 +627,7 @@ section{
         ValType=Real
         MinOccurs=1
         MaxOccurs=1
         ### Units="m"
         MinValExc=0.0
      }
   }
@@ -580,6 +639,8 @@ section{
         ValType=Real
         MinOccurs=1
         MaxOccurs=NoLimit
         MinValExc=0.0
         ### Units="m"
      }
   }
}
@@ -593,6 +654,7 @@ gap_geo{
      Description="ID of the gap geometry object."
      MinOccurs=1
      MaxOccurs=1
      ### Appearance="Can be string or integer."
      value{
         ValType="String"
         MinOccurs=1
@@ -607,8 +669,10 @@ gap_geo{
      MaxOccurs=1
      value{
         ValType="Real"
         ### Units="m and m"
         MinOccurs=2
         MaxOccurs=2
         MinValExc=0.0
      }
    }
   length{
@@ -618,6 +682,8 @@ gap_geo{
      ChildExactlyOne="../width"
      value{
         ValType="Real"
         ### Units="m"
         MinValExc=0.0
         MinOccurs=1
         MaxOccurs=1
      }
@@ -629,7 +695,9 @@ gap_geo{
      ChildExactlyOne="../length"
      value{
         ValType="Real"
         ### Units="m"
         MinOccurs=1
         MinValExc=0.0
         MaxOccurs=1
      }
   }
@@ -645,6 +713,7 @@ gap{
      Description="Specify the gap ID."
      MinOccurs=1
      MaxOccurs=1
      ### Appearance="Must start at 1 and cannot skip gap IDs"
      value{
         MinOccurs=1
         MaxOccurs=1
@@ -666,26 +735,29 @@ gap{
      }
   }
   length{
      MinOccurs=0
      Description="The length of the gap defined as the distance between the channel centroids."
      MinOccurs=0
      MaxOccurs=1
      ChildExactlyOne="../width"
      ### Appearance="Must also provide width."
      value{
         MinOccurs=1
         ### Units="m"
         MaxOccurs=1
         ValType=Real
      }
   }
   width{
      MinOccurs=0
      Description="The width of the gap defined as the distance across the other direction."
      Description="The width of the gap defined as the distance between the rods, walls, or channel width in which the gap exists."
      MinOccurs=0
      MaxOccurs=1
      ChildExactlyOne="../length"
      ### Appearance="Must also provide length."
      value{
         MinOccurs=1
         MaxOccurs=1
         ### Units="m"
         ValType=Real
      }
   }
@@ -693,15 +765,17 @@ gap{
      Description="A shortcut to writing 'length' and 'width' separately.  Accepts two values, which should be length and width of the gap"
      MinOccurs=0
      MaxOccurs=1
      ### Appearance="Must not specify length and width if specifying geo."
      value{
         ValType="Real"
         ### Units="m and m"
         MinOccurs=2
         MaxOccurs=2
      }
   }
   geo_ref{
      Description="ID of the gap geometry object defined in the gap_geo block."
      ### Appearance="ID must be defined in the gap_geo block"
      ### Appearance="ID must be defined in the gap_geo block.  Must not specify length, width, or geo."
      MinOccurs=0
      MaxOccurs=1
      value{
@@ -720,7 +794,7 @@ solid_geo{
   MinOccurs=0
   MaxOccurs=NoLimit
   id{
      Description="Specify the ID of the reference solid geometry."
      Description="Specify the ID of the reference solid geometry.  Can be string or integer."
      MinOccurs=1
      MaxOccurs=1
      value{
@@ -731,6 +805,7 @@ solid_geo{
   }
   type{
      Description="Specify the type of the reference solid geometry."
      ### Appearance="Accepted types are 'nucl' and 'tube'."
      MinOccurs=1
      MaxOccurs=1
      ValType=String
@@ -740,10 +815,12 @@ solid_geo{
      MinOccurs=0
      MaxOccurs=1
      Description="Fuel rod pellet diameter"
      ### Appearance="Only enter if this is a 'nucl' type."
      value{
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
         ### Units="m"
         ValType=Real
      }
   }
@@ -751,8 +828,10 @@ solid_geo{
      Description="Outer diameter of the reference solid geometry"
      MinOccurs=0
      MaxOccurs=1
      ### Appearance="Enter for 'tube' or 'nucl' types."
      value{
         MinOccurs=1
         ### Units="m"
         MaxOccurs=1
         MinValExc=0.0
         ValType=Real
@@ -762,8 +841,10 @@ solid_geo{
      Description="Inner diameter of the reference solid geometry"
      MinOccurs=0
      MaxOccurs=1
      ### Appearance="Enter for 'tube' or 'nucl' type.  Do not enter if entering 'tclad' instead."
      value{
         MinOccurs=1
         ### Units="m"
         MaxOccurs=1
         MinValExc=0.0
         ValType=Real
@@ -773,10 +854,12 @@ solid_geo{
      Description="Fuel clad thickness"
      MinOccurs=0
      MaxOccurs=1
      ### Appearance="Enter for 'tube' or 'nucl' geometry.  Do not enter if 'din' was entered."
      value{
         MinOccurs=1
         MaxOccurs=1
         MinValExc=0.0
         ### Units="m"
         ValType=Real
      }
   }
@@ -789,7 +872,7 @@ solid{
   MinOccurs=0
   MaxOccurs=NoLimit
   id{
      Description="Specify the ID of the solid object."
      Description="Specify the ID of the solid object.  IDs must include 1, be unique for each solid, and not skip numbers."
      MinOccurs=1
      MaxOccurs=1
      value{
@@ -813,6 +896,7 @@ solid{
   }
   chconn{
      Description="List of all channel IDs connected to the solid object."
      ### Appearance="IDs must exist in the ch/id/value"
      MinOccurs=1
      MaxOccurs=1
      value{
@@ -827,6 +911,7 @@ solid{
   }
   pct{
      Description="List of azimuthal percentages of all channels connected to the solid object. The list size must match the number of connected channels specified in 'chconn'."
      ### Appearance="If not specified, the rod will connect equally to all connected channels."
      MinOccurs=0
      MaxOccurs=1
      value{
@@ -839,7 +924,7 @@ solid{
   }
   axpow{
      Description="ID of the axial power table (if defined)"
      ### Appearance="ID must exist in the 'axialpow' block"
      ### Appearance="ID must exist in the 'axialpow' block.  If not specified, the solid will have a uniform power."
      MinOccurs=0
      MaxOccurs=1
      value{
@@ -855,7 +940,7 @@ solid{
ChildAtMostOne=["axialpow/id/value"=1]
ChildUniqueness="axialpow/id"
axialpow{
   Description="Specify the axial power table(s) block using a list of axial locations and power factors for a steady state simulation alongside a series of time groups for a transient simulation."
   Description="Use to specify an axial power table.  A single table can be provided, which will apply for the entire transient or steady state solution, or a set of tables can be applied for multiple times in the transient (only valid for transients)."
   MinOccurs=0
   MaxOccurs=NoLimit
   id{
@@ -877,14 +962,16 @@ axialpow{
      value{
         MinOccurs=1
         MaxOccurs=NoLimit
         ### Units="m"
         ValType=Real
         MinValInc=0.0
         ChildCountEqual(EvenNone)="../../pow"
      }
   }
   # The user may either specify z/pow if not transient, or z and a series of time groups
   ChildExactlyOne=[pow, time]
   pow{
      Description="Specify the list of axial power factor for the axial power table for a steady state simulation."
      Description="Specify the list of axial power factors for the axial power table if only one axial power factor table is being supplied for the transient or steady state solution."
      ### Appearance="The list length should match the list of axial locations."
      MinOccurs=0
      MaxOccurs=1
@@ -897,17 +984,18 @@ axialpow{
      }
   }
   time{
      Description="Specify a series of starting time groups at which the axial power factors are applied for the axial power table for a transient simulation."
      Description="If specifying a set of tables for the transient, the power shape in this time group and add as many time groups as desired."
      MinOccurs=0
      MaxOccurs=NoLimit
      value{
         MinOccurs=1
         MaxOccurs=1
         ### Units="s"
         ValType=Real
         MinValInc=0.0
      }
      pow{
         Description="For a transient simulation, list the power factors for the axial power table for a given start time."
         Description="A list of power factors for this point in the transient."
         ### Appearance="The list length should match the list of axial locations."
         MinOccurs=1
         MaxOccurs=1
@@ -981,7 +1069,7 @@ domain{
      }
   }
   chans{
      Description="This may be a single channel or a list of channels to which the parallel domain defined in this 'domain' group will be applied."
      Description="List of the channels owned by this domain.  All channels in the model must be accounted for in one of the domains.  Channels cannot exist in multiple domains."
      MinOccurs=1
      MaxOccurs=1
      value{
@@ -992,7 +1080,7 @@ domain{
      }
   }
   solids{
      Description="This may be a single solid rod or a list of solid rods to which the parallel domain defined in this 'domain' group will be applied."
      Description="Solids owned by this domain.  All solids in the model must be accounted for by one of the domains.  Solid may exist in multiple domains, but can only be owned by one."
      MinOccurs=0
      MaxOccurs=1
      value{
@@ -1004,7 +1092,7 @@ domain{
      }
   }
   solid_owners{
      Description="This is a list of parallel domain indices which own the solid rods defined in the 'solids' group."
      Description="List of the domains that own each solid in this domain.  It is necessary to add solids to domains that do not own them so their energy is deposited into the channels in that domain to which it connects."
      ### Appearance="The list length must match the length of the list of the solid rods for the specified 'domain' group and the parallel domain indices must match the parallel domain IDs defined in the model."
      MinOccurs=0
      MaxOccurs=1
+48 −31
Original line number Diff line number Diff line
@@ -14,8 +14,12 @@ types = {}
restrictions = {}
minOccurs = {}
maxOccurs = {}
myParent = []
hasChildren = {}
parent = ""

indent = 0
inValue = False
for line in f.readlines():
    attrLine = False
    for param in attr:
@@ -26,49 +30,63 @@ for line in f.readlines():
    elif line.lstrip().startswith("###"):
        splitline = line.split("###")[1].strip()
        if "Appearance" in splitline:
            appearance[name+str(group[-1])] = splitline.split("=")[1].strip()[1:-1]
            appearance[parent+name] = splitline.split("=")[1].strip()[1:-1]
        elif "Units" in splitline:
            units[name+str(group[-1])] = splitline.split("=")[1].strip()[1:-1]
            units[parent+name] = splitline.split("=")[1].strip()[1:-1]
    elif line.lstrip().startswith('#'):
        continue
    elif not line.strip():
        continue
    elif "value{" in line:
        inValue = True
        indent = indent+1
        hasChildren[parent+name]=False
    elif '}' in line:
        if inValue: inValue=False
        indent = indent-1
    elif "Description" in line:
        splitline = line.split("=")
        descriptions[name+str(group[-1])] = splitline[1].strip()[1:-1]
        descriptions[parent+name] = splitline[1].strip()[1:-1]
    elif "ValType" in line:
        splitline = line.split("=")
        types[name+str(group[-1])] = splitline[1].strip()
        types[parent+name] = splitline[1].strip()
    elif "MinOccurs" in line:
        if inValue: continue
        splitline = line.split("=")
        minOccurs[name+str(group[-1])] = splitline[1].strip()
        minOccurs[parent+name] = splitline[1].strip()
    elif "MaxOccurs" in line:
        if inValue: continue
        splitline = line.split("=")
        maxOccurs[name+str(group[-1])] = splitline[1].strip()
        maxOccurs[parent+name] = splitline[1].strip()
    elif "MinValExc" in line:
        val = line.split("=")[1].strip()
        restrictions[name+str(group[-1])] = ">"+str(val)
        restrictions[parent+name] = ">"+str(val)
    elif "MinValInc" in line:
        val = line.split("=")[1].strip()
        restrictions[name+str(group[-1])] = ">="+str(val)
        restrictions[parent+name] = ">="+str(val)
    elif "MaxValExc" in line:
        val = line.split("=")[1].strip()
        restrictions[name+str(group[-1])] = "<"+str(val)
        restrictions[parent+name] = "<"+str(val)
    elif "MaxValInc" in line:
        val = line.split("=")[1].strip()
        restrictions[name+str(group[-1])] = "<="+str(val)
        restrictions[parent+name] = "<="+str(val)
    elif "ValEnums" in line:
        val = line.split("=")[1].strip()
        restrictions[name+str(group[-1])] = val
        restrictions[parent+name] = val
    else:
        splitline = line.split('{')
        name = splitline[0].strip()
        names.append(name)
        group.append(indent)
        if indent==0:
            parent=""
        else:
            for i in range(len(group)-1, 0, -1):
                if group[i]<indent:
                    parent = names[i]
                    break
        myParent.append(parent)
        hasChildren[parent+name]=True
        indent = indent+1

preamble = open('user_manual_preamble')
@@ -88,7 +106,7 @@ header = ["=", "-", "^", '"']
for i, param in enumerate(names):
    rst.write(param+"\n")
    rst.write(len(param)*header[group[i]]+"\n")
    uniqueName = param+str(group[i])
    uniqueName = myParent[i]+param
    rst.write(":Description: ")
    if uniqueName in descriptions:
        rst.write(descriptions[uniqueName]+"\n")
@@ -96,6 +114,7 @@ for i, param in enumerate(names):
        rst.write("n/a\n")
    rst.write(":Min Occurance: "+str(minOccurs[uniqueName])+"\n")
    rst.write(":Max Occurance: "+str(maxOccurs[uniqueName])+"\n")
    if not hasChildren[uniqueName]:
       rst.write(":Units: ")
       if uniqueName in units:
           rst.write(units[uniqueName]+"\n")
@@ -111,10 +130,8 @@ for i, param in enumerate(names):
           rst.write(restrictions[uniqueName]+"\n")
       else:
           rst.write("n/a\n")
    rst.write(":Note: ")
    if uniqueName in appearance:
       rst.write(":Note: ")
       rst.write(appearance[uniqueName]+"\n")
    else:
        rst.write("n/a\n")
    rst.write("\n")
+230 −332

File changed.

Preview size limit exceeded, changes collapsed.

+12 −1

File changed.

Preview size limit exceeded, changes collapsed.