Changeset 11215
- Timestamp:
- 07/06/10 08:44:50 (2 months ago)
- Location:
- jsystemFramework/trunk/systemObjects/core/scriptingLanguages
- Files:
-
- 2 modified
-
.classpath (modified) (1 diff)
-
src/jsystem/sysobj/scripting/python/PyShell.java (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jsystemFramework/trunk/systemObjects/core/scriptingLanguages/.classpath
r10664 r11215 11 11 <classpathentry kind="lib" path="/runner/thirdparty/commonLib/qdox.jar"/> 12 12 <classpathentry kind="lib" path="/runner/thirdparty/commonLib/mail-1.4.1.jar"/> 13 <classpathentry kind="lib" path="/runner/lib/stations.jar" sourcepath="/runner/lib/stations_src.zip"/> 13 14 <classpathentry kind="output" path="classes"/> 14 15 </classpath> -
jsystemFramework/trunk/systemObjects/core/scriptingLanguages/src/jsystem/sysobj/scripting/python/PyShell.java
r11210 r11215 1 1 package jsystem.sysobj.scripting.python; 2 2 3 import jsystem.extensions.analyzers.text.TextNotFound;4 3 import jsystem.framework.system.SystemObjectImpl; 5 4 import systemobject.terminal.Prompt; … … 9 8 import com.aqua.sysobj.conn.CliApplication; 10 9 import com.aqua.sysobj.conn.CliCommand; 11 import com.aqua.sysobj.conn.Cli Factory;10 import com.aqua.sysobj.conn.CliConnection; 12 11 13 12 public class PyShell extends SystemObjectImpl { … … 15 14 private StationDefaultImpl station; 16 15 private CliApplication cliApplication; 16 private CliConnection cliConnection; 17 17 18 private String host;19 private int port;18 private String worstation; 19 private String os; 20 20 private String user; 21 21 private String password; 22 23 private StringBuffer logFileS = null; 22 24 23 25 public void init() throws Exception { … … 31 33 pyPrompts[0].setCommandEnd(true); 32 34 33 station = StationsFactory.createStation(getHost(), CliFactory.OPERATING_SYSTEM_WINDOWS, "telnet", getUser(), getPassword(), null); 35 36 station = StationsFactory.createStation(getWorstation(), getOs(), "telnet", getUser(), getPassword(), null); 34 37 station.init(); 35 38 cliApplication = station.getCliSession(false); 39 cliConnection = cliApplication.getConnectivityManager().getCli(); 40 41 logFileS = new StringBuffer(); 36 42 37 43 } 38 44 45 @Override 46 public void close() { 47 station.close(); 48 super.close(); 49 } 50 39 51 public void handleCliCommand(String command) throws Exception { 40 cliApplication.handleCliCommand(command, new CliCommand(command)); 41 cliApplication.analyze(new TextNotFound("Error")); 52 logFileS.append(command + "\r"); 53 CliCommand cmd = new CliCommand(command); 54 cmd.addErrors("Error"); 55 cliConnection.handleCliCommand(command, cmd); 42 56 } 43 57 44 public void handleCliCommandWithoutWait(String title, String command) throws Exception { 45 // report.startLevel(title, Reporter.CurrentPlace); 46 // telnet.WriteLine(command); 47 // Thread.sleep(200); 48 // String result = telnet.Read(""); 49 // setTestAgainstObject(result); 50 // report.stopLevel(); 58 public void handleCliCommandWithoutWait(String command) throws Exception { 59 logFileS.append(command + "\n\r"); 60 cliConnection.sendString(command, false); 51 61 } 52 62 … … 67 77 } 68 78 69 public String get Host() {70 return host;79 public String getWorstation() { 80 return worstation; 71 81 } 72 82 73 public void set Host(String host) {74 this. host = host;83 public void setWorstation(String worstation) { 84 this.worstation = worstation; 75 85 } 76 86 77 public int getPort() {78 return port;87 public String getOs() { 88 return os; 79 89 } 80 90 81 public void set Port(int port) {82 this. port = port;91 public void setOs(String os) { 92 this.os = os; 83 93 } 84 85 94 95 public StringBuffer getLogFileS() { 96 return logFileS; 97 } 98 86 99 }
