Re: [IronPython] Building from source

2008-08-27 Thread Michael Foord

hellosticky wrote:

Hi, I downloaded the latest change set of IronPython from CodePlex source code 
tab, but the SLN file doesn't load in VS 2005, and running NMAKE it looks like 
there are C# 3.0 or 3.5 features being used.

How do I build a .NET 2.0 version of IronPython from source?
  


VS 2008 can build a .NET 2.0 version (and VS Express should work I 
think), but I'm pretty sure that VS 2005 won't be able to build it.


I built from the latest sources last night, it is up at:

http://www.voidspace.org.uk/Ipy-38029.zip

(Release binaries only, 2.8mb, no warranties etc!)

Michael


Thanks,

___
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/
http://www.trypython.org/
http://www.ironpython.info/
http://www.resolverhacks.net/
http://www.theotherdelia.co.uk/

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


[IronPython] Building stand alone executable

2008-08-27 Thread cephire
Hi:
The program that I've written works well when using the ipy command. I
tried to compile it as a standalond executable using pyc.py. It
produces an executable without any error. When I try to execute the
executable, nothing happens; There is no error message; nothing. How
can I debug? How can I produce a executable?

Here are some info:
IronPython and IronMath are present in the same directory
I'm using the below command to produce the executable:

ipy pyc.py /main:MainForm.py /out:mysecs.exe /target:winexe

Begining of the program looks like this:

import clr
clr.AddReference('System')
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
#unmanaged code
clr.AddReference('mySecs')
#external dlls
clr.AddReference('SourceGrid')
clr.AddReference("System.Data")
clr.AddReference('System.Data.SQLite')

import System
from System import *
from System.Windows.Forms import *
from System.Drawing import *
from System.Text import StringBuilder
from System.Diagnostics import Process
from System import Environment
from System import DateTime

from System.Data.SQLite import *
import SourceGrid

from mySecsUnmanagedCode import User32

Any help is appreciated. Thank you,
Joseph
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Building stand alone executable

2008-08-27 Thread Michael Foord

cephire wrote:

Hi:
The program that I've written works well when using the ipy command. I
tried to compile it as a standalond executable using pyc.py. It
produces an executable without any error. When I try to execute the
executable, nothing happens; There is no error message; nothing. How
can I debug? How can I produce a executable?

Here are some info:
IronPython and IronMath are present in the same directory
I'm using the below command to produce the executable:

ipy pyc.py /main:MainForm.py /out:mysecs.exe /target:winexe

  


Try compiling as a console application rather than a windows executable 
and when you run it you will get the error message output to the console.


Michael


Begining of the program looks like this:

import clr
clr.AddReference('System')
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
#unmanaged code
clr.AddReference('mySecs')
#external dlls
clr.AddReference('SourceGrid')
clr.AddReference("System.Data")
clr.AddReference('System.Data.SQLite')

import System
from System import *
from System.Windows.Forms import *
from System.Drawing import *
from System.Text import StringBuilder
from System.Diagnostics import Process
from System import Environment
from System import DateTime

from System.Data.SQLite import *
import SourceGrid

from mySecsUnmanagedCode import User32

Any help is appreciated. Thank you,
Joseph
___
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/
http://www.trypython.org/
http://www.ironpython.info/
http://www.resolverhacks.net/
http://www.theotherdelia.co.uk/

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


Re: [IronPython] Building from source

2008-08-27 Thread hellosticky
Hi Michael, thanks. I'll be getting VS 2008 hopefully in a week or two. By the 
way, would you be able to build yours with a strong name?
Thanks, 

> -Original Message-
> From: Michael Foord [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 27, 2008 5:48 AM
> To: [EMAIL PROTECTED]; Discussion of IronPython
> Subject: Re: [IronPython] Building from source
> 
> hellosticky wrote:
> > Hi, I downloaded the latest change set of IronPython from 
> CodePlex source code tab, but the SLN file doesn't load in VS 
> 2005, and running NMAKE it looks like there are C# 3.0 or 3.5 
> features being used.
> >
> > How do I build a .NET 2.0 version of IronPython from source?
> >   
> 
> VS 2008 can build a .NET 2.0 version (and VS Express should work I 
> think), but I'm pretty sure that VS 2005 won't be able to build it.
> 
> I built from the latest sources last night, it is up at:
> 
> http://www.voidspace.org.uk/Ipy-38029.zip
> 
> (Release binaries only, 2.8mb, no warranties etc!)
> 
> Michael
> 
> > Thanks,
> >
> > ___
> > 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/
> http://www.trypython.org/
> http://www.ironpython.info/
> http://www.resolverhacks.net/
> http://www.theotherdelia.co.uk/
> 
> 

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


Re: [IronPython] Building from source

2008-08-27 Thread Michael Foord

hellosticky wrote:

Hi Michael, thanks. I'll be getting VS 2008 hopefully in a week or two. By the 
way, would you be able to build yours with a strong name?
  


No idea. :-)

Can try, but not from here as I don't have VS 2008 at work.

Michael

Thanks, 

  

-Original Message-
From: Michael Foord [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2008 5:48 AM

To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Building from source

hellosticky wrote:

Hi, I downloaded the latest change set of IronPython from 
  
CodePlex source code tab, but the SLN file doesn't load in VS 
2005, and running NMAKE it looks like there are C# 3.0 or 3.5 
features being used.


How do I build a .NET 2.0 version of IronPython from source?
  
  
VS 2008 can build a .NET 2.0 version (and VS Express should work I 
think), but I'm pretty sure that VS 2005 won't be able to build it.


I built from the latest sources last night, it is up at:

http://www.voidspace.org.uk/Ipy-38029.zip

(Release binaries only, 2.8mb, no warranties etc!)

Michael



Thanks,

___
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/
http://www.trypython.org/
http://www.ironpython.info/
http://www.resolverhacks.net/
http://www.theotherdelia.co.uk/





  



--
http://www.ironpythoninaction.com/
http://www.voidspace.org.uk/
http://www.trypython.org/
http://www.ironpython.info/
http://www.resolverhacks.net/
http://www.theotherdelia.co.uk/

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


Re: [IronPython] Building from source

2008-08-27 Thread Curt Hagenlocher
You need a certificate to sign the assembly if you want a strong name -- and
of course any certificate that Michael has or generates won't have the same
key signature as the certificate we use to sign here.

For IronRuby, we've modified the export script so that building from source
will no longer delay-sign the assembly but just leave it unsigned.  Is this
something that people would find useful for our regular source drops?  If
so, I can try to cajole Dave into changing the script.  He probably doesn't
have enough work to do anyway ;).
On Wed, Aug 27, 2008 at 6:53 AM, hellosticky <[EMAIL PROTECTED]> wrote:

> Hi Michael, thanks. I'll be getting VS 2008 hopefully in a week or two. By
> the way, would you be able to build yours with a strong name?
> Thanks,
>
> > -Original Message-
> > From: Michael Foord [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 27, 2008 5:48 AM
> > To: [EMAIL PROTECTED]; Discussion of IronPython
> > Subject: Re: [IronPython] Building from source
> >
> > hellosticky wrote:
> > > Hi, I downloaded the latest change set of IronPython from
> > CodePlex source code tab, but the SLN file doesn't load in VS
> > 2005, and running NMAKE it looks like there are C# 3.0 or 3.5
> > features being used.
> > >
> > > How do I build a .NET 2.0 version of IronPython from source?
> > >
> >
> > VS 2008 can build a .NET 2.0 version (and VS Express should work I
> > think), but I'm pretty sure that VS 2005 won't be able to build it.
> >
> > I built from the latest sources last night, it is up at:
> >
> > http://www.voidspace.org.uk/Ipy-38029.zip
> >
> > (Release binaries only, 2.8mb, no warranties etc!)
> >
> > Michael
> >
> > > Thanks,
> > >
> > > ___
> > > 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/
> > http://www.trypython.org/
> > http://www.ironpython.info/
> > http://www.resolverhacks.net/
> > http://www.theotherdelia.co.uk/
> >
> >
>
> ___
> 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] Building from source

2008-08-27 Thread hellosticky
I can't even run DLR/IronPython without a strong name, so that'd be nice :). I 
actually don't really mind signing them myself for now


  _  

From: Curt Hagenlocher [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2008 10:04 AM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Building from source


You need a certificate to sign the assembly if you want a strong name -- and of 
course any certificate that Michael has or generates won't have the same key 
signature as the certificate we use to sign here.
 
For IronRuby, we've modified the export script so that building from source 
will no longer delay-sign the assembly but just leave it unsigned.  Is this 
something that people would find useful for our regular source drops?  If so, I 
can try to cajole Dave into changing the script.  He probably doesn't have 
enough work to do anyway ;).

On Wed, Aug 27, 2008 at 6:53 AM, hellosticky <[EMAIL PROTECTED]> wrote:


Hi Michael, thanks. I'll be getting VS 2008 hopefully in a week or two. By the 
way, would you be able to build yours with a strong name?
Thanks,

> -Original Message-
> From: Michael Foord [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 27, 2008 5:48 AM
> To: [EMAIL PROTECTED]; Discussion of IronPython
> Subject: Re: [IronPython] Building from source
>
> hellosticky wrote:
> > Hi, I downloaded the latest change set of IronPython from
> CodePlex source code tab, but the SLN file doesn't load in VS
> 2005, and running NMAKE it looks like there are C# 3.0 or 3.5
> features being used.
> >
> > How do I build a .NET 2.0 version of IronPython from source?
> >
>
> VS 2008 can build a .NET 2.0 version (and VS Express should work I
> think), but I'm pretty sure that VS 2005 won't be able to build it.
>
> I built from the latest sources last night, it is up at:
>
> http://www.voidspace.org.uk/Ipy-38029.zip
>
> (Release binaries only, 2.8mb, no warranties etc!)
>
> Michael
>
> > Thanks,
> >
> > ___
> > 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/
> http://www.trypython.org/
> http://www.ironpython.info/
> http://www.resolverhacks.net/
> http://www.theotherdelia.co.uk/
>
>

___
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] Building stand alone executable

2008-08-27 Thread cephire
Thank you. I built as console and I get an error

no module named logging.

I am using IPCE-r7. i'm importing logging using import logging. and as
i said before it works fine when i invoke using ipy mainform.py.

Joseph

On Aug 27, 6:18 pm, Michael Foord <[EMAIL PROTECTED]> wrote:
> cephire wrote:
> > Hi:
> > The program that I've written works well when using the ipy command. I
> > tried to compile it as a standalond executable using pyc.py. It
> > produces an executable without any error. When I try to execute the
> > executable, nothing happens; There is no error message; nothing. How
> > can I debug? How can I produce a executable?
>
> > Here are some info:
> > IronPython and IronMath are present in the same directory
> > I'm using the below command to produce the executable:
>
> > ipy pyc.py /main:MainForm.py /out:mysecs.exe /target:winexe
>
> Try compiling as a console application rather than a windows executable
> and when you run it you will get the error message output to the console.
>
> Michael
>
>
>
>
>
> > Begining of the program looks like this:
>
> > import clr
> > clr.AddReference('System')
> > clr.AddReference('System.Windows.Forms')
> > clr.AddReference('System.Drawing')
> > #unmanaged code
> > clr.AddReference('mySecs')
> > #external dlls
> > clr.AddReference('SourceGrid')
> > clr.AddReference("System.Data")
> > clr.AddReference('System.Data.SQLite')
>
> > import System
> > from System import *
> > from System.Windows.Forms import *
> > from System.Drawing import *
> > from System.Text import StringBuilder
> > from System.Diagnostics import Process
> > from System import Environment
> > from System import DateTime
>
> > from System.Data.SQLite import *
> > import SourceGrid
>
> > from mySecsUnmanagedCode import User32
>
> > Any help is appreciated. Thank you,
> > Joseph
> > ___
> > Users mailing list
> > [EMAIL PROTECTED]
> >http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
> --http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://www.trypython.org/http://www.ironpython.info/http://www.resolverhacks.net/http://www.theotherdelia.co.uk/
>
> ___
> Users mailing list
> [EMAIL PROTECTED]://lists.ironpython.com/listinfo.cgi/users-ironpython.com- 
> Hide quoted text -
>
> - Show quoted text -
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Building from source

2008-08-27 Thread Dave Fugate
Hi, the source updates to CodePlex's TFS repository and the source zip files 
should not even include the ability to delay-sign  assemblies.  I've just 
verified this is still the case with the update to CodePlex yesterday.  Which 
IronPython binaries are you trying to run and what error message are you 
getting?

The other thing is you shouldn't need Visual Studio 2008 to build the latest 
IronPython sources from CodePlex's TFS repository.  You just need .NET 3.5 
installed and the following should work:
pushd %WHEREEVER%\IronPython-38029\IronPython_Main\Src
C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild IronPython.sln

Dave


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hellosticky
Sent: Wednesday, August 27, 2008 7:51 AM
To: 'Curt Hagenlocher'; 'Discussion of IronPython'
Subject: Re: [IronPython] Building from source

I can't even run DLR/IronPython without a strong name, so that'd be nice :). I 
actually don't really mind signing them myself for now


From: Curt Hagenlocher [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2008 10:04 AM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Building from source
You need a certificate to sign the assembly if you want a strong name -- and of 
course any certificate that Michael has or generates won't have the same key 
signature as the certificate we use to sign here.

For IronRuby, we've modified the export script so that building from source 
will no longer delay-sign the assembly but just leave it unsigned.  Is this 
something that people would find useful for our regular source drops?  If so, I 
can try to cajole Dave into changing the script.  He probably doesn't have 
enough work to do anyway ;).
On Wed, Aug 27, 2008 at 6:53 AM, hellosticky <[EMAIL PROTECTED]> wrote:
Hi Michael, thanks. I'll be getting VS 2008 hopefully in a week or two. By the 
way, would you be able to build yours with a strong name?
Thanks,

> -Original Message-
> From: Michael Foord [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 27, 2008 5:48 AM
> To: [EMAIL PROTECTED]; Discussion of IronPython
> Subject: Re: [IronPython] Building from source
>
> hellosticky wrote:
> > Hi, I downloaded the latest change set of IronPython from
> CodePlex source code tab, but the SLN file doesn't load in VS
> 2005, and running NMAKE it looks like there are C# 3.0 or 3.5
> features being used.
> >
> > How do I build a .NET 2.0 version of IronPython from source?
> >
>
> VS 2008 can build a .NET 2.0 version (and VS Express should work I
> think), but I'm pretty sure that VS 2005 won't be able to build it.
>
> I built from the latest sources last night, it is up at:
>
> http://www.voidspace.org.uk/Ipy-38029.zip
>
> (Release binaries only, 2.8mb, no warranties etc!)
>
> Michael
>
> > Thanks,
> >
> > ___
> > 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/
> http://www.trypython.org/
> http://www.ironpython.info/
> http://www.resolverhacks.net/
> http://www.theotherdelia.co.uk/
>
>

___
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] Building from source

2008-08-27 Thread hellosticky
Hi Dave, I was using a build from last night's source by Michael Foord. They 
didn't have a PublicKeyToken and in VS 2005 I got the error:
 
error CS1577: Assembly generation failed -- Referenced assembly 
'Microsoft.Scripting' does not have a strong name

Can I use your MSBuild (using 3.5) to target 2.0?
 
Thanks,


  _  

From: Dave Fugate [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2008 12:25 PM
To: [EMAIL PROTECTED]; Discussion of IronPython; 'Curt Hagenlocher'
Subject: RE: [IronPython] Building from source



Hi, the source updates to CodePlex's TFS repository and the source zip files 
should not even include the ability to delay-sign  assemblies.  I've just 
verified this is still the case with the update to CodePlex yesterday.  Which 
IronPython binaries are you trying to run and what error message are you 
getting?

 

The other thing is you shouldn't need Visual Studio 2008 to build the latest 
IronPython sources from CodePlex's TFS repository.  You just need .NET 3.5 
installed and the following should work:

pushd %WHEREEVER%\IronPython-38029\IronPython_Main\Src

C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild IronPython.sln

 

Dave

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hellosticky
Sent: Wednesday, August 27, 2008 7:51 AM
To: 'Curt Hagenlocher'; 'Discussion of IronPython'
Subject: Re: [IronPython] Building from source

 

I can't even run DLR/IronPython without a strong name, so that'd be nice :). I 
actually don't really mind signing them myself for now

 

  _  

From: Curt Hagenlocher [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2008 10:04 AM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Building from source

You need a certificate to sign the assembly if you want a strong name -- and of 
course any certificate that Michael has or generates won't have the same key 
signature as the certificate we use to sign here.

 

For IronRuby, we've modified the export script so that building from source 
will no longer delay-sign the assembly but just leave it unsigned.  Is this 
something that people would find useful for our regular source drops?  If so, I 
can try to cajole Dave into changing the script.  He probably doesn't have 
enough work to do anyway ;).

On Wed, Aug 27, 2008 at 6:53 AM, hellosticky <[EMAIL PROTECTED]> wrote:

Hi Michael, thanks. I'll be getting VS 2008 hopefully in a week or two. By the 
way, would you be able to build yours with a strong name?
Thanks,

> -Original Message-
> From: Michael Foord [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 27, 2008 5:48 AM
> To: [EMAIL PROTECTED]; Discussion of IronPython
> Subject: Re: [IronPython] Building from source
>
> hellosticky wrote:
> > Hi, I downloaded the latest change set of IronPython from
> CodePlex source code tab, but the SLN file doesn't load in VS
> 2005, and running NMAKE it looks like there are C# 3.0 or 3.5
> features being used.
> >
> > How do I build a .NET 2.0 version of IronPython from source?
> >
>
> VS 2008 can build a .NET 2.0 version (and VS Express should work I
> think), but I'm pretty sure that VS 2005 won't be able to build it.
>
> I built from the latest sources last night, it is up at:
>
> http://www.voidspace.org.uk/Ipy-38029.zip
>
> (Release binaries only, 2.8mb, no warranties etc!)
>
> Michael
>
> > Thanks,
> >
> > ___
> > 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/
> http://www.trypython.org/
> http://www.ironpython.info/
> http://www.resolverhacks.net/
> http://www.theotherdelia.co.uk/
>
>

___
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] Building from source

2008-08-27 Thread Dave Fugate
Yes, .NET 3.5's msbuild can be used to generate IronPython (2.x) binaries that 
will run under .NET 2.0 SP1 in the manner I showed below.  This is what we use 
for generating IronPython Alpha/Beta/etc releases.  Please note that you won't 
be able to run IronPython 2.x without SP1 of .NET 2.0 (or alternatively .NET 
3.5) installed though.

It hasn't been possible to build IronPython.sln under Visual Studio 2005 for a 
couple of release cycles.

From: hellosticky [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2008 9:34 AM
To: Dave Fugate; 'Discussion of IronPython'; 'Curt Hagenlocher'
Subject: RE: [IronPython] Building from source

Hi Dave, I was using a build from last night's source by Michael Foord. They 
didn't have a PublicKeyToken and in VS 2005 I got the error:

error CS1577: Assembly generation failed -- Referenced assembly 
'Microsoft.Scripting' does not have a strong name
Can I use your MSBuild (using 3.5) to target 2.0?

Thanks,


From: Dave Fugate [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2008 12:25 PM
To: [EMAIL PROTECTED]; Discussion of IronPython; 'Curt Hagenlocher'
Subject: RE: [IronPython] Building from source
Hi, the source updates to CodePlex's TFS repository and the source zip files 
should not even include the ability to delay-sign  assemblies.  I've just 
verified this is still the case with the update to CodePlex yesterday.  Which 
IronPython binaries are you trying to run and what error message are you 
getting?

The other thing is you shouldn't need Visual Studio 2008 to build the latest 
IronPython sources from CodePlex's TFS repository.  You just need .NET 3.5 
installed and the following should work:
pushd %WHEREEVER%\IronPython-38029\IronPython_Main\Src
C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild IronPython.sln

Dave


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hellosticky
Sent: Wednesday, August 27, 2008 7:51 AM
To: 'Curt Hagenlocher'; 'Discussion of IronPython'
Subject: Re: [IronPython] Building from source

I can't even run DLR/IronPython without a strong name, so that'd be nice :). I 
actually don't really mind signing them myself for now


From: Curt Hagenlocher [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 27, 2008 10:04 AM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Building from source
You need a certificate to sign the assembly if you want a strong name -- and of 
course any certificate that Michael has or generates won't have the same key 
signature as the certificate we use to sign here.

For IronRuby, we've modified the export script so that building from source 
will no longer delay-sign the assembly but just leave it unsigned.  Is this 
something that people would find useful for our regular source drops?  If so, I 
can try to cajole Dave into changing the script.  He probably doesn't have 
enough work to do anyway ;).
On Wed, Aug 27, 2008 at 6:53 AM, hellosticky <[EMAIL PROTECTED]> wrote:
Hi Michael, thanks. I'll be getting VS 2008 hopefully in a week or two. By the 
way, would you be able to build yours with a strong name?
Thanks,

> -Original Message-
> From: Michael Foord [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 27, 2008 5:48 AM
> To: [EMAIL PROTECTED]; Discussion of IronPython
> Subject: Re: [IronPython] Building from source
>
> hellosticky wrote:
> > Hi, I downloaded the latest change set of IronPython from
> CodePlex source code tab, but the SLN file doesn't load in VS
> 2005, and running NMAKE it looks like there are C# 3.0 or 3.5
> features being used.
> >
> > How do I build a .NET 2.0 version of IronPython from source?
> >
>
> VS 2008 can build a .NET 2.0 version (and VS Express should work I
> think), but I'm pretty sure that VS 2005 won't be able to build it.
>
> I built from the latest sources last night, it is up at:
>
> http://www.voidspace.org.uk/Ipy-38029.zip
>
> (Release binaries only, 2.8mb, no warranties etc!)
>
> Michael
>
> > Thanks,
> >
> > ___
> > 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/
> http://www.trypython.org/
> http://www.ironpython.info/
> http://www.resolverhacks.net/
> http://www.theotherdelia.co.uk/
>
>

___
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] Building from source

2008-08-27 Thread hellosticky
Thanks Dave, I have SP1 and I'll figure out how to build 2.x binaries with 3.5. 
Do you have any idea about:
 
error CS1577: Assembly generation failed -- Referenced assembly 
'Microsoft.Scripting' does not have a strong name
 
Thanks,


  _  

From: Dave Fugate [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2008 2:33 PM
To: [EMAIL PROTECTED]; 'Discussion of IronPython'; 'Curt Hagenlocher'
Subject: RE: [IronPython] Building from source



Yes, .NET 3.5's msbuild can be used to generate IronPython (2.x) binaries that 
will run under .NET 2.0 SP1 in the manner I showed below.  This is what we use 
for generating IronPython Alpha/Beta/etc releases.  Please note that you won't 
be able to run IronPython 2.x without SP1 of .NET 2.0 (or alternatively .NET 
3.5) installed though.

 

It hasn't been possible to build IronPython.sln under Visual Studio 2005 for a 
couple of release cycles.

 

From: hellosticky [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2008 9:34 AM
To: Dave Fugate; 'Discussion of IronPython'; 'Curt Hagenlocher'
Subject: RE: [IronPython] Building from source

 

Hi Dave, I was using a build from last night's source by Michael Foord. They 
didn't have a PublicKeyToken and in VS 2005 I got the error:

 

error CS1577: Assembly generation failed -- Referenced assembly 
'Microsoft.Scripting' does not have a strong name

Can I use your MSBuild (using 3.5) to target 2.0?

 

Thanks,

 

  _  

From: Dave Fugate [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2008 12:25 PM
To: [EMAIL PROTECTED]; Discussion of IronPython; 'Curt Hagenlocher'
Subject: RE: [IronPython] Building from source

Hi, the source updates to CodePlex's TFS repository and the source zip files 
should not even include the ability to delay-sign  assemblies.  I've just 
verified this is still the case with the update to CodePlex yesterday.  Which 
IronPython binaries are you trying to run and what error message are you 
getting?

 

The other thing is you shouldn't need Visual Studio 2008 to build the latest 
IronPython sources from CodePlex's TFS repository.  You just need .NET 3.5 
installed and the following should work:

pushd %WHEREEVER%\IronPython-38029\IronPython_Main\Src

C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild IronPython.sln

 

Dave

 

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of hellosticky
Sent: Wednesday, August 27, 2008 7:51 AM
To: 'Curt Hagenlocher'; 'Discussion of IronPython'
Subject: Re: [IronPython] Building from source

 

I can't even run DLR/IronPython without a strong name, so that'd be nice :). I 
actually don't really mind signing them myself for now

 

  _  

From: Curt Hagenlocher [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 27, 2008 10:04 AM
To: [EMAIL PROTECTED]; Discussion of IronPython
Subject: Re: [IronPython] Building from source

You need a certificate to sign the assembly if you want a strong name -- and of 
course any certificate that Michael has or generates won't have the same key 
signature as the certificate we use to sign here.

 

For IronRuby, we've modified the export script so that building from source 
will no longer delay-sign the assembly but just leave it unsigned.  Is this 
something that people would find useful for our regular source drops?  If so, I 
can try to cajole Dave into changing the script.  He probably doesn't have 
enough work to do anyway ;).

On Wed, Aug 27, 2008 at 6:53 AM, hellosticky <[EMAIL PROTECTED]> wrote:

Hi Michael, thanks. I'll be getting VS 2008 hopefully in a week or two. By the 
way, would you be able to build yours with a strong name?
Thanks,

> -Original Message-
> From: Michael Foord [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 27, 2008 5:48 AM
> To: [EMAIL PROTECTED]; Discussion of IronPython
> Subject: Re: [IronPython] Building from source
>
> hellosticky wrote:
> > Hi, I downloaded the latest change set of IronPython from
> CodePlex source code tab, but the SLN file doesn't load in VS
> 2005, and running NMAKE it looks like there are C# 3.0 or 3.5
> features being used.
> >
> > How do I build a .NET 2.0 version of IronPython from source?
> >
>
> VS 2008 can build a .NET 2.0 version (and VS Express should work I
> think), but I'm pretty sure that VS 2005 won't be able to build it.
>
> I built from the latest sources last night, it is up at:
>
> http://www.voidspace.org.uk/Ipy-38029.zip
>
> (Release binaries only, 2.8mb, no warranties etc!)
>
> Michael
>
> > Thanks,
> >
> > ___
> > 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/
> http://www.trypython.org/
> http://www.ironpython.info/
> http://www.resolverhacks.net/
> http://www.theotherdelia.co.uk/
>
>

___
Users mailing list
Users@lists.ironpython.com

[IronPython] Return value for ADODB .Execute() call?

2008-08-27 Thread Vernon Cole
I've hit my next sticking point in porting adodbapi.


try:
import win32com.client
def Dispatch(dispatch):
return win32com.client.Dispatch(dispatch)
win32 = True
except ImportError:  # implies running on IronPython
from System import Activator, Type
def Dispatch(dispatch):
type = Type.GetTypeFromProgID(dispatch)
return Activator.CreateInstance(type)
win32 = False#implies IronPython
# [... much later ...]
class Cursor(object):
# ...
  def _executeHelper(self,operation,etc):
self.cmd=Dispatch("ADODB.Command")
# ...
   self.cmd.CommandText=operation
# ...
adoRetVal = self.cmd.Execute()
if win32:
rs=adoRetVal[0]
try:
self.rowcount = rs.RecordCount
except:
self.rowcount = adoRetVal[1]
else:  # iron Python
rs = adoRetVal
try:
self.rowcount = rs.RecordCount
except:
# HOW DO I GET THE ROW COUNT ? ? ?
self.rowcount= -1

It appears that, when called from VB, the Execute method takes an optional
agument.
>From w3schools.com:

ADO Execute Method
--
[image: Command Object Reference] Complete Command Object
Reference
--

The Execute method executes the query, SQL statement or procedure specified
in the CommandText property of the Command object.

The results are stored in a new Recordset object if it is a row-returning
query. A closed Recordset object will be returned if it is not a
row-returning query.
Syntax for row-returning

Set rs=objcommand.Execute(ra,parameters,options)

  Syntax for non-row-returning

objcommand.Execute ra,parameters,options


 Parameter Description  ra  Optional. Returns the number of records affected
by a query. For a row-returning query, use the RecordCount property of the
Recordset object to count of how many records are in the object.  parameters
 Optional. Parameter values passed with an SQL statement. Used to change,
update, or insert new parameter values into the Parameters Collection.  options
Optional. Sets how the provider should evaluate the CommandText property.
Can be one or more
CommandTypeEnumor
ExecuteOptionEnumvalues.
Default is adCmdUnspecified.
We can't pass the "ra" parameter in python, so pywin32 returns a
tuple with the recordset and the number of records.

How do I retrieve the number of records (for a non-row-returning query) in
Iron?
--
Vernon Cole
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] Building stand alone executable

2008-08-27 Thread Michael Foord

cephire wrote:

Thank you. I built as console and I get an error

no module named logging.

I am using IPCE-r7. i'm importing logging using import logging. and as
i said before it works fine when i invoke using ipy mainform.py.
  


logging is a Python standard library module. IPCE includes the Python 
standard library - and probably adds it to the path for you when you run 
stuff with the IPCE version of ipy.exe.


You may be able to setup the IRONPYTHONPATH environment variable to 
point to the standard library directory (not 100%  certain that apps 
compiled with Pyc will honour IRONPYTHONPATH but it is easy enough to 
find out) - or your program can add this to sys.path yourself. 
Alternatively you could work out exactly which standard library modules 
you are relying on and compile them into your application as well.


Michael Foord


Joseph

On Aug 27, 6:18 pm, Michael Foord <[EMAIL PROTECTED]> wrote:
  

cephire wrote:


Hi:
The program that I've written works well when using the ipy command. I
tried to compile it as a standalond executable using pyc.py. It
produces an executable without any error. When I try to execute the
executable, nothing happens; There is no error message; nothing. How
can I debug? How can I produce a executable?
  
Here are some info:

IronPython and IronMath are present in the same directory
I'm using the below command to produce the executable:
  
ipy pyc.py /main:MainForm.py /out:mysecs.exe /target:winexe
  

Try compiling as a console application rather than a windows executable
and when you run it you will get the error message output to the console.

Michael







Begining of the program looks like this:
  
import clr

clr.AddReference('System')
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
#unmanaged code
clr.AddReference('mySecs')
#external dlls
clr.AddReference('SourceGrid')
clr.AddReference("System.Data")
clr.AddReference('System.Data.SQLite')
  
import System

from System import *
from System.Windows.Forms import *
from System.Drawing import *
from System.Text import StringBuilder
from System.Diagnostics import Process
from System import Environment
from System import DateTime
  
from System.Data.SQLite import *

import SourceGrid
  
from mySecsUnmanagedCode import User32
  
Any help is appreciated. Thank you,

Joseph
___
Users mailing list
[EMAIL PROTECTED]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
  

--http://www.ironpythoninaction.com/http://www.voidspace.org.uk/http://www.trypython.org/http://www.ironpython.info/http://www.resolverhacks.net/http://www.theotherdelia.co.uk/

___
Users mailing list
[EMAIL PROTECTED]://lists.ironpython.com/listinfo.cgi/users-ironpython.com- 
Hide quoted text -

- Show quoted text -


___
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/
http://www.trypython.org/
http://www.ironpython.info/
http://www.theotherdelia.co.uk/
http://www.resolverhacks.net/

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


Re: [IronPython] Return value for ADODB .Execute() call?

2008-08-27 Thread Curt Hagenlocher
On Wed, Aug 27, 2008 at 12:17 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:
>
> We can't pass the "ra" parameter in python, so pywin32 returns a tuple with
> the recordset and the number of records.
>
> How do I retrieve the number of records (for a non-row-returning query) in
> Iron?

Presumably, Execute expects you to pass a VT_I4 | VT_BYREF so that it
can store the value in the reference.  If this were for a CLR API,
you'd pass an int reference by using a variable of type
clr.Reference[int](). I don't know that this will work for COM, but I
assume that it would:

ra = clr.Reference[int]()
self.cmd.Execute(ra)
recordCount = ra.Value

--
Curt Hagenlocher
[EMAIL PROTECTED]
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] creatiing .exe file with ipy.exe v. 1.1

2008-08-27 Thread Vadim Khaskel

 
Here is the command line output:
 
C:\Pyc>ipy.exe pyc.py /main:Program.py Form1.py help.py routineM.py 
/target:winexe /r:System.Drawing /r:System.Windows.FormsInput Files:
Program.pyForm1.pyhelp.pyroutineM.pyResource 
Files:Output:Program.exeTarget:WindowApplication
C:\Pyc>
 
 
On the machine where I developing this program Program.exe works perfectly.
 
I transfer this file along with Ironpython.dll, IronMath.dll, Program.pdb to 
another machine, and try to start it there...
and nothing happens, not even error message. (I tried to start it from cmd line 
too)
 
appreciate any hint,
 
Vadim
 
 
 
 
 
> Message: 5> Date: Tue, 26 Aug 2008 20:53:16 +0100> From: Michael Foord 
> <[EMAIL PROTECTED]>> Subject: Re: [IronPython] ipy.exe location?> To: 
> Discussion of IronPython > Message-ID: <[EMAIL 
> PROTECTED]>> Content-Type: text/plain; charset=ISO-8859-1; format=flowed>> 
> Vadim Khaskel wrote:> > Where to find ipy.exe in order to use> >> > ipy.exe 
> pyc.py ...> >> > is it available in IronPython Studio?>> I have no idea if it 
> is included in IronPython Studio (probably?), but> the easiest way of 
> obtaining it is downloading IronPython:>> 
> http://www.codeplex.com/IronPython>> Note that you should use the appropriate 
> version of IronPython for the> version of pyc you are using - there are 
> versions of pyc for both> IronPython 1 & 2.>> Also note that if you intend to 
> run pyc on code generated by the> IronPython Studio winforms / wpf designers 
> then they will need some> manual tweaking in order to work.>> Michael
_
Be the filmmaker you always wanted to be—learn how to burn a DVD with Windows®.
http://clk.atdmt.com/MRT/go/108588797/direct/01/___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] creatiing .exe file with ipy.exe v. 1.1

2008-08-27 Thread Michael Foord

Vadim Khaskel wrote:
 
Here is the command line output:
 
C:\Pyc>ipy.exe pyc.py /main:Program.py Form1.py help.py routineM.py 
/target:winexe /r:System.Drawing /r:System.Windows.F

orms
Input Files:
Program.py
Form1.py
help.py
routineM.py
Resource Files:
Output:
Program.exe
Target:
WindowApplication
C:\Pyc>
 
 
On the machine where I developing this program Program.exe works 
perfectly.
 
I transfer this file along with Ironpython.dll, IronMath.dll, 
Program.pdb to another machine, and try to start it there...

and nothing happens, not even error message.
(I tried to start it from cmd line too)


If you create a Windows Application it detaches from the console so you 
will never see any error message. It is likely that you are missing a 
module or assembly that you rely on (do you use any standard library 
modules?).


Create it as a console application and run it from the command line on 
the target machine and you will see the error message.


Michael Foord

 
appreciate any hint,
 
Vadim
 
 
 
 
 
> Message: 5

> Date: Tue, 26 Aug 2008 20:53:16 +0100
> From: Michael Foord <[EMAIL PROTECTED]>
> Subject: Re: [IronPython] ipy.exe location?
> To: Discussion of IronPython 
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Vadim Khaskel wrote:
> > Where to find ipy.exe in order to use
> >
> > ipy.exe pyc.py ...
> >
> > is it available in IronPython Studio?
>
> I have no idea if it is included in IronPython Studio (probably?), but
> the easiest way of obtaining it is downloading IronPython:
>
> http://www.codeplex.com/IronPython
>
> Note that you should use the appropriate version of IronPython for the
> version of pyc you are using - there are versions of pyc for both
> IronPython 1 & 2.
>
> Also note that if you intend to run pyc on code generated by the
> IronPython Studio winforms / wpf designers then they will need some
> manual tweaking in order to work.
>
> Michael



Be the filmmaker you always wanted to be—learn how to burn a DVD with 
Windows®. Make your smash hit 




___
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/
http://www.trypython.org/
http://www.ironpython.info/
http://www.theotherdelia.co.uk/
http://www.resolverhacks.net/

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


Re: [IronPython] Return value for ADODB .Execute() call?

2008-08-27 Thread Shri Borde
Using clr.Reference[int] should work if ra is an in-out (VT_BYREF) parameter. 
Note that not many OleAut APIs use VT_BYREF. Jscript does not support in-out 
parameters and the API would not be usable form Jscript.

We do have the option of returning a tuple with the recordset and the number of 
records, just like pywin32, by checking the ITypeInfo if any of the parameters 
are VT_BYREF. We even had this working at some point. However, we have decided 
not to use ITypeInfo to check the type of parameters in order to keep the code 
paths the same when there is no typelib available.

If you run into lots of APIs with in-out parameters, do let us know. Its 
something we could revisit for IPy 2.1. I will collect a list of such APIs in 
the "Known Issues" section in my blog at 
http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx
 for tracking purposes.

Using clr.Reference will always work now and in the future, with or without 
typelibs being available.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher
Sent: Wednesday, August 27, 2008 1:10 PM
To: Discussion of IronPython
Subject: Re: [IronPython] Return value for ADODB .Execute() call?

On Wed, Aug 27, 2008 at 12:17 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:
>
> We can't pass the "ra" parameter in python, so pywin32 returns a tuple with
> the recordset and the number of records.
>
> How do I retrieve the number of records (for a non-row-returning query) in
> Iron?

Presumably, Execute expects you to pass a VT_I4 | VT_BYREF so that it
can store the value in the reference.  If this were for a CLR API,
you'd pass an int reference by using a variable of type
clr.Reference[int](). I don't know that this will work for COM, but I
assume that it would:

ra = clr.Reference[int]()
self.cmd.Execute(ra)
recordCount = ra.Value

--
Curt Hagenlocher
[EMAIL PROTECTED]
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

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


Re: [IronPython] Return value for ADODB .Execute() call?

2008-08-27 Thread Vernon Cole

if win32:
adoRetVal=self.cmd.Execute()
else:  #Iron Python
ra = clr.Reference[int]()
adoRetVal=[self.cmd.Execute(ra)] # return a list like win32
adoRetVal.append(ra.Value)


Works great!
Unit tests passed.
Thank you!
--
Vernon
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Vernon Cole
Dear miracle workers:
  This may actually be the last failed unittest for adodbapai. Progress has
been remarkable.
Can you help with one more?

Situation: filling in the parameter list for an ADO execute.  The second
parameter (parameter 1) is a python "buffer" to be loaded into a binary(4)
column.
"elem" contains the value of the parameter.
"p" is the parameter object.
Pywin32 uses p.AppendChunk successfully to pass the buffer to SQL, but Iron
objects:


DatabaseError:
--ADODBAPI
-- Trying parameter 1 = 
Traceback (most recent call last):
   File "C:\Program Files\IronPython 2.0
Beta4\lib\site-packages\adodbapi\adodba
pi.py", line 659, in _executeHelper
p.AppendChunk(elem)
 TypeError: Specified cast is not valid.
-- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
-- with parameters: (2, )


What coercion should be supplied to make AppendChunk happy to accept the
buffer contents without trying to cast it?
--
Vernon Cole
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Curt Hagenlocher
This will probably need to be a string.  I don't think we do any automatic
conversions of buffer objects for CLR or COM calls.

On Wed, Aug 27, 2008 at 6:28 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:

> Dear miracle workers:
>   This may actually be the last failed unittest for adodbapai. Progress has
> been remarkable.
> Can you help with one more?
>
> Situation: filling in the parameter list for an ADO execute.  The second
> parameter (parameter 1) is a python "buffer" to be loaded into a binary(4)
> column.
> "elem" contains the value of the parameter.
> "p" is the parameter object.
> Pywin32 uses p.AppendChunk successfully to pass the buffer to SQL, but Iron
> objects:
>
> 
> DatabaseError:
> --ADODBAPI
> -- Trying parameter 1 =  offset
>  0 at 0x003B>
> Traceback (most recent call last):
>File "C:\Program Files\IronPython 2.0
> Beta4\lib\site-packages\adodbapi\adodba
> pi.py", line 659, in _executeHelper
> p.AppendChunk(elem)
>  TypeError: Specified cast is not valid.
> -- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
> -- with parameters: (2,  offset
>  0 at 0x003B>)
> 
>
> What coercion should be supplied to make AppendChunk happy to accept the
> buffer contents without trying to cast it?
> --
> Vernon Cole
>
>
>
> ___
> 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] What is .AppendChunk expecting?

2008-08-27 Thread Vernon Cole
I tried both
p.AppendChunk(str(elem))
and
p.AppendChunk(unicode(elem))
both of which work, but then the execution fails with:

   File "C:\Program Files\IronPython 2.0
Beta4\lib\site-packages\adodbapi\adodbapi.py", line 675, in _executeHelper
rs = self.cmd.Execute(ra)
 EnvironmentError: The field is too small to accept the amount of data you
attempted to add.  Try inserting or pasting less data.
-- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
-- with parameters: (2, )

which lead me to believe that I'm not giving .AppendChunk() the argument it
expects.

I even tried
p.Value = elem
which results in:
 StandardError: Exception has been thrown by the target of an invocation.

--
Vernon

On Wed, Aug 27, 2008 at 7:40 PM, Curt Hagenlocher <[EMAIL PROTECTED]>wrote:

> This will probably need to be a string.  I don't think we do any automatic
> conversions of buffer objects for CLR or COM calls.
>
> On Wed, Aug 27, 2008 at 6:28 PM, Vernon Cole <[EMAIL PROTECTED]>wrote:
>
>> Dear miracle workers:
>>   This may actually be the last failed unittest for adodbapai. Progress
>> has been remarkable.
>> Can you help with one more?
>>
>> Situation: filling in the parameter list for an ADO execute.  The second
>> parameter (parameter 1) is a python "buffer" to be loaded into a binary(4)
>> column.
>> "elem" contains the value of the parameter.
>> "p" is the parameter object.
>> Pywin32 uses p.AppendChunk successfully to pass the buffer to SQL, but
>> Iron objects:
>>
>> 
>> DatabaseError:
>> --ADODBAPI
>> -- Trying parameter 1 = > offset
>>  0 at 0x003B>
>> Traceback (most recent call last):
>>File "C:\Program Files\IronPython 2.0
>> Beta4\lib\site-packages\adodbapi\adodba
>> pi.py", line 659, in _executeHelper
>> p.AppendChunk(elem)
>>  TypeError: Specified cast is not valid.
>> -- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
>> -- with parameters: (2, > offset
>>  0 at 0x003B>)
>> 
>>
>> What coercion should be supplied to make AppendChunk happy to accept the
>> buffer contents without trying to cast it?
>> --
>> Vernon Cole
>>
>>
>>
>> ___
>> 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] What is .AppendChunk expecting?

2008-08-27 Thread Curt Hagenlocher
Two more ideas:

1) Try passing a list of numbers.  You can trivially get this from the
buffer by saying
a = map(lambda c: ord(c), buf)
2) Try passing a BCL array of bytes.  This is almost as easy:
import System
a = System.Array[System.Byte](map(lambda c: ord(c), b))

On Wed, Aug 27, 2008 at 7:36 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:

> I tried both
> p.AppendChunk(str(elem))
> and
> p.AppendChunk(unicode(elem))
> both of which work, but then the execution fails with:
> 
>File "C:\Program Files\IronPython 2.0
> Beta4\lib\site-packages\adodbapi\adodbapi.py", line 675, in _executeHelper
> rs = self.cmd.Execute(ra)
>  EnvironmentError: The field is too small to accept the amount of data you
> attempted to add.  Try inserting or pasting less data.
> -- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
> -- with parameters: (2,  offset
>  0 at 0x003B>)
> 
> which lead me to believe that I'm not giving .AppendChunk() the argument it
> expects.
>
> I even tried
> p.Value = elem
> which results in:
>  StandardError: Exception has been thrown by the target of an invocation.
>
> --
> Vernon
>
>
> On Wed, Aug 27, 2008 at 7:40 PM, Curt Hagenlocher <[EMAIL PROTECTED]>wrote:
>
>> This will probably need to be a string.  I don't think we do any automatic
>> conversions of buffer objects for CLR or COM calls.
>>
>> On Wed, Aug 27, 2008 at 6:28 PM, Vernon Cole <[EMAIL PROTECTED]>wrote:
>>
>>> Dear miracle workers:
>>>   This may actually be the last failed unittest for adodbapai. Progress
>>> has been remarkable.
>>> Can you help with one more?
>>>
>>> Situation: filling in the parameter list for an ADO execute.  The second
>>> parameter (parameter 1) is a python "buffer" to be loaded into a binary(4)
>>> column.
>>> "elem" contains the value of the parameter.
>>> "p" is the parameter object.
>>> Pywin32 uses p.AppendChunk successfully to pass the buffer to SQL, but
>>> Iron objects:
>>>
>>> 
>>> DatabaseError:
>>> --ADODBAPI
>>> -- Trying parameter 1 = >> offset
>>>  0 at 0x003B>
>>> Traceback (most recent call last):
>>>File "C:\Program Files\IronPython 2.0
>>> Beta4\lib\site-packages\adodbapi\adodba
>>> pi.py", line 659, in _executeHelper
>>> p.AppendChunk(elem)
>>>  TypeError: Specified cast is not valid.
>>> -- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
>>> -- with parameters: (2, >> offset
>>>  0 at 0x003B>)
>>> 
>>>
>>> What coercion should be supplied to make AppendChunk happy to accept the
>>> buffer contents without trying to cast it?
>>> --
>>> Vernon Cole
>>>
>>>
>>>
>>> ___
>>> Users mailing list
>>> Users@lists.ironpython.com
>>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>>
>>>
>>
>> ___
>> Users mailing list
>> Users@lists.ironpython.com
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>>
>
> ___
> Users mailing list
> Users@lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
>
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Shri Borde
I think you are going to need Curt's solution #2 and explicitly create a "byte 
array".

Let us know if that works. If it does, we could also consider adding to 
IronPython.Runtime.PythonBuffer (the class which implements 
buffer) an implicit 
conversion operator to "byte array". With a few tweaks to 
System.Scripting.Com.VarEnumSelector, we could get to a point where you should 
be able to just do 
"p.AppendChunk(elem)"
 and have elem converted from a 
buffer to "VT_ARRAY | 
VT_I1"

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher
Sent: Wednesday, August 27, 2008 8:51 PM
To: Discussion of IronPython
Subject: Re: [IronPython] What is .AppendChunk expecting?

Two more ideas:

1) Try passing a list of numbers.  You can trivially get this from the buffer 
by saying
a = map(lambda c: ord(c), buf)
2) Try passing a BCL array of bytes.  This is almost as easy:
import System
a = System.Array[System.Byte](map(lambda c: ord(c), b))
On Wed, Aug 27, 2008 at 7:36 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:
I tried both
p.AppendChunk(str(elem))
and
p.AppendChunk(unicode(elem))
both of which work, but then the execution fails with:

   File "C:\Program Files\IronPython 2.0 
Beta4\lib\site-packages\adodbapi\adodbapi.py", line 675, in _executeHelper
rs = self.cmd.Execute(ra)
 EnvironmentError: The field is too small to accept the amount of data you 
attempted to add.  Try inserting or pasting less data.

-- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
-- with parameters: (2, )

which lead me to believe that I'm not giving .AppendChunk() the argument it 
expects.

I even tried
p.Value = elem
which results in:
 StandardError: Exception has been thrown by the target of an invocation.

--
Vernon

On Wed, Aug 27, 2008 at 7:40 PM, Curt Hagenlocher <[EMAIL 
PROTECTED]> wrote:
This will probably need to be a string.  I don't think we do any automatic 
conversions of buffer objects for CLR or COM calls.
On Wed, Aug 27, 2008 at 6:28 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:
Dear miracle workers:
  This may actually be the last failed unittest for adodbapai. Progress has 
been remarkable.
Can you help with one more?

Situation: filling in the parameter list for an ADO execute.  The second 
parameter (parameter 1) is a python "buffer" to be loaded into a binary(4) 
column.
"elem" contains the value of the parameter.
"p" is the parameter object.
Pywin32 uses p.AppendChunk successfully to pass the buffer to SQL, but Iron 
objects:


DatabaseError:
--ADODBAPI
-- Trying parameter 1 = 
Traceback (most recent call last):
   File "C:\Program Files\IronPython 2.0 Beta4\lib\site-packages\adodbapi\adodba
pi.py", line 659, in _executeHelper
p.AppendChunk(elem)
 TypeError: Specified cast is not valid.
-- on command: "INSERT INTO tblTemp (fldId,fldData) VALUES (?,?)"
-- with parameters: (2, )


What coercion should be supplied to make AppendChunk happy to accept the buffer 
contents without trying to cast it?
--
Vernon Cole


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


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


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

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


Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Vernon Cole
On Wed, Aug 27, 2008 at 9:50 PM, Curt Hagenlocher <[EMAIL PROTECTED]>wrote:

> Two more ideas:
>
> 1) Try passing a list of numbers.  You can trivially get this from the
> buffer by saying
> a = map(lambda c: ord(c), buf)
> 2) Try passing a BCL array of bytes.  This is almost as easy:
> import System
> a = System.Array[System.Byte](map(lambda c: ord(c), b))
>
> 1) gave
 TypeError: Specified cast is not valid.
  again.

2) implemented as:
 from System import Array,Byte
 a = Array[Byte](map(lambda c: ord(c),elem))
 p.AppendChunk(a)
gives:
 SystemError: Unexpected VarEnum 8209.

which is new, at least.
--
VC
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Curt Hagenlocher
On Wed, Aug 27, 2008 at 9:51 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:
>
> 2) implemented as:
>  from System import Array,Byte
>  a = Array[Byte](map(lambda c: ord(c),elem))
>  p.AppendChunk(a)
> gives:
>  SystemError: Unexpected VarEnum 8209.

8209 is 0x2011, which is indeed VT_UI1 | VT_ARRAY.  Do you know as
what type this argument ends up getting passed when you call this
through pythoncom?

--
Curt Hagenlocher
[EMAIL PROTECTED]
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Shri Borde
System.Scripting.Com.VarEnumSelector.GetManagedMarshalType does not deal with 
VT_ARRAY. Curt, I believe we need to add code to handle this.

Vernon, could you open a CodePlex bug please?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher
Sent: Wednesday, August 27, 2008 10:01 PM
To: Discussion of IronPython
Subject: Re: [IronPython] What is .AppendChunk expecting?

On Wed, Aug 27, 2008 at 9:51 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:
>
> 2) implemented as:
>  from System import Array,Byte
>  a = Array[Byte](map(lambda c: ord(c),elem))
>  p.AppendChunk(a)
> gives:
>  SystemError: Unexpected VarEnum 8209.

8209 is 0x2011, which is indeed VT_UI1 | VT_ARRAY.  Do you know as
what type this argument ends up getting passed when you call this
through pythoncom?

--
Curt Hagenlocher
[EMAIL PROTECTED]
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

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


Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Shri Borde
Btw, for now, you could workaround the problem by using Type.InvokeMember 
(http://msdn.microsoft.com/en-us/library/66btctbe.aspx) directly as such:

import clr
from System.Reflection import BindingFlags
bindingFlags = BindingFlags.InvokeMethod | BindingFlags.Instance | 
BindingFlags.Public | BindingFlags.IgnoreReturn
t = clr.GetClrType(type(p))
from System import Array, Byte
a = Array[Byte](map(lambda c: ord(c),elem))
t.InvokeMember("AppendChunk", bindingFlags, None, p, Array[object]([a])

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shri Borde
Sent: Wednesday, August 27, 2008 10:04 PM
To: Discussion of IronPython
Cc: Martin Maly
Subject: Re: [IronPython] What is .AppendChunk expecting?

System.Scripting.Com.VarEnumSelector.GetManagedMarshalType does not deal with 
VT_ARRAY. Curt, I believe we need to add code to handle this.

Vernon, could you open a CodePlex bug please?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher
Sent: Wednesday, August 27, 2008 10:01 PM
To: Discussion of IronPython
Subject: Re: [IronPython] What is .AppendChunk expecting?

On Wed, Aug 27, 2008 at 9:51 PM, Vernon Cole <[EMAIL PROTECTED]> wrote:
>
> 2) implemented as:
>  from System import Array,Byte
>  a = Array[Byte](map(lambda c: ord(c),elem))
>  p.AppendChunk(a)
> gives:
>  SystemError: Unexpected VarEnum 8209.

8209 is 0x2011, which is indeed VT_UI1 | VT_ARRAY.  Do you know as
what type this argument ends up getting passed when you call this
through pythoncom?

--
Curt Hagenlocher
[EMAIL PROTECTED]
___
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

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

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