Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix #10: "key" builtin was a character code, not a string

  • Loading branch information...
commit 6090135039c2032bfd4299d5b7210130852914ec 1 parent 06607c0
@jdf authored
View
1  buildtime/template/DriverImpl.java.cog
@@ -50,5 +50,6 @@ public class DriverImpl extends PAppletJythonDriver {
b.emit()
]]]*/
/*[[[end]]] */
+ super.setFields();
}
}
View
7 runtime/src/jycessing/PAppletJythonDriver.java
@@ -25,6 +25,7 @@
import org.python.core.PySet;
import org.python.core.PyStringMap;
import org.python.core.PyType;
+import org.python.core.PyUnicode;
import org.python.util.InteractiveConsole;
import processing.core.PApplet;
@@ -51,8 +52,6 @@
abstract protected void populateBuiltins();
- abstract protected void setFields();
-
protected final PyStringMap builtins;
protected final InteractiveConsole interp;
private final String pySketchPath;
@@ -96,6 +95,10 @@ private void interpretSketch() {
}
}
+ protected void setFields() {
+ builtins.__setitem__("key", new PyUnicode(Character.toString(key)));
+ }
+
public PAppletJythonDriver(final InteractiveConsole interp,
final String sketchPath, final String programText) {
this.programText = programText;
Please sign in to comment.
Something went wrong with that request. Please try again.