Expose "g", the PGraphics object. Fix
MODIFY
runtime/src/jycessing/PAppletJythonDriver.java
runtime/src/jycessing/PAppletJythonDriver.java
@@ -434,7 +434,6 @@ public class PAppletJythonDriver extends PApplet {
setSet();
setColorMethods();
setText();
- builtins.__setitem__("g", Py.java2py(g));
// Make sure key and keyCode are defined.
builtins.__setitem__("key", Py.newUnicode((char) 0));
@@ -469,6 +468,7 @@ public class PAppletJythonDriver extends PApplet {
} else if (s instanceof PSurfaceFX) {
System.err.println("I don't know how to watch FX2D windows for close.");
}
+ builtins.__setitem__("g", Py.java2py(g));
return s;
}

ADD
testing/resources/test_g.py
+import processing.opengl.PGraphics3D
+
+def setup():
+ size(100, 100, P3D)
+
+def draw():
+ assert(isinstance(g, processing.opengl.PGraphics3D))
+ print 'OK'
+ exit()

MODIFY
testing/src/test/jycessing/JycessingTests.java
testing/src/test/jycessing/JycessingTests.java
@@ -318,4 +318,10 @@ public class JycessingTests {
// noop
}
}
+
+ // https://github.com/jdf/processing.py/issues/280
+ @Test
+ public void g() throws Exception {
+ expectOK("g");
+ }
}

Expose "g", the PGraphics object. Fix #280.