Re: [IronPython] using XAML in IronPython

2010-07-09 Thread Dino Viehland
It should be sometime this month.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Andrew Evans
Sent: Friday, July 09, 2010 3:37 PM
To: Discussion of IronPython
Subject: Re: [IronPython] using XAML in IronPython

Sounds great when is the expected release date for that :D
On Fri, Jul 9, 2010 at 3:28 PM, Dino Viehland 
mailto:di...@microsoft.com>> wrote:
The next release of Ipy Tools (and IronPython 2.7) will greatly simplify this.  
You'll be able to call clr.LoadComponent and point at your XAML file and your 
Window subclass.  It'll then automatically add all of the x:Name (and Name'd) 
elements onto your Window subclass so you can just do "self.hello.Text" or 
whatever w/o having to pull the values from the instance using FindName or 
other methods.

From: 
users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com]
 On Behalf Of Andrew Evans
Sent: Friday, July 09, 2010 3:23 PM
To: Discussion of IronPython
Subject: Re: [IronPython] using XAML in IronPython

ahh yes that's right I was using the development environment you linked. Thanks 
for the insight into my issue makes sense now
On Fri, Jul 9, 2010 at 3:14 PM, Andrew Evans 
mailto:evans.d.and...@gmail.com>> wrote:
Hello I am learning IronPython having come from a CPython background, I started 
learning C# to add more to my knowledge base for IronPython.

I have a few questions using XAML:

First if I build something using the xaml designer in IronPython Studio and 
give it a name x:name="somename" and want to reference it in a function def 
doSomething(s, e): how do I reference the item with the x:name value do I just 
type somename = changePropertyofControl? and how do I call the function?

XAML

http://schemas.microsoft.com/winfx/2006/xaml/presentation";
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
   Title="Hello World" Height="300" Width="300">
   Click Me


Python Code is where I am confused

import clr
clr.AddReference('PresentationFramework')

from System.Windows.Markup import XamlReader
from System.Windows import Application
from System.IO import FileStream, FileMode

app = Application()

def doSomething(sender,event):
hello.Content = "Try again"


app.Run(XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open)))

This I am sure is really simple... Coming from a Tk background its confusing 
for me.

Anyway ty

Cheers

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] using XAML in IronPython

2010-07-09 Thread Andrew Evans
Sounds great when is the expected release date for that :D

On Fri, Jul 9, 2010 at 3:28 PM, Dino Viehland  wrote:

>  The next release of Ipy Tools (and IronPython 2.7) will greatly simplify
> this.  You’ll be able to call clr.LoadComponent and point at your XAML file
> and your Window subclass.  It’ll then automatically add all of the x:Name
> (and Name’d) elements onto your Window subclass so you can just do
> “self.hello.Text” or whatever w/o having to pull the values from the
> instance using FindName or other methods.
>
>
>
> *From:* users-boun...@lists.ironpython.com [mailto:
> users-boun...@lists.ironpython.com] *On Behalf Of *Andrew Evans
> *Sent:* Friday, July 09, 2010 3:23 PM
> *To:* Discussion of IronPython
> *Subject:* Re: [IronPython] using XAML in IronPython
>
>
>
> ahh yes that's right I was using the development environment you linked.
> Thanks for the insight into my issue makes sense now
>
> On Fri, Jul 9, 2010 at 3:14 PM, Andrew Evans 
> wrote:
>
> Hello I am learning IronPython having come from a CPython background, I
> started learning C# to add more to my knowledge base for IronPython.
>
> I have a few questions using XAML:
>
> First if I build something using the xaml designer in IronPython Studio and
> give it a name x:name="somename" and want to reference it in a function def
> doSomething(s, e): how do I reference the item with the x:name value do I
> just type somename = changePropertyofControl? and how do I call the
> function?
>
> XAML
>
> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation";
>xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
>Title="Hello World" Height="300" Width="300">
>Click Me
> 
>
> Python Code is where I am confused
>
> import clr
> clr.AddReference('PresentationFramework')
>
> from System.Windows.Markup import XamlReader
> from System.Windows import Application
> from System.IO import FileStream, FileMode
>
> app = Application()
>
> def doSomething(sender,event):
> hello.Content = "Try again"
>
>
> app.Run(XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open)))
>
> This I am sure is really simple... Coming from a Tk background its
> confusing for me.
>
> Anyway ty
>
> Cheers
>
> 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] using XAML in IronPython

2010-07-09 Thread Dino Viehland
The next release of Ipy Tools (and IronPython 2.7) will greatly simplify this.  
You'll be able to call clr.LoadComponent and point at your XAML file and your 
Window subclass.  It'll then automatically add all of the x:Name (and Name'd) 
elements onto your Window subclass so you can just do "self.hello.Text" or 
whatever w/o having to pull the values from the instance using FindName or 
other methods.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Andrew Evans
Sent: Friday, July 09, 2010 3:23 PM
To: Discussion of IronPython
Subject: Re: [IronPython] using XAML in IronPython

ahh yes that's right I was using the development environment you linked. Thanks 
for the insight into my issue makes sense now
On Fri, Jul 9, 2010 at 3:14 PM, Andrew Evans 
mailto:evans.d.and...@gmail.com>> wrote:
Hello I am learning IronPython having come from a CPython background, I started 
learning C# to add more to my knowledge base for IronPython.

I have a few questions using XAML:

First if I build something using the xaml designer in IronPython Studio and 
give it a name x:name="somename" and want to reference it in a function def 
doSomething(s, e): how do I reference the item with the x:name value do I just 
type somename = changePropertyofControl? and how do I call the function?

XAML

http://schemas.microsoft.com/winfx/2006/xaml/presentation";
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
   Title="Hello World" Height="300" Width="300">
   Click Me


Python Code is where I am confused

import clr
clr.AddReference('PresentationFramework')

from System.Windows.Markup import XamlReader
from System.Windows import Application
from System.IO import FileStream, FileMode

app = Application()

def doSomething(sender,event):
hello.Content = "Try again"


app.Run(XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open)))

This I am sure is really simple... Coming from a Tk background its confusing 
for me.

Anyway ty

Cheers

Andrew

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


Re: [IronPython] using XAML in IronPython

2010-07-09 Thread Andrew Evans
ahh yes that's right I was using the development environment you linked.
Thanks for the insight into my issue makes sense now

On Fri, Jul 9, 2010 at 3:14 PM, Andrew Evans wrote:

> Hello I am learning IronPython having come from a CPython background, I
> started learning C# to add more to my knowledge base for IronPython.
>
> I have a few questions using XAML:
>
> First if I build something using the xaml designer in IronPython Studio and
> give it a name x:name="somename" and want to reference it in a function def
> doSomething(s, e): how do I reference the item with the x:name value do I
> just type somename = changePropertyofControl? and how do I call the
> function?
>
> XAML
>
> xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation";
>xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
>Title="Hello World" Height="300" Width="300">
>Click Me
> 
>
> Python Code is where I am confused
>
> import clr
> clr.AddReference('PresentationFramework')
>
> from System.Windows.Markup import XamlReader
> from System.Windows import Application
> from System.IO import FileStream, FileMode
>
> app = Application()
>
> def doSomething(sender,event):
> hello.Content = "Try again"
>
>
> app.Run(XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open)))
>
> This I am sure is really simple... Coming from a Tk background its
> confusing for me.
>
> Anyway ty
>
> Cheers
>
> Andrew
>
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] using XAML in IronPython

2010-07-09 Thread Michael Foord

On 09/07/2010 23:14, Andrew Evans wrote:
Hello I am learning IronPython having come from a CPython background, 
I started learning C# to add more to my knowledge base for IronPython.


I have a few questions using XAML:

First if I build something using the xaml designer in IronPython Studio 


Don't do that, really. IronPython Studio uses IronPython 1 which is 
years out of date. Plus it is very unstable. Use IronPython Tools for 
Visual Studio 2010 instead:


http://ironpython.net/ironpython/tools/

I don't think the xaml designer works particularly well with IronPython 
Tools, but you can use the xaml designer in Expression or Visual Studio 
(Express).


and give it a name x:name="somename" and want to reference it in a 
function def doSomething(s, e): how do I reference the item with the 
x:name value do I just type somename = changePropertyofControl? and 
how do I call the function?


Controls with an x:Name can be accessed as named attributes on parent 
controls.


Something like:

def doSomething(s, e):
button = root.hello # also equals "s" as it happens
root = XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open))
app.Run(root)

HTH,

Michael


XAML

http://schemas.microsoft.com/winfx/2006/xaml/presentation";
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
   Title="Hello World" Height="300" Width="300">
Click Me


Python Code is where I am confused

import clr
clr.AddReference('PresentationFramework')

from System.Windows.Markup import XamlReader
from System.Windows import Application
from System.IO import FileStream, FileMode

app = Application()

def doSomething(sender,event):
hello.Content = "Try again"


app.Run(XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open)))

This I am sure is really simple... Coming from a Tk background its 
confusing for me.


Anyway ty

Cheers

Andrew


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



--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of your 
employer, to release me from all obligations and waivers arising from any and all 
NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, clickwrap, browsewrap, 
confidentiality, non-disclosure, non-compete and acceptable use policies ("BOGUS 
AGREEMENTS") that I have entered into with your employer, its partners, licensors, 
agents and assigns, in perpetuity, without prejudice to my ongoing rights and privileges. 
You further represent that you have the authority to release me from any BOGUS AGREEMENTS 
on behalf of your employer.


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


[IronPython] using XAML in IronPython

2010-07-09 Thread Andrew Evans
Hello I am learning IronPython having come from a CPython background, I
started learning C# to add more to my knowledge base for IronPython.

I have a few questions using XAML:

First if I build something using the xaml designer in IronPython Studio and
give it a name x:name="somename" and want to reference it in a function def
doSomething(s, e): how do I reference the item with the x:name value do I
just type somename = changePropertyofControl? and how do I call the
function?

XAML

http://schemas.microsoft.com/winfx/2006/xaml/presentation";
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
   Title="Hello World" Height="300" Width="300">
   Click Me


Python Code is where I am confused

import clr
clr.AddReference('PresentationFramework')

from System.Windows.Markup import XamlReader
from System.Windows import Application
from System.IO import FileStream, FileMode

app = Application()

def doSomething(sender,event):
hello.Content = "Try again"


app.Run(XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open)))

This I am sure is really simple... Coming from a Tk background its confusing
for me.

Anyway ty

Cheers

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


Re: [IronPython] JSON vs. IronPython

2010-07-09 Thread Tristan Zajonc
There are bugs in the IronPython 2.6.1 json implementation that I believe
have been reported and will be fixed in 2.6.2.  For instance, the following
gives me an exception:

json.loads(json.dumps(dict(test="test")))

I have had better luck with simplejson and

import simplejson as json

Tristan

On Fri, Jul 9, 2010 at 2:12 PM, Brian Curtin  wrote:

> On Fri, Jul 9, 2010 at 13:05, Marcin Krol  wrote:
>
>> Hello everyone,
>>
>> I have successfully used JSON as serialization protocol between various
>> clients and servers in 2 projects, incl. Java app talking to Python servers,
>> so I would like to use JSON in my upcoming C/S project as well: there's
>> Json.NET, but how viable is using it in IronPython?
>>
>> Does anybody here have experience with using JSON in IronPython?
>>
>> --
>>
>> Regards,
>> mk
>
>
> I've never used JSON.NET, but the standard library json module works fine
> for me.
>
>
> IronPython 2.6.1 (2.6.10920.0) on .NET 4.0.30319.1
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import json
> >>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
> '["foo", {"bar": ["baz", null, 1.0, 2]}]'
>
> ___
> 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] overriding methods from C# classes

2010-07-09 Thread Dino Viehland
Marcin wrote:
> Curt Hagenlocher wrote:
> > Yes. It's universally true in the CLR that you can't override a function
> > in a derived class unless the function was marked as virtual in the base
> > class. IronPython is no different than C# in this regard.
> 
> One thing that would be *nice* for C# noobs like me would be throwing an
> exception in IPY when a method in a base C# class assembly isn't virtual.
> 
Unfortunately some time you want to do this - C# has "new" as well which 
explicitly lets you do this (otherwise it's only a warning).  If anything I
could see us providing a warning here but we'd need some way to squelch it 
as well.  And it would have an additional cost for constructing classes that
I'm not certain would be worth it.


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


Re: [IronPython] Unable to find assembly 'Microsoft.Dynamic

2010-07-09 Thread Dino Viehland
Marcin wrote:
> Dino Viehland wrote:
> > Can you bring the interactive window up normally using Alt-I or
> > View->Other Windows->IronPython Interactive?
> 
> Sure -- you mean that I run the program via execfile()?
> 
> Here's result, it's an exception but different one this time:
> 
> 
> > execfile('Program.py')
> Traceback (most recent call last):
>File "", line 1, in 
>File "Program.py", line 4, in 
> IOError: System.IO.IOException: Could not add reference to assembly ip_cl1
> at
> Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[]
> args, Boolean& shouldOptimize)
> at
> IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSit
> e
> site, CodeContext context, TFuncType func, T0 arg0)
> at
> System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite
> site, T0 arg0, T1 arg1, T2 arg2)
> at
> Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame
> frame)
> at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame
> frame)
> at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0
> arg0, T1 arg1)
> at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
> at IronPython.Compiler.PythonScriptCode.Run(Scope scope)
> at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
> at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)
> at Microsoft.Scripting.Hosting.CompiledCode.Execute(ScriptScope scope)
> at
> Microsoft.Scripting.Hosting.CompiledCode.ExecuteAndWrap(ScriptScope
> scope, ObjectHandle& exception)
> >

I was just more wanting to see if the REPL was behaving normally...  I'm
not entirely certain what the problem is for why this won't work but I have
at least one guess.  I'll try and see if I can get a repro on my side

But the good news is I'm pretty sure the next release will fix it.  The next 
release will have Microsoft.Dynamic in the GAC and so we'll always be able
to load that assembly (right now the app domain needs to be setup correctly
and it could be there's an issue w/ the remote domain here).
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Lukas Cenovsky

 On 9.7.2010 19:17, Dino Viehland wrote:

This is one of the reasons why I suggest WPF over WinForms.  In WPF you can
declare the event handlers in the XAML and we can wire them up to you.  In
our IronPython 2.7 source code I recently added a clr.LoadComponent method which
does this.  So for WPF the code ends up looking like:

import clr
clr.AddReference('PresentationFramework')

from System.Windows import Application, Window

class MyWindow(Window):
 def __init__(self):
 clr.LoadComponent('WpfApplication16.xaml', self)

 def Button_Click(self, sender, e):
 pass



if __name__ == '__main__':
Application().Run(MyWindow())


While the XAML looks like:

http://schemas.microsoft.com/winfx/2006/xaml/presentation";
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml";
Title="WpfApplication16" Height="300" Width="300">

 
 



And we'll both connect MyWindow.ButtonClick() to the event handlers as well as 
make Foo (the name of the button) available on the self instance.



This is very nice enhancement. Thanks.

--
-- Lukáš

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


[IronPython] reading utf-8 files

2010-07-09 Thread abdalla ramadan
Hello,

I am trying to read utf-8 files (written using notepad and have BOM) using
the following code

file = codecs.open(dir+ '\\' + i,"r",'utf_8_sig')
for line in file:
print "line"

I attached two files the a - 3 lines.txt file gives this exception and print
"line" is never called not even once

Unhandled Exception: System.Text.EncoderFallbackException: failed to decode
bytes at index 65

but the file a - 2 lines.txt is read without problems

I tried with several different texts but I could not find rule for a file
that throws this exception. I tested other files with 3 lines that did not
throw the exception.

Thanks very much for advance
九州看看
九州看看

九州看看
九州看看
九州看看

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


Re: [IronPython] Foolproof IP Embedding

2010-07-09 Thread Alex
2010/7/9 Michael Foord 

>  On 09/07/2010 16:20, Alex wrote:
>
>
>  This is probably the most effective solution. Instead of providing direct
> access to the UI elements provide an API for installing event handlers and
> wrap the user code in exception handling. Another way is to provide proxy
> objects  as you suggest.
>
> It may be a limitation - but if you want the user to be able to have access
> to your UI objects and attach events executing arbitrary code how else are
> you going to handle exceptions? This isn't a limitation of IronPython but a
> limitation of executing arbitrary user code in response to events.
>
>
yep, for the event attachement problem I think that IronPyton could have a
thin metaprogramation layer, when it encouters the  "button.Click += foo"
statement, it decorates foo automatically.
figuratively in the C# client we could have script.Execute(_scope, meta)
that raises the meta.EventAdded event that notify you the user is attaching
an event and let you decorates it. meta could also have some flags to impose
limitations etc..
 I dont know if it conflicts some core IronPython design.  I may try to do
it one day. If it works I'll propose it ;)
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Funke, Matt
I found the source of the error.

C:\Documents and Settings is a protected folder in Windows 7.  You need to 
change the security permissions on it so that IronPython has permission to view 
its contents and read files from it.  First, I needed to be sure I could view 
all files and folders (one of the Options in Windows Explorer); then the 
"Documents and Settings" folder showed up.  Changing permissions can be done 
under the Security tab if you right-click on the folder and select "Properties" 
in the context menu.

Thanks to those who responded for your help and insight.

-- Best Regards,
Matt Funke

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Funke, Matt
Sent: Friday, July 09, 2010 1:50 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

IRONPYTHONPATH is not even an environment variable.

README.txt is the only file in %PROGRAMFILES%\IronPython 2.6 for .NET 
4.0\Lib\site-packages.

Changing line 242 of site.py in 
C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython
 Tools for Visual Studio\0.2\Lib did not make the error go away.

I'll see if I can find anything useful in the call stack.  Thank you for your 
reply and your time.

-- Best Regards,
Matt Funke

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Dino Viehland
Sent: Friday, July 09, 2010 1:25 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

I can think of 1 of 2 things causing this:

1.   IRONPYTHONPATH is set somewhere and causing us to search in 
directories we shouldn't be

a.   You can just clear this env var if that's the problem

2.   There's something in site-packages which is causing this to be messed 
up.

a.   You can look in %PROGRAMFILES%\IronPython 2.6 for .NET 
4.0\Lib\site-packages and see if there's any unwanted goo here.  By default I 
think there's just a README.txt and pkg_resources.py.

b.  You can also look in %APPDATA%\Python - I think this may still not be 
properly versioned based upon Python runtime so it's possible something from 
CPython could interfere.  You could modify line 242 of site.py to be 
"IronPython" instead of "Python"


If that doesn't help it might be useful to look through that call stack and see 
where the directories are being pulled from.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Funke, Matt
Sent: Friday, July 09, 2010 9:06 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

I'm beginning to think that something is seriously wrong with my installation 
of IronPython.

When I enter IronPython from the command line (by typing "ipy -D 
-X:ColorfulConsole -X:TabCompletion"), and type in "help('modules')" to start 
my investigation of the dbapi implementation, I get this error:

Traceback (most recent call last):
  File "", line unknown, in 
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\site.py", line 429, in 
__call__
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1719, 
in __call__
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1754, 
in help
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1879, 
in listmodules
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1930, 
in run
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 105, 
in walk_packages
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 147, 
in iter_modules
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 211, 
in iter_modules
WindowsError: [Errno 13] [Errno 5] Access to the path 'C:\Documents and 
Settings\' is denied.

The path 'C:\Documents and Settings\' does not exist in a Windows 7 default 
installation.  What do I need to do to fix IronPython?

Thanks again for your time.

-- Best Regards,
Matt Funke

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Vernon Cole
Sent: Friday, July 09, 2010 11:44 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

There IS a working dbapi 2.0 implementation for Iron Python. see 
http://sourceforge.net/projects/adodbapi

It uses Microsoft ADO, so should be able to connect with PostgreSQL or almost 
any other tabular data source. I have not yet tested it with Postgres. That's 
the next thing on my to-do list. (I have a server running on my handy Ubuntu 
box, but can't seem to get it to connect. Why is there never enough time?)  It 
is known to work with MicroSoft SQL, ACCESS, MySQL, and IBM AS400 sql.

I also have not yet written a distutils setup for it for IronPython -- you will 
have to unzip and co

Re: [IronPython] JSON vs. IronPython

2010-07-09 Thread Brian Curtin
On Fri, Jul 9, 2010 at 13:05, Marcin Krol  wrote:

> Hello everyone,
>
> I have successfully used JSON as serialization protocol between various
> clients and servers in 2 projects, incl. Java app talking to Python servers,
> so I would like to use JSON in my upcoming C/S project as well: there's
> Json.NET, but how viable is using it in IronPython?
>
> Does anybody here have experience with using JSON in IronPython?
>
> --
>
> Regards,
> mk


I've never used JSON.NET, but the standard library json module works fine
for me.


IronPython 2.6.1 (2.6.10920.0) on .NET 4.0.30319.1
Type "help", "copyright", "credits" or "license" for more information.
>>> import json
>>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
'["foo", {"bar": ["baz", null, 1.0, 2]}]'
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Marcin Krol

Curt Hagenlocher wrote:
Yes. It's universally true in the CLR that you can't override a function 
in a derived class unless the function was marked as virtual in the base 
class. IronPython is no different than C# in this regard.


One thing that would be *nice* for C# noobs like me would be throwing an 
exception in IPY when a method in a base C# class assembly isn't virtual.


--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] JSON vs. IronPython

2010-07-09 Thread Marcin Krol

Hello everyone,

I have successfully used JSON as serialization protocol between various 
clients and servers in 2 projects, incl. Java app talking to Python 
servers, so I would like to use JSON in my upcoming C/S project as well: 
there's Json.NET, but how viable is using it in IronPython?


Does anybody here have experience with using JSON in IronPython?

--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Marcin Krol

Thanks for replies, Dino!

Dino Viehland wrote:


1. when IPY 2.7 is to be released?


Our current plan is around the end of this year.


That's a pity, I need to get rolling with this relatively soon.


2. Documentation. This sort of worries me: where do I get the detailed
info how to use this stuff? So far I have developed only in CPython/Linux...


Most of the documentation for WPF will apply here.  We'll need to document our
LoadComponent but I actually think you won't need to know much about it.  And
for what it's worth is basically mirrors what C#/VB.NET are doing with XAML it's
just more dynamic.

Of course if you want to continue to deploy to Linux w/ IronPython then I think 
WinForms is actually your best bet and you're on the right path.  I say that 
because Mono has WinForms support but not WPF support.


No, it's not like that: CPython/Linux is my server part of client/server 
app, IronPython/Windows is my client app platform.


--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Unable to find assembly 'Microsoft.Dynamic

2010-07-09 Thread Marcin Krol

Dino Viehland wrote:
Can you bring the interactive window up normally using Alt-I or 
View->Other Windows->IronPython Interactive?


Sure -- you mean that I run the program via execfile()?

Here's result, it's an exception but different one this time:


» execfile('Program.py')
Traceback (most recent call last):
  File "", line 1, in 
  File "Program.py", line 4, in 
IOError: System.IO.IOException: Could not add reference to assembly ip_cl1
   at 
Microsoft.Scripting.Actions.Calls.MethodCandidate.Caller.Call(Object[] 
args, Boolean& shouldOptimize)
   at 
IronPython.Runtime.Types.BuiltinFunction.BuiltinFunctionCaller`2.Call1(CallSite 
site, CodeContext context, TFuncType func, T0 arg0)
   at 
System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite 
site, T0 arg0, T1 arg1, T2 arg2)
   at 
Microsoft.Scripting.Interpreter.DynamicInstruction`4.Run(InterpretedFrame 
frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame 
frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 
arg0, T1 arg1)

   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at IronPython.Compiler.PythonScriptCode.Run(Scope scope)
   at IronPython.Compiler.RuntimeScriptCode.InvokeTarget(Scope scope)
   at IronPython.Compiler.RuntimeScriptCode.Run(Scope scope)
   at Microsoft.Scripting.Hosting.CompiledCode.Execute(ScriptScope scope)
   at 
Microsoft.Scripting.Hosting.CompiledCode.ExecuteAndWrap(ScriptScope 
scope, ObjectHandle& exception)

»



Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Dino Viehland
Marcin wrote:
> Dino Viehland wrote:
> >> Is there some way of simply overriding methods in Python so that they do
> >> get called by form events?
> >
> > In both of these cases there are no methods to be overridden.  You're just
> > defining methods which you want to use for the event handlers.  You need
> > to connect those methods to the event handlers somewhere.
> 
> OK hang on a second - WHICH methods do you mean precisely - In the base
> class or the overriden class?
> 
> Bc when I changed declaration of the method to "protected virtual" in
> the Form1.cs, the inherited class calls my Ipython method all right -
> that looks like overriding to me, at least when looking at it from the
> outside and not looking "under covers" what's happening.

Sorry I was confused...  I was thinking the C# code was a comparison not
what you were inheriting from.  

> 
> > Your C# code is
> > working probably because the connection of the event handlers is in the
> > generated code in InitializeComponent().
> 
> It is there all right:
> 
> public void InitializeComponent()
> {
> ..
>  this.comboBox1.SelectedIndexChanged += new
> System.EventHandler(this.comboBox1_SelectedIndexChanged);
> }
> 
> 
> 
> > This is one of the reasons why I suggest WPF over WinForms.  In WPF you can
> > declare the event handlers in the XAML and we can wire them up to you.  In
> > our IronPython 2.7 source code I recently added a clr.LoadComponent method
> which
> > does this.
> 
> Well that certainly makes WPF worth considering. Questions:
> 
> 1. when IPY 2.7 is to be released?

Our current plan is around the end of this year.

> 
> 2. Documentation. This sort of worries me: where do I get the detailed
> info how to use this stuff? So far I have developed only in CPython/Linux...

Most of the documentation for WPF will apply here.  We'll need to document our
LoadComponent but I actually think you won't need to know much about it.  And
for what it's worth is basically mirrors what C#/VB.NET are doing with XAML it's
just more dynamic.

Of course if you want to continue to deploy to Linux w/ IronPython then I think 
WinForms is actually your best bet and you're on the right path.  I say that 
because Mono has WinForms support but not WPF support.

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


Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Funke, Matt
IRONPYTHONPATH is not even an environment variable.

README.txt is the only file in %PROGRAMFILES%\IronPython 2.6 for .NET 
4.0\Lib\site-packages.

Changing line 242 of site.py in 
C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython
 Tools for Visual Studio\0.2\Lib did not make the error go away.

I'll see if I can find anything useful in the call stack.  Thank you for your 
reply and your time.

-- Best Regards,
Matt Funke

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Dino Viehland
Sent: Friday, July 09, 2010 1:25 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

I can think of 1 of 2 things causing this:

1.   IRONPYTHONPATH is set somewhere and causing us to search in 
directories we shouldn't be

a.   You can just clear this env var if that's the problem

2.   There's something in site-packages which is causing this to be messed 
up.

a.   You can look in %PROGRAMFILES%\IronPython 2.6 for .NET 
4.0\Lib\site-packages and see if there's any unwanted goo here.  By default I 
think there's just a README.txt and pkg_resources.py.

b.  You can also look in %APPDATA%\Python - I think this may still not be 
properly versioned based upon Python runtime so it's possible something from 
CPython could interfere.  You could modify line 242 of site.py to be 
"IronPython" instead of "Python"


If that doesn't help it might be useful to look through that call stack and see 
where the directories are being pulled from.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Funke, Matt
Sent: Friday, July 09, 2010 9:06 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

I'm beginning to think that something is seriously wrong with my installation 
of IronPython.

When I enter IronPython from the command line (by typing "ipy -D 
-X:ColorfulConsole -X:TabCompletion"), and type in "help('modules')" to start 
my investigation of the dbapi implementation, I get this error:

Traceback (most recent call last):
  File "", line unknown, in 
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\site.py", line 429, in 
__call__
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1719, 
in __call__
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1754, 
in help
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1879, 
in listmodules
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1930, 
in run
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 105, 
in walk_packages
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 147, 
in iter_modules
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 211, 
in iter_modules
WindowsError: [Errno 13] [Errno 5] Access to the path 'C:\Documents and 
Settings\' is denied.

The path 'C:\Documents and Settings\' does not exist in a Windows 7 default 
installation.  What do I need to do to fix IronPython?

Thanks again for your time.

-- Best Regards,
Matt Funke

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Vernon Cole
Sent: Friday, July 09, 2010 11:44 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

There IS a working dbapi 2.0 implementation for Iron Python. see 
http://sourceforge.net/projects/adodbapi

It uses Microsoft ADO, so should be able to connect with PostgreSQL or almost 
any other tabular data source. I have not yet tested it with Postgres. That's 
the next thing on my to-do list. (I have a server running on my handy Ubuntu 
box, but can't seem to get it to connect. Why is there never enough time?)  It 
is known to work with MicroSoft SQL, ACCESS, MySQL, and IBM AS400 sql.

I also have not yet written a distutils setup for it for IronPython -- you will 
have to unzip and copy to do the install the hard way. (Another to-do list 
item.)

You will either need to find an ADO provider for Postgres, or use an ODBC 
driver and a different connection string. (I use an ODBC connection for the 
MySQL sample in the \test folder.) Let me know how it works for you.
--
Vernon Cole
On Fri, Jul 9, 2010 at 8:49 AM, Michael Foord 
mailto:fuzzy...@voidspace.org.uk>> wrote:
On 09/07/2010 14:50, Funke, Matt wrote:
I'm extremely new to compiling things in anything approaching a pythonic way, 
so my apologies in advance for what's probably a very simplistic question.

I've downloaded the source for psycopg2-2.2.1.  The documentation recommends 
using the standard "python setup.py build" and "python setup.py install".

So I tried to run "ipy setup.py build" to incorporate these libraries into 
IronPython.

I get this error:

Traceback (most recent call l

Re: [IronPython] Writing to a file with unicode name

2010-07-09 Thread abdalla ramadan
Vernon:

Thank you very much for your reply.
Since the unicode text is not hard coded and is read from file I thought
that writing
line = line[0:-1]
will get rid of the new line character but it seemed I have to write
line = line.replace("\r","").replace("\n","")
now the code works correctly.

Thanks again.

2010/7/9 Vernon Cole 

> Adballa:
>   One problem you may be having is with Python trying to escape the
> backslashes in your Windows file name.  I tried a very simple test using the
> Python "open" statement rather than any fancy .NET things. It created a file
> with a japenese name on my Windows Vista laptop. Note that I used forward
> (/) slashes where Windows users would expect a back (\) slash.
>
> 
> out = open(u"c:/temp/青山学院大学相模原キャンパス",'w')
> out.write('testing...\n')
> out.close()
> 
>
> The same code works in CPython, too.  If I remove the "u" unicode indicator
> as in
>  ...open("c:/temp...
> then the same code will work in IronPython and Python 3.1, since it is
> unnecessary in IPy and illegal in Python 3.
> --
> Vernon
>
> 2010/7/9 abdalla ramadan 
>
>> Hello,
>>
>> I am trying to write to a file with the japanese name 青山学院大学相模原キャンパス
>> The relative path I am passing to the methods is
>> "output\url\c\青山学院大学相模原キャンパス"
>>
>> I used two methods
>> s = StreamWriter(filenamenew, True, Encoding.UTF8)
>> and
>> outputfile = codecs.open(filenamenew, "w",'utf_8_sig')
>>
>> which both throwed the following exception:
>> Unhandled Exception: System.ArgumentException: Illegal characters in path.
>>
>> Thanks very much for advance.
>>
>> ___
>> 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] overriding methods from C# classes

2010-07-09 Thread Curt Hagenlocher
On Fri, Jul 9, 2010 at 10:43 AM, Marcin Krol  wrote:

>
> Bc when I changed declaration of the method to "protected virtual" in the
> Form1.cs, the inherited class calls my Ipython method all right - that looks
> like overriding to me, at least when looking at it from the outside and not
> looking "under covers" what's happening.


Yes. It's universally true in the CLR that you can't override a function in
a derived class unless the function was marked as virtual in the base class.
IronPython is no different than C# in this regard.

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


Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Marcin Krol

Dino Viehland wrote:

Is there some way of simply overriding methods in Python so that they do
get called by form events?


In both of these cases there are no methods to be overridden.  You're just 
defining methods which you want to use for the event handlers.  You need
to connect those methods to the event handlers somewhere.  


OK hang on a second - WHICH methods do you mean precisely - In the base 
class or the overriden class?


Bc when I changed declaration of the method to "protected virtual" in 
the Form1.cs, the inherited class calls my Ipython method all right - 
that looks like overriding to me, at least when looking at it from the 
outside and not looking "under covers" what's happening.



Your C# code is
working probably because the connection of the event handlers is in the 
generated code in InitializeComponent().


It is there all right:

public void InitializeComponent()
{
..
this.comboBox1.SelectedIndexChanged += new 
System.EventHandler(this.comboBox1_SelectedIndexChanged);

}




This is one of the reasons why I suggest WPF over WinForms.  In WPF you can
declare the event handlers in the XAML and we can wire them up to you.  In
our IronPython 2.7 source code I recently added a clr.LoadComponent method which
does this.  


Well that certainly makes WPF worth considering. Questions:

1. when IPY 2.7 is to be released?

2. Documentation. This sort of worries me: where do I get the detailed 
info how to use this stuff? So far I have developed only in CPython/Linux...




Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] System.MissingMemberException

2010-07-09 Thread Marcin Krol

Dino Viehland wrote:

We do have an option to report inconsistent tabs/spaces...  We just need to
enable it in the parser and setup an option to disable it.  I believe it's
somewhere on the TODO list.


Good to know -- inconsistent indentation can be a real pain in a large 
project. WingIDE does have red underlining for inconsistent indentation 
IIRC.



--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Dino Viehland
I can think of 1 of 2 things causing this:

1.   IRONPYTHONPATH is set somewhere and causing us to search in 
directories we shouldn't be

a.   You can just clear this env var if that's the problem

2.   There's something in site-packages which is causing this to be messed 
up.

a.   You can look in %PROGRAMFILES%\IronPython 2.6 for .NET 
4.0\Lib\site-packages and see if there's any unwanted goo here.  By default I 
think there's just a README.txt and pkg_resources.py.

b.  You can also look in %APPDATA%\Python - I think this may still not be 
properly versioned based upon Python runtime so it's possible something from 
CPython could interfere.  You could modify line 242 of site.py to be 
"IronPython" instead of "Python"


If that doesn't help it might be useful to look through that call stack and see 
where the directories are being pulled from.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Funke, Matt
Sent: Friday, July 09, 2010 9:06 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

I'm beginning to think that something is seriously wrong with my installation 
of IronPython.

When I enter IronPython from the command line (by typing "ipy -D 
-X:ColorfulConsole -X:TabCompletion"), and type in "help('modules')" to start 
my investigation of the dbapi implementation, I get this error:

Traceback (most recent call last):
  File "", line unknown, in 
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\site.py", line 429, in 
__call__
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1719, 
in __call__
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1754, 
in help
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1879, 
in listmodules
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1930, 
in run
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 105, 
in walk_packages
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 147, 
in iter_modules
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 211, 
in iter_modules
WindowsError: [Errno 13] [Errno 5] Access to the path 'C:\Documents and 
Settings\' is denied.

The path 'C:\Documents and Settings\' does not exist in a Windows 7 default 
installation.  What do I need to do to fix IronPython?

Thanks again for your time.

-- Best Regards,
Matt Funke

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Vernon Cole
Sent: Friday, July 09, 2010 11:44 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

There IS a working dbapi 2.0 implementation for Iron Python. see 
http://sourceforge.net/projects/adodbapi

It uses Microsoft ADO, so should be able to connect with PostgreSQL or almost 
any other tabular data source. I have not yet tested it with Postgres. That's 
the next thing on my to-do list. (I have a server running on my handy Ubuntu 
box, but can't seem to get it to connect. Why is there never enough time?)  It 
is known to work with MicroSoft SQL, ACCESS, MySQL, and IBM AS400 sql.

I also have not yet written a distutils setup for it for IronPython -- you will 
have to unzip and copy to do the install the hard way. (Another to-do list 
item.)

You will either need to find an ADO provider for Postgres, or use an ODBC 
driver and a different connection string. (I use an ODBC connection for the 
MySQL sample in the \test folder.) Let me know how it works for you.
--
Vernon Cole
On Fri, Jul 9, 2010 at 8:49 AM, Michael Foord 
mailto:fuzzy...@voidspace.org.uk>> wrote:
On 09/07/2010 14:50, Funke, Matt wrote:
I'm extremely new to compiling things in anything approaching a pythonic way, 
so my apologies in advance for what's probably a very simplistic question.

I've downloaded the source for psycopg2-2.2.1.  The documentation recommends 
using the standard "python setup.py build" and "python setup.py install".

So I tried to run "ipy setup.py build" to incorporate these libraries into 
IronPython.

I get this error:

Traceback (most recent call last):
  File "setup.py", line 50, in
ImportError: No module named subprocess



subprocess relies on modules like signal that aren't available in IronPython 
2.6.1.

There is a partial implementation of subprocess by Jeff Hardy floating around 
that you could try. In general the IronPython support for distutils is 
"minimal", so I still wouldn't expect normal module installation to work.

All the best,

Michael

I can verify that subprocess.py is in 
C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython
 Tools for Visual Studio\0.2\Lib.  Do I need to add this directory to an 
environment variable (like PATH), or is there some other way I can notify 
IronPython about where to look for li

Re: [IronPython] overriding methods from C# classes

2010-07-09 Thread Dino Viehland
Marcin wrote:
> Hello Michael and everyone,
> 
> Michael Foord wrote:
> > I recommend using the Visual Studio C# designer and then subclass
> > the classes it generates from IronPython.
> 
> I set out to do just that and stumbled upon a problem:
> 
> I generated Windows form in C#, compiled into assembly (ip_cl1), copied
> to python project folder:
> 
> clr.AddReference('ip_cl1')
> ..
> from ip_cl1 import Form1
> 
> 
> class Form1Inh(Form1):
> def __init__(self):
> Form1.__init__(self)
> 
> def comboBox1_SelectedIndexChanged(self, sender, event):
> self.BackColor = Color.Azure
> 
> This doesn't work, i.e. method comboBox1_SelectedIndexChanged doesn't
> get called. I have to expicitly add EventHandler in Python:
> 
> class Form1Inh(Form1):
> def __init__(self):
> Form1.__init__(self)
> self.box1.SelectedIndexChanged +=
> EventHandler(self.comboBox1_SelectedIndexChanged);
> 
> def comboBox1_SelectedIndexChanged(self, sender, event):
> self.BackColor = Color.Azure
> 
> 
> Is there some way of simply overriding methods in Python so that they do
> get called by form events?

In both of these cases there are no methods to be overridden.  You're just 
defining methods which you want to use for the event handlers.  You need
to connect those methods to the event handlers somewhere.  Your C# code is
working probably because the connection of the event handlers is in the 
generated code in InitializeComponent().

This is one of the reasons why I suggest WPF over WinForms.  In WPF you can
declare the event handlers in the XAML and we can wire them up to you.  In
our IronPython 2.7 source code I recently added a clr.LoadComponent method which
does this.  So for WPF the code ends up looking like:

import clr
clr.AddReference('PresentationFramework')

from System.Windows import Application, Window

class MyWindow(Window):
def __init__(self):
clr.LoadComponent('WpfApplication16.xaml', self)

def Button_Click(self, sender, e):
pass



if __name__ == '__main__':
Application().Run(MyWindow())


While the XAML looks like:

http://schemas.microsoft.com/winfx/2006/xaml/presentation"; 
   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"; 
   Title="WpfApplication16" Height="300" Width="300"> 
   





And we'll both connect MyWindow.ButtonClick() to the event handlers as well as 
make Foo (the name of the button) available on the self instance.

WinForms is likely to always be a bit of a rough experience because we don't 
have the meta-data to know how to wire things up automatically for you.

> 
> 
> 
> 
> In Form1.cs I have:
> 
> 
> namespace ip_cl1
> {
>  public partial class Form1 : Form
>  {
>  public Form1()
>  {
>  InitializeComponent();
>  }
> 
>  protected void box1_SelectedIndexChanged(object sender,
> EventArgs e)
>  {
> 
>  }
> 
>  protected void comboBox1_SelectedIndexChanged(object sender,
> EventArgs e)
>  {
> 
>  }
>  }
> }
> 
> --
> 
> Regards,
> mk
> 
> --
> Premature optimization is the root of all fun.
> ___
> 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] overriding methods defined in C# classes

2010-07-09 Thread Marcin Krol

Simon Dahlbacka wrote:

Shouldn't your c# methods be protected virtual to be overridable?


Yes, that was it. Thanks! I'm a total newbie in C#.


--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Unable to find assembly 'Microsoft.Dynamic

2010-07-09 Thread Dino Viehland
Can you bring the interactive window up normally using Alt-I or 
View->Other Windows->IronPython Interactive?

> -Original Message-
> From: users-boun...@lists.ironpython.com [mailto:users-
> boun...@lists.ironpython.com] On Behalf Of Marcin Krol
> Sent: Friday, July 09, 2010 9:24 AM
> To: Discussion of IronPython
> Subject: [IronPython] Unable to find assembly 'Microsoft.Dynamic
> 
> Hello everyone,
> 
> I seem to be hitting all the rough edges: when I run my project in
> interactive window (Debug | Execute project in python interactive..), I
> get this exception:
> 
> Remote process has been reset...
> Exception: System.Runtime.Serialization.SerializationException: Unable
> to find assembly 'Microsoft.Dynamic, Version=1.0.0.0, Culture=neutral,
> PublicKeyToken=31bf3856ad364e35'.
> 
> Huh? Do I need DLR or smth?
> 
> Full text:
> 
> Running c:\Documents and Settings\Administrator\My Documents\Visual
> Studio 2010\Projects\WindowsApplication1\WindowsApplication1\Program.py
> Remote process has been reset...
> Exception: System.Runtime.Serialization.SerializationException: Unable
> to find assembly 'Microsoft.Dynamic, Version=1.0.0.0, Culture=neutral,
> PublicKeyToken=31bf3856ad364e35'.
> 
> Server stack trace:
> at
> System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly(
> )
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAsse
> mblyInfo
> assemblyInfo, String name)
> at
> System.Runtime.Serialization.Formatters.Binary.BinaryConverter.TypeFromInfo(Bi
> naryTypeEnum
> binaryTypeEnum, Object typeInformation, ObjectReader objectReader,
> BinaryAssemblyInfo assemblyInfo, InternalPrimitiveTypeE&
> primitiveTypeEnum, String& typeString, Type& type, Boolean& isVariant)
> at
> System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(Binary
> HeaderEnum
> binaryHeaderEnum)
> at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
> at
> System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(Header
> Handler
> handler, __BinaryParser serParser, Boolean fCheck, Boolean
> isCrossAppDomain, IMethodCallMessage methodCallMessage)
> at
> System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Str
> eam
> serializationStream, HeaderHandler handler, Boolean fCheck, Boolean
> isCrossAppDomain, IMethodCallMessage methodCallMessage)
> at
> System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryResponseMessage(
> Stream
> inputStream, IMethodCallMessage reqMsg, Boolean bStrictBinding)
> at
> System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(
> IMessage
> msg)
> 
> Exception rethrown at [0]:
> at
> System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage
> reqMsg, IMessage retMsg)
> at
> System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&
> msgData, Int32 type)
> at Microsoft.Scripting.Hosting.CompiledCode.Execute(ScriptScope scope)
> at
> Microsoft.IronPythonTools.Commands.ExecuteInReplCommand.<>c__DisplayClass1. Command>b__0(Object
> _)
> 
> 
> --
> 
> Regards,
> mk
> 
> --
> Premature optimization is the root of all fun.
> ___
> 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] sys._getframe(0).f_lineno always returns 1

2010-07-09 Thread Dino Viehland
This is definitely a bug.  If you'd open a bug on CodePlex that'd be great.  
Currently we only track the line information locally but in -X:Frames mode we 
should hoist that information into the frame.

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of yngipy hernan
Sent: Thursday, July 08, 2010 8:24 PM
To: Discussion of IronPython
Subject: Re: [IronPython] sys._getframe(0).f_lineno always returns 1

Bump.

Anyone can confirm this issue? Or am I doing it incorrectly?

Yngipy

On Thu, Jul 8, 2010 at 1:15 AM, yngipy hernan 
mailto:yng...@gmail.com>> wrote:
Hi all,

I have observed something that may be an issue, see snippet below

import sys

#filename is temp.py
print 'hello world'
print 'hello world'
print 'Line : %s'%sys._getframe(0).f_lineno

Here is my command line:

ipy.exe -X:FullFrames temp.py

The command "sys._getframe(0).f_lineno" always returns 1.

Below my IPY version:
IronPython 2.6.1 (2.6.10920.0) on .NET 4.0.30319.1

Note that CPython 2.6.5 reports "6"

Regards,
Yngipy
IPRobot (http://pyas.svn.sourceforge.net/viewvc/pyas/trunk/src/ipr/)


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


Re: [IronPython] Tracebacks

2010-07-09 Thread Dino Viehland

Rob wrote:
> Hi
> 
> This might be the wrong list for this, but when I run python apps in
> an ide (like wing) I get nice exception tracebacks with line numbers,
> yet in visualstudio with ironpython tools these are missing, instead I
> get a dialog that isn't very useful unless I copy the details to the
> clip board and paste it to an empty file.
> 
> Is there a more natural way to get this information inside visual studio?


The experience here is definitely rough.  You should see the call stack in
the VS call stack window.  And it should include line number information
as well and you should be able to double click on a frame and go to the
line immediately.  But the function names are rather mangled so it doesn't
look very pretty right now.  We need to do more work to integrate w/ the
debugger beyond what we get for free from VS.


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


Re: [IronPython] System.MissingMemberException

2010-07-09 Thread Dino Viehland
Marcin wrote:
> Hello everyone,
> 
> I have stumbled upon what's probably an idiotic newbie problem: if I add
> any method to a class, I get System.MissingMemberException. E.g.
> 
> import clr
> clr.AddReference('System.Windows.Forms')
> 
> from System.Windows.Forms import *
> 
> 
> class MyForm(Form):
>  def __init__(self):
>   button = Button()
>   button.Text = 'Click Me'
>   self.button = button
>   self.Controls.Add(button)
>   x = 'abc'
>   b = self.func(range(5))
> 
>   def func(self, x):
>   return x
> 
> 
> form = MyForm()
> Application.Run(form)
> 
> 
> If I comment out func and reference to func in __init__, it works.
> However, with func I get lots of exceptions:
> 
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e
> 089\mscorlib.dll',
> Skipped loading symbols. Module is optimized and the debugger option
> 'Just My Code' is enabled.
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and
> Settings\Administrator\Local Settings\Application
> Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools
> for Visual Studio\0.3\ipyw.exe'
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and
> Settings\Administrator\Local Settings\Application
> Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools
> for Visual Studio\0.3\Microsoft.Dynamic.dll'
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and
> Settings\Administrator\Local Settings\Application
> Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools
> for Visual Studio\0.3\Microsoft.Scripting.dll'
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0_
> _b03f5f7f11d50a3a\System.Configuration.dll',
> Skipped loading symbols. Module is optimized and the debugger option
> 'Just My Code' is enabled.
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e
> 089\System.dll',
> Skipped loading symbols. Module is optimized and the debugger option
> 'Just My Code' is enabled.
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561
> 934e089\System.Xml.dll',
> Skipped loading symbols. Module is optimized and the debugger option
> 'Just My Code' is enabled.
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and
> Settings\Administrator\Local Settings\Application
> Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools
> for Visual Studio\0.3\IronPython.dll'
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c56
> 1934e089\System.Core.dll',
> Skipped loading symbols. Module is optimized and the debugger option
> 'Just My Code' is enabled.
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a
> 5c561934e089\System.Numerics.dll',
> Skipped loading symbols. Module is optimized and the debugger option
> 'Just My Code' is enabled.
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and
> Settings\Administrator\Local Settings\Application
> Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools
> for Visual Studio\0.3\IronPython.Modules.dll'
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded 'Snippets.debug.scripting'
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded
> 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\ISymWrapper\v4.0_4.0.0.0__b03f5f7f11
> d50a3a\ISymWrapper.dll'
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted
> DynamicMethods Assembly'
> A first chance exception of type
> 'Microsoft.Scripting.ArgumentTypeException' occurred in
> Snippets.debug.scripting
> 'ipyw.exe' (Managed (v4.0.30319)): Loaded 'Snippets.scripting'
> A first chance exception of type 'System.MissingMemberException'
> occurred in IronPython.dll
> A first chance exception of type
> 'IronPython.Runtime.UnboundNameException' occurred in Microsoft.Dynamic.dll
> A first chance exception of type
> 'IronPython.Runtime.UnboundNameException' occurred in Microsoft.Dynamic.dll
> A first chance exception of type
> 'IronPython.Runtime.UnboundNameException' occurred in Microsoft.Dynamic.dll
> A first chance exception of type
> 'IronPython.Runtime.UnboundNameException' occurred in IronPython.dll
> A first chance exception of type 'System.MissingMemberException'
> occurred in IronPython.dll
> A first chance exception of type 'System.MissingMemberException'
> occurred in IronPython.dll
> A first chance exception of type 'System.MissingMemberException'
> occurred in IronPython.dll
> A first chance exception of type 'System.MissingMemberException'
> occurred in IronPython.dll
> A first chance exception of type 'System.MissingMemberException'
> occurred in IronPython.dll
> A first chance exception of type 'System.Mis

Re: [IronPython] System.MissingMemberException

2010-07-09 Thread Dino Viehland

Marcin wrote:
> Hello everyone,
> 
> 
> Ok I found the cause, the __init__ filled in from the template is
> exactly one space to the left from where it should be:
> 
> class MyForm(Form):
>  def __init__(self):
> ...
>   def func(self, x):
>   return x
> 
> If I shift "def __init__.." one space to the right, everything works.
> 
> But why I got such a strange exception?
> 
> And isn't there some sort of tab nanny or "inconsistent layout" exception?

We do have an option to report inconsistent tabs/spaces...  We just need to
enable it in the parser and setup an option to disable it.  I believe it's
somewhere on the TODO list.


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


Re: [IronPython] overriding methods defined in C# classes

2010-07-09 Thread Simon Dahlbacka
Shouldn't your c# methods be protected virtual to be overridable?

On Jul 9, 2010 7:41 PM, "Marcin Krol"  wrote:

Hello Michael and everyone,

(sigh, I sent reply recently while I meant to start a new thread, this is
it)

Michael Foord wrote:
> I recommend using the Visual Studio C# designer and then subclass the
classes it generates from IronPython.

I set out to do just that and stumbled upon a problem:

I generated Windows form in C#, compiled into assembly (ip_cl1), copied to
python project folder:

clr.AddReference('ip_cl1')
..
from ip_cl1 import Form1


class Form1Inh(Form1):
  def __init__(self):
  Form1.__init__(self)

  def comboBox1_SelectedIndexChanged(self, sender, event):
  self.BackColor = Color.Azure

This doesn't work, i.e. method comboBox1_SelectedIndexChanged doesn't get
called. I have to expicitly add EventHandler in Python:

class Form1Inh(Form1):
  def __init__(self):
  Form1.__init__(self)
  self.box1.SelectedIndexChanged +=
EventHandler(self.comboBox1_SelectedIndexChanged);

  def comboBox1_SelectedIndexChanged(self, sender, event):
  self.BackColor = Color.Azure


Is there some way of simply overriding methods in Python so that they do get
called by form events?




In Form1.cs I have:


namespace ip_cl1
{
   public partial class Form1 : Form
   {
   public Form1()
   {
   InitializeComponent();
   }

   protected void box1_SelectedIndexChanged(object sender, EventArgs e)
   {

   }

   protected void comboBox1_SelectedIndexChanged(object sender,
EventArgs e)
   {

   }
   }
}

-- 

Regards,
mk

-- 
Premature optimization is the root of all fun.



-- 

Regards,
mk

--
Premature optimization is the root of all fun.
___
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] Writing to a file with unicode name

2010-07-09 Thread Vernon Cole
Adballa:
  One problem you may be having is with Python trying to escape the
backslashes in your Windows file name.  I tried a very simple test using the
Python "open" statement rather than any fancy .NET things. It created a file
with a japenese name on my Windows Vista laptop. Note that I used forward
(/) slashes where Windows users would expect a back (\) slash.


out = open(u"c:/temp/青山学院大学相模原キャンパス",'w')
out.write('testing...\n')
out.close()


The same code works in CPython, too.  If I remove the "u" unicode indicator
as in
 ...open("c:/temp...
then the same code will work in IronPython and Python 3.1, since it is
unnecessary in IPy and illegal in Python 3.
--
Vernon

2010/7/9 abdalla ramadan 

> Hello,
>
> I am trying to write to a file with the japanese name 青山学院大学相模原キャンパス
> The relative path I am passing to the methods is
> "output\url\c\青山学院大学相模原キャンパス"
>
> I used two methods
> s = StreamWriter(filenamenew, True, Encoding.UTF8)
> and
> outputfile = codecs.open(filenamenew, "w",'utf_8_sig')
>
> which both throwed the following exception:
> Unhandled Exception: System.ArgumentException: Illegal characters in path.
>
> Thanks very much for advance.
>
> ___
> 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


[IronPython] overriding methods defined in C# classes

2010-07-09 Thread Marcin Krol

Hello Michael and everyone,

(sigh, I sent reply recently while I meant to start a new thread, this 
is it)


Michael Foord wrote:
> I recommend using the Visual Studio C# designer and then subclass the 
classes it generates from IronPython.


I set out to do just that and stumbled upon a problem:

I generated Windows form in C#, compiled into assembly (ip_cl1), copied 
to python project folder:


clr.AddReference('ip_cl1')
..
from ip_cl1 import Form1


class Form1Inh(Form1):
   def __init__(self):
   Form1.__init__(self)

   def comboBox1_SelectedIndexChanged(self, sender, event):
   self.BackColor = Color.Azure

This doesn't work, i.e. method comboBox1_SelectedIndexChanged doesn't 
get called. I have to expicitly add EventHandler in Python:


class Form1Inh(Form1):
   def __init__(self):
   Form1.__init__(self)
   self.box1.SelectedIndexChanged += 
EventHandler(self.comboBox1_SelectedIndexChanged);


   def comboBox1_SelectedIndexChanged(self, sender, event):
   self.BackColor = Color.Azure


Is there some way of simply overriding methods in Python so that they do 
get called by form events?





In Form1.cs I have:


namespace ip_cl1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

protected void box1_SelectedIndexChanged(object sender, 
EventArgs e)

{

}

protected void comboBox1_SelectedIndexChanged(object sender, 
EventArgs e)

{

}
}
}

--

Regards,
mk

--
Premature optimization is the root of all fun.



--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Unable to find assembly 'Microsoft.Dynamic

2010-07-09 Thread Marcin Krol

Hello everyone,

I seem to be hitting all the rough edges: when I run my project in 
interactive window (Debug | Execute project in python interactive..), I 
get this exception:


Remote process has been reset...
Exception: System.Runtime.Serialization.SerializationException: Unable 
to find assembly 'Microsoft.Dynamic, Version=1.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35'.


Huh? Do I need DLR or smth?

Full text:

Running c:\Documents and Settings\Administrator\My Documents\Visual 
Studio 2010\Projects\WindowsApplication1\WindowsApplication1\Program.py

Remote process has been reset...
Exception: System.Runtime.Serialization.SerializationException: Unable 
to find assembly 'Microsoft.Dynamic, Version=1.0.0.0, Culture=neutral, 
PublicKeyToken=31bf3856ad364e35'.


Server stack trace:
   at 
System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at 
System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo 
assemblyInfo, String name)
   at 
System.Runtime.Serialization.Formatters.Binary.BinaryConverter.TypeFromInfo(BinaryTypeEnum 
binaryTypeEnum, Object typeInformation, ObjectReader objectReader, 
BinaryAssemblyInfo assemblyInfo, InternalPrimitiveTypeE& 
primitiveTypeEnum, String& typeString, Type& type, Boolean& isVariant)
   at 
System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadArray(BinaryHeaderEnum 
binaryHeaderEnum)

   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at 
System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler 
handler, __BinaryParser serParser, Boolean fCheck, Boolean 
isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at 
System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream 
serializationStream, HeaderHandler handler, Boolean fCheck, Boolean 
isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at 
System.Runtime.Remoting.Channels.CoreChannel.DeserializeBinaryResponseMessage(Stream 
inputStream, IMethodCallMessage reqMsg, Boolean bStrictBinding)
   at 
System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage(IMessage 
msg)


Exception rethrown at [0]:
   at 
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage 
reqMsg, IMessage retMsg)
   at 
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& 
msgData, Int32 type)

   at Microsoft.Scripting.Hosting.CompiledCode.Execute(ScriptScope scope)
   at 
Microsoft.IronPythonTools.Commands.ExecuteInReplCommand.<>c__DisplayClass1.b__0(Object 
_)



--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] overriding methods from C# classes

2010-07-09 Thread Marcin Krol

Hello Michael and everyone,

Michael Foord wrote:
I recommend using the Visual Studio C# designer and then subclass 
the classes it generates from IronPython.


I set out to do just that and stumbled upon a problem:

I generated Windows form in C#, compiled into assembly (ip_cl1), copied 
to python project folder:


clr.AddReference('ip_cl1')
..
from ip_cl1 import Form1


class Form1Inh(Form1):
   def __init__(self):
   Form1.__init__(self)

   def comboBox1_SelectedIndexChanged(self, sender, event):
   self.BackColor = Color.Azure

This doesn't work, i.e. method comboBox1_SelectedIndexChanged doesn't 
get called. I have to expicitly add EventHandler in Python:


class Form1Inh(Form1):
   def __init__(self):
   Form1.__init__(self)
   self.box1.SelectedIndexChanged += 
EventHandler(self.comboBox1_SelectedIndexChanged);


   def comboBox1_SelectedIndexChanged(self, sender, event):
   self.BackColor = Color.Azure


Is there some way of simply overriding methods in Python so that they do 
get called by form events?





In Form1.cs I have:


namespace ip_cl1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

protected void box1_SelectedIndexChanged(object sender, 
EventArgs e)

{

}

protected void comboBox1_SelectedIndexChanged(object sender, 
EventArgs e)

{

}
}
}

--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Funke, Matt
I'm beginning to think that something is seriously wrong with my installation 
of IronPython.

When I enter IronPython from the command line (by typing "ipy -D 
-X:ColorfulConsole -X:TabCompletion"), and type in "help('modules')" to start 
my investigation of the dbapi implementation, I get this error:

Traceback (most recent call last):
  File "", line unknown, in 
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\site.py", line 429, in 
__call__
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1719, 
in __call__
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1754, 
in help
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1879, 
in listmodules
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pydoc.py", line 1930, 
in run
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 105, 
in walk_packages
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 147, 
in iter_modules
  File "C:\Program Files\IronPython 2.6 for .NET 4.0\Lib\pkgutil.py", line 211, 
in iter_modules
WindowsError: [Errno 13] [Errno 5] Access to the path 'C:\Documents and 
Settings\' is denied.

The path 'C:\Documents and Settings\' does not exist in a Windows 7 default 
installation.  What do I need to do to fix IronPython?

Thanks again for your time.

-- Best Regards,
Matt Funke

From: users-boun...@lists.ironpython.com 
[mailto:users-boun...@lists.ironpython.com] On Behalf Of Vernon Cole
Sent: Friday, July 09, 2010 11:44 AM
To: Discussion of IronPython
Subject: Re: [IronPython] Compiling so that IronPython libraries are recognized?

There IS a working dbapi 2.0 implementation for Iron Python. see 
http://sourceforge.net/projects/adodbapi

It uses Microsoft ADO, so should be able to connect with PostgreSQL or almost 
any other tabular data source. I have not yet tested it with Postgres. That's 
the next thing on my to-do list. (I have a server running on my handy Ubuntu 
box, but can't seem to get it to connect. Why is there never enough time?)  It 
is known to work with MicroSoft SQL, ACCESS, MySQL, and IBM AS400 sql.

I also have not yet written a distutils setup for it for IronPython -- you will 
have to unzip and copy to do the install the hard way. (Another to-do list 
item.)

You will either need to find an ADO provider for Postgres, or use an ODBC 
driver and a different connection string. (I use an ODBC connection for the 
MySQL sample in the \test folder.) Let me know how it works for you.
--
Vernon Cole
On Fri, Jul 9, 2010 at 8:49 AM, Michael Foord 
mailto:fuzzy...@voidspace.org.uk>> wrote:
On 09/07/2010 14:50, Funke, Matt wrote:
I'm extremely new to compiling things in anything approaching a pythonic way, 
so my apologies in advance for what's probably a very simplistic question.

I've downloaded the source for psycopg2-2.2.1.  The documentation recommends 
using the standard "python setup.py build" and "python setup.py install".

So I tried to run "ipy setup.py build" to incorporate these libraries into 
IronPython.

I get this error:

Traceback (most recent call last):
  File "setup.py", line 50, in
ImportError: No module named subprocess



subprocess relies on modules like signal that aren't available in IronPython 
2.6.1.

There is a partial implementation of subprocess by Jeff Hardy floating around 
that you could try. In general the IronPython support for distutils is 
"minimal", so I still wouldn't expect normal module installation to work.

All the best,

Michael

I can verify that subprocess.py is in 
C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython
 Tools for Visual Studio\0.2\Lib.  Do I need to add this directory to an 
environment variable (like PATH), or is there some other way I can notify 
IronPython about where to look for library files?

Thanks for your time.

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


--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of 
your employer, to release me from all obligations and waivers arising from any 
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, 
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and 
acceptable use policies ("BOGUS AGREEMENTS") that I have entered into with your 
employer, its partners, licensors, agents and assigns, in perpetuity, without 
prejudice to my ongoing rights and privileges. You further represent that you 
have the authority to release me from any BOGUS AGREEMENTS on behalf of your 
employer.



___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.c

Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Vernon Cole
There IS a working dbapi 2.0 implementation for Iron Python. see
http://sourceforge.net/projects/adodbapi

It uses Microsoft ADO, so should be able to connect with PostgreSQL or
almost any other tabular data source. I have not yet tested it with
Postgres. That's the next thing on my to-do list. (I have a server running
on my handy Ubuntu box, but can't seem to get it to connect. Why is there
never enough time?)  It is known to work with MicroSoft SQL, ACCESS, MySQL,
and IBM AS400 sql.

I also have not yet written a distutils setup for it for IronPython -- you
will have to unzip and copy to do the install the hard way. (Another to-do
list item.)

You will either need to find an ADO provider for Postgres, or use an ODBC
driver and a different connection string. (I use an ODBC connection for the
MySQL sample in the \test folder.) Let me know how it works for you.
--
Vernon Cole

On Fri, Jul 9, 2010 at 8:49 AM, Michael Foord wrote:

> On 09/07/2010 14:50, Funke, Matt wrote:
>
>> I'm extremely new to compiling things in anything approaching a pythonic
>> way, so my apologies in advance for what's probably a very simplistic
>> question.
>>
>> I've downloaded the source for psycopg2-2.2.1.  The documentation
>> recommends using the standard "python setup.py build" and "python setup.py
>> install".
>>
>> So I tried to run "ipy setup.py build" to incorporate these libraries into
>> IronPython.
>>
>> I get this error:
>>
>> Traceback (most recent call last):
>>   File "setup.py", line 50, in
>> ImportError: No module named subprocess
>>
>>
>>
>
> subprocess relies on modules like signal that aren't available in
> IronPython 2.6.1.
>
> There is a partial implementation of subprocess by Jeff Hardy floating
> around that you could try. In general the IronPython support for distutils
> is "minimal", so I still wouldn't expect normal module installation to work.
>
> All the best,
>
> Michael
>
>
>  I can verify that subprocess.py is in
>> C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython
>> Tools for Visual Studio\0.2\Lib.  Do I need to add this directory to an
>> environment variable (like PATH), or is there some other way I can notify
>> IronPython about where to look for library files?
>>
>> Thanks for your time.
>>
>>  -- Best Regards,
>> Matt Funke
>> ___
>> Users mailing list
>> Users@lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>
>
> --
> http://www.ironpythoninaction.com/
> http://www.voidspace.org.uk/blog
>
> READ CAREFULLY. By accepting and reading this email you agree, on behalf of
> your employer, to release me from all obligations and waivers arising from
> any and all NON-NEGOTIATED agreements, licenses, terms-of-service,
> shrinkwrap, clickwrap, browsewrap, confidentiality, non-disclosure,
> non-compete and acceptable use policies (”BOGUS AGREEMENTS”) that I have
> entered into with your employer, its partners, licensors, agents and
> assigns, in perpetuity, without prejudice to my ongoing rights and
> privileges. You further represent that you have the authority to release me
> from any BOGUS AGREEMENTS on behalf of your employer.
>
>
>
> ___
> 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] Foolproof IP Embedding

2010-07-09 Thread Alex
2010/7/8 Michael Foord 

>  On 08/07/2010 22:34, Alex wrote:
>
> Hello
> In my WPF application, I want to have an "expert mode" that lets the
> end-user write inline python code targetting one specific control (a
> sheetmusic). I embed IronPython and when the user code throws an exception I
> catch it and display it but there are a few foolproof problems:
>
>  1) If the user write some bad code in a function and binds it to one of
> the control event, it will crash the whole app. Of course I can recommand my
> users to always wrap event handlers into a try catch block (or ask to use a
> decorator that do it) but it's not really foolproof. I want to make it
> impossible to crash the whole app with user code. Perhaps native events
> mecanism is a bit too low-level to be foolproof?
>
>
> Catch and report exceptions.
>
>
>
hi Mickael

if the user write this code :

#script

def foo():
print 2/0

button.Click = foo

###

the script will execute with no exception, only when the button is clicked,
an exception is raised, how should I handle it ?



>  2) If the user code makes  an infinite loop it will hang the whole app. I
> want to have a "panic button" to stop the script (and even restart the
> python engine if necessary). I suppose I have to run user code in a worker
> thread but then the user have to use Invoke mecanisms each time he touchs an
> UI object? Is there an elegant pattern that deals with this concerns?
>
>
> Execute the user code on a background thread. Provide a means for actions
> to be invoked on the gui thread (wrapped in exception handling) if
> necessary. Provide a button to abort the thread if it goes on too long.
>
>

My only concern is that the users shouldn't have to think about it. Maybe I
should only let them access UI elements through non-UI proxy objects, but
it's a great limitation.

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


Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Jeff Hardy
On Fri, Jul 9, 2010 at 8:49 AM, Michael Foord  wrote:
> subprocess relies on modules like signal that aren't available in IronPython
> 2.6.1.

http://bitbucket.org/jdhardy/code/src/tip/subprocess.py

>
> There is a partial implementation of subprocess by Jeff Hardy floating
> around that you could try. In general the IronPython support for distutils
> is "minimal", so I still wouldn't expect normal module installation to work.

Also, anything that uses a C extension will only work with Ironclad
(http://code.google.com/p/ironclad/), and even then it might not work.
I seem to recall that there is a pure-python Postgres driver, but I
can't remember what it's called.

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


Re: [IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Michael Foord

On 09/07/2010 14:50, Funke, Matt wrote:

I'm extremely new to compiling things in anything approaching a pythonic way, 
so my apologies in advance for what's probably a very simplistic question.

I've downloaded the source for psycopg2-2.2.1.  The documentation recommends using the standard 
"python setup.py build" and "python setup.py install".

So I tried to run "ipy setup.py build" to incorporate these libraries into 
IronPython.

I get this error:

Traceback (most recent call last):
   File "setup.py", line 50, in
ImportError: No module named subprocess

   


subprocess relies on modules like signal that aren't available in 
IronPython 2.6.1.


There is a partial implementation of subprocess by Jeff Hardy floating 
around that you could try. In general the IronPython support for 
distutils is "minimal", so I still wouldn't expect normal module 
installation to work.


All the best,

Michael


I can verify that subprocess.py is in 
C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython
 Tools for Visual Studio\0.2\Lib.  Do I need to add this directory to an 
environment variable (like PATH), or is there some other way I can notify 
IronPython about where to look for library files?

Thanks for your time.

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



--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/blog

READ CAREFULLY. By accepting and reading this email you agree, on behalf of 
your employer, to release me from all obligations and waivers arising from any 
and all NON-NEGOTIATED agreements, licenses, terms-of-service, shrinkwrap, 
clickwrap, browsewrap, confidentiality, non-disclosure, non-compete and 
acceptable use policies (”BOGUS AGREEMENTS”) that I have entered into with your 
employer, its partners, licensors, agents and assigns, in perpetuity, without 
prejudice to my ongoing rights and privileges. You further represent that you 
have the authority to release me from any BOGUS AGREEMENTS on behalf of your 
employer.


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


[IronPython] Crippled Intellisense?

2010-07-09 Thread Marcin Krol


Now that I got tabs right, intellisense works too.



--

Regards,
mk

--
Premature optimization is the root of all fun.

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


[IronPython] System.MissingMemberException

2010-07-09 Thread Marcin Krol

Hello everyone,


Ok I found the cause, the __init__ filled in from the template is 
exactly one space to the left from where it should be:


class MyForm(Form):
def __init__(self):
...
 def func(self, x):
 return x

If I shift "def __init__.." one space to the right, everything works.

But why I got such a strange exception?

And isn't there some sort of tab nanny or "inconsistent layout" exception?

--

Regards,
mk

--
Premature optimization is the root of all fun.

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


[IronPython] System.MissingMemberException

2010-07-09 Thread Marcin Krol

Hello everyone,

I have stumbled upon what's probably an idiotic newbie problem: if I add 
any method to a class, I get System.MissingMemberException. E.g.


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

from System.Windows.Forms import *


class MyForm(Form):
def __init__(self):
 button = Button()
 button.Text = 'Click Me'
 self.button = button
 self.Controls.Add(button)
 x = 'abc'
 b = self.func(range(5))

 def func(self, x):
 return x


form = MyForm()
Application.Run(form)


If I comment out func and reference to func in __init__, it works. 
However, with func I get lots of exceptions:


'ipyw.exe' (Managed (v4.0.30319)): Loaded 
'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll', 
Skipped loading symbols. Module is optimized and the debugger option 
'Just My Code' is enabled.
'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and 
Settings\Administrator\Local Settings\Application 
Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools 
for Visual Studio\0.3\ipyw.exe'
'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and 
Settings\Administrator\Local Settings\Application 
Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools 
for Visual Studio\0.3\Microsoft.Dynamic.dll'
'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and 
Settings\Administrator\Local Settings\Application 
Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools 
for Visual Studio\0.3\Microsoft.Scripting.dll'
'ipyw.exe' (Managed (v4.0.30319)): Loaded 
'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll', 
Skipped loading symbols. Module is optimized and the debugger option 
'Just My Code' is enabled.
'ipyw.exe' (Managed (v4.0.30319)): Loaded 
'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll', 
Skipped loading symbols. Module is optimized and the debugger option 
'Just My Code' is enabled.
'ipyw.exe' (Managed (v4.0.30319)): Loaded 
'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0__b77a5c561934e089\System.Xml.dll', 
Skipped loading symbols. Module is optimized and the debugger option 
'Just My Code' is enabled.
'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and 
Settings\Administrator\Local Settings\Application 
Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools 
for Visual Studio\0.3\IronPython.dll'
'ipyw.exe' (Managed (v4.0.30319)): Loaded 
'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0__b77a5c561934e089\System.Core.dll', 
Skipped loading symbols. Module is optimized and the debugger option 
'Just My Code' is enabled.
'ipyw.exe' (Managed (v4.0.30319)): Loaded 
'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll', 
Skipped loading symbols. Module is optimized and the debugger option 
'Just My Code' is enabled.
'ipyw.exe' (Managed (v4.0.30319)): Loaded 'C:\Documents and 
Settings\Administrator\Local Settings\Application 
Data\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython Tools 
for Visual Studio\0.3\IronPython.Modules.dll'

'ipyw.exe' (Managed (v4.0.30319)): Loaded 'Snippets.debug.scripting'
'ipyw.exe' (Managed (v4.0.30319)): Loaded 
'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\ISymWrapper\v4.0_4.0.0.0__b03f5f7f11d50a3a\ISymWrapper.dll'
'ipyw.exe' (Managed (v4.0.30319)): Loaded 'Anonymously Hosted 
DynamicMethods Assembly'
A first chance exception of type 
'Microsoft.Scripting.ArgumentTypeException' occurred in 
Snippets.debug.scripting

'ipyw.exe' (Managed (v4.0.30319)): Loaded 'Snippets.scripting'
A first chance exception of type 'System.MissingMemberException' 
occurred in IronPython.dll
A first chance exception of type 
'IronPython.Runtime.UnboundNameException' occurred in Microsoft.Dynamic.dll
A first chance exception of type 
'IronPython.Runtime.UnboundNameException' occurred in Microsoft.Dynamic.dll
A first chance exception of type 
'IronPython.Runtime.UnboundNameException' occurred in Microsoft.Dynamic.dll
A first chance exception of type 
'IronPython.Runtime.UnboundNameException' occurred in IronPython.dll
A first chance exception of type 'System.MissingMemberException' 
occurred in IronPython.dll
A first chance exception of type 'System.MissingMemberException' 
occurred in IronPython.dll
A first chance exception of type 'System.MissingMemberException' 
occurred in IronPython.dll
A first chance exception of type 'System.MissingMemberException' 
occurred in IronPython.dll
A first chance exception of type 'System.MissingMemberException' 
occurred in IronPython.dll
A first chance exception of type 'System.MissingMemberException' 
occurred in IronPython.dll
A first chance exception of type 'System.ComponentModel.Win32Exception' 
occurred in Microsoft.Dynamic.dll
A first chance exception of type 'System.Com

[IronPython] Writing to a file with unicode name

2010-07-09 Thread abdalla ramadan
Hello,

I am trying to write to a file with the japanese name 青山学院大学相模原キャンパス
The relative path I am passing to the methods is
"output\url\c\青山学院大学相模原キャンパス"

I used two methods
s = StreamWriter(filenamenew, True, Encoding.UTF8)
and
outputfile = codecs.open(filenamenew, "w",'utf_8_sig')

which both throwed the following exception:
Unhandled Exception: System.ArgumentException: Illegal characters in path.

Thanks very much for advance.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] Compiling so that IronPython libraries are recognized?

2010-07-09 Thread Funke, Matt
I'm extremely new to compiling things in anything approaching a pythonic way, 
so my apologies in advance for what's probably a very simplistic question.

I've downloaded the source for psycopg2-2.2.1.  The documentation recommends 
using the standard "python setup.py build" and "python setup.py install".

So I tried to run "ipy setup.py build" to incorporate these libraries into 
IronPython.

I get this error:

Traceback (most recent call last):
  File "setup.py", line 50, in 
ImportError: No module named subprocess

I can verify that subprocess.py is in 
C:\Users\me\AppData\Local\Microsoft\VisualStudio\10.0\Extensions\Microsoft\IronPython
 Tools for Visual Studio\0.2\Lib.  Do I need to add this directory to an 
environment variable (like PATH), or is there some other way I can notify 
IronPython about where to look for library files?

Thanks for your time.

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


[IronPython] Crippled Intellisense?

2010-07-09 Thread Marcin Krol


I got an MSDN license which allowed me to install VS 2010 Professional, 
I also installed IronPython tools. However, intellisense doesn't seem to 
fully work, for instance I can access string method's like


'abc'.(complete)

but when I do

x = 'abc'

and then

x.

it just underscores it in red.

Most of intellisense autocompletions from IronPython walkthrough don't 
work, e.g.:


def f(abc):
return abc

f('ab').


Anybody knows what's going on with this? Is this limitation of Pro as 
opposed to Ultimate and whatitsname versions of VS 2010?



--

Regards,
mk

--
Premature optimization is the root of all fun.
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com