Skip to content

Commit 7d6321f

Browse files
committed
Switched to linux build environment, use spaces instead of tabs, removed release .zip (inaccessible anyways)
1 parent 82b8275 commit 7d6321f

File tree

4 files changed

+42
-39
lines changed

4 files changed

+42
-39
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/dist/
44
/build.number
55
/generated/*
6+
/release/
67

78
# Java things #
89
*.class
@@ -11,4 +12,4 @@
1112
*.ear
1213

1314
# Other things #
14-
*.bat
15+
*.bat

build.xml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@
22
<project name="ProcessingPythonMode" default="release" basedir="./">
33
<!-- Based on mode template http://github.com/martinleopold/TemplateMode -->
44
<!-- Note: now compiles two separate jars- one for python mode, and one that's a wrapper for the processing core that can run python files -->
5-
5+
66
<!-- You'll want to change these to compile. -->
7-
<property name="processing.base" location="C:\Dev\processing-2.0.2-windows64\processing-2.0.2" /> <!-- The directory that you unpacked Processing into. -->
8-
<property name="processing.sketchfolder" location="C:\Dev\Processing" /> <!-- Your sketchbook folder. -->
9-
<property name="java.target.bootclasspath" location="C:\Program Files\Java\jdk1.6.0_38\jre\lib\rt.jar" /> <!-- If you're using a newer jdk -->
10-
7+
<property name="processing.base" location="/home/james/dev/processing-2.1.1" /> <!-- The directory that you unpacked Processing into. -->
8+
<property name="processing.sketchfolder" location="/home/james/dev/sketchbook" /> <!-- Your sketchbook folder. -->
9+
<property name="java.target.bootclasspath" location="/usr/lib/jvm/java-6-oracle/jre/lib/rt.jar" /> <!-- If you're using a newer jdk -->
10+
1111
<!-- Leave these be. -->
1212
<description>Python Mode for Processing 2.0.</description>
13-
13+
1414
<property name="lib.name" value="PythonMode" />
1515
<property name="wrap.name" value="ProcessingJythonWrapper" />
1616
<property name="release" value="0.1" />
1717
<property name="java.target.version" value="1.6" />
18-
18+
1919
<property name="src" value="src" />
2020
<property name="gen" value="generated" />
2121
<property name="build" value="build" />
2222
<property name="dist" value="dist" />
2323
<property name="releasedir" value="release" />
24-
24+
2525
<property name="lib.path" value="info/sansgills/mode/python" />
2626
<property name="wrap.path" value="info/sansgills/mode/python/wrapper" />
2727
<property name="preproc.path" value="info/sansgills/mode/python/preproc" />
@@ -30,7 +30,7 @@
3030
<fileset dir="${processing.base}/core/library/" > <!-- processing core -->
3131
<include name="*.jar" />
3232
</fileset>
33-
33+
3434
<fileset dir="${processing.base}/lib/" > <!-- pde and ant -->
3535
<include name="*.jar" />
3636
</fileset>
@@ -39,20 +39,20 @@
3939
<include name="*.jar" /> <!-- jython and antlr runtime -->
4040
</fileset>
4141
</path>
42-
42+
4343
<condition property="gen.present">
4444
<available file="${gen}" />
4545
</condition>
46-
46+
4747
<!-- - - - - - - - - - - - - - - - - - - - - - -
4848
GET
4949
- - - - - - - - - - - - - - - - - - - - - - - -->
5050
<target name="get">
5151
<mkdir dir="lib" />
5252
<mkdir dir="tool" />
53-
<get
54-
src="http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7-b1/jython-standalone-2.7-b1.jar"
55-
dest="lib/jython-standalone-2.7-b1.jar"
53+
<get
54+
src="http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7-b1/jython-standalone-2.7-b1.jar"
55+
dest="lib/jython-standalone-2.7-b1.jar"
5656
skipexisting="true"
5757
verbose="true" /> <!-- download latest jython (note: update this if jython updates) -->
5858
<get
@@ -66,9 +66,9 @@
6666
skipexisting="true"
6767
verbose="true" /> <!-- download latest ANTLR compiler (to compile our grammars; not included) -->
6868
</target>
69-
70-
71-
69+
70+
71+
7272
<target name="generate" depends="get" unless="gen.present">
7373
<mkdir dir="${gen}" />
7474
<java jar="tool/antlr-4.1-complete.jar" fork="true">
@@ -79,29 +79,29 @@
7979
<arg value="${basedir}/${src}/${preproc.path}/PyPde.g4" />
8080
</java>
8181
</target>
82-
83-
82+
83+
8484
<!-- - - - - - - - - - - - - - - - - - - - - - -
8585
BUILD
8686
- - - - - - - - - - - - - - - - - - - - - - - -->
8787
<target name="build" depends="get,generate">
8888
<propertyfile file="build.number" /> <!-- create the build.number file if it doesn't exist -->
8989
<buildnumber file="build.number" />
90-
90+
9191
<mkdir dir="${build}" />
92-
92+
9393
<javac destdir="${build}" source="${java.target.version}" target="${java.target.version}" bootclasspath="${java.target.bootclasspath}" includeantruntime="false" debug="true">
9494
<src path="${src}" />
9595
<src path="${gen}" />
9696
<classpath>
9797
<path refid="library-classpath"/>
9898
</classpath>
9999
</javac>
100-
101-
100+
101+
102102
<copy file="${src}/${wrap.path}/prepend.py" tofile="${build}/${wrap.path}/prepend.py" />
103103
<copy file="${src}/${wrap.path}/scrub.py" tofile="${build}/${wrap.path}/scrub.py" />
104-
104+
105105
</target>
106106

107107
<!-- - - - - - - - - - - - - - - - - - - - - - -
@@ -112,21 +112,21 @@
112112
<property name="bundle" value="${dist}/${lib.name}"/>
113113
<mkdir dir="${bundle}" />
114114
<mkdir dir="${bundle}/mode" />
115-
115+
116116
<!-- make mode jar -->
117117
<jar jarfile="${bundle}/mode/${lib.name}.jar" basedir="build" includes="${lib.path}/*.class ${preproc.path}/*.class"/>
118118
<!-- make wrapper jar -->
119119
<jar jarfile="${bundle}/mode/${wrap.name}.jar" basedir="build" includes="${wrap.path}/*"/> <!-- include *.py -->
120-
121-
120+
121+
122122
<copy todir="${bundle}">
123123
<fileset dir="resources/" />
124124
</copy>
125125

126126
<copy todir="${bundle}/mode">
127127
<fileset dir="lib/" />
128128
</copy>
129-
129+
130130
<replaceregexp file="${bundle}/mode.properties" flags="g"
131131
match="@@version@@" replace="${build.number}" />
132132
<replaceregexp file="${bundle}/mode.properties" flags="g"
@@ -158,9 +158,9 @@
158158
<delete dir="${build}" />
159159
<delete dir="${dist}" />
160160
</target>
161-
161+
162162
<target name="cleangen" depends="clean" >
163163
<delete dir="${gen}" />
164164
</target>
165-
165+
166166
</project>

release/PythonMode.zip

-12.1 MB
Binary file not shown.

src/info/sansgills/mode/python/PythonKeyListener.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
import java.util.regex.Pattern;
1212

1313
/**
14-
*
14+
*
1515
* A class to handle smart-indentation and things. Should really use a proper
1616
* python parser, will have to find and/or make one.
17-
*
17+
*
1818
* So, the Editor class uses a homebrewed text editing panel based on the
1919
* primordial goo that was to become JEdit (see jedit.org). That class is
2020
* hardcoded to have a PdeKeyListener managing things; to override stuff, I have
2121
* to override it.
22-
*
22+
*
2323
*/
2424
public class PythonKeyListener extends processing.mode.java.PdeKeyListener {
2525
PythonEditor peditor;
@@ -28,6 +28,8 @@ public class PythonKeyListener extends processing.mode.java.PdeKeyListener {
2828
//ctrl-alt on windows & linux, cmd-alt on os x
2929
private static int CTRL_ALT = ActionEvent.ALT_MASK | Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
3030

31+
private static final String TAB = " ";
32+
3133
public PythonKeyListener(Editor editor, JEditTextArea textarea) {
3234
super(editor, textarea);
3335

@@ -37,9 +39,9 @@ public PythonKeyListener(Editor editor, JEditTextArea textarea) {
3739

3840
/*
3941
* Handles special stuff for Java brace indenting & outdenting, etc.
40-
* Overriding it 'cause we do things different here in python-land
42+
* Overriding it 'cause we do things different here in python-land
4143
* TODO use actual parser; handle spaces
42-
*
44+
*
4345
*/
4446
@Override
4547
public boolean keyPressed(KeyEvent event) {
@@ -69,8 +71,8 @@ public boolean keyPressed(KeyEvent event) {
6971
// handle specific keypresses
7072
switch (c) {
7173

72-
case 9: //tab; may do something here later. NOT overriding with spaces- this is python!
73-
ptextarea.setSelectedText("\t");
74+
case 9: //tab; overriding with spaces
75+
ptextarea.setSelectedText(TAB);
7476
break;
7577

7678
case 10: //return
@@ -111,7 +113,7 @@ String getIndent(int cursor, String text) {
111113
indent = '\n' + f.group();
112114

113115
if (incIndent.matcher(line).find()) {
114-
indent += '\t';
116+
indent += TAB;
115117
}
116118
} else {
117119
indent = "\n";

0 commit comments

Comments
 (0)