Re: [IronPython] Newbie questions. . .

2008-01-06 Thread Martin Maly
Some of the samples have prerequisites. I believe the DirectX tutorial comes 
with a great readme (readme.html) that should get you going.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Keith Hoard
Sent: Sunday, January 06, 2008 11:56 AM
To: IronPython Mailing List
Subject: [IronPython] Newbie questions. . .

I have a few questions about getting up and running with IronPython.

I have downloaded and installed ipy.exe to the D:\IronPython directory.  I have 
also added this directory to the Path environment varialble.  However, when I 
try to run the examples (In this case  tutorial.py) from the web site, I get 
the following error:


Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

D:\IronPythonipy tutorial.py
Traceback (most recent call last):
File D:\IronPython\tutorial.py, line 19, in Initialize
File , line 0, in AddReferenceByPartialName##12
IOError: Could not add reference to assembly Microsoft.DirectX

When I try to run the other samples, I get similar errors.  Is there another 
environment variable that I'm supposed to set so that IPy can find the .NET 
libraries?  Also, if there is some documentation that I missed, I was hoping 
that someone could point me in the right direction.

Thanks in advance for any help. . .


___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Parser is not accessible anymore in IP2A6

2007-11-30 Thread Martin Maly
Hi David,

This is actually a bug in the DLR code. What is happening, and what made your 
brain hurt, was the code which creates instructions for DLR how to do a given 
operation, in this case how to call the CreateParser method. Since it is not a 
public method, we have to invoke it through reflection. And because it is a 
static method, the instance must be null. Here's where the problem lies. The 
null at execution time is expressed via Ast.Null() expression node at code 
generation time. So to fix this on your machine, you can replace line 156 in 
MethodTarget.cs which reads:

Expression instance = mi.IsStatic ? null : 
_instanceBuilder.ToExpression(context, parameters);

With:

Expression instance = mi.IsStatic ? Ast.Null() : 
_instanceBuilder.ToExpression(context, parameters);

I'll check the fix soon (after due testing) so it should be on codeplex in 
matter of days and also in the next release.

Thanks for a great repro!

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Wednesday, November 28, 2007 1:46 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Parser is not accessible anymore in IP2A6

 Yes, Parser being internal definitely causes the error. It is a good
 question whether it is a permanent change because there are pros and
 cons going both ways. Let me open a bug on this since it is
 something we need to make decision on. In the meantime, as a
 temporary workaround (emphasizing the temporary workaround) you can
 use -X:PrivateBinding flag with IronPython to get access to the
 internal/private classes.

 The bug I opened is here:

 http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14105

 Feel free to vote/comment on it and also keep an eye on it for the
 ultimate resolution.

 Thanks for the feedback!
 Martin


Well - that SHOULD work - but does not.  If you take the following example
program:

import clr

clr.AddReference('IronPython')
clr.AddReference('Microsoft.Scripting')

from System.Text import Encoding
import IronPython
import Microsoft.Scripting

path = PythonParserTest.py
pe = IronPython.Hosting.PythonEngine.CurrentEngine
enc = Encoding.Default
s = Microsoft.Scripting.Hosting.SourceUnit.CreateFileUnit(pe, path, enc)
c = Microsoft.Scripting.CompilerContext(s)

p = IronPython.Compiler.Parser.CreateParser(c,
IronPython.PythonEngineOptions())

ast = p.ParseFile(True)

print all done

save it as PythonParserTest.py and run it you get this:

ipy -X:PrivateBinding -X:ExceptionDetail PythonParserTest.py
Value cannot be null.
Parameter name: expression
   at Microsoft.Scripting.Ast.Ast.ConvertHelper(Expression expression,
Type type
)
   at
Microsoft.Scripting.Generation.MethodTarget.MakeExpression(ActionBinder bi
nder, StandardRule rule, Expression[] parameters)
   at
Microsoft.Scripting.Generation.MethodTarget.MakeExpression(ActionBinder bi
nder, StandardRule rule, Expression[] parameters, Type[] knownTypes)
   at
Microsoft.Scripting.Actions.CallBinderHelper`2.MakeMethodBaseRule(MethodBa
se[] targets)
   at Microsoft.Scripting.Actions.CallBinderHelper`2.MakeRule()
   at IronPython.Runtime.Types.BuiltinFunction.MakeCallRule[T](CallAction
action
, CodeContext context, Object[] args)
   at
IronPython.Runtime.Types.BuiltinFunction.Microsoft.Scripting.IDynamicObjec
t.GetRule[T](DynamicAction action, CodeContext context, Object[] args)
   at
Microsoft.Scripting.Actions.ActionBinder.UpdateSiteAndExecute[T](CodeConte
xt callerContext, DynamicAction action, Object[] args, Object site, T
target, R
uleSet`1 rules)
   at
Microsoft.Scripting.Actions.FastDynamicSite`4.UpdateBindingAndInvoke(T0 ar
g0, T1 arg1, T2 arg2)
   at
Microsoft.Scripting.Actions.DynamicSiteHelpers.UninitializedTargetHelper`7
.FastInvoke3(FastDynamicSite`4 site, T0 arg0, T1 arg1, T2 arg2)
   at Microsoft.Scripting.Actions.FastDynamicSite`4.Invoke(T0 arg0, T1
arg1, T2
arg2)
   at __main__$mod_1.Initialize(CodeContext ) in PythonParserTest.py:line
16
   at Microsoft.Scripting.ScriptCode.Run(CodeContext codeContext, Boolean
tryEva
luate)
   at Microsoft.Scripting.ScriptModule.Execute()
   at IronPython.Hosting.PythonCommandLine.RunFileWorker(String fileName)
   at IronPython.Hosting.PythonCommandLine.RunFile(String filename)

if you make your own version of IronPython 2A6 with Parser set to public
rather
than internal, then the above example works.  The problem appears to be in
MethodTarget.cs
around line 150 or so:

// Private binding, invoke via reflection
if (mi != null) {
Expression instance = mi.IsStatic ? null :
_instanceBuilder.ToExpression(context, parameters);
call = Ast.Call(
Ast.RuntimeConstant(mi),
typeof(MethodInfo).GetMethod(Invoke, new Type[]
{ typeof(object), typeof(object[]) }),
Ast.ConvertHelper(instance, typeof(object)),

Re: [IronPython] Parser is not accessible anymore in IP2A6

2007-11-27 Thread Martin Maly
Yes, Parser being internal definitely causes the error. It is a good question 
whether it is a permanent change because there are pros and cons going both 
ways. Let me open a bug on this since it is something we need to make decision 
on. In the meantime, as a temporary workaround (emphasizing the temporary 
workaround) you can use -X:PrivateBinding flag with IronPython to get access to 
the internal/private classes.

The bug I opened is here:

http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=14105

Feel free to vote/comment on it and also keep an eye on it for the ultimate 
resolution.

Thanks for the feedback!
Martin


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, November 27, 2007 1:19 PM
To: Discussion of IronPython
Subject: [IronPython] Parser is not accessible anymore in IP2A6

Hello,

The example at www.ironpython.info 'The IronPython 2 Parser' does not seem
to work anymore with IP2A6...fails with a NameError: name 'Parser' is not
defined.  I think it fails because Parser is now 'internal'?  The question
I have is: Is this a permanent change - or is there another way to parse
and then have access to the ast?

Thanks,

David
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Bug report

2007-10-01 Thread Martin Maly
I don't believe it is a bug. Notice that when you appended C:\\bin, you used 
double  back-slash \\, but when appending the C:\Windows\Bin you only used 
single backslash. Python standard then says:

Unlike Standard C, all unrecognized escape sequences are left in the string 
unchanged, i.e., the backslash is left in the string.

Therefore, the firs backslash \w is left in the string, but the 2nd one (\b) 
is replaced because it is a valid escape sequence (backspace).

You can use either rC:\windows\bin or C:\\windows\\bin to achieve what you 
need.

Martin

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ???
Sent: Monday, July 16, 2007 12:38 AM
To: Dino Viehland; 'Discussion of IronPython'
Subject: [IronPython] Bug report

Hi Dino,  I met a IronPython bug, does this bug has been reported?

 IronPython 1.1 (1.1) on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. 
All rights reserved.
 import sys
 sys.path.append(c:\\bin)
 sys.path
['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin']
 sys.path.append(c:\windows)
 sys.path
['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', 
'c:\\windows']
 sys.path.append(c:\windows\bin)
 sys.path
['D:\\Python\\IronPython', 'D:\\Python\\IronPython\\Lib', 'c:\\bin', 
'c:\\windows', 'c:\\windows\x08in']



Andy.Tao
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] DLR Documentation?

2007-09-24 Thread Martin Maly
There is a MSDN article that very recently got published in October 2007 issue 
of MSDN magazine that can also help fill in some gaps:

http://msdn.microsoft.com/msdnmag/issues/07/10/CLRInsideOut/default.aspx

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dino Viehland
Sent: Monday, September 24, 2007 8:57 AM
To: Discussion of IronPython
Subject: Re: [IronPython] DLR Documentation?

Unfortunately we don't have any great sources of documentation.  The way you do 
any dynamic invocation is usually through a DynamicSite - which is the fastest 
way to do it.  There's also another way you could do this which is via 
ScriptEngine.CallObject - which is the simplest way to do it.  Ultimately we're 
still working on what the end story is for what the best way for doing these 
operations still from static languages.

So let's look at these two ways.  First we have the DynamicSite.  There's a 
couple of different forms of DynamicSite's but we'll keep things simple and 
look at the normal one.  You create a dynamic site like so:

DynamicSiteobject, object, object ds = 
DynamicSiteobject,object,object.Create(CallAction.Simple);

This creates a DynamicSite which takes 2 parameters (typed to object) and 
returns a parameter typed to object.  The DynamicSite will attempt to perform a 
call operation on the 1st argument passing it the 2nd argument and returning 
the result.

So then to invoke a site we'd do:

object res = ds.Invoke(codeContext, callableObject, parameter);

The one problem here is where do you get a CodeContext object from?  My best 
advice to you now is if you're using IronPython objects just use 
IronPython.Runtime.Calls.DefaultContext.Default which is still public.  Again 
we're still working on this part of the story :).

So that will let you call something but one thing which is noticeably missing 
is that we never got Foo.  That can be done with a GetMemberAction, so we get 
another site:

DynamicSiteobject, object gmSite = DynamicSiteobject, 
object.Create(GetMemberAction.Make(Foo));


Now we combine the two:

object res = ds.Invoke(DefaultContext.Default, gmSite.Invoke(obj), parameter);

and now we've gotten the Foo member and invoked it.  Now the great thing about 
this is that this one code path will do what you want - it will work w/ a C# 
object, it will work w/ an IronPython object, and it'll work w/ a Ruby object.

Doing this via ScriptEngine is basically the same thing - except for using 
site's were calling the SE's methods.  So that becomes

object callable;
If(se.TryGetObjectMemberVariable(obj, Foo,out callable)) {
res = se.CallObject(callable, parameter);
}

Hopefully that will get you started.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lee Culver
Sent: Sunday, September 23, 2007 10:37 PM
To: Discussion of IronPython
Subject: Re: [IronPython] DLR Documentation?

I should have been more specific here.  I *am* interested in general DLR 
information, but specifically there is a problem I am trying to solve, and I'm 
wondering if anyone has some advice on this:

I'd like to write a C# wrapper function which dynamically calls a method of a 
class.  For a general method in the .Net library I would do something like this 
(where obj is an object):

Type t = obj.GetType();
MethodInfo mi = t.GetMethod(Foo);
result = mi.Invoke(obj, parameters);

(Just hacked this together, might be errors there).  What I'd like to do is 
have a second code path so my function could also handle objects from the DLR 
itself.  Is there a way of doing this for objects based on the DLR (e.g. 
IronPython 2.0)?  How do you check if a general object is a DLR object?

My goal is to create a function which will call Foo on the given object given 
no matter if the object is a C# object, an IronRuby object, IronPython object, 
etc.

Thanks,
-Lee

From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Lee Culver [EMAIL 
PROTECTED]
Sent: Saturday, September 22, 2007 10:35 AM
To: Discussion of IronPython
Subject: [IronPython] DLR Documentation?

I took some time to play with IronPython 2.0 this weekend, and I see that the 
DLR is included with it.  I'm interested playing with some of the interface and 
looking to see how new languages might be implemented on the DLR.  Obviously I 
could dig through the source (and I have been), but I was wondering if there is 
any documentation available on using the DLR?  (I understand that it would be 
subject to change at any time, being early in development and all.)

Thanks,
-Lee
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Re: [IronPython] Status of Nested Yield Support?

2007-09-09 Thread Martin Maly
Nested yields (a.k.a. yields occurring in a more than one nested try blocks) 
are supported in IronPython 2.0 alpha releases.

Martin


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of M. David Peterson
Sent: Saturday, September 08, 2007 10:35 PM
To: Discussion of IronPython
Cc: [EMAIL PROTECTED]
Subject: [IronPython] Status of Nested Yield Support?

As per the source of the issue mentioned in my previous post[1] my ultimate 
goal was to gain a deeper understanding of where things stood in regards to 
gaining support for nested yield statements and, as a result, a better idea of 
where things stand with gaining the ability to run Kamaelia and Kamaelia-based 
applications via IronPython.

Can someone (Dino?) @ MSFT provide a quick status update?

Thanks in advance! :D

[1] 
http://lists.ironpython.com/pipermail/users-ironpython.com/2007-September/005530.html

--
/M:D

M. David Peterson
http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | 
http://dev.aol.com/blog/3155
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] [Kamaelia-list] Status of Nested Yield Support?

2007-09-09 Thread Martin Maly
Alpha 3 (and I am pretty sure even Alpha 2) include the nested yields 
implementation.

Martin

From: M. David Peterson [mailto:[EMAIL PROTECTED]
Sent: Sunday, September 09, 2007 9:46 AM
To: Martin Maly
Cc: Discussion of IronPython; [EMAIL PROTECTED]
Subject: Re: [Kamaelia-list] [IronPython] Status of Nested Yield Support?

Hi Martin,
On 9/9/07, Martin Maly [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote:

Nested yields (a.k.a. yields occurring in a more than one nested try blocks) 
are supported in IronPython 2.0 alpha releases.
Nice!  I just ran a quick test and verified things are now working as they 
should be.

Did this make it into the alpha 3 release or is this new to alpha 4?  To be 
honest, I didn't check when a3 came out as Dino had mentioned he didn't think 
it would make into that release.  Guess I should have checked, but regardless, 
thanks for getting this handled so quickly!  *VERY* much appreciated!

--
/M:D

M. David Peterson
http://mdavid.name | http://www.oreillynet.com/pub/au/2354 | 
http://dev.aol.com/blog/3155
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Unused files

2007-09-06 Thread Martin Maly
Thanks for the report, Seo. Some of the files you reported are actually alredy 
gone, but the DictionaryEnumerators are still there. We moved them elsewhere in 
the tree and apparently didn't delete them from the old location.

The change will go through soon.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Thursday, September 06, 2007 2:04 AM
To: Discussion of IronPython
Subject: [IronPython] Unused files

Please consider removing following unused files from the repository so
that they don't appear in the source code download.

Microsoft.Scripting/Ast/TryFinallyStatement.cs
Microsoft.Scripting/CheckedDictionaryEnumerator.cs
Microsoft.Scripting/DictionaryUnionEnumerator.cs
Microsoft.Scripting/Publisher.cs
Microsoft.Scripting/Utils.cs
Microsoft.Scripting/WeakHash.cs

I know, they are already removed from the project file, but some
people (including myself) prefer to use filesystem rather than XML
file for the view of the project.

--
Seo Sanghyeon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Console history

2007-06-20 Thread Martin Maly
The behavior in your point 4. (the line stays) is modeled after the behavior of 
the Windows command line..

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Tuesday, June 19, 2007 7:47 PM
To: Discussion of IronPython
Subject: [IronPython] Console history

This is my pet peeve. This applies to both 1.1 and 2.0a1.

1. Run ipy.exe with -X:TabCompletion.
2. Execute a line. (Let's say a = 1.)
3. Press up arrow. (The last line appears.)
4. Press down arrow. (The line stays.)

What I want:

4. The line disappears.

Otherwise, you're forced to delete the entire line, when you thought
you'd edit one of the line in history, and changed your mind. The idea
is that down arrow should reverse the any effect up arrow had.

This is the case for any readline-based systems like Linux bash shell
and CPython installs on Unix. This is not the case for Windows cmd.exe
and CPython installs on Windows though.

--
Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Passing a reference to a string

2007-06-19 Thread Martin Maly
The output value of the ref parameter will be returned in the return value:

r.cs:

public class C{
public static string M(ref string s) {
string old = s;
s = new string;
return old;
}
}

D:\Merlin1\Main\Bin\Debugcsc /t:library r.cs
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.42
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.


D:\Merlin1\Main\Bin\Debugipy.exe
IronPython console: IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.832
Copyright (c) Microsoft Corporation. All rights reserved.
 import clr
 clr.AddReference(r.dll)
 import C
 C.M(old string)
('old string', 'new string')



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of John Barham
Sent: Tuesday, June 19, 2007 10:10 AM
To: users@lists.ironpython.com
Subject: [IronPython] Passing a reference to a string

I'm trying to call a C# method from IP that takes a reference to a
string as one of its parameters.  I'm passing it a System.String()
object, but the string is not changed after I call the method.  I know
that CPython (and presumably IP) strings are immutable so how do I get
C# to change the string object that I pass in?

Thanks,

  John
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Hello world?

2007-06-14 Thread Martin Maly
I think the best available resource is in the documentation which is part of 
the 2.0 Alpha release. Right off the root of the documentation there is a big 
Hosting article which provides very good overview and may answer most of your 
questions.

http://www.codeplex.com/IronPython/Release/ProjectReleases.aspx?ReleaseId=438

Hope this helps
Martin

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dennis Drew
Sent: Thursday, June 14, 2007 3:00 PM
To: users@lists.ironpython.com
Cc: 'Kurt Kiefer'
Subject: [IronPython] Hello world?

We have been using IP 1.1 and just tried 2.x. We ran into a bunch of changes 
and are kindof clueless about were to find a guide to fix things. Like:

using IronPython.Runtime.Exceptions;
using IronPython.Runtime.Operations;

doesn't work and we have no idea how to fix. Is there ad step by step list of 
the changes and reasons and what to do kind of thing anywhere?

Thanks,

Dennis A. Drew
805.560.0404 Ext. 105
[EMAIL PROTECTED]
Director of Software Engineering
Multiprobe Corporation
819 Reddick Street
Santa Barbara, CA 93103
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] WPF objects not available?

2007-06-12 Thread Martin Maly
You need to add references to the WPF assemblies from IronPython. There's a 
section on how to use WPF from IronPython in the tutorial which is part of the 
distribution.

The code you need is roughly (emphasizing roughly, because from module import 
* is best avoided for possible name clashes)

import clr

clr.AddReferenceByPartialName(PresentationCore)
clr.AddReferenceByPartialName(PresentationFramework)
clr.AddReferenceByPartialName(WindowsBase)
clr.AddReferenceByPartialName(IronPython)
clr.AddReferenceByPartialName(Microsoft.Scripting)

from math import *
from System import *
from System.Windows import *
from System.Windows.Media import *
from System.Windows.Media.Animation import *
from System.Windows.Controls import *
from System.Windows.Shapes import *

Martin


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of mike arty
Sent: Tuesday, June 12, 2007 12:45 PM
To: users@lists.ironpython.com
Subject: [IronPython] WPF objects not available?

This question may be off-topic. I'm using IronPython to work w/Net. I recently 
installed the .Net 3.0 framework and the C# SDK, but the only object I have 
available in System.Windows is Forms. I'm not seeing any of the new WPF 
modules, .Media, etc...

Any ideas? WPF is included w/the .Net 3.0 install from the MSDN web site right?

Input greatly appreciated!

-mike
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Command line

2007-06-12 Thread Martin Maly
That seems correct. If I read your message correctly, when you run the .py file 
directly and rely on the file association, the python file name will get passed 
to the ipy.exe as full path. It is consistent with what I am seeing with simple 
test using notepad:

If, from command line I start x.txt, notepad will launch with the command 
line:

C:\WINDOWS\system32\NOTEPAD.EXE D:\Dev\Gen\bin\Debug\x.txt

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Iain
Sent: Tuesday, June 12, 2007 9:18 PM
To: Discussion of IronPython
Subject: [IronPython] Command line

If I associate ipy.exe with *.py files then run the IronPython files
directory I am not seeing any command line argument that I try to pass
in to the script.

I have a file called cmdline_test.py with the following two lines,
import System
print System.Environment.CommandLine

If I run C:\Program Files\IronPython\ipy.exe cmdline_test.py test I
will get
C:\Program Files\IronPython\ipy.exe cmdline_test.py test

If I run cmdline_test.py test I then get
C:\Program Files\IronPython\ipy.exe  C:\Scripts\cmdline_test.py

Is this the expected behavior?

Thanks

Iain.
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Implicit line joining error of PythonEngine

2007-06-10 Thread Martin Maly
The implicit line joining doesn't work across calls to Execute. The Execute 
expects a complete statement.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HEMMI, Shigeru
Sent: Sunday, June 10, 2007 4:40 AM
To: Discussion of IronPython
Subject: [IronPython] Implicit line joining error of PythonEngine

Hello all,

I am using IronPython 1.1
I encounterd an error in implicit  line joining of PythonEngine.
The source is

lines = ['x = [1,2,3,',  '4]']
from IronPython.Hosting import PythonEngine
engine = PythonEngine()
for line in lines:
engine.Execute(line)


Thanks.
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] __doc__ on None

2007-06-07 Thread Martin Maly
Thanks for yet another bug report, we now have it on codeplex as:

http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=10823

As Shri already said earlier, we are focusing most of our energy on the 2.0 
development, but will address important blocking issues that are found in 
IronPython 1.1. We have moved all issues tracked on CodePlex over to target the 
2.0 release, however if we did accidentally moved a serious blocking issue, 
please let us know so that we can track the important bugs that need to be 
fixed in the 1.1 release.

Thanks!
Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
Sent: Monday, June 04, 2007 8:46 AM
To: Discussion of IronPython
Subject: [IronPython] __doc__ on None

Hello all,

More fun with None:

CPython 2.4.4:
  print None.__doc__
None

IP 1.1:
  print None.__doc__
T.__new__(S, ...) - a new object with type S, a subtype of T

This is again confusing our auto-documentation tool. :-)

By the way - can any of 'the team' answer the question as to whether the
1.1 branch is still being developed? (Bugfixes being backported?)

Thanks

Michael Foord

--
Michael Foord
Resolver Systems
[EMAIL PROTECTED]

Office address: 17a Clerkenwell Road, London EC1M 5RD, UK
Registered address: 843 Finchley Road, London NW11 8NA, UK

Resolver Systems Limited is registered in England and Wales as company number 
5467329.
VAT No. GB 893 5643 79

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Sockets and Standard Library Modules in IronPython

2007-06-07 Thread Martin Maly
We are tracking the plea on codeplex:

http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=10825

Thanks!
Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fuzzyman
Sent: Tuesday, June 05, 2007 3:11 AM
To: Discussion of IronPython
Subject: [IronPython] Sockets and Standard Library Modules in IronPython

Hello all,

A plea to 'the team'. urllib and urllib2 are Python standard libraries
modules that provide a high level interface to accessing internet
resources. They are widely used.

These modules are broken for the official IronPython distribution, but
they work with FePy thanks to patches that Seo has applied.

Seo says that the IronPython support for Python sockets has improved
greatly in IronPython 1.1 - but unfortunately not to the point where
these modules functions.

This is a request for these issues to be addressed as soon as possible. :-)


Many Thanks


Michael Foord
http://www.voidspace.org.uk/ironpython/index.shtml
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython and Visual Studio Shell

2007-06-06 Thread Martin Maly
The ASP.NET Futures includes the VS integration for IP based on IronPython 2.0

http://www.microsoft.com/downloads/details.aspx?FamilyId=9323777E-FE78-430C-AD92-D5BE5B5EAD98displaylang=en

Martin

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mohamed A. Meligy
Sent: Wednesday, June 06, 2007 1:05 PM
To: Discussion of IronPython
Subject: Re: [IronPython] IronPython and Visual Studio Shell

I knew earlier it's not possible to have the same thing with IronPython 2.0, 
for 1.1, that's already included as VS SDK sample.
Any ideas ??


On 6/6/07, M. David Peterson [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] 
wrote:
FYI  via http://msdn2.microsoft.com/en-us/vstudio/bb510103.aspx
Visual Studio Shell (integrated mode)

Optimized for Programming Languages

Applications built on the integrated Shell will automatically merge with any 
other editions of Visual Studio installed on the same machine.

This is the Visual Studio Shell (integrated mode) running Iron Python.

http://msdn2.microsoft.com/en-us/vstudio/bb510103.vss_IronPython_large.jpg

--
/M:D

M. David Peterson
http://mdavid.namehttp://mdavid.name/ | http://www.oreillynet.com/pub/au/2354 
| http://dev.aol.com/blog/3155
___
users mailing list
users@lists.ironpython.commailto:users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



--
Regards,

Mohamed Ahmed Meligy
Senior Software Engineer
Silver Key ( www.SilverKey.ushttp://www.SilverKey.us) - Egypt Branch

E-mail: Eng.Meligy (AT) Gmail.comhttp://Gmail.com (NO SPAM PLEASE)
Weblog: http://GeeksWithBlogs.NET/Mohamed
Mobile: +20 10 603 3013
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Lambdas, properties and namespace leakage

2007-06-01 Thread Martin Maly
Thanks for a fun bug, Michael, just to clarify, this is using the IronPython 
1.1 release, correct?

If it is of any consolation, this is the output from the IronPython 2.0 alpha 
where this no longer happens:

IronPython console: IronPython 2.0 (2.0.0.0) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 class X(object):
... p2 = property(lambda self: 3)
...
 dir(X)
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', 
'__hash__', '__init__', '__module__', '__name__', '__new__', '__reduce__', 
'__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__', 'p2']

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
Sent: Friday, June 01, 2007 8:06 AM
To: Discussion of IronPython
Subject: [IronPython] Lambdas, properties and namespace leakage

Hello all,

Another fun one. If you use 'property' to wrap a lambda in a class
namespace then an extra name leaks into the class namespace (which
confused our documentation system).

CPython:
  class X(object):
...  p2 = property(lambda self: 34)
...
  dir(X)
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__',
'__hash_
_', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__',
'__repr_
_', '__setattr__', '__str__', '__weakref__', 'p2']

Amongst all the detritus you can see 'p2' nestled there at the end.

IronPython:
  class X(object):
...  p2 = property(lambda self: 34)
...
  dir(X)
['lambda$0', '__class__', '__dict__', '__doc__', '__init__',
'__module__', '__
new__', '__reduce__', '__reduce_ex__', '__repr__', '__weakref__', 'p2']

See the weird first entry! Shouldn't be there...

Thanks

Michael



--
Michael Foord
Resolver Systems
[EMAIL PROTECTED]

Office address: 17a Clerkenwell Road, London EC1M 5RD, UK
Registered address: 843 Finchley Road, London NW11 8NA, UK

Resolver Systems Limited is registered in England and Wales as company number 
5467329.
VAT No. GB 893 5643 79

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] SyntaxError: yield in more than one try blocks

2007-05-10 Thread Martin Maly
Yes, this is currently a an unfortunate limitation of our compiler.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sylvain 
Hellegouarch
Sent: Thursday, May 10, 2007 3:40 AM
To: Discussion of IronPython
Subject: [IronPython] SyntaxError: yield in more than one try blocks

[EMAIL PROTECTED] mono bin/ipy.exe
IronPython 1.1 (1.1) on .NET 2.0.50727.42

def test():
try:
yield 1
except:
try:
yield 2
except:
pass

if __name__ == '__main__':
for _ in test():
print _


Will produce:
[EMAIL PROTECTED] mono bin/ipy.exe -X:Python25 testyield.py
Traceback (most recent call last):
SyntaxError: yield in more than one try blocks (testyield.py, line 6)


It does work fine with CPython 2.5

- Sylvain
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] SyntaxError: yield in more than one try blocks

2007-05-10 Thread Martin Maly
Absolutely!

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sylvain 
Hellegouarch
Sent: Thursday, May 10, 2007 10:31 AM
To: Discussion of IronPython
Subject: Re: [IronPython] SyntaxError: yield in more than one try blocks

I assume you are looking at a solution in the future :)

Martin Maly wrote:
 Yes, this is currently a an unfortunate limitation of our compiler.

 Martin

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sylvain 
 Hellegouarch
 Sent: Thursday, May 10, 2007 3:40 AM
 To: Discussion of IronPython
 Subject: [IronPython] SyntaxError: yield in more than one try blocks

 [EMAIL PROTECTED] mono bin/ipy.exe
 IronPython 1.1 (1.1) on .NET 2.0.50727.42

 def test():
 try:
 yield 1
 except:
 try:
 yield 2
 except:
 pass

 if __name__ == '__main__':
 for _ in test():
 print _


 Will produce:
 [EMAIL PROTECTED] mono bin/ipy.exe -X:Python25 testyield.py
 Traceback (most recent call last):
 SyntaxError: yield in more than one try blocks (testyield.py, line 6)


 It does work fine with CPython 2.5

 - Sylvain
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] DLR and VS-Interactive

2007-05-02 Thread Martin Maly
The VS Interactive as you call it, or perhaps simply a good interactive 
development experience is an integral part of the dynamic language world. The 
VS SDK IronPython sample which demonstrates hosting of IronPython within Visual 
Studio offers a small glimpse one direction, the new Silverlight DLR Console 
sample that Keith pointed out is a glimpse different direction. There are lots 
of other possibilities as well.

For example the ASP.NET futures Visual Studio integration 
(http://www.microsoft.com/downloads/details.aspx?FamilyId=9323777E-FE78-430C-AD92-D5BE5B5EAD98displaylang=en)
 goes a little further than the IronPython VS integration sample which has been 
part of the VS SDK for a while (and which has been the initial exploration into 
static analysis and intellisense support for Python in the editor, rather than 
analyzing dynamically executing state). The ASP.NET Futures now has slightly 
more intellisense support - for controls that are present in the HTML markup, 
and the Request and Response objects. For example if you have text box in the 
HTML markup called text1, you can type text1 (dot) and get completion help 
inside Python. This is another direction altogether, and they are all 
challenging and interesting.

To answer the original question which direction the refactoring is headed ... 
right now all the focus is on the runtime itself, so the only fair answer I can 
give is: I really don't know yet, but once the runtime has solidified, it 
seems that the languages benefiting from executing on the runtime would like to 
benefit from common hosting or some kind of interactive development experience 
that you are envisioning.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeffrey Sax
Sent: Tuesday, May 01, 2007 6:06 PM
To: 'Discussion of IronPython'
Subject: [IronPython] DLR and VS-Interactive

This is more a DLR than an IronPython question.

There are two 'dynamic' aspects that are covered by the DLR extension to the
CLR. One is runtime support for efficient dynamic typing. The other is the
hosting side: console interface, integration with Visual Studio, etc. These
are useful for other (non-dynamic) languages as well. Case in point: F# has
an interactive console in Visual Studio, but is compiled and statically
typed. This second aspect looks more like an extension of the Visual Studio
SDK, if it wasn't taken straight from the VS Integration samples from the VS
SDK.

In other words: my impression is that the current DLR is made up of two
separable parts:
1. The actual DLR, which enables efficient dynamic typing on the CLR.
2. VS-Interactive, a set of extensions to the Visual Studio SDK that turn
Visual Studio into an interactive development environment.

Is this where the refactoring is headed?

Jeffrey Sax
Extreme Optimization



___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Callback per statement

2007-04-17 Thread Martin Maly
I think this may work pretty well. Something worth thinking through would be to 
what degree can user make your life complicated by catching exceptions. Once 
you throw your exception, the user can actually catch it (or you can modify 
codegen to filter your special exceptions out so user cannot catch them), but 
at the same time, to do that, user has to execute a statement (or in this case 
the except clause of the try statement) which would end up throwing the 
exception again as the time quantum for the script expired. The only danger I 
can see is if there is an exception handler on the stack which you don't 
control (such as a call into .NET) User can catch anything there and never give 
you control back. I can only think of explicit monitor thread and forced 
termination of the runaway thread as a protection against such misbehavior...

Martin


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Markus Hajek
Sent: Monday, April 16, 2007 11:55 PM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] Callback per statement

One more question: I want to use this callback to abort python execution in 
certain cases. I'm currently thinking the best way to go about this would be to 
throw an exception in the callback I hook up.
About like:

public static class PythonCallback
{
public static void Callback()
{
   If (pythonAbortionDesired)
   Throw new 
PythonAbortionException();
}
}
//...
try
{
engine.ExecuteFile(SomePythonFile.py);
}
catch (PythonAbortionException)
{
// do whatever I wanna do when Python execution has aborted
}

What do you think of this? Is there any better alternative?

Many thanks again,


Markus Hajek
Team Vienna - Kazemi, Hajek  Pisarik OG

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Markus Hajek
Gesendet: Dienstag, 17. April 2007 08:38
An: 'Discussion of IronPython'
Betreff: Re: [IronPython] Callback per statement

Thanks a million, I'll start experimenting with that right away. Looks just 
exactly like what I need, thanks again.

Cheers,

Markus Hajek
Team Vienna - Kazemi, Hajek  Pisarik OG

Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Martin Maly
Gesendet: Montag, 16. April 2007 20:13
An: Discussion of IronPython
Betreff: Re: [IronPython] Callback per statement

It is not possible to do this without change to code generation at this point. 
Essentially you could do something like this:

public class MyCallbackClass {
public void MyCallback() {
//
}
}

And then emit call to this utility wherever you like:
cg.EmitCall(typeof(MyCallbackClass).GetMethod(MyCallback))

You can then control the granularity at which you call this. Per statement, or 
even per expression (I am a bit confused about your mention of operators below, 
whether you want to do this for each expression, but it is certainly possible 
as well).

For starters, what you could easily do to get feel for things would be to 
modify SuiteStatement's Emit method (which only loops through enclosed 
statements and emits each of them) and add the above cg.EmitCall for each 
statement, run your repro, say:

X = 1
X = 2
X = 3

And put breakpoint in the MyCallback, or better yet, run the repro:

Ipy.exe -X:SaveAssemblies x.py

And examine the x.exe we'll generate with ildasm or reflector. Then you can add 
calls to your callbacks wherever desired.

Hope this helps
Martin


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Markus Hajek
Sent: Monday, April 16, 2007 3:37 AM
To: 'Discussion of IronPython'
Subject: [IronPython] Callback per statement


Hi,

is there a way to execute a callback whenever a Python statement is about to be 
executed (or just has executed)? With Python statements, I mean method calls, 
operators, assignments.

And if there's no such way, how would I have to go about changing code 
generation to facilitate that?

Many thanks,

Markus Hajek

Team Vienna - Kazemi, Hajek  Pisarik OG
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Callback per statement

2007-04-16 Thread Martin Maly
It is not possible to do this without change to code generation at this point. 
Essentially you could do something like this:

public class MyCallbackClass {
public void MyCallback() {
//
}
}

And then emit call to this utility wherever you like:
cg.EmitCall(typeof(MyCallbackClass).GetMethod(MyCallback))

You can then control the granularity at which you call this. Per statement, or 
even per expression (I am a bit confused about your mention of operators below, 
whether you want to do this for each expression, but it is certainly possible 
as well).

For starters, what you could easily do to get feel for things would be to 
modify SuiteStatement's Emit method (which only loops through enclosed 
statements and emits each of them) and add the above cg.EmitCall for each 
statement, run your repro, say:

X = 1
X = 2
X = 3

And put breakpoint in the MyCallback, or better yet, run the repro:

Ipy.exe -X:SaveAssemblies x.py

And examine the x.exe we'll generate with ildasm or reflector. Then you can add 
calls to your callbacks wherever desired.

Hope this helps
Martin


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Markus Hajek
Sent: Monday, April 16, 2007 3:37 AM
To: 'Discussion of IronPython'
Subject: [IronPython] Callback per statement


Hi,

is there a way to execute a callback whenever a Python statement is about to be 
executed (or just has executed)? With Python statements, I mean method calls, 
operators, assignments.

And if there's no such way, how would I have to go about changing code 
generation to facilitate that?

Many thanks,

Markus Hajek

Team Vienna - Kazemi, Hajek  Pisarik OG
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Q: How do I compile .py files to a DLL for linking into my C# or VB program?

2007-04-06 Thread Martin Maly
There is a way to compile Python sources into a dll (there's a pyc sample on 
the codeplex website), however it will not produce a dll that is easily used 
from C# or VB. It is the dynamic nature of Python that makes it hard to compile 
into classes and methods in the same fashion as C# or VB do.

Martin

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ???
Sent: Friday, April 06, 2007 2:39 AM
To: users@lists.ironpython.com
Subject: [IronPython] Q: How do I compile .py files to a DLL for linking into 
my C# or VB program?

A: IronPython does not support building DLLs for a C# style of linking and 
calling into Python code.  You can define interfaces in C#, build those into a 
DLL, and then implement those interfaces in Python code as well as pass the 
python objects that implement the interfaces to C# code.

Can Someone kindly give an example?

Thanks in advance.

iap
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Better source code access?

2007-02-20 Thread Martin Maly
Unfortunately, the table _is_ static :(

M.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Tuesday, February 20, 2007 4:02 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Better source code access?

2007/2/14, Martin Maly [EMAIL PROTECTED]:
We did talk to the CodePlex team and it turns out that they
consciously impose this limitation. Only the members of the
Contributor/Developer group have access to the server via the Team
Explorer. Since we talked to them last, we haven't heard any update on
this so I presume this limitation has not gone away and probably won't
in the foreseeable future.

Is this really the case?

Today I found this page:
http://www.codeplex.com/IronPython/Project/ProjectRoles.aspx

Is it not possible to modify this table? e.g. granting Source
Code/Access Source Control Server permission to Logged-In role...?
Or is this page just good-looking static table?

--
Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Better source code access?

2007-02-13 Thread Martin Maly
We did talk to the CodePlex team and it turns out that they consciously impose 
this limitation. Only the members of the Contributor/Developer group have 
access to the server via the Team Explorer. Since we talked to them last, we 
haven't heard any update on this so I presume this limitation has not gone away 
and probably won't in the foreseeable future.

Please accept our apologies,

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nicholas Riley
Sent: Tuesday, February 13, 2007 12:45 AM
To: users@lists.ironpython.com
Subject: [IronPython] Better source code access?

Hi,

I found some messages in the archives from back in October regarding
access for non-contributors to CodePlex's Team Foundation Server.  Has
there been any progress on this?  I've been trying to figure out how
some code in IronPython evolved and the lack of an easily browseable
interface (diffs? commit messages?) is a real impediment.

If there's no other choice I could download the zip files for each
revision, check them in somewhere else and make the repository
available for public browsing.

It would help if you mention on the front page of the wiki (under Get
the Sources) that Team Explorer cannot be used by all users - it
would have saved me a lot of time knowing that!

Thanks,

--
Nicholas Riley [EMAIL PROTECTED] | http://www.uiuc.edu/ph/www/njriley
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Backslash on the interactive console

2006-12-14 Thread Martin Maly
Thanks for the report, Seo. I opened the issue on codeplex:

http://www.codeplex.com/IronPython/WorkItem/View.aspx?WorkItemId=6489


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Wednesday, December 13, 2006 10:40 PM
To: Discussion of IronPython
Subject: [IronPython] Backslash on the interactive console

$ python
Python 2.4.4 (#2, Oct 20 2006, 00:23:25)
[GCC 4.1.2 20061015 (prerelease) (Debian 4.1.1-16.1)] on linux2
Type help, copyright, credits or license for more information.
 1 + \
... 2
3

This causes SyntaxError on IronPython.

--
Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Possible problem with DockStyle.Fill

2006-12-04 Thread Martin Maly
I suspect that the same code written in VB/C# would behave the same way. This 
is most likely behavior of Windows Forms. Not being a winforms expert, I can't 
tell for sure whether this is correct behavior or a bug in Winforms...

Martin

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Patrick O'Brien
Sent: Saturday, December 02, 2006 3:48 PM
To: users@lists.ironpython.com
Subject: [IronPython] Possible problem with DockStyle.Fill

I've either found a bug or a misunderstanding on my part.  I'd appreciate 
confirmation or either.  :-)

Running this bit of code the layout of the form appears as expected:

import clr
clr.AddReference('System.Windows.Forms ')
import System.Windows.Forms as SWF

form = SWF.Form()
menu_strip = SWF.MenuStrip()
button = SWF.Button()
button.Dock = SWF.DockStyle.Fill
form.Controls.Add(button)
form.Controls.Add(menu_strip)
SWF.Application.Run(form)


Whereas in the following example the button is cut off by the menu:

import clr
clr.AddReference('System.Windows.Forms')
import System.Windows.Forms as SWF

form = SWF.Form ()
menu_strip = SWF.MenuStrip()
button = SWF.Button()
button.Dock = SWF.DockStyle.Fill
form.Controls.Add(menu_strip)
form.Controls.Add(button)
SWF.Application.Run(form)


The only difference between the two bits of code is the order of the calls to ' 
form.Controls.Add()'.  Is this expected, or is this a bug?

--
Patrick K. O'Brien
Orbtech   http://www.orbtech.com
Schevohttp://www.schevo.org
Louie http://www.pylouie.org
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Very strange problem with ExecuteFile

2006-11-22 Thread Martin Maly
I believe in this case the exception is result of what seems to be a CLR 
limitation. The code (in this case one static method) IronPython needs to 
generate to handle this input is too big and CLR/Jit then throws invalid 
program exception.

The only workaround I am aware of is to split the code up to multiple functions.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Giles Thomas
Sent: Wednesday, November 22, 2006 6:07 AM
To: Discussion of IronPython
Subject: [IronPython] Very strange problem with ExecuteFile

When the attached test.py is executed using ExecuteFile (sample .cs file also 
attached), we get the following exception:

System.InvalidProgramException: Common Language Runtime detected an invalid 
program.

The problem does not occur under the IP Console (which I guess doesn't use 
ExecuteFile).  My best guess is that the problem occurs when the complexity of 
the parse tree exceeds some particular limit.

Does anyone have any ideas for a workaround or a fix?  This one is causing us 
serious problems, so any thoughts would be much appreciated.


Regards,

Giles

--
Giles Thomas
Resolver Systems
[EMAIL PROTECTED]

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Very strange problem with ExecuteFile

2006-11-22 Thread Martin Maly
Exactly. In console, each statement is compiled into its own CLR method so you 
won't hit this problem.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Giles Thomas
Sent: Wednesday, November 22, 2006 8:12 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Very strange problem with ExecuteFile

Martin,

We don't see the same problem in the IronPython console; is this because
it is executing the file somehow differently - perhaps line-by-line,
maintaining a context dictionary?


Regards,

Giles



Martin Maly wrote:
 I believe in this case the exception is result of what seems to be a CLR 
 limitation. The code (in this case one static method) IronPython needs to 
 generate to handle this input is too big and CLR/Jit then throws invalid 
 program exception.

 The only workaround I am aware of is to split the code up to multiple 
 functions.

 Martin

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Giles Thomas
 Sent: Wednesday, November 22, 2006 6:07 AM
 To: Discussion of IronPython
 Subject: [IronPython] Very strange problem with ExecuteFile

 When the attached test.py is executed using ExecuteFile (sample .cs file also 
 attached), we get the following exception:

 System.InvalidProgramException: Common Language Runtime detected an 
 invalid program.

 The problem does not occur under the IP Console (which I guess doesn't use 
 ExecuteFile).  My best guess is that the problem occurs when the complexity 
 of the parse tree exceeds some particular limit.

 Does anyone have any ideas for a workaround or a fix?  This one is causing us 
 serious problems, so any thoughts would be much appreciated.


 Regards,

 Giles

 --
 Giles Thomas
 Resolver Systems
 [EMAIL PROTECTED]

 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


--
Giles Thomas
Resolver Systems
[EMAIL PROTECTED]

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] [ ] - System.Array

2006-11-08 Thread Martin Maly
This could be what you are looking for:

 import System
 System.Array[int]([1,2,3])
System.Int32[](1, 2, 3)
 System.Array[str]([Hello, World])
System.String[]('Hello', 'World')



From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Mujtaba Syed [EMAIL 
PROTECTED]
Sent: Monday, November 06, 2006 5:11 PM
To: Discussion of IronPython
Subject: [IronPython] [ ] - System.Array

How can I convert a IronPython list ([ ]) into a CLR array (System.Array)?

Thanks,
Mujtaba

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Visual studio edit and continue

2006-11-06 Thread Martin Maly
No, the Visual Studio IronPython integration does not support edit and 
continue, unfortunately.
It is certainly a valid scenario that is, as you point out, extremely valuable 
especially for dynamic languages. Hopefully, we'll be able to address this in 
the future.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Baus
Sent: Saturday, November 04, 2006 8:47 AM
To: users@lists.ironpython.com
Subject: [IronPython] Visual studio edit and continue


Is there any edit and continue functionality for the VS IronPython
integration?  I don't know if I have the IP integration installed
correctly, but I couldn't get it to work.  I think this would be the
killer feature for IronPython since theoretically code completion could
work with the dynamic type information.  Plus writing code while executing
it is a huge advantage of dynamic languages.

Overall though I'm impressed with the platform.  The work to allow both
pure python development and python/.net development (eg import clr) is
appreciated.  It makes me feel confident that the project is heading in a
direction I can be happy with over the longer term.

Thanks,
Chris

http://baus.net/

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython 1.0.1 Released!

2006-10-11 Thread Martin Maly
I am sorry, this is a simple miscommunication. I am not suggesting that this is 
(and always will be) the way to check for IronPython's version. I only provided 
this temporary solution for people who absolutely must be able to tell the 
difference between 1.0 and 1.0.1 for simply there is no other good way to tell 
at this point. Of course, apart from making this (I admit not ideal) solution 
available now, we must find something better, something which will fit nicely 
with the Python model of providing version information. The script below, or 
probably looking for substrings in sys.version:

1.0: sys.version == 'IronPython 1.0.60816 on .NET 2.0.50727.42'
1.0.1: sys.version == 'IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42'

are just about the only way to tell (for now) between 1.0 and 1.0.1. Note that 
our sys.version_info reports (2, 4, 0, 'final', 0) to express compatibility 
with CPython 2.4) and that in the absence of sys.subversion. We can certainly 
add the sys.subversion in the nearest release, but it will be solution going 
forward, unfortunately not available for 1.0 and 1.0.1 where - sadly - we don't 
have anything as clean as that available.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Baxter
Sent: Tuesday, October 10, 2006 11:50 PM
To: Discussion of IronPython
Subject: Re: [IronPython] IronPython 1.0.1 Released!

 import System
 a = 
 [].GetType().Assembly.GetCustomAttributes(System.Reflection.AssemblyFileVersionAttribute,
  False)
 if len(a)  0:
 if a[0].Version == 1.0.61005.1977: print IronPython 1.0.1
 else: print Unknown version
 else:
 print IronPython 1.0

Er - what? This isn't even close to a good approach. How on earth can
I make code that uses this forward-compatible? Any code I write using
this will need to be updated for IronPython1.1, and whenever there is
a subsequent version.

Please, please at least support sys.subversion to identify the
version. I'm thinking something like
('IronPython', 'tags/1.0.1', '61005') or the like.

CPython 2.5 is currently
('CPython', 'tags/r25', '51908')

Right now, there is no easy way (aside from parsing sys.version) to
say is this code running on CPython or IronPython. And, as I started
this thread, the format of sys.version changed from 1.0 to 1.0.1.

I'd be open to suggesting some other attribute in sys - but it really
does need to be in sys. If there was something like
sys.implementation I could see we could add that to CPython as well.
(But see note below about CPython release schedule)

As far as sys.version_info claiming to be Python 2.4 - I can sort of
understand that from a pragmatic point of view. But it leaves me with
a bad feeling - it's all too similar to almost every http client
identifying themselves as Mozilla 4.0 (Actual Browser Name Here).

The basic problem is that the stuff we have now was designed really
for a world where all Python implementations shared a common concept
of version - that is, Jython 2.2 is feature-compatible with CPython
2.2. It's possible that needs to be addressed, although given we just
did CPython 2.5, we're not going to be able to change it for CPython
for a good 18 months (the approximate timeframe for a 2.6).

Anthony
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython 1.0.1 Released!

2006-10-10 Thread Martin Maly
There is a way to tell the difference, but first let me provide a little 
background ...

IronPython is released as signed binaries, and in order to maintain binary 
compatibility (for example for the customer who writes an application that 
relies on particular version of IronPython binaries, but then wants to simply 
replace IronPython 1.0 binaries with 1.0.1 binaries without having to recompile 
his application) the assembly version is identical with the assembly version of 
the 1.0 release. However, we added some more assembly-level attributes which 
can be used to tell the difference between versions. They are 
AssemblyInformationVersionAttribute and AssemblyFileVersionAttribute. Note that 
they are not present on the 1.0 assemblies.

Unfortunately, due to a omission/bug, one of them 
(AssemblyInformationVersionAttribute) still reads 1.0 on the 1.0.1 
assemblies, but the other (AssemblyFileVersionAttribute) changes with each 
build of IronPython and its version for 1.0.1 release is:

1.0.61005.1977

Now, how can I find out which version I am running?

import System
a = 
[].GetType().Assembly.GetCustomAttributes(System.Reflection.AssemblyFileVersionAttribute,
 False)
if len(a)  0:
if a[0].Version == 1.0.61005.1977: print IronPython 1.0.1
else: print Unknown version
else:
print IronPython 1.0

Hope this helps and sorry for the confusion with 
AssemblyInformationVersionAttribute. It'll be fixed in the next release.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sylvain 
Hellegouarch
Sent: Tuesday, October 10, 2006 1:07 AM
To: Discussion of IronPython
Cc: Discussion of IronPython
Subject: Re: [IronPython] IronPython 1.0.1 Released!

I could not agree more. If people are two write Python packages which
could run in both environment they may need to differentiate both in some
cases (like import statements of assemblies which would fail with
CPython).

This is quite an important piece of information and I was so surprised to
see sys.version returning my CPython major version number (because it does
not set the minor version number either).

Thanks,
- Sylvain

 I notice the format of sys.version has changed. Since sys.version_info
 lies, and sys.subversion isn't supported, could this please not be
 changed so much?

 Old:
 IronPython 1.0.2453 on .NET 2.0.50727.42
 New:
 IronPython 1.0 (1.0.61005.1977) on .NET 2.0.50727.42

 On another related matter, there really is no useful way to ask what
 version of IronPython is the user running that I can see. Ideally,
 IronPython would also support sys.subversion in some way, at least -
 even if it has to synthesise the values. But *please* don't just copy
 the sys.subversion values from CPython - actually make it relevant to
 the IronPython release!

 Python 2.5 (r25:51908, Sep 19 2006, 14:29:31)
 [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2
 Type help, copyright, credits or license for more information.
 t import sys
 sys.subversion
 ('CPython', 'tags/r25', '51908')

 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Word and MissingMemberException, 'tuple' object has no attribute 'SaveAs

2006-10-09 Thread Martin Maly
The problem is that app.Documents.Open returns multiple values (in addition to 
regular return value, there are others either via ref or out parameters). This 
is what IronPython translates into tuples. This is quite common construct in 
Python:

def multiple():
return 1, hello, 4.5

i, s, f = multiple()

Similarly, you can capture the multiple return values from Word's Open to a 
tuple and then inspect its elements to find out which one is the actual 
document. It appears from the printout below, that it is the one at index zero. 
Therefore, you can write:

values = app.Documents.Open( ... );
myDoc = values[0]

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Frey576
Sent: Saturday, October 07, 2006 2:48 PM
To: users@lists.ironpython.com
Subject: [IronPython] Word and MissingMemberException, 'tuple' object has no 
attribute 'SaveAs


Hi,

I am new to IronPython but have a couple of years experience with Python.
Currently I am stuck with a problem trying to open a Word document (WordML)
and saving it as .rtf back to disk

The exception I get upon call of myDoc.SaveAs is:

MissingMemberException, 'tuple' object has no attribute 'SaveAs'

when I check myDoc (obtained from Word.Documents.Open) in the CLR debugger I
see indeed that I got a tuple
but it does not look like a Python tuple and I dont know how to handle that:

-   myDoc   {(DocumentClass object at 0x002B,
'D:\\Projekte\\SGMLtoRtf\\dirWatch_SGMLtoRtf\\test\\HelloWorld.xml',
Missing object at 0x002C, True, Missing object at
0x002C, Missing object at 0x002C, Missing object
at 0x002C, Missing object at 0x002C, Missing
object at 0x002C, Missing object at 0x002C,
Missing object at 0x002C, Missing object at
0x002C, Missing object at 0x002C, Missing object
at 0x002C, Missing object at 0x002C, Missing
object at 0x002C, Missing object at 0x002C)}
object {IronPython.Runtime.Tuple}

so the type is IronPython.Runtime.Tuple
What is wrong with using Documents.Open from IronPython?

My script, stripped down a little bit, is:

import System.Type

import clr
clr.AddReferenceByPartialName(Microsoft.Office.Interop.Word)
import Microsoft.Office.Interop.Word as Word # ApplicationClass,
WdSaveFormat

import sys
sys.path.append(rc:\python24\lib)
import os

inPath = r.\test\HelloWorld.xml
inPath = os.path.abspath(inPath)
assert os.path.isfile(inPath), not found: %s % inPath

outPath = os.path.splitext(inPath)[0] +.rtf

app = Word.ApplicationClass()
try:
readOnly = True
myDoc = app.Documents.Open(inPath, System.Type.Missing, readOnly,
*[System.Type.Missing]*13);

myDoc.SaveAs( outPath,
Word.WdSaveFormat.wdFormatRTF, # FileFormat
System.Type.Missing, # LockComments
System.Type.Missing, # Password
False,# AddToRecentFiles
System.Type.Missing, # WritePassword
System.Type.Missing, # ReadOnlyRecommended
System.Type.Missing, # EmbedTrueTypeFonts
System.Type.Missing, # SaveNativePictureFormat
System.Type.Missing, # SaveFormsData
System.Type.Missing, # SaveAsAOCELetter
System.Type.Missing, # Encoding
System.Type.Missing, # InsertLineBreaks
System.Type.Missing, # AllowSubstitutions
System.Type.Missing, # LineEnding
System.Type.Missing, # AddBiDiMarks
)
myDoc.Close(
False, # SaveChanges
System.Type.Missing, # OriginalFormat
System.Type.Missing, # RouteDocument
)

finally:
app.Quit(*[System.Type.Missing]*3)


How can I call member functions of a Word document obtained from
Documents.Open?

Peter






--
View this message in context: 
http://www.nabble.com/Word-and-MissingMemberException%2C-%27tuple%27-object-has-no-attribute-%27SaveAs-tf2402444.html#a6698479
Sent from the IronPython mailing list archive at Nabble.com.

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Access to IronPython version control

2006-10-06 Thread Martin Maly
IronPython didn't start as CodePlex project so we started with another source 
repository which we are slowly transitioning away from. The 'look under the 
hood' would reveal that we submit our changes to the other repository and 
changes get propagated automatically to codeplex. This version of reality will 
last only for few more days and after that we will be changing things. However, 
the final version is not completely decided yet.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Fraser
Sent: Friday, October 06, 2006 8:08 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Access to IronPython version control

Hi Martin

Had another idea - it seems that most of the IronPython team's commits
to the CodePlex repository seem to be dumps from out of another system -
is that true, do you use another version control system internally and
sync, or do you use CodePlex directly and just creatively name your
commits the revision number in brackets? :-)

David

Martin Maly wrote:
 Unfortunately, it turns out that at this point it is not possible to get 
 access to the version control without being Contributor or higher. I hope 
 that this will change sometimes in the future, but for the moment, the only 
 way to get access to the contents of the IronPython source control is via the 
 zip download...

 Sorry for the bad news.

 Martin

 -Original Message-
 /Wed Oct 4 10:04:02 PDT 2006/ *Martin Maly* Martin.Maly at microsoft.com  
 mailto:users%40lists.ironpython.com?Subject=%5BIronPython%5D%20Access%20to%20IronPython%20version%20controlIn-Reply-To=1159795725.401404.233560%40m73g2000cwd.googlegroups.comWrote:



 We are talking to CodePlex development team about possibly adding a group of 
 users which could have access to the version control without the need to be 
 Contributor or higher. Some kind of read only access for community members. 
 This is going on as we speak so no final word yet, but we'll keep you posted 
 as we hear more.

 Thanks for the patience
 Martin


 -Original Message-
 From: users-bounces at lists.ironpython.com 
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com 
 [mailto:users-bounces at lists.ironpython.com 
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com] On Behalf Of 
 martin at teamprise.com 
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
 Sent: Monday, October 02, 2006 6:29 AM
 To: users at lists.ironpython.com 
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
 Subject: Re: [IronPython] Access to IronPython version control


 David,

 You only get access to the source code repository if you are a
 developer or greater with the project.  Anonymous access to source code
 of CodePlex project is from the source tab.

 If you are having trouble getting Teamprise to talk to your CodePlex
 project and you do have developer permissions then give me a shout (or
 email support at teamprise.com 
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com) and we'll 
 try and help out.

 Cheers,

 Martin.


 David Fraser wrote:
 / Hi Martin/
 / /
 / Not unless I'm blind :-)/
 / Maybe only for developers of the project?/
 / In any case Seo helped me:/
 / server should be https://tfs01.codeplex.com/
 / username should be your username + _cp/
 / password as normal/
 / domain should be SND/
 / /
 / But not sure of the workspace name although this could just be a/
 / permissions thing - tried IronPython and $\IronPython/
 / /
 / Cheers/
 / David/
 / /
 / Martin Maly wrote:/
 /  If you go to the IronPython CodePlex Source page, in the upper right 
 corner you'll see the settings for server, user name, port .../
 / /
 /  
 http://www.codeplex.com/SourceControl/ListDownloadableCommits.aspx?ProjectName=IronPython/
 / /
 /  Martin/
 / /
 /  -Original Message-/
 /  From: users-bounces at lists.ironpython.com 
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com 
 [mailto:users-bounces at lists.ironpython.com 
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com] On Behalf 
 Of David Fraser/
 /  Sent: Friday, September 22, 2006 8:11 AM/
 /  To: Discussion of IronPython/
 /  Subject: [IronPython] Access to IronPython version control/
 / /
 /  Hi/
 / /
 /  I was trying today to access the IronPython source code repository -/
 /  there doesn't seem to be much information online on CodePlex as to how/
 /  to do this without using the Visual tool./
 /  Being more at home on the commandline and waiting for the 200MB+/
 /  download (doesn't seem to be possible to get the commandline client/
 /  standalone) I stumbled upon Teamprise's Java client at/
 /  http://www.teamprise.com/download/index.html/
 /  Unfortunately I can't seem to access the IronPython workspace - what/
 /  should the settings for server, workspace, etc be? (It seems that/
 /  username needs a _cp appended)./
 /  I am beginning to suspect that access is limited to the Microsoft

[IronPython] Access to IronPython version control

2006-10-05 Thread Martin Maly






Unfortunately, it turns out that at this point it is not possible to get access to the version control without being Contributor or higher. I hope that this will change sometimes in the future, but for the moment, the only way to get access to the contents of the IronPython source control is via the zip download...Sorry for the bad news.Martin-Original Message-Wed Oct 4 10:04:02 PDT 2006 Martin Maly Martin.Maly at microsoft.com Wrote:

We are talking to CodePlex development team about possibly adding a group of users which could have access to the version control without the need to be Contributor or higher. Some kind of read only access for community members. This is going on as we speak so no final word yet, but we'll keep you posted as we hear more.Thanks for the patienceMartin-Original Message-From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of martin at teamprise.comSent: Monday, October 02, 2006 6:29 AMTo: users at lists.ironpython.comSubject: Re: [IronPython] Access to IronPython version controlDavid,You only get access to the source code repository if you are adeveloper or greater with the project. Anonymous access to source codeof CodePlex project is from the source tab.If you are having trouble getting Teamprise to talk to your CodePlexproject and you do have developer permissions then give me a shout (oremail support at teamprise.com) and we'll try and help out.Cheers,Martin.David Fraser wrote: Hi Martin Not unless I'm blind :-) Maybe only for developers of the project? In any case Seo helped me: server should be https://tfs01.codeplex.com username should be your username + _cp password as normal domain should be SND But not sure of the workspace name although this could just be a permissions thing - tried IronPython and $\IronPython Cheers David Martin Maly wrote:  If you go to the IronPython CodePlex Source page, in the upper right corner you'll see the settings for server, user name, port ...   http://www.codeplex.com/SourceControl/ListDownloadableCommits.aspx?ProjectName=IronPython   Martin   -Original Message-  From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of David Fraser  Sent: Friday, September 22, 2006 8:11 AM  To: Discussion of IronPython  Subject: [IronPython] Access to IronPython version control   Hi   I was trying today to access the IronPython source code repository -  there doesn't seem to be much information online on CodePlex as to how  to do this without using the Visual tool.  Being more at home on the commandline and waiting for the 200MB+  download (doesn't seem to be possible to get the commandline client  standalone) I stumbled upon Teamprise's Java client at  http://www.teamprise.com/download/index.html  Unfortunately I can't seem to access the IronPython workspace - what  should the settings for server, workspace, etc be? (It seems that  username needs a _cp appended).  I am beginning to suspect that access is limited to the Microsoft team  which would be a shame :-)   David




___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Telnet API

2006-09-26 Thread Martin Maly








Telnetlib is a module implemented in Python so ideally
IronPython should be able to run it. At this point, however, there is a module select
that telnetlib depends on and IronPython doesnt support so IronPython cannot
run telnetlib.



Martin







From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Yan Manevich
Sent: Tuesday, September 19, 2006 5:45 PM
To: users@lists.ironpython.com
Subject: [IronPython] Telnet API







Hello,



I
want to connect through Telnet from Windows machine to UNIX machine and run some
scripts on the last one. My question is if that is possible to work with Telnet
from IronPython? Is there any API in IronPython like telnetlib in Python2.4.3?



Thank
you in advance for you answers.

Yan






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Arrays in IronPython

2006-09-25 Thread Martin Maly
Array[int][int] is equivalent to Array[int]. Using this syntax, the type that 
takes effect is actually the type in the right-most brackets. For example:

Array[int][str] is equivalent to Array[str]

This is probably an unintentional (and admittedly confusing) behavior that we 
will look at fixing in the future releases.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Anton
Sent: Friday, September 22, 2006 1:55 PM
To: users@lists.ironpython.com
Subject: Re: [IronPython] Arrays in IronPython


Thanks Dino.  That's cleared up Python jagged arrays for me.

Any idea what the Array[int][int] means?  Iron Python is ok with it, but I
can't figure out what it is (or how to initialize it).


Dino Viehland wrote:

 You can initialize the values on this like:

 Array[Array[int]]( ( (1,2), (2,3) ) )

 (any sequence will do here, e.g. a list work too).

 If you want to create a true multi-dimensional array you can do:

 x = Array.CreateInstance(int, Array[int]( (1,2,3)))

 And then you can fill the values by hand:

 x[0,1,2] = 2


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of David Anton
 Sent: Wednesday, September 20, 2006 8:15 AM
 To: users@lists.ironpython.com
 Subject: [IronPython] Arrays in IronPython


 After a lot of googling on this, I'm still confused about .NET arrays (not
 Python lists) in IronPython.
 One dimensional arrays are clear:
 foo = Array[int] ((1,2))

 But how to set up jagged arrays and multidimensional arrays?

 I know that IronPython is happy with the following (i.e., no error), but
 I'm not sure what they mean:
 foo = Array[int][int]
 foo = Array[Array[int]]

 The first one behaves just like Array[int], so I think IronPython is just
 ignoring the second [int] ?
 The second one would appear to me to be a jagged array, but how do I
 initialize it with values?

 --
 View this message in context:
 http://www.nabble.com/Arrays-in-IronPython-tf2306048.html#a6409948
 Sent from the IronPython mailing list archive at Nabble.com.

 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



--
View this message in context: 
http://www.nabble.com/Arrays-in-IronPython-tf2306048.html#a6454898
Sent from the IronPython mailing list archive at Nabble.com.

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Access to IronPython version control

2006-09-22 Thread Martin Maly
If you go to the IronPython CodePlex Source page, in the upper right corner 
you'll see the settings for server, user name, port ...

http://www.codeplex.com/SourceControl/ListDownloadableCommits.aspx?ProjectName=IronPython

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Fraser
Sent: Friday, September 22, 2006 8:11 AM
To: Discussion of IronPython
Subject: [IronPython] Access to IronPython version control

Hi

I was trying today to access the IronPython source code repository -
there doesn't seem to be much information online on CodePlex as to how
to do this without using the Visual tool.
Being more at home on the commandline and waiting for the 200MB+
download (doesn't seem to be possible to get the commandline client
standalone) I stumbled upon Teamprise's Java client at
http://www.teamprise.com/download/index.html
Unfortunately I can't seem to access the IronPython workspace - what
should the settings for server, workspace, etc be? (It seems that
username needs a _cp appended).
I am beginning to suspect that access is limited to the Microsoft team
which would be a shame :-)

David

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] socket for IronPython update

2006-09-18 Thread Martin Maly
Actually, there were some related discussions after the release of IronPython 
0.7. It is archived in the list archives, starting in March 2005. Hopefully, it 
will answer some of your questions. Second link is Jason Matusow's blog which 
has some related comments too.

http://lists.ironpython.com/pipermail/users-ironpython.com/2005-March/date.html
http://blogs.msdn.com/jasonmatusow/archive/2005/03.aspx

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Fraser
Sent: Friday, September 15, 2006 10:11 AM
To: Discussion of IronPython
Subject: Re: [IronPython] socket for IronPython update

Dino Viehland wrote:
 Unfortunately we cannot currently accept changes back into the IronPython 
 core right now. :(

Not at all? What are the issues?

David
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Descriptor/metaclass problems

2006-09-15 Thread Martin Maly
Filed as CodePlex issue  # 3287

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gary Stephenson
Sent: Thursday, September 14, 2006 4:56 PM
To: Discussion of IronPython
Subject: [IronPython] Descriptor/metaclass problems

Hi,

The following code works perfectly in CPython, but is all over the shop in
ipy :-(  Any ideas on how I might make it work in ipy?

class valueDescriptor(object):
def __init__(self,x=None):
self.value = x
def __get__(self,ob,cls):
return self.value
def __set__(self,ob,x):
self.value = x

class Ameta(type):
def createShared( cls, nm, initValue=None ):
o = valueDescriptor(initValue)
setattr( cls,nm, o )
setattr( cls.__class__,nm, o )

class A:
__metaclass__ = Ameta

class B( A ):
A.createShared(cls2,1)

def show():
# all outputs should be the same!!
print o.cls2
print o2.cls2
print A.cls2
print B.cls2

o = A()
o2 = B()
show()

B.cls2 = 2
show()

A.cls2 = 3
show()

o.cls2 = 4
show()

o2.cls2 = 5
show()



___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Another issue tracker component

2006-09-13 Thread Martin Maly
Done.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Wednesday, September 13, 2006 9:06 PM
To: Discussion of IronPython
Subject: [IronPython] Another issue tracker component

It would be nice to have Test Suite as another component, as I have
got some issues to report on files under Src/Tests directory.

--
Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPyton newbie questions

2006-09-12 Thread Martin Maly
Great documentation on Python in general is available at 
http://www.python.org/doc/
As for IronPython specific information, you can refer to the tutorial included 
with the IronPython distribution, check out our wiki at 
http://www.codeplex.com/ironpython, specifically the page 
http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPythontitle=More%20Information

As for your specific questions:

- conditional compilation is not part of Python language. However, Python does 
provide tools which can help you achieve something quite similar. You can 
conditionally define functions, for example:

if condition:
def func(): return 1
else:
def func(): return 2

print func()# the depending on the condition, the function func will have 
different value and therefore do different things

- .NET attributes are not yet supported by IronPython

- properties - Python does support construct similar to .NET properties:

class C(object):
def __init__(self): self.__value = 0

def getter(self): return self.__value
def setter(self, value): self.__value = value

m = property(getter, setter)

c = C()
print c.m
c.m = 10
print c.m

If you meant using properties on .NET objects, that works also:

 import System
 System.Environment.CurrentDirectory # static property
'D:\\Ip1'

- the is is an operator which checks for object identity. The reason you can 
do condition is True is that value of a condition (if true or false) always 
returns the same _instance_ of True. Checking for object identity is faster 
than testing for equality, but not always the correct thing to do, for example:

 x = 123456 + 123456
 x
246912
 y = 246912
 x == y  # Same value
True
 x is y  # But different instance
False


- delegates: IronPython will automatically convert any Python method into a 
.NET delegate and ensures the type of the delegate matches. For example:

D:\Ip1ipy
IronPython 1.0.2445 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 import clr
 clr.AddReference(System.Windows.Forms)
 def Click(*args): print args
...
 import System.Windows.Forms as Forms
 f = Forms.Form()
 f.Click += Click# This took the Python method Click, turned 
 it into
# a delegate and added it as the event 
listener

- structs: You can certainly use .NET structs inside IronPython with some 
limitations, see 
http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPythontitle=Value%20Types
 for more details. As for constructing structs, it is not possible to define a 
.NET struct in IronPython. The closest you'll probably get is using new-style 
classes (classes that have object in their inheritance hierarchy) with 
__slots__ (this actually allocates slots for the members as opposed to putting 
them into a dictionary. Once you define __slots__, attributes not specified 
within __slots__ are not accessible (unless one of your __slots__ is __dict__ :)

 class C(object):
... __slots__ = ['a', 'b']
...

 c = C()
 c.a = 10
 c.b = 10
 c.c = 10
Traceback (most recent call last):
  File stdin, line 1, in ?
AttributeError: 'C' object has no attribute 'c'


Hope this helps
Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of David Anton
Sent: Saturday, September 09, 2006 4:51 PM
To: users@lists.ironpython.com
Subject: [IronPython] IronPyton newbie questions


I'm new to IronPyton (and Python in general).
Where can I find a good reference or spec for IronPython?

I'd like to find information on whether the following is available in
IronPython (google has been of limited help so far in the following
searches):
- conditional compilation
- attributes (e.g., System.SerializableAttribute)
- properties
- use of is (for example, why is is used with the boolean literal
True?)
- defining delegates
- structs (as in C#)

Thanks
--
View this message in context: 
http://www.nabble.com/IronPyton-newbie-questions-tf2246006.html#a6229361
Sent from the IronPython forum at Nabble.com.

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] [ANN] IronPython 1.0 released today!

2006-09-07 Thread Martin Maly
Thank you for letting us know. I've corrected your name. Please accept our 
apologies for misspelling it.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Szymon Kobalczyk
Sent: Thursday, September 07, 2006 2:33 AM
To: Discussion of IronPython
Subject: Re: [IronPython] [ANN] IronPython 1.0 released today!

On behalf of BizMind team at SoftwareMind, congratulations and thank you
for making this such a great product and sharing it with the community
starting from the early stages. Also thanks for all the people in this
mailing list for helping us all.

--
Szymon Kobalczyk
SoftwareMind
[EMAIL PROTECTED]

PS: Thanks for mentioning me on the IP wiki pages, but my first name is
Szymon not Syzmon -- this is a common mistake.
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] NotImplementedError: bad mode: rb+

2006-09-05 Thread Martin Maly
This is a bug in IP, I've filed it on codeplex (2911) for us to fix in one of 
the future releases.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HEMMI, Shigeru
Sent: Monday, September 04, 2006 5:13 PM
To: Discussion of IronPython
Subject: [IronPython] NotImplementedError: bad mode: rb+

Hello, I want to use 'anydbm' module.
However, some feature missing. See below.
Is there a plan to add this feature?

IronPython 1.0.2420 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 import sys
 sys.path.append(r'C:\Python24\Lib')
 import anydbm
 d = anydbm.open('testing.db','c')
 d[foo]=goo
Traceback (most recent call last):
  File , line 0, in stdin##53
  File C:\Python24\Lib\dumbdbm.py, line 163, in __setitem__
  File C:\Python24\Lib\dumbdbm.py, line 129, in _addval
  File , line 0, in Make##49
NotImplementedError: bad mode: rb+

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] an unexpected keyword argument

2006-09-02 Thread Martin Maly
Yes, this is a bug in IronPython. I've filed it on CodePlex as bug 2810

Thanks for the report!

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HEMMI, Shigeru
Sent: Friday, September 01, 2006 6:28 PM
To: Discussion of IronPython
Subject: Re: [IronPython] an unexpected keyword argument

Nobody replies, I think this is a bug.
On my MAC OS X,  I got the same output:

$ cat testingIP.py
class TEST(file):
def __init__(self,fname,VERBOSITY=0):
file.__init__(self,fname,r,1)
self.VERBOSITY = VERBOSITY
if __name__=='__main__':
f=TEST(r'sometext.txt',VERBOSITY=1)
print f.VERBOSITY=,f.VERBOSITY

$ mono ipy.exe -V
IronPython 1.0.2436 on .NET 2.0.50727.42

$ mono ipy.exe testingIP.py
Traceback (most recent call last):
  File testingIP, line unknown, in Initialize
TypeError: __new__() got an unexpected keyword argument 'VERBOSITY'

$ python testingIP.py
f.VERBOSITY= 1






I wrote:
 Hello, for a code,

 class TEST(file):
 def __init__(self,fname,VERBOSITY=0):
 file.__init__(self,fname,r,1)
 self.VERBOSITY = VERBOSITY
 if __name__=='__main__':
 f=TEST(r'sometext.txt',VERBOSITY=1)
 print f.VERBOSITY=,f.VERBOSITY

 I got different result:

 C:\home\ipy testIPY.py
 Traceback (most recent call last):
   File C:\cygwin\home\c1544\crcsolver\magna_examples\testIPY.py, line 6, in 
 Init
 ialize
 TypeError: __new__() got an unexpected keyword argument 'VERBOSITY'

 C:home\python testIPY.py
 f.VERBOSITY= 1

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Final release packaging

2006-08-26 Thread Martin Maly


Our intention is to continue our tradition of zero-impact installers and release the 1.0 as the zip file.
It seems though that it may be worth looking at the msi release (in addition to the zip file) as a possibility...

Martin




From: [EMAIL PROTECTED] On Behalf Of jeff sacksteder
Sent: Saturday, August 26, 2006 6:09 PM
To: users@lists.ironpython.com
Subject: [IronPython] Final release packaging



I haven't heard any discussion about how the final release will be packaged. Will it be similar to the existing releases or a more polished msi? I'd like to see an installer with that drops the binaries into a known location and adds it to the system path,
 add itself to add/remove programs, etc- at least create a shell shortcut so that I can do start-run-ipy. Maybe register an association with.py files(asking first, of course.)

Thoughts?




___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] users Digest, Vol 25, Issue 37

2006-08-21 Thread Martin Maly
I think that generally people are signed up for the non-digest membership so 
they get each question/response in separate email, making it easy to respond...

You can change your mailing list membership options to disable digest and 
receive separate messages ...

M.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Collett
Sent: Monday, August 21, 2006 11:53 AM
To: users@lists.ironpython.com
Subject: Re: [IronPython] users Digest, Vol 25, Issue 37

How does one respond to specific questions and answers in this users lists
scheme in this group.
I just tried respond from Lotus Notes and I will not be sure what happens
till I see the next list emailed.
Thanks
Jeff



 [EMAIL PROTECTED]
 ts.ironpython.com
 Sent by:   To
 [EMAIL PROTECTED] users@lists.ironpython.com
 ts.ironpython.com  cc

   Subject
 08/21/2006 01:31  users Digest, Vol 25, Issue 37
 PM


 Please respond to
 [EMAIL PROTECTED]
 ython.com






Send users mailing list submissions to
 users@lists.ironpython.com

To subscribe or unsubscribe via the World Wide Web, visit
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
or, via email, send a message with subject or body 'help' to
 [EMAIL PROTECTED]

You can reach the person managing the list at
 [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than Re: Contents of users digest...


Today's Topics:

   1. engine.ImportSite(); broken in RC2 (Stanislas Pinte)
   2. Re: Code broken in RC2 (Stanislas Pinte)
   3. Re: Getting a line number of error (RC2) (Matt Beckius)
   4. Re: console startup time: 7s (Dino Viehland)
   5. Re: Iron Python Question (Dino Viehland)
   6. Re: engine.ImportSite(); broken in RC2 (Dino Viehland)


--

Message: 1
Date: Mon, 21 Aug 2006 18:17:14 +0200
From: Stanislas Pinte [EMAIL PROTECTED]
Subject: [IronPython] engine.ImportSite(); broken in RC2
To: Discussion of IronPython users@lists.ironpython.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-1

hello,

could you please tell me what happened to engine.ImportSite();, and what
should I change in my code to get same behaviour?

thanks,

Stan.

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



--

Message: 2
Date: Mon, 21 Aug 2006 18:21:14 +0200
From: Stanislas Pinte [EMAIL PROTECTED]
Subject: Re: [IronPython] Code broken in RC2
To: Discussion of IronPython users@lists.ironpython.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-1

by looking at IronPythonConsole sources, it seems it might be like:

private static void DefaultExceptionHandler(object sender,
UnhandledExceptionEventArgs args) {
MyConsole.WriteLine(Unhandled exception: , Style.Error);

MyConsole.Write(engine.FormatException((Exception)args.ExceptionObject),
Style.Error);
}

Can anyone from the team confirm this?

Thanks a lot,

Stan.

Stanislas Pinte a ?crit :
 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 

Re: [IronPython] PythonEngine.SetVariable

2006-08-18 Thread Martin Maly
You can use engine.Globals[name] = value

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Cosby
Sent: Thursday, August 17, 2006 5:34 PM
To: IronPython Users
Subject: [IronPython] PythonEngine.SetVariable

At one point, PythonEngine.SetVariable was replaced by PythonEngine.SetGlobal. 
I don't find either of them in RC1. Why is this?


Jon

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython 1.0 RC2

2006-08-17 Thread Martin Maly
Sources are in separate zip file.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Zoltan Varga
Sent: Thursday, August 17, 2006 7:00 AM
To: Discussion of IronPython
Subject: Re: [IronPython] IronPython 1.0 RC2

 Hi,

  This release does not seem to include sources/tests. Is this
intentional, or it is
a bug ?

 Zoltan

On 8/17/06, Dino Viehland [EMAIL PROTECTED] wrote:




 Hello IronPython Community,



 We have just released IronPython 1.0 RC2.  This build includes fixes for all
 known blocking issues against RC1, and we're anticipating that this build
 will be the same as 1.0 final unless we hear otherwise.  We're looking for
 any feedback, but in particular we'd like to know of any blocking issues
 discovered against this build or fundamental language incompatibilities.
 Please try out the latest build over the next 2 weeks and let us know if you
 encounter any issues as soon as possible.



 We'd like to thank everyone in the community for your bug reports and
 suggestions that helped make this a better release: Kevin Bjorke, Kevin Chu,
 Mark Rees, Stanislas Pinte, and Timothy Fitz.



 Thanks and keep in touch,


  The IronPython Team



 More complete list of changes and bug fixes:
  

 CodePlex bug 2199: ReflectedPackage exposes internal types

 Several exception handling fixes including issue with break in except block

 CodePlex 2014 - __getitem__ on old style classes cannot be called as x[1,2]

 CodePlex 2015 - list.__rmul__ returns Ops.NotImplemented for subclass of
 long

 CodePlex 2016 - Power with module on classes with __pow__ throws

 CodePlex 2023 - Cannot convert class whose __int__ returns long to int

 CodeDom reports file  line numbers based upon External Source information

 CodeDom auto-adds unknown namespaces to import list

 CodePlex 1752 - Issue with yield in finally

 Bugfix: CodePlex 1388 - TypeError when calling __init__ with keyword
 argument 'args'

 Bugfix: CodePlex 1886 - Powmod throws ValueError for large numbers

 BugFix: CodePlex 1887 - powmod is very slow for large numbers

 Bugfix: 1357 - MD5.Create call raises TypeError - multiple overloads
 conflict for static methods with same name in type hierarchy

 Bugfix: CodePlex 1393 - get_DefaultFont() takes exactly -1 arguments (-1
 given) when accessing static property with self (now a better error
 message)

 Bugfix: CodePlex 1361 - help() function in ironpython shows incorrect
 behavior

 Bugfix: CodePlex 1399 -Accessing generic methods requires use of explicit
 tuple syntax

 Bugfix: CodePlex 1694 -Issue with yield in finally

 Bugfix: CodePlex 1728 - ipy shows different output when we use   __new__

 Bugfix: CodePlex 1731 - __init__ replaces the dictionary

 Static type Compiler produces overflow exception with following script code
 in the web project integration with Visual Studio

 Winforms tutorial tweaks

 Bugfix: CodePlex 1417 - True division behaves differently for Execute and
 Evaluate on PythonEngine

 Bugfix: CodePlex 1468 - List items are different when i use the htmlparser

 Bugfix: CodePlex 1732 - ipy throws error instead of returning complex number




 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] dynamic types

2006-08-16 Thread Martin Maly








You can implement ICustomAttributes interface on your class (defined
in IronPython\Runtime\Interfaces.cs) and IronPython will do the right thing.



Martin





From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Aviad Rozenhek
Sent: Tuesday, August 15, 2006 7:14 PM
To: users@lists.ironpython.com
Subject: [IronPython] dynamic types







Hi,











I havea C# class with the following design











public interface IDynamicProperty





{





/// ...





}











public class DynamicPropertiesContainer





{





 IDynamicProperty GetDynamicProperty (string
name)





}











and I have embedded IP as an internal scripting langauge.











what I would like is to expose the DynamicProperties
of my class as actual properties in IP, which is logical since IP
is dynamic.











example:





I want the following IP code to be equivalent (assuming that
'container' is an object of type DynamicPropertiesContainer)











print container.GetDynamicProperty (name)





print container.name











 -- or -- 













print container.GetDynamicProperty
(phone_number)





print container.phone_number











is there an easy way to achieve this?











thanks





A.






















___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Bug of big integer manipulation

2006-08-10 Thread Martin Maly
As for the infinite loop ... it is a bug in our PowMod code. It is not an 
actual infinite loop, but we just do the calculation very inefficiently. Filing 
as a bug also.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly
Sent: Thursday, August 10, 2006 8:26 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Bug of big integer manipulation

This is a current limitation of IronPython implementation. I am filing it as a 
bug for us to seriously investigate.

Thanks for your help with the repro!

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HEMMI, Shigeru
Sent: Thursday, August 10, 2006 1:38 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Bug of big integer manipulation

Thanks for the answer.

I was able to take a log with  -X:ExceptionDetail, but since Japanese, log file 
includes Japanse characters; I removed them by hand. I was not able to which 
numbers were involved. The log file is attached.

Please note that there are two problems; one is ValueError: value too big 
problem which we do not encounter with CPython. The other is an infinite loop 
bug.

Please also note that NZMATH is pure python, having simple module structure and 
we will be able to duplicate the problem if you download it.

Best regards,

2006/8/10, Martin Maly [EMAIL PROTECTED]:
 By any chance, were you able to determine which operation caused the 
 exception and which numbers were involved? What would help me find out what 
 the problem is faster would be get a call stack (for that, could you please 
 run your repro with -X:ExceptionDetail switch? Then ideally if you could find 
 out what the big integer numbers were with which the operation failed, that 
 would be ideal.

 Thanks!
 Martin

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of HEMMI,
 Shigeru
 Sent: Tuesday, August 08, 2006 4:31 PM
 To: Discussion of IronPython
 Subject: [IronPython] Bug of big integer manipulation

 Hello,

 NZMATH is a Python based number theory oriented calculation system developed 
 by Tokyo Metropolitan University. The URL is 
 http://tnt.math.metro-u.ac.jp/nzmath/.

 Using NZMATH, I encounterd a bug of big integer manipulation.

 IronPython
 
 C:\IronPython-2604ipy
 IronPython 1.0.2411 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. 
 All rights reserved.
  import sys
  sys.path.append(r'C:\Python24\Lib')
  sys.path.append(r'C:\Python24\Lib\site-packages')
  from nzmath import prime
  prime.nextPrime(256)
 257
  nx = sys.maxint
  prime.nextPrime(nx*nx)
 Traceback (most recent call last):
   File , line 0, in stdin##115
   File C:\Python24\Lib\site-packages\nzmath\prime.py, line 158, in nextPrime
   File C:\Python24\Lib\site-packages\nzmath\prime.py, line 206, in primeq
   File C:\Python24\Lib\site-packages\nzmath\prime.py, line 188, in smallSpsp
   File C:\Python24\Lib\site-packages\nzmath\prime.py, line 41, in spsp
 ValueError: value too big
  prime.nextPrime(nx)  ## Seems going into infinite loop.

 CPython
 
 C:\IronPython-2604python
 Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on 
 win32 Type help, copyright, credits or license for more information.
  import sys
  from nzmath import prime
  nx = sys.maxint
  prime.nextPrime(nx*nx)
 4611686014132420667L
  prime.nextPrime(nx)
 2147483659L
 

 Regards,
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] PythonEngine.RunFile

2006-08-10 Thread Martin Maly








Think PythonEngine.ExecuteFile may work for you.





From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Tim Riley
Sent: Thursday, August 10, 2006 1:01 PM
To: Discussion of IronPython
Subject: [IronPython] PythonEngine.RunFile





In IP version 0.9 there was a PythonEngine.RunFile() method,
this seems to be gone in 1.0.6. Is there a replacement? 






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] PythonEngine.RunFile

2006-08-10 Thread Martin Maly








You can try the PythonEngine.CreateOptimizedModule which you can
also pass a name your module should get. Let us know if that doesnt meet your
needs.



Martin





From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Tim Riley
Sent: Thursday, August 10, 2006 2:17 PM
To: Discussion of IronPython
Subject: Re: [IronPython] PythonEngine.RunFile





I've tested that and I don't
think it works with:

if __name___ == __main__:

in the python script.

Regards,
Tim Riley



On 8/10/06, Martin Maly [EMAIL PROTECTED]
wrote:







Think
PythonEngine.ExecuteFile may work for you.





From: [EMAIL PROTECTED]
[mailto:
[EMAIL PROTECTED]] On Behalf Of Tim Riley
Sent: Thursday, August 10, 2006 1:01 PM
To: Discussion of IronPython
Subject: [IronPython] PythonEngine.RunFile









In IP version 0.9 there was a PythonEngine.RunFile() method, this seems to
be gone in 1.0.6. Is there a replacement? 








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com












___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Bug of big integer manipulation

2006-08-09 Thread Martin Maly
By any chance, were you able to determine which operation caused the exception 
and which numbers were involved? What would help me find out what the problem 
is faster would be get a call stack (for that, could you please run your repro 
with -X:ExceptionDetail switch? Then ideally if you could find out what the big 
integer numbers were with which the operation failed, that would be ideal.

Thanks!
Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HEMMI, Shigeru
Sent: Tuesday, August 08, 2006 4:31 PM
To: Discussion of IronPython
Subject: [IronPython] Bug of big integer manipulation

Hello,

NZMATH is a Python based number theory oriented calculation system developed by 
Tokyo Metropolitan University. The URL is http://tnt.math.metro-u.ac.jp/nzmath/.

Using NZMATH, I encounterd a bug of big integer manipulation.

IronPython

C:\IronPython-2604ipy
IronPython 1.0.2411 on .NET 2.0.50727.42 Copyright (c) Microsoft Corporation. 
All rights reserved.
 import sys
 sys.path.append(r'C:\Python24\Lib')
 sys.path.append(r'C:\Python24\Lib\site-packages')
 from nzmath import prime
 prime.nextPrime(256)
257
 nx = sys.maxint
 prime.nextPrime(nx*nx)
Traceback (most recent call last):
  File , line 0, in stdin##115
  File C:\Python24\Lib\site-packages\nzmath\prime.py, line 158, in nextPrime
  File C:\Python24\Lib\site-packages\nzmath\prime.py, line 206, in primeq
  File C:\Python24\Lib\site-packages\nzmath\prime.py, line 188, in smallSpsp
  File C:\Python24\Lib\site-packages\nzmath\prime.py, line 41, in spsp
ValueError: value too big
 prime.nextPrime(nx)  ## Seems going into infinite loop.

CPython

C:\IronPython-2604python
Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)] on win32 
Type help, copyright, credits or license for more information.
 import sys
 from nzmath import prime
 nx = sys.maxint
 prime.nextPrime(nx*nx)
4611686014132420667L
 prime.nextPrime(nx)
2147483659L


Regards,
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] producing exe's

2006-08-08 Thread Martin Maly


Yes, that's correct. The -X:SaveAssemblies flag is mainly for debugging purposes. If you need to produce an exe, the recommended way is to use the IronPython.Hosting.PythonCompiler class which allows you to
 set the type of assembly among other things.

Martin



From: [EMAIL PROTECTED] On Behalf Of jeff sacksteder
Sent: Monday, August 07, 2006 11:10 AM
To: users@lists.ironpython.com
Subject: [IronPython] producing exe's



If I make exe's like this-

ipyw.exe -X:SaveAssemblies myscript.py

I still get the console window. Is this correct?



___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] producing exe's

2006-08-08 Thread Martin Maly








Nope, ipy.exe does not have the option
to do that. Since its main purpose is to be the command line console to a large
degree compatible with CPython, we didnt expose the functionality
through ipy.exe.



Martin 











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rodolfo Conde
Sent: Tuesday, August 08, 2006
1:14 PM
To: Discussion of IronPython
Subject: Re: [IronPython]
producing exe's













 Hi all, first mail on the list :)...











 Do you mean you have do make a little
program with IronPython.Hosting.PythonCompiler class to make
your assembly ?? Doest have the ipy.exe console an option for this
purpose??











 Greetings...



















- Original Message - 





From: Martin
Maly 





To: Discussion
of IronPython 





Sent: Tuesday, August
08, 2006 11:05 AM





Subject: Re: [IronPython]
producing exe's











Yes, that's correct.
The -X:SaveAssemblies flag is mainly for debugging purposes. If you need to
produce an exe, the recommended way is to use the
IronPython.Hosting.PythonCompiler class which allows you to set the type of
assembly among other things.











Martin

















From: [EMAIL PROTECTED]
On Behalf Of jeff sacksteder
Sent: Monday, August 07, 2006
11:10 AM
To: users@lists.ironpython.com
Subject: [IronPython] producing
exe's





If I make exe's like this-

ipyw.exe -X:SaveAssemblies myscript.py

I still get the console window. Is this correct?





__ Información de NOD32, revisión 1.1696 (20060807) __

Este mensaje ha sido analizado con NOD32 antivirus system
http://www.nod32.com







___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


__ Información de NOD32, revisión 1.1696 (20060807) __

Este mensaje ha sido analizado con NOD32 antivirus system
http://www.nod32.com








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] delete key on MAC OS X

2006-08-01 Thread Martin Maly
If you are not using the -X:TabCompletion, then IronPython console relies 
simply on the underlying console implementation in the CLR/System. My first 
guess is therefore that there may be something different about the console 
implementation on MAC in mono, but not being a mac user, I cannot confirm this 
for sure, unfortunately.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of HEMMI, Shigeru
Sent: Sunday, July 30, 2006 6:59 PM
To: Discussion of IronPython
Subject: Re: [IronPython] delete key on MAC OS X

Thanks for the answer

 Are you using the -X:TabCompletion command line switch? If so, then only some
 of the control keys are handled and the MAC OS X delete is probably not one of
 them.
No, I'm not using the -X:TabCompletion command line switch.


 If you are not using the -X:TabCompletion command line switch, the problem
 may lie in the System.Console implementation.
Does it mean that the System.Console implementation by mono on OS X may have
some problem?  If this is the case, this mailing list is not the right
place to ask this
question; then I will switch the place to ask.
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] delete key on MAC OS X

2006-07-30 Thread Martin Maly
Are you using the -X:TabCompletion command line switch? If so, then only some 
of the control keys are handled and the MAC OS X delete is probably not one of 
them. If you are not using the -X:TabCompletion command line switch, the 
problem may lie in the System.Console implementation.

Martin


From: [EMAIL PROTECTED] On Behalf Of HEMMI, Shigeru
Sent: Sunday, July 30, 2006 12:32 AM
To: Discussion of IronPython
Subject: Re: [IronPython] delete key on MAC OS X

Sorry my confusion.

I finally found a tricky result. Any conrole key input,  delete,
contol+w and others
not work properly in the intial IP interactive session.
Then stop ipy job using ^Z key and go back to IP interactive sessin
by fg command,  every controle key involving ^D works as I wish.

$ mono ipy.exe
IronPython 1.0.2401 on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 ^Z
[1]+  Stopped mono ipy.exe

$ fg
mono ipy.exe

 ^D

$
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Working Beta7 WinForms Code fails under RC1

2006-07-28 Thread Martin Maly
This is great news indeed! Glad all your problems so far got resolved.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Bjorke
Sent: Thursday, July 27, 2006 9:02 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1

Changing self.DefaultFont to Control.DefaultFont results is a
different error:

No overloads of DrawString could match(Graphics, str, Font,
SoildBrush, Point)
  DrawString(Graphics, str, Font, Brush, PointF)
  DrawString(Graphics, str, Font, Brush, RectangleF)

So I chnaged my (previously okay) Point to PointF... Got some more
array/list errors, fixed those, got the program up and running until
Iclicked the mouse:

get_ModifierKeys() takes exactly -1 arguments (-1 given)

So I got all the self.ModifiersKeys properties poiting to Control too
-- seems to be running now but I'll have to go on a more detailed
property hunt later.

Good news: It does seem to run faster :)

Thamks!
KB

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly
Sent: Thursday, July 27, 2006 12:34 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1

This is really interesting error message. I am going to file a bug for
us to look into this for the final release. My guess is that the bug
here may be that we get confused by the static property being accessed
with self argument.

Could you try accessing the property as Control.DefaultFont ?

Thanks
Martin

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kevin Bjorke
Sent: Wednesday, July 26, 2006 11:21 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1

That was correct! Sadly now I'm getting an error when I trry to access a
Windwos Forms Panel DefaultFont property.

The line
g.DrawString(self.block.name,self.DefaultFont, bb, Point(4, 2))

(g is a Graphics object -- this DID work under Beta 7!)

Results in the error

get_DefaultFont() takes exactly -1 arguments (-1 given)

?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly
Sent: Wednesday, July 26, 2006 11:06 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1

I wonder if the exception string is off a little. What it probably
should say is expecting array, got list. We no longer have automatic
conversion from list to array. We have one from tuple to array, but not
from list.

You can construct the array explicitly:

System.Array[element_type](anything_enumerable)

Does this work?

Martin

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kevin Bjorke
Sent: Wednesday, July 26, 2006 10:55 PM
To: Discussion of IronPython
Subject: [IronPython] Working Beta7 WinForms Code fails under RC1

I have these two lines which worked well under Beta7:

 cb = Drawing2D.ColorBlend()
 cb.Colors = [c,hilight,c,c]

Now I get an error saying expecting list got array

??

---
This email message is for the sole use of the intended recipient(s) and
may contain
confidential information.  Any unauthorized review, use, disclosure or
distribution
is prohibited.  If you are not the intended recipient, please contact
the sender by
reply email and destroy all copies of the original message.

---
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] PythonEngine.EvaluateAs and future division

2006-07-28 Thread Martin Maly








Great bug, thanks for reporting it! Ive
filed it on CodePlex as http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPythonWorkItemId=1417













From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kristof Wagemans
Sent: Wednesday, July 26, 2006
9:08 AM
To: 'Discussion of IronPython'
Subject: [IronPython]
PythonEngine.EvaluateAs and future division





The following code gives different results. Is this expected
or a bug?



IronPython.Compiler.Options.Division =
IronPython.Compiler.DivisionOption.New;

PythonEngine _pe = new PythonEngine();

_pe.Execute(result1 = 1/2);

double result1 = Convert.ToDouble(_pe.Globals[result1]);

double result2 =
_pe.EvaluateAsdouble(1/2);



result1 = 0.5

result2 = 0.0






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Working Beta7 WinForms Code fails under RC1

2006-07-27 Thread Martin Maly
I wonder if the exception string is off a little. What it probably should say 
is expecting array, got list. We no longer have automatic conversion from 
list to array. We have one from tuple to array, but not from list.

You can construct the array explicitly:

System.Array[element_type](anything_enumerable)

Does this work?

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Bjorke
Sent: Wednesday, July 26, 2006 10:55 PM
To: Discussion of IronPython
Subject: [IronPython] Working Beta7 WinForms Code fails under RC1

I have these two lines which worked well under Beta7:

 cb = Drawing2D.ColorBlend()
 cb.Colors = [c,hilight,c,c]

Now I get an error saying expecting list got array

??
---
This email message is for the sole use of the intended recipient(s) and may 
contain
confidential information.  Any unauthorized review, use, disclosure or 
distribution
is prohibited.  If you are not the intended recipient, please contact the 
sender by
reply email and destroy all copies of the original message.
---
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Working Beta7 WinForms Code fails under RC1

2006-07-27 Thread Martin Maly
This is really interesting error message. I am going to file a bug for us to 
look into this for the final release. My guess is that the bug here may be that 
we get confused by the static property being accessed with self argument.

Could you try accessing the property as Control.DefaultFont ?

Thanks
Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Bjorke
Sent: Wednesday, July 26, 2006 11:21 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1

That was correct! Sadly now I'm getting an error when I trry to access a
Windwos Forms Panel DefaultFont property.

The line
g.DrawString(self.block.name,self.DefaultFont, bb, Point(4, 2))

(g is a Graphics object -- this DID work under Beta 7!)

Results in the error

get_DefaultFont() takes exactly -1 arguments (-1 given)

?

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly
Sent: Wednesday, July 26, 2006 11:06 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Working Beta7 WinForms Code fails under RC1

I wonder if the exception string is off a little. What it probably
should say is expecting array, got list. We no longer have automatic
conversion from list to array. We have one from tuple to array, but not
from list.

You can construct the array explicitly:

System.Array[element_type](anything_enumerable)

Does this work?

Martin

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kevin Bjorke
Sent: Wednesday, July 26, 2006 10:55 PM
To: Discussion of IronPython
Subject: [IronPython] Working Beta7 WinForms Code fails under RC1

I have these two lines which worked well under Beta7:

 cb = Drawing2D.ColorBlend()
 cb.Colors = [c,hilight,c,c]

Now I get an error saying expecting list got array

??

---
This email message is for the sole use of the intended recipient(s) and
may contain
confidential information.  Any unauthorized review, use, disclosure or
distribution
is prohibited.  If you are not the intended recipient, please contact
the sender by
reply email and destroy all copies of the original message.

---
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] md5.py throws exception

2006-07-26 Thread Martin Maly
This appears to be a bug in IronPython. I tried with Beta 8 and 9 and they both 
worked, RC fails. I've filed the bug on CodePlex. It is a good one to look at 
for the final release.

Thanks for the report!

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Rees
Sent: Tuesday, July 25, 2006 8:14 PM
To: Discussion of IronPython
Subject: [IronPython] md5.py throws exception

On 7/26/06, Kevin Chu [EMAIL PROTECTED] wrote:
 I try this md5.py,but throw an exception!

  import md5
  m=md5.new()
 Traceback (most recent call last):
   File , line 0, in stdin##12
   File D:\TECH\IronPython\Lib\md5.py, line 31, in new
   File D:\TECH\IronPython\Lib\md5.py, line 15, in __init__
 TypeError: multiple overloads of Create could match ()
   Create()
   Create()

It worked in previous betas, but hadn't tested against RC1 yet. Let me
have a look and see if I can fix.

Mark
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] 'DataGridView' object has no attribute 'BeginInit'

2006-07-26 Thread Martin Maly
BeginInit is an explicitly implemented interface (ISupportInitialize) method on 
the DataGridView class. To call it, you need to use the explicit syntax:

grid = DataGridView( ... )

ISupportInitialize.BeginInit(grid)

In this case we wanted to preserve the nature of explicitly implemented 
interface methods and allow them to be called in this manner only.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Cheemeng
Sent: Tuesday, July 25, 2006 11:28 PM
To: users@lists.ironpython.com
Subject: [IronPython] 'DataGridView' object has no attribute 'BeginInit'

hi IP team,

the DataGridView object has no attribute BeginInit

this is previously fix in 1.0 beta4 I think.

cheemeng

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Ah, DataGridView- my cruel, inconstant muse.

2006-07-25 Thread Martin Maly








Which method on the DataGridViewCheckBoxColumn
are you calling?











From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of jeff sacksteder
Sent: Monday, July 24, 2006 9:42
PM
To: users@lists.ironpython.com
Subject: [IronPython] Ah,
DataGridView- my cruel, inconstant muse.





DataGridViewCheckBoxColumns seem to return (True|None) instead of
(True|False) even if The ThreeState and FalseValue attributes are set to
'False'. 

One of us is in error...






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Typing problem with vendor library?

2006-07-20 Thread Martin Maly








The problem is that the method is called
with int as the last parameter, but the two overloads in question take ref
Int16 and ref UInt16. So the conversion is happening in
the opposite direction and IronPython cannot safely choose between Int16 and
UInt16 given that the input is Int32. They are both narrowing conversions.



You can either select the method from
Overloads, or cast the int to whichever type you want to use:



board.AIn(channel, mode, Int16(output))



Hope this helps

Martin











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jeff sacksteder
Sent: Wednesday, July 19, 2006
9:54 PM
To: users@lists.ironpython.com
Subject: [IronPython] Typing
problem with vendor library?





I have a data-acquisition device whose vendor provides a dotnet library
for software integration. The dynamic nature of IP is giving me a bit of a
problem. To record data from the unit, I make a method call like this:

errorlevel = board.AIn(channel,mode,output)

It seems that the library wants to put an UInt16 value into the 'output'
variable. I would not expect this to be a problem, but this produces...

TypeError: no overloads of AIn could match (int, Range, int) 
 AIn(int, Range, Reference[Int16])
 AIn(int, Range, Reference[UInt16])

Surely an unsigned Int16 should be able to go into an Int32?






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Function call bug

2006-07-17 Thread Martin Maly
Thank you, Seo, opened as bug 1018 on CodePlex. Hopfully this will be an easy 
fix.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Monday, July 17, 2006 5:42 AM
To: Discussion of IronPython
Subject: [IronPython] Function call bug

I am very surprised to find this.

# test.py
def f(a, *b): print a
f(1, *[2])

Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Exceptions from the console in a background thread...

2006-07-16 Thread Martin Maly








Good catch, Lee. Ive filed this as bug 1015
on CodePlex.











From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Lee Culver
Sent: Sunday, July 16, 2006 12:45
PM
To: Discussion of IronPython
Subject: [IronPython] Exceptions
from the console in a background thread...





Id like to file a low priority bugunder the wouldnt it
be nice if category.



When you have an exception occur while using the console, it
produces a very nice output (a stack trace including only Python code).



However, if you run this in a background thread you get a
monstrosity of a stack trace including C# code with no Python code. It
would be very nice if this printed a nice python stack trace since the error
which is returned in a thread is not useful in the slightest. Heres a
quick repro:



 def Test():

... asdf

...

 Test() # useful stack trace

 import thread

 thread.start_new_thread(Test, tuple()) #
not useful at all



Thanks,

-Lee






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType'

2006-07-14 Thread Martin Maly








Thank you very much, great repro, which points
to an IronPython bug which I opened on CodePlex (bug 940)



http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPythonWorkItemId=940



in fact, the actual repro is even
simpler, no need to declare the TestClass either, simply import minidom and
exception happens.



 import sys


sys.path.append(rC:\Python24\Lib)

 import xml.dom.minidom

Traceback (most recent call last):

 File , line 0, in
stdin##8

 File , line 0, in __import__##5

 File
C:\Python24\Lib\xml\dom\minidom.py, line 462, in Initialize

TypeError: Unable to cast object of type
'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'.



Martin









From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Raath
Sent: Friday, July 14, 2006 12:18
AM
To: Discussion
 of IronPython
Subject: Re: [IronPython] Unable
to cast object of type 'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'





OK - I've broken it down
to its simplest form. It looks like there's a problem importing the minidom
class.

If you create a module TestModule.py containing the following code:

Python Code
==
import xml.dom.minidom

class TestClass:
 pass


and then try to import this class you will see this error.

My C# code is as follows:

 PythonEngine
engine = new PythonEngine(); 


engine.AddToPath(C:\\Python24\\lib);

engine.AddToPath(C:\\Temp\\IronPythonTest\\IronPythonTest\\Python\\);

engine.Execute(from TestModule import TestClass); 


Mike



On 7/13/06, Martin Maly [EMAIL PROTECTED]
wrote:







However, that said, in Beta 9, the OldClass is no longer a
DynamicType, which explains the exception itself. To find out what you need to
change in your code is something that we'll need more info for.



For example, the exception can come from anywhere in the
Module body (during import, the module body gets executed  unless the
module has been already imported). Since I don't get exception when executing
from Module import Class, I suspect that this is what may be the
case. The call stack for the exception could help find out what line in your
module code is throwing.



M.











From: [EMAIL PROTECTED]
[mailto: [EMAIL PROTECTED]]
On Behalf Of Martin Maly
Sent: Thursday, July 13, 2006 8:09
AM
To: Discussion
 of IronPython
Subject: Re: [IronPython] Unable
to cast object of type 'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'









To help you, we will need more information about your use of
the Python Engine. The simple case of executing from Module import
Class does work so we need to know more to find out what the problem may
be.



Thanks

Martin











From: [EMAIL PROTECTED]
[mailto: [EMAIL PROTECTED]]
On Behalf Of Mike Raath
Sent: Thursday, July 13, 2006 1:41
AM
To: Discussion
 of IronPython
Subject: [IronPython] Unable to
cast object of type 'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'





Hi

Having tried to switch over to beta 9, and changing my generic
EvaluateT references to EvaluateAsT, I get a runtime error on
an import statement which works under beta 8. The exception is as is detailed
in the message above, and is from a statement like 
engine.Execute(from Module import Class);

The Module and Class definitions are custom - and as i say this statement works
under beta 8.

Do you require more information or do I need to make a further change to my
code to get it to work? 

Thanks,
Mike










___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com










___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType'

2006-07-13 Thread Martin Maly








To help you, we will need more information
about your use of the Python Engine. The simple case of executing from
Module import Class does work so we need to know more to find out what
the problem may be.



Thanks

Martin











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Raath
Sent: Thursday, July 13, 2006 1:41
AM
To: Discussion of IronPython
Subject: [IronPython] Unable to
cast object of type 'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'





Hi

Having tried to switch over to beta 9, and changing my generic
EvaluateT references to EvaluateAsT, I get a runtime error on
an import statement which works under beta 8. The exception is as is detailed
in the message above, and is from a statement like 
engine.Execute(from Module import Class);

The Module and Class definitions are custom - and as i say this statement works
under beta 8.

Do you require more information or do I need to make a further change to my
code to get it to work? 

Thanks,
Mike






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Unable to cast object of type 'IronPython.Runtime.Types.OldClass' to type 'IronPython.Runtime.Types.DynamicType'

2006-07-13 Thread Martin Maly








However, that said, in Beta 9, the
OldClass is no longer a DynamicType, which explains the exception itself. To
find out what you need to change in your code is something that well need more
info for.



For example, the exception can come from
anywhere in the Module body (during import, the module body gets executed 
unless the module has been already imported). Since I dont get exception when executing
from Module import Class, I suspect that this is what may be the case. The
call stack for the exception could help find out what line in your module code
is throwing.



M.











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Martin Maly
Sent: Thursday, July 13, 2006 8:09
AM
To: Discussion of IronPython
Subject: Re: [IronPython] Unable
to cast object of type 'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'





To help you, we will need more information
about your use of the Python Engine. The simple case of executing from Module
import Class does work so we need to know more to find out what the problem
may be.



Thanks

Martin











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Raath
Sent: Thursday, July 13, 2006 1:41
AM
To: Discussion of IronPython
Subject: [IronPython] Unable to
cast object of type 'IronPython.Runtime.Types.OldClass' to type
'IronPython.Runtime.Types.DynamicType'





Hi

Having tried to switch over to beta 9, and changing my generic
EvaluateT references to EvaluateAsT, I get a runtime error on
an import statement which works under beta 8. The exception is as is detailed
in the message above, and is from a statement like 
engine.Execute(from Module import Class);

The Module and Class definitions are custom - and as i say this statement works
under beta 8.

Do you require more information or do I need to make a further change to my
code to get it to work? 

Thanks,
Mike






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Bug in beta9?

2006-07-13 Thread Martin Maly
Dino is absolutely right. In our new conversion rules, there is no implicit 
conversion between integer types (both standard Python types - int and bigint, 
and CLR integer types - byte, sbyte, short, ushort, long, ulong, uint, decimal) 
and char. Char is in Python pretty much interchangeable with one-character 
string and we tried to find the right balance for conversions that are implicit 
and those which require explicit 'cast'. Consider for example CPython's:

 range('a')
Traceback (most recent call last):
  File stdin, line 1, in ?
TypeError: range() integer end argument expected, got str.

You can still do int(1) or int(Char.Parse('a')), both explicit conversions.

Hope this helps.

Martin


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dino Viehland
Sent: Thursday, July 13, 2006 4:47 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Bug in beta9?

I think this is probably due to some changes w/ method dispatch (we'll no 
longer convert from char to int?).  I'll have to ask around to see if that's 
part of the design or not.  As a work around you can do:

chr(ord(a.KeyChar))


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jörgen Stenarson
Sent: Thursday, July 13, 2006 3:17 PM
To: Discussion of IronPython
Subject: [IronPython] Bug in beta9?

Hi

I have hit a change in the behaviour that results in an exception. Is this 
behaviour expected? My workaround for now is to change chr to str.

/Jörgen

file(tipy.py) used in test:

import System
readkey=System.Console.ReadKey
print Press a key
a=readkey(True)
print chr(a.KeyChar)

Test with beta8:
 c:\IronPython-1.0-Beta8\IronPythonConsole.exe tipy.py Press a key d


Test with beta9:
 c:\IronPython-1.0-Beta9\ipy -i tipy.py Press a key Traceback (most recent 
 call last):
   File C:\python\pyreadline_branch\pyreadline\console\tipy.py, line 8, in 
Initialize
   File , line 0, in Chr##75
TypeError: Cannot convert Char(d) to Int32

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Regression with Beta9?

2006-07-13 Thread Martin Maly








Yep, we have entered the ToString issue,
but your operator issue is a new one. Ive filed it in CodePlex as work item
939



Martin











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lee
 Culver
Sent: Thursday, July 13, 2006 8:35
PM
To: Discussion
 of IronPython
Subject: Re: [IronPython]
Regression with Beta9?





And another one



IronPython 1.0.60712 (Beta) on .NET
2.0.50727.42

Copyright (c) Microsoft Corporation. All
rights reserved.

 import clr



 clr.AddReferenceByPartialName(Microsoft.DirectX)

 from Microsoft import DirectX

 v = DirectX.Vector3(1, 2, 3)

 v * 2

...]osoft.DirectX.Vector3 object at
0x002C [Z : 6

 v * 2.2

Traceback (most recent call last):

 File , line 0, in stdin##30

TypeError: unsupported operand type(s) for
*: 'Vector3' and 'float'



Whereas this worked fine in IronPython8
(and indeed the DirectX.Vector3 class supports a multiplication with floats):



IronPython 1.0.2376 (Beta) on .NET 2.0.50727.42

Copyright (c) Microsoft Corporation. All
rights reserved.

 import clr


clr.AddReferenceByPartialName(Microsoft.DirectX)

 v = DirectX.Vector3(1, 2, 3)

Traceback (most recent call last):

 File , line 0, in stdin##13

NameError: name 'DirectX' not defined

 from Microsoft import DirectX

 v = DirectX.Vector3(1, 2, 3)

 v * 2

Z : 6

Y : 4

X : 2



 v * 2.2

Z : 6.6

Y : 4.4

X : 2.2



I think the ToString issue has already
been reported



Thanks

-Lee











From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Lee Culver
Sent: Thursday, July 13, 2006 8:17
PM
To: Discussion
 of IronPython
Subject: [IronPython] Regression
with Beta9?





This seems to not work anymore:



 import clr

 HasAttr

Traceback (most recent call last):

 File , line 0, in stdin##9

NameError: name 'HasAttr' not defined



Whereas under Beta8 it worked fine Is this
intentional? If so, this seems a bit weird that its still in
__builtins__:

 __builtins__.HasAttr

built-in function HasAttr



Thanks

-Lee






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] modal dialog example

2006-07-06 Thread Martin Maly








import clr

clr.AddReference
('System.Windows.Forms')



from System.Windows import Forms





class MyDialog(Forms.Form):

 def __init__(self):


self.Text ='Dialog'


egg_button = Forms.Button(Text='Eggs', Visible=True)


egg_button.Click += self.OnEgg


spam_button = Forms.Button(Text='Spam', Visible=True, Left = 50)


spam_button.Click += self.OnSpam


print self.Controls.Add(egg_button)


print self.Controls.Add(spam_button)



 def OnEgg(self,
*args):


self.result = Eggs


self.DialogResult = Forms.DialogResult.OK


self.Close()

 def OnSpam(self,
*args):


self.result = Spam


self.DialogResult = Forms.DialogResult.OK


self.Close()





class MyMainForm(Forms.Form):

 def __init__(self):


self.Text = 'Main Form'


my_button = Forms.Button(Text='Choose one!')


my_button.Click += self.OnClick


self.Controls.Add(my_button)

 def OnClick(self,
*args):


md = MyDialog()


if md.ShowDialog() == Forms.DialogResult.OK: print md.result






app = MyMainForm()


Forms.Application.Run(app)











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jeff sacksteder
Sent: Thursday, July 06, 2006 9:43
AM
To: Discussion of IronPython
Subject: [IronPython] modal dialog
example





I'm have trouble mentally translating the Vb and C# examples I found
online. Could someone finish this trivial example of calling a modal dialog and
returning the choice that was selected?

import clr
clr.AddReference ('System.Windows.Forms')

from System.Windows import Forms

class MyMainForm(Forms.Form):
 def __init__(self):
 self.Text = 'Main Form'
 my_button =
Forms.Button(Text='Choose one!')
 
class MyDialog(Forms.Form):
 def __init_(self):
 self.Text ='Dialog'
 egg_button =
Forms.Button(Text='Eggs')
 spam_button =
Forms.Button(Text='Spam')

app =
MyMainForm() 
Forms.Application.Run(app)






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython + IPython?

2006-07-03 Thread Martin Maly
IronPython doesn't support _getframe yet. It is something that is on our list 
of things to investigate, but we may not be able to implement it before the 
next release.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lee Culver
Sent: Monday, July 03, 2006 8:57 AM
To: Discussion of IronPython
Subject: Re: [IronPython] IronPython + IPython?

Let me know if you get this working.  IPython is an incredible shell,
and combining it with IronPython would be wonderful.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Krell
Sent: Monday, July 03, 2006 8:14 AM
To: users@lists.ironpython.com; [EMAIL PROTECTED]
Subject: [IronPython] IronPython + IPython?

You got your peanut butter on my chocolate!
You got your chocolate in my peanut butter!
Hey, they're two great tastes that taste great together!

What would it take to get IronPython to work well with the IPython
shell?

A quick google on this topic revealed this message

http://www.scipy.net/pipermail/ipython-user/2005-December/001222.html

which indicates that sys._getframe would be required.  Does FePy
support this?  Could it be done?

   Mike
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Code Coverage

2006-06-22 Thread Martin Maly
Michael,

thanks for the feedback. The settrace function is actually one of many things 
we are hoping to address in the next release. Dino and I discussed options for 
implementing it and hopefully we can get it fixed for the next release.

Thanks
Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
Sent: Thursday, June 22, 2006 4:13 AM
To: Discussion of IronPython
Subject: [IronPython] Code Coverage

Hello all,

I've been looking at code coverage tools for Python, as we would like to
check the coverage of our unit tests.

Unfortunately all the Python code coverage tools use ``sys.settrace``
which isn't implemented in IronPython. This (I guess) is because Python
stack frames and code objects aren't used in IronPython.

Unfortunately this makes coverage tools impossible (or just very
difficult),  unless an alternative mechanism is provided. (They also
tend to use the parser module which is another issue.)

I browsed the IronPython source (is there an API doc ?) but couldn't see
anything useful to get a callback as new source-code lines are entered.
Line information is obviously *somewhere*, as it is presented in
traceback information.

Two alternative ideas.

1) Implement a 'cut down' version of sys.settrace which only implements
what is possible.

For sys.settrace - see
http://docs.python.org/lib/debugger-hooks.html#debugger-hooks

coverage.py is one of the most common tools :

http://www.nedbatchelder.com/code/modules/coverage.html

It uses settrace with the following function :

def t(f, x, y):
c[(f.f_code.co_filename, f.f_lineno)] = 1
return t

So it only uses a filename reference from the code object and the
line_no from the frame. Either dummy objects could be constructed, or an
IronPython specific implementation could be made which presents this
information directly.

2) Alternatively a callback hook on the C# side could be implemented, so
that as IronPython enters a new line we could cache this information -
and generate a report once execution has stopped.

Either of these would be much appreciated.

All the best,

Michael Foord
http://www.resolversystems.com
http://www.voidspace.org.uk/python/index.shtml


___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Code Quality Tools

2006-06-22 Thread Martin Maly
Great feedback. We will need to investigate this some more to see what exactly 
the python's compiler package requires in terms of built-in modules. For now I 
opened CodePlex bug 563 so that we can include this important feature in our 
planning.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord
Sent: Thursday, June 22, 2006 7:10 AM
To: Discussion of IronPython
Subject: [IronPython] Code Quality Tools

Hello all,

At Resolver we are looking into tools that we can use to provide simple
code hygiene checks. Check we're not shadowing built-in names, check for
unneeded import statements and unused variables; that sort of thing.

I know of three Python modules that do this. They all fail unredeemably
on  IronPython :

* PyLint

Uses the compiler.ast module extensively

* PyChecker

Does bytecode analysis

* PyFlakes

Uses compiler.parse

(See also the previous email about coverage tools not working on
IronPython because sys.settrace is not implemented.)

We can use PyFlakes from CPython (and possbily PyLint- but not PyChecker
because it executes code), but that means our test code is dependent on
CPython.

So there are no native code quality tools that will work with
IronPython. This could be a barrier to entry for some projects who
consider using IronPython.

I realise it is not going to be high up the priority list, but if a
solution to this was possible it would be good.

One possibility is a pure Python ports of the parser module (which
should get the compiler and compiler.ast modules working). There is a
tool called EasyExtend which can generate CSTs in Pure Python, so it
could be possible to convert one of the existing tools to use this.

All the best,


Michael Foord
http://www.resolversystems.com
http://www.voidspace.org.uk/python/index.shtml

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compiler flags and co_flags value

2006-06-22 Thread Martin Maly
We did make change in the co_flags but this is a case we probably missed.
I filed a bug on CodePlex (#567) for this issue and we'll try to fix it before 
the next release.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrzej Krzywda
Sent: Thursday, June 22, 2006 10:16 AM
To: Discussion of IronPython
Subject: [IronPython] Compiler flags and co_flags value

Hi all,

It's good to see that the compiler flags are now working in IronPython
Beta8.

However, the compiled code object doesn't return valid co_flags value:

CPython:
  x = compile(print 2/3, string, exec, 8192)
  x.co_flags
8256

IronPython Beta 8:
  x = compile(print 2/3, string, exec, 8192)
  x.co_flags
0

Andrzej Krzywda
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Running applications vs. forms?

2006-06-17 Thread Martin Maly








import clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')

from System.Windows.Forms import Form,Application

class Form1(Form):
 pass
class Form2(Form):
 pass
Application.Run(Form1())













From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of jeff sacksteder
Sent: Saturday, June 17, 2006 1:34
PM
To: users@lists.ironpython.com
Subject: [IronPython] Running
applications vs. forms?





To clarify my earlier
message-

If I want to create a non-trivial application, I will have several forms and
dialogs. My(apparently broken) understanding is that I would create a class
representing the application and pass that to the
Application.Run(method). For example, the tiny app here:


import
clr
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')

from System.Windows.Forms import Form,Application

class Form1(Form):
 pass
class Form2(Form):
 pass
class MyApp(Application):
 pass
a = MyApp() 
Application.Run(a)


Produces 'TypeError: cannot derive from sealed or value types'. Alternatively,
If I create a class with no inheritance, I get 'TypeError: bad args for
method'. What is the correct way to do this? 








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Choosing the right overload

2006-06-16 Thread Martin Maly
The array_EffectInstance is EffectInstance[] and to get that type, you can do:

clr.GetClrType(Direct3D.X.EffectInstance).MakeArrayType()

For example:

 clr.GetClrType(System.Collections.Hashtable).MakeArrayType()
System.Collections.Hashtable[]

Hope this helps.
Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Jacobs
Sent: Friday, June 16, 2006 3:25 AM
To: IronPython List
Subject: [IronPython] Choosing the right overload

Hi,

I'm wondering how to call a specific overload, more specifically one that in
C# would take an out parameter but in IronPython does/can not.

Here are the available overloads:

  print Direct3D.Mesh.FromFile.__doc__
static (Mesh, array_EffectInstance) FromFile(str filename, MeshFlags options,
Device device)
static (Mesh, GraphicsStream, array_EffectInstance) FromFile(str filename,
MeshFlags options, Device device)
static (Mesh, array_ExtendedMaterial, array_EffectInstance) FromFile(str
filename, MeshFlags options, Device device)
static Mesh FromFile(str filename, MeshFlags options, Device device)
static (Mesh, GraphicsStream) FromFile(str filename, MeshFlags options, Device
device)
static (Mesh, array_ExtendedMaterial) FromFile(str filename, MeshFlags
options, Device device)
static (Mesh, GraphicsStream, array_ExtendedMaterial) FromFile(str filename,
MeshFlags options, Device device)
static (Mesh, GraphicsStream, array_ExtendedMaterial, array_EffectInstance)
FromFile(str filename, MeshFlags options, Device device)

I want to call:

static (Mesh, array_ExtendedMaterial) FromFile(str filename, MeshFlags
options, Device device)

I've tried using __overloads__:

  print Direct3D.Mesh.FromFile.__overloads__[(str, Direct3D.MeshFlags,
Direct3D.Device)].__doc__
static Mesh FromFile(str filename, MeshFlags options, Device device)

I'm going to assume that I'd need some way to specify the return type, which
also makes me wonder how you'd specify an object of type array_ExtendedMaterial?

So, is there a way I can do this without resorting to writing a C# helper
function?

I'd also like to suggest that the representation of the keys in
__overloads__ change to look something a little more like what you need to
pass. For instance:

'static (Mesh, array_EffectInstance) FromFile(str filename, MeshFlags options,
Device device)': built-in function FromFile

would be more easily understood (IMO) if it looked like:

(str, MeshFlags, Device): built-in function FromFile

Regards
--
Jonathan

When you meet a master swordsman,
show him your sword.
When you meet a man who is not a poet,
do not show him your poem.
 -- Rinzai, ninth century Zen master
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Infinite loop on package import

2006-06-05 Thread Martin Maly
Title: Re: [IronPython] How to update visual studio for Ironpython beta 7 
Infinite loop on package import








You are right. It is a bug. Thanks for
reporting it, well try to get it fixed as soon as possible.



Martin











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Aude Espesset
Sent: Monday, June 05, 2006 2:06
PM
To: Discussion
 of IronPython
Subject: [IronPython] Infinite
loop on package import









Hi,





I get an infinite loop when importing a package with
thefollowing files :











__init__.py reads:





from a import *











a.py reads:





import b











b.py reads:





import a

































From:
[EMAIL PROTECTED] on behalf of Dino Viehland
Sent: Fri 6/2/2006 2:14 PM
To: Discussion
 of IronPython
Subject: Re: [IronPython] How to
update visual studio for Ironpython beta 7  Infinite loop on package
import





We're
actually not aware of any issues w/ importing... do you have a simple
repro, or does it repro w/ the same steps as the previous one for you?



To update to beta 7 you should be able to replace the IronPython binaries that
ship w/ VSIP. Those typically get deployed to:

%ProgramFiles\Visual Studio 2005 SDK\(some date)\VisualStudioIntegration\Common\Assemblies

Just replace those, then re-build the IronPython integration sample
(%ProgramFiles%\Visual Studio 2005 SDK\(some
date)\VisualStudioIntegration\Samples\IronPythonIntegration\) and then the
project should be up-to-date and using beta 7.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
On Behalf Of Aude Espesset
Sent: Friday, June 02, 2006 2:00 PM
To: users@lists.ironpython.com
Subject: [IronPython] How to update visual studio for Ironpython beta 7 
Infinite loop on package import

Hi,

I have the april 2006 version of Visual Studio which contains IronPython, but I
don't know how to update it to work with beta 7. I'm guessing I should copy the
new source code somewhere and rebuild but I don't know where to copy it.

My second question is about infinite loops when importing packages. There is an
old message regarding this issue: http://lists.ironpython.com/htdig.cgi/users-ironpython.com/2006-March/001884.html
Is it still an active bug? One package gives me an infinite loop on import.
Should I try to trace back where it falls into an infinite loop or are you
aware of this bug and still working on it?

Thanks,
Aude

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Static methods that look similar to instance methods?

2006-05-08 Thread Martin Maly
IronPython uses the style of the call to determine which of the 2 methods it 
will prefer:

Class.Method(instance, parameter)   ... will prefer static method
instance.Method(parameter)  ... will prefer instance method

So this should work. However, we made changes to the overload resolution code 
recently so this may be a case that escaped us. I'll file a bug and hopefully 
we'll get to it before the next beta.

Martin


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jonathan Jacobs
Sent: Monday, May 08, 2006 7:19 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Static methods that look similar to instance methods?

Simon Dahlbacka wrote:
 I suppose the problem is that the following is valid (and even used)
 python code

Quite right.

 Btw, why do you need both a static and a non-static method with the same
 name?

Well, it's not my code, it's from the Managed DirectX API.
--
Jonathan

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compiler flags

2006-05-08 Thread Martin Maly
A great bug, thanks! We'll fix it.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrzej Krzywda
Sent: Monday, May 08, 2006 8:09 AM
To: users@lists.ironpython.com
Subject: [IronPython] Compiler flags

Hi all,

It seems that IronPython doesn't deal correctly with compiler flags
(8192 is the compiler flag for __future__.division).

IronPython Beta 6

  exec(compile(print 2/3, string, exec, 8192), {})
0


CPython
  exec(compile(print 2/3, string, exec, 8192), {})
0.6667

Andrzej Krzywda
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] System.Windows.Serialization

2006-04-20 Thread Martin Maly








The WinFX is still undergoing changes
that often result in the tutorial not working. We are actually resolving all
these incompatibilities right now to make sure that the tutorial released with
Beta 6 works with the February CTP of WinFX. As for possible differences
between Feb CTP of WinFX and march CTP of the designer, that is a bit trickier and
well probably have to wait for the two to work together again with
subsequent releases of WinFX.



Martin











From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Vamshi Raghu
Sent: Thursday, April 20, 2006
12:11 AM
To: Discussion
 of IronPython
Subject: [IronPython]
System.Windows.Serialization





Hello,

Just wanted to let you know that LoadXaml in avalon.py in 1.0 Beta 5 imports
System.Windows.Serialization, but this has been renamed from the Feb CTP of
WinFX onwards to System.Windows.Markup.

Had some trouble figuring it out! Still having trouble using LoadXaml though.
It seems there is some incompatibility in the XAML expected by the
deserializer. 

 xaml1 = LoadXaml(calc.xaml)
Traceback (most recent call last):
 File , line 0, in input##14
 File G:\Program Files\IronPython-1.0-Beta5\Tutorial\avalon.py, line 69,
in Loa
dXaml 
 File PresentationFramework, line unknown, in Load
 File PresentationFramework, line unknown, in XmlTreeBuildDefault
 File PresentationFramework, line unknown, in Parse
 File PresentationFramework, line unknown, in ParseFragment 
 File PresentationFramework, line unknown, in GetParseMode
 File PresentationFramework, line unknown, in ReadXaml
 File PresentationFramework, line unknown, in ParseError
SystemError: 'Canvas' tag not valid in namespace ' http://schemas.microsoft.com/w
infx/avalon/2005'. Tag names are case sensitive. Line '2' Position '2'.

Also, it can't read files created from _expression_ Interactive Designer March
CTP. I get errors like: 
 xaml1 = LoadXaml(D:\\Code\\C#\\Graph\\Scene1.xaml)
Traceback (most recent call last):
 File , line 0, in input##16
 File G:\Program Files\IronPython-1.0-Beta5\Tutorial\avalon.py, line 69,
in LoadXaml 
 File PresentationFramework, line unknown, in Load
 File PresentationFramework, line unknown, in XmlTreeBuildDefault
 File PresentationFramework, line unknown, in Parse
 File PresentationFramework, line unknown, in ParseFragment 
 File PresentationFramework, line unknown, in GetParseMode
 File PresentationFramework, line unknown, in ReadXaml
 File PresentationFramework, line unknown, in ParseError
SystemError: 'Class' attribute in ' http://schemas.microsoft.com/winfx/2006/xaml'
namespace not valid. Try compiling the XAML. Line '9' Position '2'.

Any hints?

Version: 
IronPython 1.0.2296 (Beta) on .NET 2.0.50727.42
Windows SDK 5308.0
WinFX SDK 50215.45

Thanks!
-Vamshi






___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] NameError

2006-03-30 Thread Martin Maly
Yes. We had discussions with the standard Python developers and Guido about it, 
actually. The language spec states that assignment is binding and if binding 
appears in a block (class body being block), all references to the name are 
local within the block. It was not clear whether it was a language spec bug or 
a implementation bug, but Guido ruled that it was a spec bug and the Python 
implementation is correct. We'll be fixing this soon.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Sunday, March 26, 2006 3:01 AM
To: Discussion of IronPython
Subject: [IronPython] NameError

Following script raises NameError, but it shouldn't.

x = ''
class C:
x = x

Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Console problem

2006-03-11 Thread Martin Maly
Hi,

I tried to look into this, but cannot reproduce the exception no matter how 
hard I try. Are you running IronPython with any command line parameters?

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Saturday, March 11, 2006 6:59 AM
To: Discussion of IronPython
Subject: [IronPython] Console problem

IronPython 1.0.2258 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 class C:
... x = 1
...
Traceback (most recent call last):
SystemError: Object reference not set to an instance of an object


Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] infinite import loop for nested packages (and fix)

2006-03-02 Thread Martin Maly
I believe we already have fix for this one. It will go out in the Beta 4 
release next week.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Sutherland
Sent: Wednesday, March 01, 2006 11:14 PM
To: users@lists.ironpython.com
Subject: [IronPython] infinite import loop for nested packages (and fix)

If you have a directory on your python path like so:

foo/
  __init__.py: import foo.bar as bar
  bar/
__init__.py: import foo.bar.baz as baz
baz.py: print 'Baz imported'
testit.py: import foo.bar

And you run testit.py, the import process will go into an infinite
loop while importing 'foo.bar' because an effort is only made to see
if the top-level package already exists.  Although it will find 'foo'
alright in that fashion, it will repeatedly look up 'foo.bar' because
the name traversal logic in Importer::ImportModule finds 'foo' already
exists, then goes to import foo.bar again.

A solution that works follows.

internal static object ImportModule(PythonModule mod, string
fullName, bool bottom) {
string[] names = fullName.Split('.');
object newmod = null;

// Find the most specific already-existing module if we may.
// Since the module import mechanism in CPython is not backtracking,
//  this is a safe behaviour.
string nameRemaining = fullName;

// (At the conclusion of this loop,) the index of the name
thus looked up.  In the
//  event our loop fails, iNameSatisfied will be zero.
int iNameSatisfied = names.Length - 1;
while(nameRemaining.LastIndexOf('.') = 0) {
if(TryGetExistingModule(nameRemaining, out newmod)) {
break;
}
else {
nameRemaining = nameRemaining.Substring(0,
nameRemaining.LastIndexOf('.'));
iNameSatisfied--;
}
}

if(iNameSatisfied == 0)
{
newmod = ImportTopFrom(mod, names[0]);
}
else if (names.Length == 1)
{
// if we imported before having the assembly
// loaded and then loaded the assembly we want
// to make the assembly available now.

PythonModule pm = newmod as PythonModule;
if (pm.InnerModule != null) pm.PackageImported = true;
}

if (newmod == null) {
newmod = ImportTop(mod, names[0]);
if (newmod == null) return null;
}

object next = newmod;
for (int i = iNameSatisfied + 1; i  names.Length; i++) {
next = ImportFrom(next, names[i]);
}

return bottom ? next : newmod;
}

Andrew
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Fallen over: from sys import *

2006-03-01 Thread Martin Maly








Thanks for the repro, Jacques. We already
have fix for this one so it will be in the next weeks release.



Martin











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of J. de Hooge
Sent: Wednesday, March 01, 2006
1:00 PM
To: users@lists.ironpython.com
Subject: [IronPython] Fallen over:
from sys import *





Hi,



IP team, thanks for the new version!

Ive just started trying out my code on it.



Seems that the following detail doesnt work anymore
in Beta 3, used to work upto Beta 2





from sys import *





The following is reported:





Traceback (most recent call
last):

 File
C:\activ_dell\prog\qQuick\try\try.py, line 1, in Initialize

StandardError: Exception has
been thrown by the target of an invocation.





Following workaround will require some prefixing but does
the job:





import sys





Kind regards

Jacques de Hooge

[EMAIL PROTECTED]



P.S. Ive uploaded some free IP stuff to www.qquick.org.

For people interested in using WinForms in combination with IP,
especially the file view.py is worth looking at.












___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Possible bug with exec(code, dict) when using lambdas

2006-02-28 Thread Martin Maly
Thanks for the repro, we'll look into it!

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Giles Thomas
Sent: Tuesday, February 28, 2006 5:20 AM
To: Discussion of IronPython
Subject: [IronPython] Possible bug with exec(code, dict) when using lambdas

Hi all,

It looks like there may still be outstanding problems with exec(code, 
dict) in beta 3; while the context in the dictionary is available to 
normal code, anything deferred into a function can't see it.

An example might clarify:

IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
  context = {}
  exec(a = 1, context)
  exec(print a, context)
1
  exec(b = lambda x : x + a, context)
  exec(c = b(5), context)
Traceback (most recent call last):
  File , line 0, in input##105
  File , line 0, in exec##106
  File , line 0, in lambda

You get the same problem if you use a regular function rather than a lambda:

  context = {}
  exec(a = 1, context)
  exec(def b(x): return x + a, context)
  exec(c = b(5), context)
Traceback (most recent call last):
  File , line 0, in input##80
  File , line 0, in exec##81
  File , line 0, in b
NameError: name 'a' not defined
 

The same code executes as expected in CPython. 

Hope this is of some help to someone!


Cheers,

Giles

-- 
Giles Thomas
Resolver Systems
[EMAIL PROTECTED]
We're hiring! http://www.resolversystems.com/jobs/

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] WCF Service Contracts implemented using IronPython

2006-02-27 Thread Martin Maly
I didn't do the IIS part either, I only registered the object directly with WCF 
server and had it listen on an http port, listening for soap messages and that 
works great with Jan CTP, but not Feb.

M.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Tarlano
Sent: Monday, February 27, 2006 1:39 PM
To: Discussion of IronPython
Cc: Discussion of IronPython
Subject: Re: [IronPython] WCF Service Contracts implemented using IronPython

Martin,

I haven't registered the server object with the IIS hosting container.
I will keep you posted ;o)

A.

On 2/27/06, Martin Maly [EMAIL PROTECTED] wrote:
 Right now, you can't do that in IronPython. We don't support adding 
 attributes yet.

 As for the February CTP. Were you able to register your server object without 
 a problem and talk to it from Python client (after generating the proxy)? 
 With the February CTP I hit the problem that if I have singleton server, 
 another custom attribute is required on it. It is not true for January CTP. 
 How did you get that working on Feb CTP? I am really curious :)

 Thanks!
 Martin

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Anthony Tarlano
 Sent: Sunday, February 26, 2006 8:03 AM
 To: Discussion of IronPython
 Subject: [IronPython] WCF Service Contracts implemented using IronPython

 Hi,

 I just downloaded the Feb CTP WinFx SDK and I was working my way
 through the WCF documentation. My goal is to create a WCF service
 using IronPython.

 From the tutorial they show the following C# code as an example of a
 ServiceContract.

 namespace Microsoft.ServiceModel.Samples
 {
 using System;
 using System.ServiceModel;
 [ServiceContract(Namespace = http://Microsoft.ServiceModel.Samples;)]
 public interface ICalculator
{
 [OperationContract]
 double Add(double n1, double n2);
 [OperationContract]
 double Subtract(double n1, double n2);
 [OperationContract]
 double Multiply(double n1, double n2);
 [OperationContract]
 double Divide(double n1, double n2);
 }
 }

 I used csc to compile it into a DLL assembly, successfully used the
 clr.Add.. methods to access the interface, and Implemented the
 operations in python.

 But what I would really like to do next is translate the service
 contract code from above and use a python class and skip the step of
 using C# to define my WCF ServiceContracts and the csc compiler.

 My question to the group is how would I add the ServiceContract and
 OperationContract declarative attributes to a python class?

 Thanks,

 A.
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
 ___
 users mailing list
 users@lists.ironpython.com
 http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython 1.0 Beta 3 Released!

2006-02-16 Thread Martin Maly
Thanks for the repro, Jon, we'll fix this right away. apart from changing the 
code, here is another workaround:

clr.AddReferenceByPartialName(System.Xml)

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Kale
Sent: Wednesday, February 15, 2006 5:35 PM
To: 'Discussion of IronPython'
Subject: Re: [IronPython] IronPython 1.0 Beta 3 Released!

Trying to add a reference to System.Xml, I get StackOverflowException. 

[] C:\Program Files\IronPython (Thu 16/02  1:19)
IronPythonConsole.exe -X:TabCompletion
IronPython 1.0.2237 (Beta) on .NET 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
 import clr
 clr.AddReference(System.Xml)

Process is terminated due to StackOverflowException.

The fix appears to be to change AddReference(object reference):

private void AddReference(object reference) 
{
string strRef = reference as string;
if (strRef != null) {
AddReference(strRef);
return;
 }
 AddReference(reference, null);
}

but since this is my first time in the IP code I could well be wrong...
--
Jon

___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Error while running sgmllib.py from Python 2.4 library

2006-02-16 Thread Martin Maly








I dont have the exact file you
are running sgmllib on, but based on running on different input (actually, the
IronPython tutorial) and consulting the source code, I believe this bug is
fixed in 1.0 Beta 3. However, when running the sgmllib on our tutorial as an
input, I got different problem down the line and well look into that
one.



Thank you!

Martin











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of richard hsu
Sent: Monday, February 13, 2006
6:39 PM
To: users@lists.ironpython.com
Subject: [IronPython] Error while
running sgmllib.py from Python 2.4 library







Running: IronPython 1.0.2190 (Beta) on .NET 2.0.50727.42











C:\IronPython\Libironpythonconsole sgmllib.py
c:\webhost\index.html
Traceback (most recent call last):
 File C:\Documents and Settings\user\My Documents\Develop\IronPython\Lib\sgmllib.py,
line 511, in Initialize 
 File C:\Documents and Settings\user\My
Documents\Develop\IronPython\Lib\sgmllib.py, line 506, in test$f38
 File C:\Documents and Settings\user\My
Documents\Develop\IronPython\Lib\sgmllib.py, line 95, in feed$f4
 File C:\Documents and Settings\user\My
Documents\Develop\IronPython\Lib\sgmllib.py, line 116, in goahead$f7
TypeError: search() takes exactly 2 argument (3 given)











I copied both sgmllib.py and its dependency markupbase.py into the
IronPython's Lib directory before running the script. The two files are from
Python 2.4 Library. The script runs with python 2.4and prints out the
html tags and data in the console. 











Mark Pilgrim's discusses sgmllib.pyin Dive Into Python[http://diveintopython.org/html_processing/introducing_sgmllib.html]











My overall objective is to get IronPythonto run Mark Pilgrim's
feedparser.py [http://feedparser.org]











feedparser.py imports sgmllib, re, sys, copy, urlparse, time, rfc822,
types, cgi, urllib, urllib2, CStringIO/StringIO, gzip/zlib,
xml.sax,base64, binascii, cjkcodecs.aliases and a few other
modules.So, it will be interesting. 











Thanks in advance.








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IronPython console runs out of memory

2006-02-16 Thread Martin Maly
This is a valid bug - thanks for the repro. IronPython gets into infinite 
recursion when importing minidom. Of course, this is something we'll fix.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Greg Lee
Sent: Tuesday, January 31, 2006 12:40 PM
To: users@lists.ironpython.com
Subject: [IronPython] IronPython console runs out of memory


This one-liner causes IronPython console to run out of memory (2.05GB page 
file) and freeze Windows XP:

from xml.dom import minidom

This is the installation:

Microsoft Windows XP [Version 5.1.2600]
IronPython 1.0.2216 (Beta) on .NET 2.0.50727.42

python 2.4.2
pyxml 0.8.4
pywin32 205
py2exe 0.6.3

IRONPYTHONPATH = c:\python24\lib
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] IRON Python Syntax Coloring

2006-02-16 Thread Martin Maly








The Visual Studio SDK contains a sample plugin
for VS 2005. Aaron Martens blog has more details http://blogs.msdn.com/aaronmar/ .
One question that appeared earlier on this alias was which Visual Studio
edition one needs to use the plug-in. At least the VS Standard edition is
required so the plug-in wont work with the VS express editions.



Martin













From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Nair, Rankarajan S (Rankarajan
S)
Sent: Monday, February 06, 2006
10:38 AM
To: users@lists.ironpython.com
Subject: [IronPython] IRON Python
Syntax Coloring







Hi,





Is there a plugin available for Visual Studio 2005 to High
light the syntax of Python...?











Thanks in Advance





-Ranka Nair








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Bug in engine.LoadAssembly(...) - PythonImportError

2006-02-11 Thread Martin Maly
Your TestOther class is not public so IronPython can't access it, hence the 
exception.

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stanislas Pinte
Sent: Friday, February 10, 2006 4:10 AM
To: users@lists.ironpython.com
Subject: [IronPython] Bug in engine.LoadAssembly(...) - PythonImportError

Hello,

I have troubles importing classes defined in my own assembly:

[Release] ./TestImport.exe

Unhandled Exception: IronPython.Runtime.PythonImportError: No module named Other

   at IronPython.Runtime.ReflectedMethodBase.Invoke(MethodBinding binding)
..
   at TestAccessOtherNamespace.Initialize() in c:TempTestImportTestImportbin
ReleaseTestAccessOtherNamespace.py:line 1

I am actually trying to give access to all the namespaces defined in the main 
assembly, like that:


class Program
  {
static void Main(string[] args)
{
  PythonEngine engine = new PythonEngine();
  //allow python scrupts to import all classes of my assembly
  engine.LoadAssembly(Assembly.GetAssembly(typeof(Program)));
  engine.AddToPath(@.);
  engine.Import(TestAccessOtherNamespace); 
}
  }

Am I missing anything? 

See attached full source code (c# program, and python script).

Thanks a lot,

Stan.




___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Creating Python file from .NET stream?

2006-02-04 Thread Martin Maly
At this point, I fear, you are right that there is no easy way to call the 
constructor that accepts Stream, even though we do have it in the code (the 
Make methods with __new__ attribute take precedence).

However, I think this is a great suggestion and we'll look into it. Thanks!

Martin

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sanghyeon Seo
Sent: Thursday, February 02, 2006 2:04 AM
To: Discussion of IronPython
Subject: [IronPython] Creating Python file from .NET stream?

Is it possible to create Python file from .NET stream?

IronPython/Runtime/PythonFile.cs seems to have code to do this, but I
couldn't find a way to call this from Python side.

Seo Sanghyeon
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Accessing the Engine's module

2006-02-04 Thread Martin Maly
No, unfortunately. But I am curious to know what you would need from Python 
Engine that you don't get without accessing the frame and module directly. Our 
motivation is to come up with solid interface on the PythonEngine so any 
feedback on its possible deficiencies is absolutely welcome.

Thanks!
Martin 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of adnand dragoti
Sent: Thursday, February 02, 2006 8:55 AM
To: Discussion of IronPython
Subject: [IronPython] Accessing the Engine's module

Hi,

is there any way to access the PythonEngine's module and frame (they are
declared private) ?

Thanks in advance
Nandi
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compiling in assemblies

2006-01-30 Thread Martin Maly








IronPython has, in the Hosting namespace,
a class PythonCompiler which allows that already. However, while the assemblies
generated are true .NET assemblies, they are not easily used from other .NET
languages yet  it is not an easy problem to solve.



Martin











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Fabio
Sent: Sunday, January 29, 2006
7:20 PM
To: IronPython
Subject: [IronPython] Compiling in
assemblies







When the IronPython library end the beta phase, we will can create
assemblies? exe, dll, etc...











Regards





Fabio








___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


  1   2   >