buildframework/helium/sf/java/antlint/src/com/nokia/helium/antlint/ant/types/AbstractScriptCheck.java
equal
deleted
inserted
replaced
16 */ |
16 */ |
17 package com.nokia.helium.antlint.ant.types; |
17 package com.nokia.helium.antlint.ant.types; |
18 |
18 |
19 import java.io.File; |
19 import java.io.File; |
20 import java.io.FileOutputStream; |
20 import java.io.FileOutputStream; |
|
21 import java.io.IOException; |
21 import java.io.PrintWriter; |
22 import java.io.PrintWriter; |
22 import java.util.ArrayList; |
23 import java.util.ArrayList; |
23 import java.util.regex.Matcher; |
24 import java.util.regex.Matcher; |
24 import java.util.regex.Pattern; |
25 import java.util.regex.Pattern; |
25 import java.io.IOException; |
|
26 |
26 |
27 import org.apache.tools.ant.BuildException; |
27 import org.apache.tools.ant.BuildException; |
28 |
28 |
29 /** |
29 /** |
30 * <code>AbstractScriptCheck</code> is an abstract implementation of |
30 * <code>AbstractScriptCheck</code> is an abstract implementation of |
73 PrintWriter output2 = new PrintWriter(new FileOutputStream( |
73 PrintWriter output2 = new PrintWriter(new FileOutputStream( |
74 file2, true)); |
74 file2, true)); |
75 output2.write("try:\n"); |
75 output2.write("try:\n"); |
76 for (String line : text.split("\n")) { |
76 for (String line : text.split("\n")) { |
77 if (line.trim().startsWith("import ") |
77 if (line.trim().startsWith("import ") |
78 || line.trim().startsWith("from ")) |
78 || line.trim().startsWith("from ")) { |
79 output2.write(" " + line + "\n"); |
79 output2.write(" " + line + "\n"); |
|
80 } |
80 } |
81 } |
81 |
82 |
82 output2.write("except ImportError, e:\n"); |
83 output2.write("except ImportError, e:\n"); |
83 output2.write(" print '" + name + " failed: ' + str(e)\n"); |
84 output2.write(" print '" + name + " failed: ' + str(e)\n"); |
84 output2.close(); |
85 output2.close(); |