/plugins/Console/tags/release-4-3-7/console/commands/python.xml

# · XML · 41 lines · 31 code · 9 blank · 1 comment · 0 complexity · 3101b25743bd49cff01e06952beccc46 MD5 · raw file

  1. <?xml version="1.0" ?>
  2. <!DOCTYPE COMMANDO SYSTEM "commando.dtd">
  3. <COMMANDO>
  4. <UI>
  5. <CAPTION LABEL="Application settings">
  6. <ENTRY LABEL="Script Name" VARNAME="scriptname"
  7. EVAL="buffer.getPath()" />
  8. <ENTRY LABEL="Application parameters" VARNAME="args" />
  9. </CAPTION>
  10. </UI>
  11. <COMMANDS>
  12. <!-- Change to dir of current open buffer -->
  13. <COMMAND SHELL="System" CONFIRM="FALSE">
  14. fSep = java.lang.System.getProperties().getProperty("file.separator");
  15. buf = new StringBuffer("cd ");
  16. buf.append(buffer.getPath().substring(0, buffer.getPath().lastIndexOf(fSep)));
  17. buf.append(fSep);
  18. buf.toString();
  19. </COMMAND>
  20. <COMMAND SHELL="System" CONFIRM="FALSE">
  21. buf = new StringBuffer();
  22. buf.append("python " + scriptname);
  23. if(!args.equals(""))
  24. {
  25. buf.append(' ');
  26. buf.append(args);
  27. }
  28. // return value
  29. buf.toString();
  30. </COMMAND>
  31. </COMMANDS>
  32. </COMMANDO>