<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000'>It looks like in python there is no equivalent to ifdefs. <br>We could simply use an if statement, but we need to have something different for cgm >= 13<br>Python is an interpreted language, and we can do something like this:<br><pre style="" class="lang-py prettyprint prettyprinted"><code><span class="kwd">import</span><span class="pln"> os
</span><span class="kwd">if</span><span class="pln"> os</span><span class="pun">.</span><span class="pln">name </span><span class="pun">==</span><span class="pln"> </span><span class="str">"posix"</span><span class="pun">:</span><span class="pln">
</span><span class="kwd">def</span><span class="pln"> foo</span><span class="pun">(</span><span class="pln">x</span><span class="pun">):</span><span class="pln">
</span><span class="kwd">return</span><span class="pln"> x </span><span class="pun">*</span><span class="pln"> x
</span><span class="kwd">else</span><span class="pun">:</span><span class="pln">
</span><span class="kwd">def</span><span class="pln"> foo</span><span class="pun">(</span><span class="pln">x</span><span class="pun">):</span><span class="pln">
</span><span class="kwd">return</span><span class="pln"> x </span><span class="pun">+</span><span class="pln"> </span><span class="lit">42<br><br></span></code></pre>Now, we need to export somehow the version from iGeom.h / iBase.h, to be visible in pytaps.<br><br>Another solution is to create an svn branch for pytaps too (I prefer not to, because there is not much difference, so far) And as long as iGeom.h does not change, we do not really need different branches.<br><br> Any suggestions?<br><br>Iulian<br><br><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><style>p { margin: 0; }</style><div style="font-family: times new roman,new york,times,serif; font-size: 12pt; color: #000000">Hello,<br>Does anybody know how to do ifdefs in python? Or something similar? <br>This is what I am using for pytaps built with cgm trunk (actually, cgm/tags/13.1.1)<br>(you should be able to apply this patch on pytaps source, and use it also for trunk version)<br><br>Iulian<br><hr id="zwchr"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;">HI<br><br>I think the iMesh implmentation in CGM13.1 is mismatched for the PyTAPS <br>1.4, PyTAPS 1.4 failed to build when using CGM 13.1, but is fine with <br>12.2. The error messages are all code issues regarding mismatched <br>arguments to functions, passing ints when it should be doubles and so on.<br><br>I figured this should be reported here since I couldnt find PyTAPS dev<br><br>Thanks<br><br>Andy<br><br></blockquote><br></div></blockquote><br></div></body></html>