<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Marc,<br>
<br>
On 11/4/11 2:09 PM, J. Marc Edwards wrote:
<blockquote cite="mid:4EB45483.9050607@nimbisservices.com"
type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
I need a little help in integrating my Jython/Python code into the
Python actor.<br>
<br>
When I double-click on the Python actor in the
PythonDialogExample, a window with the Python code appears. I can
of course edit the code from within this window. However, I want
to perform my code development and editing from within my Eclipse
environment from my Kepler development build.<br>
</blockquote>
I don't know that much about Python, but I believe that you could
use the Python import facility to find imports.<br>
I just added text to the Kepler Jython page about this, see:<br>
<a class="moz-txt-link-freetext" href="https://kepler-project.org/developers/reference/python-and-kepler#how-jython-finds-imports">https://kepler-project.org/developers/reference/python-and-kepler#how-jython-finds-imports</a><br>
<br>
Note that I found a few other references on the web, included what
appears to be people who are using the full version of Python (not
Jython) with Kepler.<br>
<blockquote cite="mid:4EB45483.9050607@nimbisservices.com"
type="cite"> When I "open the actor", the beginning of the file
has some Javadoc as well as what appear to be some unmatched XML
elements (<p>), along with some matching XML element tags
(</pre>) (does this correspond to some pre-fire method?).<br>
</blockquote>
When you open the actor, you are seeing the Java code that
implements the PythonActor. The <p> tags are html tags used
in the javadoc comments of the Java file. All of the instances of
the PythonActor share the same Java code, but may have different
Python code.<br>
<blockquote cite="mid:4EB45483.9050607@nimbisservices.com"
type="cite"> After this all of the Java code for the actor follows
with the standard initialize(), stop(), stopFire(),
preinitialize(), terminate(), etc, methods.<br>
<br>
I do see in the Java code where there is a PythonScript method
that accepts a CompositeEntity where a script template is provided
where I am supposing a long Python string in the
script.setExpression is defined.<br>
<br>
However, what I would like to do is simply include my Jython
module within my Kepler build and debug my Jython code in
connection with my overall workflow.<br>
<br>
Can someone tell me how to go about achieving this objective?<br>
</blockquote>
It looks like Jython uses sys.path to find imports. I included a
Ptolemy II model that opens in the devel version of Kepler that
lists the contents of sys.path. For further information about
sys.path, see<br>
<br>
<a class="moz-txt-link-freetext" href="http://jythonpodcast.hostjava.net/jythonbook/en/1.0/ModulesPackages.html">http://jythonpodcast.hostjava.net/jythonbook/en/1.0/ModulesPackages.html</a><br>
<br>
_Christopher<br>
<blockquote cite="mid:4EB45483.9050607@nimbisservices.com"
type="cite"> <br>
Thanks, Marc<br>
<div class="moz-signature">-- <br>
<meta http-equiv="CONTENT-TYPE" content="text/html;
charset=ISO-8859-1">
<title></title>
<meta name="GENERATOR" content="LibreOffice 3.3 (Unix)">
<meta name="CREATED" content="0;0">
<meta name="CHANGEDBY" content="J. Edwards">
<meta name="CHANGED" content="20110727;17373400">
<meta name="CHANGEDBY" content="J. Edwards">
<style type="text/css">
<!--
P { color: #000000 }
-->
</style>
<p><font color="#800080"><font face="Comic Sans MS, cursive"><font
style="font-size: 13pt" size="3"><span
style="font-weight: normal">J. Marc Edwards</span></font></font></font><font
face="Comic Sans MS, cursive"><br>
Lead Architect - Semiconductor Design Portals</font><br>
<font color="#3333ff"><font face="Nimbus Sans L, sans-serif"><font
size="4">Nimbis Services, Inc.</font></font></font><br>
<font face="Courier New">Skype: (919) 747-3775<br>
Cell: (919) 345-1021<br>
Fax: (919) 882-8602</font><br>
<font face="Ubuntu"><a moz-do-not-send="true"
class="moz-txt-link-abbreviated"
href="mailto:marc.edwards@nimbisservices.com">marc.edwards@nimbisservices.com</a><br>
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
href="http://www.nimbisservices.com">www.nimbisservices.com</a></font></p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kepler-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a>
<a class="moz-txt-link-freetext" href="http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users">http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Christopher Brooks, PMP University of California
CHESS Executive Director US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust Berkeley, CA 94720-1774
ph: 510.643.9841 (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670 </pre>
</body>
</html>