~ubuntu-branches/ubuntu/feisty/monodevelop/feisty

« back to all changes in this revision

Viewing changes to Extras/PythonBinding/PythonExecutionManager.cs

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2006-08-18 00:51:23 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060818005123-5iit07y0j7wjg55f
Tags: 0.11+svn20060818-0ubuntu1
* New SVN snapshot
  + Works with Gtk# 2.9.0
* debian/control:
  + Updated Build-Depends
* debian/patches/use_nunit2.2.dpatch,
  debian/patches/use_real_libs.dpatch:
  + Updated
* debian/patches/versioncontrol_buildfix.dpatch:
  + Fix build failure in the version control addin

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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;
 
9
 
 
10
using MonoDevelop.Projects;
 
11
using MonoDevelop.Core.Gui;
 
12
using MonoDevelop.Core;
 
13
using MonoDevelop.Core;
 
14
 
 
15
namespace PythonBinding
 
16
{
 
17
        public class PythonExecutionManager
 
18
        {
 
19
                public void Execute (string filename, bool debug)
 
20
                {
 
21
                        ProcessStartInfo psi = new ProcessStartInfo ("IronPythonConsole", filename);
 
22
                        psi.WorkingDirectory = Path.GetDirectoryName (filename);
 
23
                        psi.UseShellExecute = false;
 
24
                }
 
25
                
 
26
                public void Execute(IProject project, bool debug)
 
27
                {
 
28
                        //PythonCompilerParameters parameters = (PythonCompilerParameters) project.ActiveConfiguration;
 
29
                        //FileUtilityService fileUtilityService = (FileUtilityService) ServiceManager.GetService (typeof (FileUtilityService));
 
30
        
 
31
                        string files = "";
 
32
 
 
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;
 
39
                                        }
 
40
                                }
 
41
                        }
 
42
                        Console.WriteLine (files);
 
43
 
 
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 ();
 
50
                }
 
51
        }
 
52
}