Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Jython 2.7, fullscreen, launcher & more #25

Merged
merged 35 commits into from

2 participants

@ralfbiedert

I have been using Processing.py quite a lot recently. With it, I also implemented some new features and bug fixes. In particular:

• Now uses jython 2.7
• Added support for fullscreen mode
• Added convenience wrappers to launch sketches without the command line
• Optionally bundled JREs 
• Also added support for true "standalone" sketches with a separate launcher 
• Better support for frameworks such as Ani 
ralfbiedert added some commits
@ralfbiedert ralfbiedert Updated to latest Processing version. 874e34e
@ralfbiedert ralfbiedert Updated to latest Processing version. 389ea4b
@ralfbiedert ralfbiedert Updated to latest jython version (2.7.1b1). 23c6f80
@ralfbiedert ralfbiedert Restored Eclipse files. e1102cf
@ralfbiedert ralfbiedert Added "primitive float" which will help us with the Ani library. 6490706
@ralfbiedert ralfbiedert Added Processing 2.0 sketchFullScreen() functionality. bdfabf6
@ralfbiedert ralfbiedert Start scripts for Mac / Linux and Windows. Windows version needs a fi…
…x for the current path though.
c6ccf7a
@ralfbiedert ralfbiedert Started to work on the launcher feature. 1ae66d9
@ralfbiedert ralfbiedert First working launcher on Mac. 77c0a53
@ralfbiedert ralfbiedert Also copies bundled resources. 34cd3d7
@ralfbiedert ralfbiedert Launcher now also works on Windows. 8292f7f
@ralfbiedert ralfbiedert Added pwd() helper function when data is bundled. 664a9db
@ralfbiedert ralfbiedert Updated the README. 6eb14d2
@ralfbiedert ralfbiedert Fixed download URL ... 18e2616
@ralfbiedert ralfbiedert Also added development launcher scripts / apps. da70347
@ralfbiedert ralfbiedert Updated run script, now works on Windows with spaced paths. 6b205c9
@ralfbiedert ralfbiedert Added JREs to git ignore list. 07d1ccb
@ralfbiedert ralfbiedert Improved zip generation. d39f510
@ralfbiedert ralfbiedert Launcher emits message when no Java was found. 6ce0eaa
@ralfbiedert ralfbiedert Now with splash screen support, since startup is somewhat slow and we…
… should produce output.
6d53221
@ralfbiedert ralfbiedert Updated example, added redirection support. 28342f9
@ralfbiedert ralfbiedert Fixed .bat bug when started from lnk. 1210ba9
@ralfbiedert ralfbiedert Fixed build problems when no JRE present. 4bbb6b3
@ralfbiedert ralfbiedert Updated README. dc5c2f5
@jdf

I wonder if it might be better to create a dir in the temp dir and put the stream files in there.

Sure. Any suggestions?

Owner

What I mean is, instead of

System.setOut(new PrintStream(new FileOutputStream("output.txt")));

create a new directory as explained here and put the output.txt and error.txt files in that directory.

I can do that. However, the problem I'm seeing from a user's perspective is that he will have to search the logs first.

Also, since processing.py will likely start without a terminal when --redirect is used, there is no simple way to tell him where to go, which is sometimes not obvious (e.g., C:\Users\XXX\AppData\Local\Temp...)

Owner

How about creating them as [script].out.txt, [script].err.txt? (In the path of the script)....

Alternative: just within the script folder output.txt, error.txt (since otherwise many script will cause many files, and I could doubt one would like to retain them all)

Third issue: when called from a wrapper (e.g., Mac OS) the script path can't be used because it will be hidden within the .app folder. There we have to pick a few folders above (or something else).

Owner
@jdf

Please change these informational messages to stderr.

@jdf

System.err.println("propsResource:" + propsResource);

and same for libraries, below.

@jdf jdf commented on the diff
README.markdown
((14 lines not shown))
## Quick Start ##
-Download the processing.py distribution.
+Download __[Processing.py All-inclusive](http://s.xr.io/processing.py/latest.zip)__ (Windows & Mac, ~170mb).
@jdf Owner
jdf added a note

Let's change these links to github file download links.

Problem: github disabled uploads / downloads. (https://github.com/blog/1302-goodbye-uploads)

There should be a place to have the binary downloads as well. Do you have a project server or any other place to put them?

@jdf Owner
jdf added a note
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jdf jdf commented on the diff
README.markdown
((25 lines not shown))
- $ java -jar processing-py.jar examples.py/Basics/Math/noisefield.py
@jdf Owner
jdf added a note

I'd love for the intro docs to still contain pointers to some of these demos.

Will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
README.markdown
((146 lines not shown))
- """
@jdf Owner
jdf added a note

Could you restore this stuff?

I very much like what you've done to the README, but I'm wondering if you'd do an edit pass to it now to integrate what you've done with the original project, so that it doesn't look like a fork anymore, but is really a core contribution to the original project. Let me know what you think.

I can rework it. However, since the README is the "main entry point" into the project at the moment I recall that I found it a little confusing when I had my first look. I'll restore and rework a few things and submit it again.

@jdf Owner
jdf added a note

Ah, that's very helpful feedback. Well, don't make it confusing again; do what you think is most helpful for the newcomer, and I can always find a different place to put the heavy verbiage. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jdf jdf commented on the diff
runtime/src/jycessing/core.py
@@ -74,3 +74,10 @@ def __mul__(a, b):
if isinstance(b, RealPVector):
raise TypeError("The * operator can only be used to multiply a PVector by a scalar")
return PVector(a.x * b, a.y * b, a.z * b)
+
+# Extra helper functions go here
+def pwd(name = ""):
+ """Returns the script's path, or the path for some data close to the script."""
+ import java.lang.System as System
+ return System.getProperty("python.main.root") + "/" + name
+
@jdf Owner
jdf added a note

Please add a newline here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jdf
Owner
jdf commented

Maybe add a unit test for the new native float thingy?

@ralfbiedert

Addressed most of the issues (apart from the download links), fixed some other bugs as well.

Also, can you review the 'set' test please? It looks as if the unit test was wrong, at least CPython reports MySet in both cases.

(And the @PythonUsage is merely experimental … might as well remove it, since all of that might be covered by python-unit tests as well)

@jdf jdf was assigned
@jdf jdf merged commit 6de2184 into jdf:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 16, 2013
  1. @ralfbiedert
  2. @ralfbiedert
  3. @ralfbiedert
  4. @ralfbiedert

    Restored Eclipse files.

    ralfbiedert authored
Commits on Feb 18, 2013
  1. @ralfbiedert
Commits on Feb 21, 2013
  1. @ralfbiedert
  2. @ralfbiedert

    Start scripts for Mac / Linux and Windows. Windows version needs a fi…

    ralfbiedert authored
    …x for the current path though.
Commits on Mar 30, 2013
  1. @ralfbiedert
  2. @ralfbiedert
  3. @ralfbiedert
  4. @ralfbiedert
Commits on Mar 31, 2013
  1. @ralfbiedert
  2. @ralfbiedert

    Updated the README.

    ralfbiedert authored
  3. @ralfbiedert

    Fixed download URL ...

    ralfbiedert authored
  4. @ralfbiedert
  5. @ralfbiedert
  6. @ralfbiedert
  7. @ralfbiedert

    Improved zip generation.

    ralfbiedert authored
  8. @ralfbiedert
  9. @ralfbiedert
  10. @ralfbiedert
  11. @ralfbiedert
  12. @ralfbiedert
  13. @ralfbiedert

    Updated README.

    ralfbiedert authored
Commits on Apr 1, 2013
  1. @ralfbiedert

    Fixed logging.

    ralfbiedert authored
    Added PythonUsage annotation to add a little safeguard against refactoring Java code used from Python.
  2. @ralfbiedert

    Fixed "set" test (please check!).

    ralfbiedert authored
    At least on CPython 2.7.3 and CPython 3.3 the type is MySet, not set for the same code.
  3. @ralfbiedert
  4. @ralfbiedert
  5. @ralfbiedert
  6. @ralfbiedert

    Moved method in launcher.

    ralfbiedert authored
  7. @ralfbiedert

    Newlines added.

    ralfbiedert authored
  8. @ralfbiedert

    Fixed noisefield demo.

    ralfbiedert authored
  9. @ralfbiedert

    Updated README.

    ralfbiedert authored
  10. @ralfbiedert
  11. @ralfbiedert

    Fixed some README links.

    ralfbiedert authored
Something went wrong with that request. Please try again.