* Makefile.am:
[monodevelop.git] / extras / PythonBinding / PythonExecutionManager.cs
blob70996ca003eaf7c5ad0b900bab723f6788dd564e
1 using System;
2 using System.IO;
3 using System.Diagnostics;
4 using System.Collections;
5 using System.Reflection;
6 using System.Xml;
7 using System.CodeDom.Compiler;
8 using Gtk;
10 using MonoDevelop.Projects;
11 using MonoDevelop.Core.Gui;
12 using MonoDevelop.Core;
13 using MonoDevelop.Core;
15 namespace PythonBinding
17 public class PythonExecutionManager
19 public void Execute (string filename, bool debug)
21 ProcessStartInfo psi = new ProcessStartInfo ("IronPythonConsole", filename);
22 psi.WorkingDirectory = Path.GetDirectoryName (filename);
23 psi.UseShellExecute = false;
26 public void Execute(IProject project, bool debug)
28 //PythonCompilerParameters parameters = (PythonCompilerParameters) project.ActiveConfiguration;
29 //FileUtilityService fileUtilityService = (FileUtilityService) ServiceManager.GetService (typeof (FileUtilityService));
31 string files = "";
33 foreach (ProjectFile finfo in project.ProjectFiles) {
34 if (finfo.Subtype != Subtype.Directory) {
35 switch (finfo.BuildAction) {
36 case BuildAction.Compile:
37 files += String.Format ("{0} ", finfo.Name);
38 break;
42 Console.WriteLine (files);
44 string fullCommand = String.Format ("-e \"IronPythonConsole {0};read -p 'press any key to continue...' -n1\"", files);
45 ProcessStartInfo psi = new ProcessStartInfo ("xterm", fullCommand);
46 //psi.WorkingDirectory = Path.GetDirectoryName (exe);
47 psi.UseShellExecute = false;
48 Process p = Process.Start (psi);
49 p.WaitForExit ();