Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
HTML
<div class="section" id="definition-files-migration">
<span id="def-files"></span><span id="index-0"></span>
<p>This can be the most interesting part, requiring choices for</p>
<ul class="simple">
<li>suite durability</li>
<li>common libraries coding</li>
<li>ensuring maintainability</li>
</ul>
<p>The CDP client provides an environment where CDP variables, aliases and
functions are global entities. Choosing ksh to design a suite will
lead to similar concepts and practices. Choosing the Python language can
lead to deeper changes.</p>
<p>Milestones are:</p>
<ul class="simple">
<li>the expanded definition file generation</li>
<li>the expanded definition file load into ecFlow server</li>
<li>running the (e)suite</li>
<li>eventually, expanded definition files played into SMS server, and run
as (e)suite</li>
</ul>
<p>Language correspondence:</p>
<table border="1" class="docutils">
<colgroup>
<col width="36%" />
<col width="36%" />
<col width="28%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">CDP</th>
<th class="head">ksh</th>
<th class="head">Python</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>if (math) then cmds; else cmds; endif</td>
<td>if ((math)); then cmds; else cmds; fi</td>
<td>if math: cmds; else: cmds</td>
</tr>
<tr class="row-odd"><td>while (math) do cmds; endwhile</td>
<td>while ((math)); do cmds; done</td>
<td>while math: cmds</td>
</tr>
<tr class="row-even"><td>loop VAR (spaced_list) do cmds; endloop</td>
<td>for VAR in spaced_list; do cmds; done</td>
<td>for VAR in list:</td>
</tr>
<tr class="row-odd"><td>case VAR</td>
<td>case $VAR in</td>
<td>if VAR in [comma_list]:</td>
</tr>
<tr class="row-even"><td>in (spaced_list) do cmds; endin</td>
<td>piped_list) cmds;;</td>
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td>in ( ) do cmds; endin</td>
<td>*) cmds;;</td>
<td>else:</td>
</tr>
<tr class="row-even"><td>endcase</td>
<td>esac</td>
<td>&nbsp;</td>
</tr>
<tr class="row-odd"><td>for VAR math1 math2; do</td>
<td>var=math1; while ((var &lt; math2)); do</td>
<td>var=math1; while var&lt;math2:</td>
</tr>
<tr class="row-even"><td>for VAR math1 math2 step math3; do</td>
<td>var=math1; while ((var &lt; math2)); do
var=$((var+math3))</td>
<td><dl class="first last docutils">
<dt>var=math1; while var&lt;math2:</dt>
<dd>var=var+math3</dd>
</dl>
</td>
</tr>
<tr class="row-odd"><td>endfor</td>
<td>done</td>
<td>&nbsp;</td>
</tr>
<tr class="row-even"><td>$ shell_cmd</td>
<td>&lt;native&gt;</td>
<td>popen2.popen2(&#8220;cmd&#8221;)</td>
</tr>
<tr class="row-odd"><td>% cshell_cmd</td>
<td>csh</td>
<td>&nbsp;</td>
</tr>
<tr class="row-even"><td>&lt; file_include</td>
<td>. file_include</td>
<td>import library</td>
</tr>
<tr class="row-odd"><td>alias a cmds ; cmds2</td>
<td>alias a=&#8221;cmds; cmds2&#8221;</td>
<td>def a: cmds; cmds2</td>
</tr>
<tr class="row-even"><td>set variable value</td>
<td>variable=value</td>
<td>variable=&#8221;value&#8221;</td>
</tr>
<tr class="row-odd"><td>variable=math</td>
<td>variable=$((math))</td>
<td>variable=math</td>
</tr>
<tr class="row-even"><td>variable=`shell_cmd`</td>
<td>variable=$(shell_cmd)</td>
<td>&lt;use popen2&gt;</td>
</tr>
<tr class="row-odd"><td>man</td>
<td>man / help</td>
<td>help()</td>
</tr>
<tr class="row-even"><td>echo</td>
<td>echo / print</td>
<td>print</td>
</tr>
<tr class="row-odd"><td># comment</td>
<td># comment</td>
<td># comment</td>
</tr>
<tr class="row-even"><td>set debug on</td>
<td>set -eux</td>
<td>python -m trace -t
pylint coverage</td>
</tr>
</tbody>
</table>
</div>