Hello,

I was using the Console class to get a more or less clean dump of
exceptions in my embedded scripting engine:

DummyConsole dummy = new DummyConsole();
engine.MyConsole = dummy;
engine.DumpException(nested);

This code is now broken in IronPython RC2...any suggestions on how to
fix this?

Thanks a lot,

Stan.

internal class DummyConsole : IConsole
  {
    private StringBuilder stringBuilder = new StringBuilder();

    public string ReadLine(int autoIndentSize)
    {
      throw new NotImplementedException();
    }

    public void Write(string text, Style style)
    {
      //Console.Out.Write(text, style);
      stringBuilder.Append(text);
    }

    public void WriteLine(string text, Style style)
    {
      //Console.Out.WriteLine(text, style);
      stringBuilder.Append(text);
      stringBuilder.AppendLine();
    }

    internal string FlushBuffer()
    {
      string value = stringBuilder.ToString();
      stringBuilder = new StringBuilder();
      return value;
    }
  }

-- 
-----------------------------------------------------------------
   Stanislas Pinte             e-mail: [EMAIL PROTECTED]
   ERTMS Solutions               http://www.ertmssolutions.com
   Rue de l'Autonomie, 1             Tel:    + 322 - 522.06.63
   1070        Bruxelles              Fax:   + 322 - 522.09.30
-----------------------------------------------------------------
   Skype (http://www.skype.com) id:                  stanpinte
-----------------------------------------------------------------

_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to