<commit_before><html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=Cp1252"/>
    <link rel="stylesheet" href="../default.css" type="text/css" />
    <title>
     Python Script
    </title>
  </head>
  <body>

    <h2>
      Python Script
    </h2>
    
    <p>BOY uses Jython, the Java implementation of Python under the hood.
    So please follow the 
    <a href="http://www.jython.org/archive/22/userguide.html#interaction-with-java-packages">
    Jython documentatoin</a> for more details in calling Java code from Jython. 
    Since it is Jython, it follows the Python language grammar, 
    see <a href="http://docs.python.org/tutorial/">
    Python Tutorial</a>. Most of standard Python modules are available from Jython,
    but not all modules implemented in C for CPython are available because they need to be re-implemented in Java
    for Jython. For example, SciPy, NumPy are not implemented for Jython yet.
    </p>    
   
    <h3>Python module files search path</h3>
	<p>
	Unlike Javascript, Python script in BOY allows you to reuse other Python scripts as modules.
	In BOY, the search path for module files includes the current path of the script file and the 
	path specified in PYTHONPATH preference which is configured in BOY preference page: 
	<code>CSS->Preferences...->CSS Applications->Display->BOY->OPI Runtime</code>. It accept
	both workspace path and system path. Paths are separated by <code>|</code>. For example:	 
 	</p>
 	<pre class="example_code">/MyPyLib/MyModule1|C:\Python27\Lib</pre>
 	
 	<p>If there was Python script executed before you make changes to this preference,
 	 	CSS must be restarted to make the new PYTHONPATH take effect. It is because the PYTHONPATH
 	 	preference is only loaded once during the first execution of any Python script in BOY.</p>
 	 	
 	<h3>Use PyDev</h3>
 	<p>One of the good parts of using Python script in BOY is that you can take advantage of 
 	the free Python development IDE <a href="http://pydev.org/">PyDev</a>. PyDev provided 
 	a good Python script editor with 
 	syntax hightlight and code auto-completion. If it is a pure Python code, you are even 
 	able to debug/run the python script in the IDE.</p>
 	<p>PyDev is also a bunch of Eclipse Plugins, so they can be easily integrated to your CSS
 	by following these steps:</p>
 	<ol>
 		<li>Install <a href = "http://jython.org/">Jython</a> to your operating system.</li>
 		<li>Go to CSS menu <code>Help->Install New Software...</code> to open the dialog as below.
 		In this dialog, click <code>Add...</code> button to add two update site locations(name can be arbitrary):
	 		<ul>
	 		<li><code>http://pydev.org/updates</code></li> 
	 		<li><code>http://download.eclipse.org/eclipse/updates/3.6</code></li>
	 		</ul> 		
 		Work with <code>http://pydev.org/updates</code>. Select the checkbox of 
 		<code>PyDev for Eclipse</code>. Select the option <code>Contact all update sites during install to find 
 		required software</code>. <br>Click <code>Next</code> and follow the instructions to finish the installation.
 			<p><img src="img/InstallPyDev.gif" alt="Install software dialog"></p>
 					
 		</li>
 		<li>Restart CSS.</li>
 		<li>Go to <code>CSS->Preferences->PyDev->Interpreter-Jython</code> and select <code>New...</code>
 		to add the jython interpreter <code>jython.jar</code> from where your Jython was installed.
 		Select the button <code>New Jar/Zips</code> in <code>Libraries</code> tab and add <code>
 		org.csstudio.opibuilder.jar </code> from  your_CSS_path/plugins folder. Adding this jar file to
 		PYTHONPATH will give you the capability to make code auto-completion to
 		BOY <a href="ScriptUtil.html">ScriptUtil</a>. You can also add other plugins if
 		you want to get code auto-completion to 
 		other plugins, for example, add <code>org.eclipse.jface.jar</code> and <code>org.eclipse.swt.jar</code>
 		will give you the power of code auto-completion to SWT and JFace code. But this doesn't mean you can run/debug
 		its code directly from PyDev. 
 		Remember, only pure Java or Python code are able to run/debug from PyDev.
 		 <p><img src="img/PyDevPreference.gif" alt="PyDev Preference Dialog"></p><commit_msg>o.c.opibuilder: Update online help according to Eclipse platform upgrade<commit_after><html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=Cp1252"/>
    <link rel="stylesheet" href="../default.css" type="text/css" />
    <title>
     Python Script
    </title>
  </head>
  <body>

    <h2>
      Python Script
    </h2>
    
    <p>BOY uses Jython, the Java implementation of Python under the hood.
    So please follow the 
    <a href="http://www.jython.org/archive/22/userguide.html#interaction-with-java-packages">
    Jython documentatoin</a> for more details in calling Java code from Jython. 
    Since it is Jython, it follows the Python language grammar, 
    see <a href="http://docs.python.org/tutorial/">
    Python Tutorial</a>. Most of standard Python modules are available from Jython,
    but not all modules implemented in C for CPython are available because they need to be re-implemented in Java
    for Jython. For example, SciPy, NumPy are not implemented for Jython yet.
    </p>    
   
    <h3>Python module files search path</h3>
	<p>
	Unlike Javascript, Python script in BOY allows you to reuse other Python scripts as modules.
	In BOY, the search path for module files includes the current path of the script file and the 
	path specified in PYTHONPATH preference which is configured in BOY preference page: 
	<code>CSS->Preferences...->CSS Applications->Display->BOY->OPI Runtime</code>. It accept
	both workspace path and system path. Paths are separated by <code>|</code>. For example:	 
 	</p>
 	<pre class="example_code">/MyPyLib/MyModule1|C:\Python27\Lib</pre>
 	
 	<p>If there was Python script executed before you make changes to this preference,
 	 	CSS must be restarted to make the new PYTHONPATH take effect. It is because the PYTHONPATH
 	 	preference is only loaded once during the first execution of any Python script in BOY.</p>
 	 	
 	<h3>Use PyDev</h3>
 	<p>One of the good parts of using Python script in BOY is that you can take advantage of 
 	the free Python development IDE <a href="http://pydev.org/">PyDev</a>. PyDev provided 
 	a good Python script editor with 
 	syntax hightlight and code auto-completion. If it is a pure Python code, you are even 
 	able to debug/run the python script in the IDE.</p>
 	<p>PyDev is also a bunch of Eclipse Plugins, so they can be easily integrated to your CSS
 	by following these steps:</p>
 	<ol>
 		<li>Install <a href = "http://jython.org/">Jython</a> to your operating system.</li>
 		<li>Go to CSS menu <code>Help->Install New Software...</code> to open the dialog as below.
 		In this dialog, click <code>Add...</code> button to add two update site locations(name can be arbitrary):
	 		<ul>
	 		<li><code>http://pydev.org/updates</code></li> 
	 		<li><code>http://download.eclipse.org/eclipse/updates/3.7</code></li>
	 		</ul> 		
 		Work with <code>http://pydev.org/updates</code>. Select the checkbox of 
 		<code>PyDev for Eclipse</code>. Select the option <code>Contact all update sites during install to find 
 		required software</code>. <br>Click <code>Next</code> and follow the instructions to finish the installation.
 			<p><img src="img/InstallPyDev.gif" alt="Install software dialog"></p>
 					
 		</li>
 		<li>Restart CSS.</li>
 		<li>Go to <code>CSS->Preferences->PyDev->Interpreter-Jython</code> and select <code>New...</code>
 		to add the jython interpreter <code>jython.jar</code> from where your Jython was installed.
 		Select the button <code>New Jar/Zips</code> in <code>Libraries</code> tab and add <code>
 		org.csstudio.opibuilder.jar </code> from  your_CSS_path/plugins folder. Adding this jar file to
 		PYTHONPATH will give you the capability to make code auto-completion to
 		BOY <a href="ScriptUtil.html">ScriptUtil</a>. You can also add other plugins if
 		you want to get code auto-completion to 
 		other plugins, for example, add <code>org.eclipse.jface.jar</code> and <code>org.eclipse.swt.jar</code>
 		will give you the power of code auto-completion to SWT and JFace code. But this doesn't mean you can run/debug
 		its code directly from PyDev. 
 		Remember, only pure Java or Python code are able to run/debug from PyDev.
 		 <p><img src="img/PyDevPreference.gif" alt="PyDev Preference Dialog"></p>
{'fraction_non_alphanumeric': 0.10638800330617547, 'fraction_numerical': 0.004014641634195301, 'mean_word_length': 3.5513164965072543, 'pattern_counts': {'":': 0, '<': 189, '<?xml version=': 0, '>': 207, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3140847', 'n_tokens_mistral': 2792, 'n_tokens_neox': 2597, 'n_words': 1007}