Skip to content

Commit e697386

Browse files
author
Jonathan Feinberg
committed
add copyright and license information
1 parent 01e7da6 commit e697386

14 files changed

+243
-5
lines changed

.classpath

+1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
66
<classpathentry kind="lib" path="thirdparty/processing/lib/core.jar" sourcepath="/processing-core/src"/>
77
<classpathentry kind="lib" path="thirdparty/jython/jython.jar" sourcepath="/jython-trunk/src"/>
8+
<classpathentry combineaccessrules="false" kind="src" path="/processing-app"/>
89
<classpathentry kind="output" path="bin"/>
910
</classpath>

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ examples.pde
99
*$py.class
1010
line.pdf
1111
generated/jycessing/*.java
12+
build

.project

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<projectDescription>
3-
<name>jyprocessing</name>
3+
<name>processing.py</name>
44
<comment></comment>
55
<projects>
66
</projects>

build.xml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- ======================================================================
3+
Aug 8, 2010 10:37:58 AM
4+
5+
processing.py
6+
Write processing sketches in Python
7+
8+
jdf
9+
====================================================================== -->
10+
<project name="processing.py" default="gen-driver">
11+
<description>
12+
Write processing sketches in Python
13+
</description>
14+
15+
<eclipse.convertPath resourcepath="processing.py" property="project" />
16+
17+
<target name="gen-driver" description="Generate DriverImpl class">
18+
<java classpath="bin:thirdparty/processing/lib/core.jar"
19+
classname="jycessing.build.DriverGenerator"
20+
fork="true"
21+
dir="${project}" />
22+
<eclipse.refreshLocal resource="processing.py" />
23+
</target>
24+
25+
<target name="ziptool" description="Create processing tool">
26+
<eclipse.convertPath resourcepath="processing-app/userdir"
27+
property="userdir" />
28+
<delete dir="build" includeemptydirs="true" />
29+
<mkdir dir="build/PythonMode/tool" />
30+
<jar destfile="build/PythonMode/tool/PythonMode.jar">
31+
<fileset dir="bin" />
32+
</jar>
33+
<copy todir="build/PythonMode/tool"
34+
file="thirdparty/jython/jython.jar" />
35+
<zip basedir="build" file="build/PythonMode.zip" />
36+
<copy todir="${userdir}/tools">
37+
<fileset dir="build" includes="PythonMode/**">
38+
</fileset>
39+
</copy>
40+
<eclipse.refreshLocal resource="processing.py" />
41+
<eclipse.refreshLocal resource="processing-app" />
42+
</target>
43+
44+
</project>

rundemo.sh

-2
This file was deleted.

src/jycessing/PAppletJythonDriver.java

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2010 Jonathan Feinberg
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
116
package jycessing;
217

318
import java.lang.reflect.Field;

src/jycessing/Runner.java

+22-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2010 Jonathan Feinberg
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
116
package jycessing;
217

318
import java.io.BufferedReader;
@@ -29,7 +44,12 @@ private static String read(final Reader r) throws IOException {
2944
}
3045

3146
public static void main(final String[] args) throws Exception {
32-
final String pathname = args[0];
47+
if (args.length < 1) {
48+
System.err.println("I need the path of your Python script as an argument.");
49+
}
50+
final String pathname = args[args.length - 1];
51+
final String[] otherArgs = new String[args.length - 1];
52+
System.arraycopy(args, 0, otherArgs, 0, otherArgs.length);
3353
final String text = read(new FileReader(pathname));
3454

3555
Py.initPython();
@@ -46,7 +66,7 @@ public static void main(final String[] args) throws Exception {
4666
try {
4767
interp.getLocals().__setitem__(new PyString("__file__"), new PyString(pathname));
4868
final PAppletJythonDriver applet = new DriverImpl(interp, text);
49-
PApplet.runSketch(new String[] { "Test" }, applet);
69+
PApplet.runSketch(otherArgs, applet);
5070
} catch (Throwable t) {
5171
Py.printException(t);
5272
interp.cleanup();

src/jycessing/build/Binding.java

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2010 Jonathan Feinberg
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
116
package jycessing.build;
217

318
import java.lang.reflect.Field;

src/jycessing/build/DriverGenerator.java

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2010 Jonathan Feinberg
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
116
package jycessing.build;
217

318
import java.io.BufferedReader;

src/jycessing/build/PolymorphicMethod.java

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
* Copyright 2010 Jonatimport java.lang.reflect.Method;
3+
import java.util.ArrayList;
4+
import java.util.Collections;
5+
import java.util.List;
6+
xcept in compliance with the License. You may obtain a copy of
7+
* the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14+
* License for the specific language governing permissions and limitations under
15+
* the License.
16+
*/
117
package jycessing.build;
218

319
import java.lang.reflect.Method;

src/jycessing/build/Signature.java

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2010 Jonathan Feinberg
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
116
package jycessing.build;
217

318
import java.lang.reflect.Method;

src/jycessing/build/TypeUtil.java

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2010 Jonathan Feinberg
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
116
package jycessing.build;
217

318
public class TypeUtil {

src/jycessing/tool/PythonMode.java

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright 2010 Jonathan Feinberg
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
16+
package jycessing.tool;
17+
18+
import processing.app.Editor;
19+
import processing.app.tools.Tool;
20+
21+
public class PythonMode implements Tool {
22+
private Editor editor;
23+
24+
public String getMenuTitle() {
25+
return "Python Mode";
26+
}
27+
28+
public void init(final Editor editor) {
29+
this.editor = editor;
30+
}
31+
32+
public void run() {
33+
editor.deactivateExport();
34+
editor.setHandlers(new RunHandler(), new PresentHandler(), new StopHandler(),
35+
new ExportHandler(), new ExportAppHandler());
36+
editor.statusNotice("Python Mode initialized.");
37+
}
38+
39+
private class ExportHandler implements Runnable {
40+
public void run() {
41+
editor.statusError("Export not implemented in Python mode.");
42+
}
43+
}
44+
45+
private class StopHandler implements Runnable {
46+
public void run() {
47+
editor.statusError("Stop not implemented in Python mode.");
48+
}
49+
}
50+
51+
class PresentHandler implements Runnable {
52+
public void run() {
53+
editor.statusError("Present not implemented in Python mode.");
54+
}
55+
}
56+
57+
class RunHandler implements Runnable {
58+
public void run() {
59+
editor.statusError("Run not implemented in Python mode.");
60+
}
61+
}
62+
63+
class ExportAppHandler implements Runnable {
64+
public void run() {
65+
editor.statusError("Export Application not implemented in Python mode.");
66+
}
67+
}
68+
}

template/DriverImpl.java

+15
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/*
2+
* Copyright 2010 Jonathan Feinberg
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
5+
* use this file except in compliance with the License. You may obtain a copy of
6+
* the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations under
14+
* the License.
15+
*/
116
package jycessing;
217

318
import org.python.util.InteractiveConsole;

0 commit comments

Comments
 (0)