Re: [Ironpython-users] New Mailing List is now available

2011-06-16 Thread Slide
On Thu, Jun 16, 2011 at 8:39 AM, Jeff Hardy  wrote:

> Hi all,
> After the downtime yesterday, the new mailing list is now available.
> It appears that everyone has received unsubscribe notices; these were
> sent in error. Everyone who was subscribed to the old list should be
> subscribed to the new list.
>
> The page for the new list is
> http://mail.python.org/mailman/listinfo/ironpython-users, and mails
> should now be sent to [email protected].
>
> If you think that you are not getting mail, please send me an email
> directly and I will verify that you are still in the membership
> database.
>
> Also, a big thank you goes out to DreamHost, Jim Hugunin, and Ralf
> Hildebrandt for their work in getting the mailing list moved over.
>
> Again, I apologize for any inconvenience this may have caused, and for
> the erroneous unsubscribe messages.
>
> - Jeff
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>

Jeff,

Thanks to you also for your continued work to improve the IP infrastructure.
Your work is much appreciated!

Slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython 2.7.1 Beta coming this weekend

2011-06-20 Thread Slide
On Mon, Jun 20, 2011 at 8:53 AM, Jeff Hardy  wrote:

> On Sun, Jun 19, 2011 at 11:07 PM, Markus Schaber
>  wrote:
> > Are there no 3rd-party applications which embed and install IronPython
> > with their own installer?
> >
> > Being afraid of such scenarios was the main reason why we build
> > IronPython on our own (with changed assembly name and signing key) and
> > install that customized version with our CoDeSys installer.
>
> Yes, but I think everyone chooses the same path you do
> (rebuild/resign). At least, I'm pretty sure that's what Resolver One
> does (I don't know of any other apps ... maybe we need a "Who's
> Using?" page).
>
> The official installer is downgrade-proof, so other apps should just
> be using that; if anyone else unconditionally puts the IronPython
> files in the GAC, I'm not sure there's much we can do about it, sadly.
> Polite requests and public shaming is about it.
>
> For embedding, I would recommend you continue what you're doing - it's
> just just straight-up safer. It's a shame zipimport doesn't work; we
> could cut the deployed size of the stdlib down significantly.
>
> >
> > (The other reason was some suspected collision between the versions
> > compiled for .NET 2.0 and 4.0. We wanted to avoid problems if users
> > install their own IronPython versions. Nowadays, I'm convinced that this
> > problem only arises if you compile an application for .net 4.x which
> > references an IronPython dll compiled for .NET 2.x.
>
> Different signing keys for .NET 2 and .NET 4 would solve that. Since
> we don't build for .NET 2 anymore it shouldn't be an issue, right?
>
> - Jeff
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



I didn't see an issue filed for the zimport missing, am I just missing it in
the bug tracker?

Thanks,

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython 2.7.1 Beta coming this weekend

2011-06-20 Thread Slide
On Mon, Jun 20, 2011 at 10:18 AM, Jeff Hardy  wrote:

> On Mon, Jun 20, 2011 at 9:59 AM, Slide  wrote:
> > I didn't see an issue filed for the zimport missing, am I just missing it
> in
> > the bug tracker?
>
> http://ironpython.codeplex.com/workitem/391
>
> Yikes, that's a low number, and high votes.
>
> Anybody want to tackle this one? I've got a big sack of internet
> points* to give away! (I've got another sack for whoever implements
> pyexpat, as well).
>
> - Jeff
>
> * They're like bitcoins, only even more useless :)
>

I'll see what I can do.

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython 2.7.1 Beta coming this weekend

2011-06-21 Thread Slide
On Mon, Jun 20, 2011 at 10:50 PM, Markus Schaber
wrote:

> Hi, Jeff,
>


>
> > For embedding, I would recommend you continue what you're doing - it's
> > just just straight-up safer. It's a shame zipimport doesn't work; we
> could
> > cut the deployed size of the stdlib down significantly.
>
> Hmm. Chould zipimport be made possible using the PAL (HAL?)
> functionality of the DLR?
> 
>

That is how I was planning on approaching it, using the
PlatformAdaptationLayer, I just haven't gotten to it quite yet.


> Regards
> Markus
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] FW: IronPython, Daily Digest 6/23/2011

2011-06-27 Thread Slide
On Mon, Jun 27, 2011 at 8:19 AM, Jeff Hardy  wrote:

> On Mon, Jun 27, 2011 at 6:45 AM, Jimmy Schementi 
> wrote:
> > It's a daily digest of the issues on ironpython.codeplex.com, not of
> this mailing list. If it's not of interest we can put it on a smaller dev
> list.
>
> I turned it on as an experiment, in an attempt to get a little more
> visibility on the bug tracker. Unfortunately the only option is daily
> - I would have preferred weekly, and I'll open a CodePlex issue to see
> if that can be changed.
>
> I can redirect these to a different list if people don't want to get
> them; any opinions one way or the other?
>
> - Jeff
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>

Would you be creating a new list? The only list I see on the
python.orgmailing list list (haha!) is the ironpython-users. Just want
to make sure I
am not missing out on some excellent developer discussions.

Thanks,

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] location for zipimport.cs

2011-06-28 Thread Slide
I am working on an implementation of zipimport.cs, there are some changes
needed to sys.cs in order to add the zipimporter to sys path_hooks. I
currently have zipimport.cs in the IronPython class library, but am
wondering if I should put it into IronPython.Modules. Are there any
guidelines for this sort of thing?

Thanks,

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] location for zipimport.cs

2011-06-28 Thread Slide
Ok, that was the direction I was going, just wanted to make sure.

Thanks

Slide
On Jun 28, 2011 10:40 PM, "Jeff Hardy"  wrote:
> On Tue, Jun 28, 2011 at 10:31 AM, Slide  wrote:
>> I am working on an implementation of zipimport.cs, there are some changes
>> needed to sys.cs in order to add the zipimporter to sys path_hooks. I
>> currently have zipimport.cs in the IronPython class library, but am
>> wondering if I should put it into IronPython.Modules. Are there any
>> guidelines for this sort of thing?
>
> IronPython.dll should not be calling into IronPython.Modules.dll; if
> it needs to be called from sys.cs, it should go into
> Languages\IronPython\IronPython\Modules.
>
> - Jeff
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Undesired Side Effects of sending digests to the list as emails

2011-07-04 Thread Slide
The daily digest is just the digest of the bug tracker for the day, not the
normal messages.
On Jul 4, 2011 9:22 AM, "David Bagby"  wrote:
> Hi List,
>
> I've been reading the list for a couple of months as part of an effort
> to learn more about Iron Python.
>
> I thought I'd speak up about the recent decision to start sending the
> list daily digest to the list (as an email)
> I rather dislike the side effect of this and wanted to explain why...
> turning this option on has created a recursive problem.
>
> If a list subscriber gets the list content as individual emails, the
> digest is just one more email they get -
>
> However, if you choose to get the list email as a daily digest (as I
> do), sending the digest as an email to the list causes the digest to be
> inserted into the daily digest email and that makes for a very hard
> to read digest.
> It also effectively doubles content of the digest (as today's digest
> ends up including an email from yesterday which is all of the prior
> day's digest). This is ugly enough when you get daily digests, I hate
> to think about what this would look like if one opted for weekly digests
> instead of daily (I don't remember if this list offers weekly digests,
> some other lists I subscribe to do).
>
> When someone then replies to an email and does not trim the quoted
> reply... well, at that point the you have a pretty massive amount of
> text within which it is darn near impossible to find the "new" content.
>
> Now think about trying to read that on a typical mobile device (as I
> often do on my android phone). one ends up having to scroll thru
> pages and pages of useless text.
>
> The net effect for me is that this recent change to the list has made
> reading the list painful enough that I've found myself just deleting the
> list emails instead of reading them. :-(
>
> So, just in case anyone is counting raised hands, mine is up for "please
> turn this digest is sent to the list option back off".
>
> Dave
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Importing .NET Lib Error

2011-07-11 Thread Slide
The next version of IP should have csv module support in it...I know that
doesn't help you NOW, but should in the future.If the DLL is in the DLLs
directory, you should be able to load by just using the clr.AddReference
method I believe.

Thanks,

slide

On Mon, Jul 11, 2011 at 12:16 PM, Chris  wrote:

> Hi all,
>
> Sorry im a .NET newbie so im going to ask here without really trying to fix
> this myself.
>
> I want to import a CSV lib, as explained here:
>
> http://www.ironpython.info/index.php/Reading_CSV_Files
>
> My code is this, im just testing the import works at the moment:
>
> import clr
> from System.Reflection import Assembly
> assembly_path = "C:\Program Files (x86)\IronPython
> 2.7\DLLs\LumenWorks.Framework.IO.dll"
> assembly = Assembly.LoadFile(assembly_path)
> clr.AddReference(assembly)
>
> I receive this error (im on Win7 with .NET4 installed):
>
> Running E:\Users\Chris\Documents\Visual Studio 2010\Projects\BACS18
> Converter\BACS18 Converter\Program.py
> Traceback (most recent call last):
>   File "c:\Program Files (x86)\Microsoft Visual Studio
> 10.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual
> Studio\1.0\visualstudio_py_repl.py", line 358, in run_file_as_main
> exec(code, self.exec_mod.__dict__, self.exec_mod.__dict__)
>   File "E:\Users\Chris\Documents\Visual Studio 2010\Projects\BACS18
> Converter\BACS18 Converter\Program.py", line 2, in 
> import SPA
>   File "E:\Users\Chris\Documents\Visual Studio 2010\Projects\BACS18
> Converter\BACS18 Converter\SPA.py", line 4, in 
> assembly = Assembly.LoadFile(assembly_path)
> SystemError: An attempt was made to load an assembly from a network
> location which would have caused the assembly to be sandboxed in previous
> versions of the .NET Framework. This release of the .NET Framework does not
> enable CAS policy by default, so this load may be dangerous. If this load is
> not intended to sandbox the assembly, please enable the
> loadFromRemoteSources switch. See
> http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
> >>>
>
> Two questions:
> Is this the best way to be importing a .NET lib, that tutorial appears to
> have been written in 2007?
> If it is, how do i fix that error, im not loading from a network
> location..?
>
> Many thanks,
> Chris
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>


-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] codeplex member

2011-07-15 Thread Slide
How does one become a member of the project on codeplex so that issues can
be assigned to them? Also, is the plan to stick with codeplex issues or
possibly move to github's issue system?

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Q: Protecting my source in an ASP.NET IronPython application possible?

2011-07-20 Thread Slide
On Wed, Jul 20, 2011 at 4:57 AM, Bernd Viehmann <
[email protected]> wrote:

> Hi,
>
> I am quit new here, so : My name is Bernd Viehmann, I live in Germany (
> near the city Aachen by the German/Dutch border ) and I am a web developer
> interested in Iron Python.
>
>
> I am just going to start a commercial ASP:NET application with Iron Python.
> I have planned to use ASP.NET 4.0 for the project.
>
> My (first  question :-) ) Is there a way to hide my source code?
>
> Normal the code-behind files for the web forms are readable for anyone with
> access to the server. Is there a way to pre-compile the .py files to make
> them unreadable in an ASP.NET application?
>
> Or is there a solution like the code-obfuscater for C#?
>
>
> Thanks for any help and kind regards
>
>  Bernd
> __**_
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/**mailman/listinfo/ironpython-**users<http://mail.python.org/mailman/listinfo/ironpython-users>
>


You can modify the permissions on the source files in IIS so that they are
not readable directly.

slide


-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] IronPython Tools (NOT Python Tools For VS2010)

2011-07-29 Thread Slide
Are the IronPython Tools officially deprecated in favor of the Python Tools
for VS2010?

Thanks,

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython Tools (NOT Python Tools For VS2010)

2011-07-29 Thread Slide
Ok, so do we want to clear out any issues in the tracker having to do with
ip tools?
On Jul 29, 2011 5:06 PM, "Jimmy Schementi"  wrote:
> Yes, which is why the tools are not enabled by default in the latest
installer.
>
> ~Jimmy
>
>
> On Jul 29, 2011, at 7:59 PM, Slide  wrote:
>
>> Are the IronPython Tools officially deprecated in favor of the Python
Tools for VS2010?
>>
>> Thanks,
>>
>> slide
>>
>> --
>> slide-o-blog
>> http://slide-o-blog.blogspot.com/
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] external libraries

2011-08-01 Thread Slide
What are the guidelines for bringing in part or all of an external library?
What licenses are compatible with the rest of the IP source code so it won't
be tainted by anything?

Thanks,

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] external libraries

2011-08-02 Thread Slide
No, I was actually thinking of pulling something in from Mono which has
nothing to do with zlib or zipimport :-) I am planning on reusing the
existing decompression that is currently used in the zlib module for
zipimport (which is coming along nicely by the way).

Thanks,

slide

On Tue, Aug 2, 2011 at 8:41 AM, Jeff Hardy  wrote:

> Unfortunately, I'm not entirely sure. We do include the Python & Ruby
> stdlibs, which have their own licenses, and zlib.net, which is
> MIT/BSD. I'm going to hazard a guess that you're thinking of #ZipLib,
> which is GPL + Classpath, which isn't as scary as it sounds, but still
> makes me slightly nervous. I'd prefer to avoid it if possible. At the
> very least, it might be an external, optional dependency.
>
> On that note, I did happen across
>
> https://github.com/IronLanguages/main/blob/master/Hosts/Silverlight/Chiron/Zip.cs
> that you might find interesting.
>
> - Jeff
>
> On Mon, Aug 1, 2011 at 9:30 PM, Slide  wrote:
> > What are the guidelines for bringing in part or all of an external
> library?
> > What licenses are compatible with the rest of the IP source code so it
> won't
> > be tainted by anything?
> > Thanks,
> > slide
> >
> > --
> > slide-o-blog
> > http://slide-o-blog.blogspot.com/
> >
> > ___
> > Ironpython-users mailing list
> > [email protected]
> > http://mail.python.org/mailman/listinfo/ironpython-users
> >
> >
>



-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Mako

2011-08-16 Thread Slide
I found this discussion from a few years ago and was wondering if anyone
knew if everything needed for Mako to work with IronPython was integrated
now

https://groups.google.com/d/topic/mako-discuss/SGYx6rjb6OY/discussion

Thanks,

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython 3 in new mono 2.10.4

2011-08-19 Thread Slide
This same question was asked a couple days ago. The Mono team grabbed a tag
from git and it had been updated to version 3.0.0. It's just the based on
the tag the Mono team grabbed, not an official release from the IronPython
project.

Thanks,

slide

On Thu, Aug 18, 2011 at 2:35 AM, Sven Jörns  wrote:

> Hi,
>
> today I installed the new version of mono 2.10.4
> (http://www.mono-project.com/Release_Notes_Mono_2.10.4), because
> packaging problems on MacOS X should be fixed.
> But in this version there is "IronPython 3.0 (3.0.0.0) on .NET 4.0.30319.1"
> Is this the official new stable version of IronPython?
>
>
> - Sven
>
>
>
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Working Directory

2011-08-26 Thread Slide
On Fri, Aug 26, 2011 at 7:56 AM, Paul Grenyer wrote:

> Hi Peter
>
> > if you are running windows:
> >
> > if you end up in the wrong directory after failure you could use
> > sub-batch-files (call .bat ) and in that sub-batch-files you
> could
> > use the command setlocal. Then environment and working directory are
> > restored on return from the batch file.
>
> Yeah, that feels like quite a hack. It's odd you can't set the working
> directory for the python executable.
>
> Any ideas about my command line argument problem?
>
>

Can you show the console output that makes you think it's pulling the second
argument as a python file to execute?

Thanks,

slide
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Working Directory

2011-08-26 Thread Slide
On Fri, Aug 26, 2011 at 8:09 AM, Paul Grenyer wrote:

> Hi
>
> > Can you show the console output that makes you think it's pulling the
> second
> > argument as a python file to execute?
>
> Sure!
>
> Here's my commandline that works:
>
> DirList\3rdparty\IronPython\ipy.exe
> DirList\AcceptanceTests\acceptance_tests.py
>
> Then if I add a parameter:
>
> DirList\3rdparty\IronPython\ipy.exe
> DirList\AcceptanceTests\acceptance_tests.py parameter
>
> Traceback (most recent call last):
>  File "DirList\AcceptanceTests\acceptance_tests.py", line 57, in 
>  File
> "C:\Sandbox\private\Articles\Testing\TDD\Examples\DirList-Abridged\DirList\3rdparty\IronPython\Lib\unittest\main.py",
> line 92, in __init__
>  File
> "C:\Sandbox\private\Articles\Testing\TDD\Examples\DirList-Abridged\DirList\3rdparty\IronPython\Lib\unittest\main.py",
> line 147, in parseArgs  File
>
> "C:\Sandbox\private\Articles\Testing\TDD\Examples\DirList-Abridged\DirList\3rdparty\IronPython\Lib\unittest\main.py",
> line 155, in createTests
>  File
> "C:\Sandbox\private\Articles\Testing\TDD\Examples\DirList-Abridged\DirList\3rdparty\IronPython\Lib\unittest\loader.py",
> line 128, in loadTestsFromNames
>  File
> "C:\Sandbox\private\Articles\Testing\TDD\Examples\DirList-Abridged\DirList\3rdparty\IronPython\Lib\unittest\loader.py",
> line 100, in loadTestsFromNameAttributeError: 'module' object has no
> attribute 'parameter'
>
>
> --
> Thanks
> Paul
>
> Paul Grenyer
> e: [email protected]
> b: paulgrenyer.blogspot.com
> t: pjgrenyer
>

What does your if __name__ == "__main__": look like? Or, if you don't have
that, can you share your entry script?

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Working Directory

2011-08-26 Thread Slide
On Fri, Aug 26, 2011 at 9:40 AM, Paul Grenyer wrote:

> Hi
>
> > What does your if __name__ == "__main__": look like? Or, if you don't
> have
> > that, can you share your entry script?
>
> Yep:
>
> if __name__ == '__main__':
>unittest.main()
>
> --
> Thanks
> Paul
>
>

You'd probably want to add something to swallow the argument and set the
working directory, otherwise the unittest module things that is the module
you want to test (look at the docs for unittest and command line arguments).
It's not an IronPython issue at all, it's unittest doing what it is supposed
to do. Inside unittest.main it pulls out the command line parameters and
uses them to determine what unittests to run.

You could do something like (not tested):

import os, sys

if __name__ == '__main__':
 os.chdir(sys.argv[1])
 del(sys.argv[1])
 unittest.main()


slide



-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython 2.7.1 release Question

2011-10-03 Thread Slide
I still need to sit down and finish my zipimport implementation, I know that
was something you wanted in for 2.7.1.
On Oct 3, 2011 11:07 AM, "Jeff Hardy"  wrote:
> Weird, I was just going to post that this afternoon :)
>
> The current plan is to cut another beta today or tomorrow (once I fold in
> the SSL patches), an RC on the 15th, and then the final 2.7.1 on the 21st.
> I'm setting the 21st as the hard deadline (unless the RC is completely
> FUBAR) because otherwise I clearly can't get anything out the door.
>
> Needless to say, this is far longer than it should have taken, and the
fault
> is entirely my own. I apologize to those who have had good patches sitting
> in the tree since April without a final release.
>
> I'm going to work out a quaterly-ish release schedule from here on out,
and
> spend some time making the release process easier. Whenever the quarter
> ticks around, as long as there are sufficient changes to make it
worthwhile,
> I'll cut another release.
>
> - Jeff
>
> On Mon, Oct 3, 2011 at 9:52 AM, Daniel Fernandez <
[email protected]
>> wrote:
>
>> Hi All,
>>
>> I was wondering if there was an estimated time frame to release
IronPython
>> 2.7.1?
>>
>> Thanks
>>
>> Danny
>>
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
>>
>>
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython 2.7.1 release Question

2011-10-03 Thread Slide
I'll do my best :-)

On Mon, Oct 3, 2011 at 11:18 AM, Jeff Hardy  wrote:
> On Mon, Oct 3, 2011 at 11:14 AM, Slide  wrote:
>>
>> I still need to sit down and finish my zipimport implementation, I know
>> that was something you wanted in for 2.7.1.
>
> If you can get it done by the 15th, I'll take it. If not, I'll target
> another release for January or February (I haven't decided on 3 or 4 month
> cycles).
> - Jeff
>
>>
>> On Oct 3, 2011 11:07 AM, "Jeff Hardy"  wrote:
>> > Weird, I was just going to post that this afternoon :)
>> >
>> > The current plan is to cut another beta today or tomorrow (once I fold
>> > in
>> > the SSL patches), an RC on the 15th, and then the final 2.7.1 on the
>> > 21st.
>> > I'm setting the 21st as the hard deadline (unless the RC is completely
>> > FUBAR) because otherwise I clearly can't get anything out the door.
>> >
>> > Needless to say, this is far longer than it should have taken, and the
>> > fault
>> > is entirely my own. I apologize to those who have had good patches
>> > sitting
>> > in the tree since April without a final release.
>> >
>> > I'm going to work out a quaterly-ish release schedule from here on out,
>> > and
>> > spend some time making the release process easier. Whenever the quarter
>> > ticks around, as long as there are sufficient changes to make it
>> > worthwhile,
>> > I'll cut another release.
>> >
>> > - Jeff
>> >
>> > On Mon, Oct 3, 2011 at 9:52 AM, Daniel Fernandez
>> > > >> wrote:
>> >
>> >> Hi All,
>> >>
>> >> I was wondering if there was an estimated time frame to release
>> >> IronPython
>> >> 2.7.1?
>> >>
>> >> Thanks
>> >>
>> >> Danny
>> >>
>> >> ___
>> >> Ironpython-users mailing list
>> >> [email protected]
>> >> http://mail.python.org/mailman/listinfo/ironpython-users
>> >>
>> >>
>
>



-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Metro Profile support

2011-11-21 Thread Slide
On Mon, Nov 21, 2011 at 11:07 AM, Cesar Mello  wrote:

> Hi,
>
> Is there support for running ironpython in Windows 8 Metro style
> applications? If not, will it be too difficult to implement?
>
> Just watched this Build 2011 
> presentation<http://channel9.msdn.com/Events/BUILD/BUILD2011/TOOL-930C>and it 
> seems DLR was not included in the Metro profile.
>
> Thank you a lot for the attention.
>
> Best regards
> Mello
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>
I don't think anyone has really looked into this yet. The DLR need not be
included in the Metro profile as you can use it as a separate component
(this is how IP worked pre-4.0). Whether that works or not is unknown at
this point as far as I know. If you try it out (DLR can be found here
http://dlr.codeplex.com/) it would be interesting to know what does and
does not work.

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Metro Profile support

2011-11-21 Thread Slide
On Mon, Nov 21, 2011 at 12:21 PM, Jeff Hardy  wrote:

> On Mon, Nov 21, 2011 at 10:07 AM, Cesar Mello  wrote:
> > Hi,
> > Is there support for running ironpython in Windows 8 Metro style
> > applications? If not, will it be too difficult to implement?
> > Just watched this Build 2011 presentation and it seems DLR was not
> included
> > in the Metro profile.
> > Thank you a lot for the attention.
>
> On a second look, I see System.Dynamic in Metro:
> http://msdn.microsoft.com/en-us/library/windows/apps/hh454068(v=VS.85).aspx
> .
>
> I haven't watched the talk, but which pieces are missing? It looks
> like someone is going to have to just build the darn thing on Win8 and
> see what happens (dibs out). I'd hate for IronPython not to be able to
> build Metro apps in some form, but I don't have the time to see it
> though right now.
>
> - Jeff
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>


I'll see what I can do, I had a Win8 VM sitting around a while back but
didn't do much with it. I'll try and cook something up.

slide

-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Removal of IronPython Tools for Visual Studio from 2.7.2

2011-12-11 Thread Slide
On Sun, Dec 11, 2011 at 1:13 PM, Jeff Hardy  wrote:

> Does anyone have an objections to removing the IronPython Tools for VS
> from 2.7.2? They're already disabled by default, they're a small
> annoyance to keep building, and the Python Tools for VS are so much
> better that I see no point in continuing to include them.
>
> - Jeff
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>


I'd say definitely do it.


-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Visual studio C# "no module named ssl" import error

2011-12-12 Thread Slide
socket is provided via IronPython.Modules, but only _ssl (the "native"
module) is implemented in IronPython.Modules. You would need the Python
stdlib which has the ssl module (which uses _ssl).

Thanks,

slide

2011/12/12 楊 鈞凱 

>  Hello Everyone, I want to use Ironpython to call a simple ssl socket
> test program
>
> but I got a ImportException error called "no module named ssl".
>
> Strange thing is I can import socket and run as "import socket".(tested
> with another simple socket program without ssl)
>
> But I cant import ssl as "import ssl" and got a big error, Any tips?
>
> My code in c# to call python:
>
> using System;
> using System.Collections.Generic;
> using System.ComponentModel;
> using System.Data;
> using System.Drawing;
> using System.Linq;
> using System.Text;
> using System.Windows.Forms;
>
> using IronPython.Hosting;
> using Microsoft.Scripting.Hosting;
>
> namespace test
> {
> public partial class Form1 : Form
> {
> public Form1()
> {
> InitializeComponent();
> }
>
> private void button1_Click(object sender, EventArgs e)
> {
> ScriptRuntime pyRuntime = Python.CreateRuntime();
>
> dynamic obj = pyRuntime.UseFile("sslsocket.py");
>
> string response = obj.openssl("hello");
>
> if (response == "true")
> MessageBox.Show("success", "success",
> MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
>
>   &nbs p; this.Close();
> }
> }
>
> And the sslsocket.py code is:
>
> import socket
> import ssl
>
> def openssl(data):
> HOST = '192.168.1.6'
> PORT = 1234
> d = data.encode('utf-8')
> s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
> ssl_sock = ssl.wrap_socket(s,ca_certs="C:\Users\test\Documents\Visual
> Studio 2008\Projects\testupload\root.crt",cert_reqs=ssl.CERT_NONE)
> ssl_sock.connect((HOST, PORT))
> ** ssl_sock.send(d)
> ssl_sock.close()
> return "true"
>
> Platform: Win7 32 bit, Python 2.7, Visual studio 2010, IronPython
> 2.7.1(latest one)
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>


-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] __package__

2011-12-14 Thread Slide
Currently, I am working on implementing zipimport. I have modules being
imported from egg files (very early and not a lot of testing done yet), but
I notice that the __package__ attribute is not getting set up correctly,
e.g.:

Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import oauth
>>> dir(oauth)
['__builtins__', '__doc__', '__file__', '__loader__', '__name__',
'__package__',
 '__path__']


IronPython 3.0 DEBUG (3.0.0.0) on .NET 4.0.30319.237
Type "help", "copyright", "credits" or "license" for more information.
>>> import oauth
>>> dir(oauth)
['__builtins__', '__doc__', '__file__', '__loader__', '__name__',
'__path__']


I see in the code that there are references to __package__, but following
where it it set is proving to be a bit difficult. Can someone point me in
the right direction?

Thanks,

slide
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] __package__

2011-12-15 Thread Slide
Yeah, the very strange this is that __package__ (in that code in
Importer.cs) is done BEFORE the module is even loaded. I don't see how it
could be ever setting the __package__ attribute correctly. In CPython,
import.c is about as "confusing" as Importer.cs, so at least IP is
compatible with CPython in that respect :-)

I'll continue to dig into import.c and see what I can determine about
__package__

Thanks,

slide



On Wed, Dec 14, 2011 at 10:19 PM, Dino Viehland  wrote:

>  It happens in Importer.cs – there’s a comment saying “// explicit
> relative import, calculate and store __package__”
>
> ** **
>
> It also happens in imp.new_module, when creating the sys module, and in
> PythonContext.CreateBuiltinModule, but I think those are all much less
> interesting.
>
> ** **
>
> Import bugs are really tough…  Anyone who has worked on the importer code
> has never looked at the CPython source code to see how it works – so
> there’s subtle issues like this.  I’d suggest looking at CPython where it
> sets it and then making IronPython work the same.  
>
> ** **
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *
> Slide
> *Sent:* Wednesday, December 14, 2011 9:03 PM
> *To:* [email protected]
> *Subject:* [Ironpython-users] __package__
>
> ** **
>
> Currently, I am working on implementing zipimport. I have modules being
> imported from egg files (very early and not a lot of testing done yet), but
> I notice that the __package__ attribute is not getting set up correctly,
> e.g.:
>
> ** **
>
> Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]
> on win
>
> 32
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import oauth
>
> >>> dir(oauth)
>
> ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',
> '__package__',
>
>  '__path__']
>
> ** **
>
> ** **
>
> IronPython 3.0 DEBUG (3.0.0.0) on .NET 4.0.30319.237
>
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import oauth
>
> >>> dir(oauth)
>
> ['__builtins__', '__doc__', '__file__', '__loader__', '__name__',
> '__path__']
>
> ** **
>
> ** **
>
> I see in the code that there are references to __package__, but following
> where it it set is proving to be a bit difficult. Can someone point me in
> the right direction?
>
> ** **
>
> Thanks,
>
> ** **
>
> slide
>
> Website: http://earl-of-code.com
>
> ** **
>



-- 
slide-o-blog
http://slide-o-blog.blogspot.com/
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Codeplex Issues

2011-12-21 Thread Slide
It would be really nice to get some help from the community in reviewing
the current set of issues that exist on Codeplex. There are LOTS of issues
that could be obsolete, duplicate, etc that would be nice if we could
determine the current status. If you have some time, please take a look at
the issues at [1] and see if you can run a quick test to verify if it is
still an issue or not.

Thanks,

slide

[1]
http://ironpython.codeplex.com/workitem/list/advanced?keyword=&status=Open%2b%28not%2bclosed%29&type=All&priority=All&release=All&assignedTo=All&component=All&sortField=LastUpdatedDate&sortDirection=Descending&page=0
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] TestRunner

2012-01-03 Thread Slide
Is there a specific reason that IronPython is using TestRunner as opposed
to just extending something like xUnit or NUnit?
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] TryGetNonInheritedValueHelper/TryGetNonInheritedMethodHelper

2012-02-08 Thread Slide
While looking a little bit into [1] I found that the two methods above in
UserTypeOps.cs stop when they get to .NET types. If I remove the condition
to stop at .NET types, the issue no longer appears. Is there a reason that
these two methods are not looking at .NET types?


Thanks,

slide

[1]  http://ironpython.codeplex.com/workitem/32166

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] TryGetNonInheritedValueHelper/TryGetNonInheritedMethodHelper

2012-02-09 Thread Slide
Hmmm, ok, that may be beyond my current knowledge of the internals :-)

On Wed, Feb 8, 2012 at 10:36 PM, Dino Viehland  wrote:

>  The reason we don't keep looking through the type hierarchy is because
> we should have generated code which does the  dispatch to the base method -
> that's much more efficient then searching at doing a dynamic invoke at
> runtime.  We generate the code in
> NewTypeMaker.EmitBaseClassCallCheckForProperties which ultimately calls
> EmitBaseMethodDispatch which checks if we can do the base-method dispatch
> and emits the code which throws when the method is abstract.
>
> I think what's probably happening is that we're overriding the interface
> slot and the class slot independently.  The class slot dispatches to the
> base virtual method correctly, but we see the interface method as abstract
> and emit code to throw.  EmitBaseMethodDispatch probably just needs to do a
> Type.GetInterfaceMap on the base type and map it to the correct base method
> if the method is abstract and the method is declared on an interface type.
>
> *From:* [email protected] [
> mailto:[email protected]]
> *On Behalf Of *Slide
> *Sent:* Wednesday, February 08, 2012 7:56 PM
> *To:* [email protected]
> *Subject:* [Ironpython-users]
> TryGetNonInheritedValueHelper/TryGetNonInheritedMethodHelper
>
> While looking a little bit into [1] I found that the two methods above in
> UserTypeOps.cs stop when they get to .NET types. If I remove the condition
> to stop at .NET types, the issue no longer appears. Is there a reason that
> these two methods are not looking at .NET types?
>
>
> Thanks,
>
> slide
>
> [1]  
> *http://ironpython.codeplex.com/workitem/32166*<http://ironpython.codeplex.com/workitem/32166>
>
>
> --
> Website: *http://earl-of-code.com* <http://earl-of-code.com>
>
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Work Item 19249

2012-02-14 Thread Slide
I'd like to get the thoughts of the community on work item 19249 [1]. I am
thinking we want to either make it an option, or just leave it as is. I
prefer the latter.

Thanks,

slide

[1] http://ironpython.codeplex.com/workitem/19249

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Work Item 19249

2012-02-14 Thread Slide
I was planning on making it an option to load assemblies, the current
behavior would be the default. I am thinking it would be best to leave
as-is though. Either that, or allow passing in assemblies to CreateEngine
to add references to.

On Tue, Feb 14, 2012 at 6:06 PM, Dino Viehland  wrote:

>  I’m fine w/ either, but if it’s an option it should be an option which
> disables adding the references for scenarios like Markus wants (otherwise
> there really is no reason to do it).
>
> ** **
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *
> Slide
> *Sent:* Tuesday, February 14, 2012 4:02 PM
> *To:* [email protected]
> *Subject:* [Ironpython-users] Work Item 19249
>
> ** **
>
> I'd like to get the thoughts of the community on work item 19249 [1]. I am
> thinking we want to either make it an option, or just leave it as is. I
> prefer the latter.
>
> ** **
>
> Thanks,
>
> ** **
>
> slide
>
> ** **
>
> [1] http://ironpython.codeplex.com/workitem/19249
> 
>
> ** **
>
> --
> Website: http://earl-of-code.com
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] [IronPython] NuGet packaging

2012-02-18 Thread Slide
The short answer is yes :-) I think Jeff is working on this, we had lost
the nuget packaging file at one point but were able to retrieve it. Jeff
would be able to give you a better idea as to when and so forth.

On Fri, Feb 17, 2012 at 9:33 PM, Leo Carbajal  wrote:

> Sorry to revive an old thread, so to speak, but I noticed IPy is still
> listed at 2.6.1 in the Nuget packet manager. Are there still plans to
> update this?
>
>
> On Mon, Feb 7, 2011 at 8:48 AM, Jeff Hardy  wrote:
>
>> I'm already the owner of that package; I just need to build an
>> updated. I forgot that it was still on 2.6.1.
>>
>> The .nuspec file should also be added to the repo and eventually just
>> part of the build process.
>>
>> - Jeff
>>
>> On Mon, Feb 7, 2011 at 5:32 AM, Richard Nienaber 
>> wrote:
>> > I searched in the NuGet gallery for IronPython and found that the
>> version is
>> > still 2.6.1. It might be good to find out the process for updating this
>> > before the 2.7 release.
>> >
>> > Is there someone we can contact to update this or is this something we
>> can
>> > do ourselves?
>> >
>> > Richard
>> >
>> > ___
>> > Users mailing list
>> > [email protected]
>> > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>> >
>> >
>> ___
>> Users mailing list
>> [email protected]
>> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>>
>
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>


-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Pyc.py dependencies

2012-02-22 Thread Slide
Currently pyc.py only uses .NET imports and classes, I'm looking at adding
support for an embedded icon and win32 (native) resources in general. Are
people opposed to adding a dependency on the struct module, or ctypes to
accomplish that stuff?

Thanks,

Slide
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Pyc.py dependencies

2012-02-22 Thread Slide
The icon has to be part of unmanaged resources, which can be defined using
DefineUnmanagedResource, but that function expects a compiled resource
file, not a .ico file. So, I have to generate the compiled resource file
from the .ico file to embed as the unmanaged resource. Unless I am
completely missing something.

slide

On Wed, Feb 22, 2012 at 12:07 PM, Jeff Hardy  wrote:

> On Wed, Feb 22, 2012 at 9:44 AM, Slide  wrote:
> > Currently pyc.py only uses .NET imports and classes, I'm looking at
> adding
> > support for an embedded icon and win32 (native) resources in general. Are
> > people opposed to adding a dependency on the struct module, or ctypes to
> > accomplish that stuff?
>
> It's weird to me that it's not possible to do that through pure .NET,
> but if that's the only way go ahead. We can safely assume a stdlib
> will be present.
>
> - Jeff
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Understanding CPython and IronPython linkage

2012-02-22 Thread Slide
If the module is a C based module, it will not import into IronPython. The
compatibility is in most of the standard library, pycurl is not part of the
standard library. There are even issues in parts of the standard library as
you can see if you look at the bug tracker on CodePlex.

slide

On Wed, Feb 22, 2012 at 2:43 PM, Lucas Vickers wrote:

> Hello,
>
> I am OS X and I am working with a pre-compiled version of IronPython (it
> is hosted by Rhino 3d to be specific).
>
> I am attempting to import standard CPython libraries, such as pycurl.  I
> am confused as the FAQ states compatibility between IronPython 2.7 and
> CPython 2.7, but using the following code which works on CPython 2.7.2
> fails on IronPython 2.7.0.
>
> sys.path[0:0] = [
> '/Users/lucasvickers/.virtualenvs/rhino/lib/python2.7/site-packages' ]
> import pycurl
>
> It claims no module pycurl.  A little more reading shows attempts to allow
> linkage between IronPython and CPython such as ironclad (
> http://code.google.com/p/ironclad/ ), but then why the claimed
> compatibility in the first place?
>
> Can anyone help me understand?  thanks
>
> Lucas
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>


-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Understanding CPython and IronPython linkage

2012-02-22 Thread Slide
Be careful with that too :-) IronPython is obviously still a work in
progress and we're trying hard to implement features and become more
CPython compatible; we've still got a lot of work to do, but you can do
some really cool stuff with IronPython.


slide

On Wed, Feb 22, 2012 at 3:06 PM, Lucas Vickers wrote:

> Got it. Makes more sense.
>
> Sounds like I'll be pickling objects back and forth between cpy and ipy.
>
> Thanks
>
>
> On Feb 22, 2012, at 5:03 PM, Slide  wrote:
>
> If the module is a C based module, it will not import into IronPython. The
> compatibility is in most of the standard library, pycurl is not part of the
> standard library. There are even issues in parts of the standard library as
> you can see if you look at the bug tracker on CodePlex.
>
> slide
>
> On Wed, Feb 22, 2012 at 2:43 PM, Lucas Vickers wrote:
>
>> Hello,
>>
>> I am OS X and I am working with a pre-compiled version of IronPython (it
>> is hosted by Rhino 3d to be specific).
>>
>> I am attempting to import standard CPython libraries, such as pycurl.  I
>> am confused as the FAQ states compatibility between IronPython 2.7 and
>> CPython 2.7, but using the following code which works on CPython 2.7.2
>> fails on IronPython 2.7.0.
>>
>> sys.path[0:0] = [
>> '/Users/lucasvickers/.virtualenvs/rhino/lib/python2.7/site-packages' ]
>> import pycurl
>>
>> It claims no module pycurl.  A little more reading shows attempts to
>> allow linkage between IronPython and CPython such as ironclad (
>> http://code.google.com/p/ironclad/ ), but then why the claimed
>> compatibility in the first place?
>>
>> Can anyone help me understand?  thanks
>>
>> Lucas
>>
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
>>
>>
>
>
> --
> Website: http://earl-of-code.com
>
>


-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Pyc.py dependencies

2012-02-23 Thread Slide
I'm feeling pretty masochistic lately, so maybe I'll write it in pure
Python :-) The other option is pulling in something like wrc.exe from WINE
depending on the license winres from binutils is another option. I can
check into those options as well. What license would we want in order to
redistribute with IP, I am terrible with licenses.

slide

On Wed, Feb 22, 2012 at 2:07 PM, Jeff Hardy  wrote:

> On Wed, Feb 22, 2012 at 11:22 AM, Slide  wrote:
> > The icon has to be part of unmanaged resources, which can be defined
> using
> > DefineUnmanagedResource, but that function expects a compiled resource
> file,
> > not a .ico file. So, I have to generate the compiled resource file from
> the
> > .ico file to embed as the unmanaged resource. Unless I am completely
> missing
> > something.
>
> No, that looks right to me.
>
> You could shell out to rc.exe. Just write a temporary .rc file,
> compile, and pass the .res to DefineUnmanagedResource. I think. I only
> had to use rc once, in the distant past. :) Downside is that rc.exe
> require VS or the Windows SDK, neither of which are small.
>
> If you can write it in Python without too much work, go for it.
>
> - Jeff
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Pyc.py dependencies

2012-02-23 Thread Slide
On Thu, Feb 23, 2012 at 9:28 AM, Jeff Hardy  wrote:

> On Thu, Feb 23, 2012 at 7:05 AM, Slide  wrote:
> > I'm feeling pretty masochistic lately, so maybe I'll write it in pure
> Python
> > :-) The other option is pulling in something like wrc.exe from WINE
> > depending on the license winres from binutils is another option. I can
> check
> > into those options as well. What license would we want in order to
> > redistribute with IP, I am terrible with licenses.
>
> I'd prefer not to distribute anything that might be platform
> specific*. I'm fine with saying "you want to embed unmanaged
> resources, go install X, Y, or Z," except for the simple case of
> setting an Icon. I don't know the details of the resource format, but
> I can't imagine it's too complicated for that one simple case.
>
> - Jeff
>
> * Yes, there's stuff in there already. Doesn't mean I like it :).
>

I agree about distributing stuff that is platform specific*. For an icon,
it probably won't be that difficult.

slide

* winres should run on any platform that binutils is ported to since it's
part of that package.

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Patch

2012-02-23 Thread Slide
Just wanted to get this out for review before I push it. I would have done
it through my fork on github and issued a pull request, but my fork is
currently messed up. Let me know if you see anything out of the ordinary.

Fixes 32288 and 26706

Thanks,

slide



-- 
Website: http://earl-of-code.com


0001-Fix-32288-and-26706.patch
Description: Binary data
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Patch

2012-02-24 Thread Slide
Good point, I'll make the change before pushing.

On Thu, Feb 23, 2012 at 9:32 PM, Jeff Hardy  wrote:

> On Thu, Feb 23, 2012 at 7:55 PM, Slide  wrote:
> > Just wanted to get this out for review before I push it. I would have
> done
> > it through my fork on github and issued a pull request, but my fork is
> > currently messed up. Let me know if you see anything out of the ordinary.
> >
> > Fixes 32288 and 26706
>
> The change to InitializeModule won't work, sorry. Default params don't
> work under v2 compilers, and I think they break binary compatibility.
> Better to add a new method that processes the envvars and emit a call
> to it in pyc.py.
>
> - Jeff
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Patch

2012-02-24 Thread Slide
I'll update the GlobalAssemblyCache check before pushing.

On Thu, Feb 23, 2012 at 11:16 PM, Dino Viehland  wrote:

>  This is awesome, a couple comments:
>
> Can AssemblyResolve be moved into PythonOps?  It looks
> like it keys off of Assembly.GetEntryAssembly() and so doesn’t rely on
> anything in the generated assembly.  That’d make it easier to read and
> update the code.  Maybe I missed something that depends upon the assembly,
> but if that’s the case the assembly could be passed into a class which has
> the AssemblyResolve method.
>
> ** **
>
> I think the GlobalAssemblyCache check is too strong.  Ipy
> install via the MSI will go into the GAC and so I think it won’t be
> embedded.  This should probably exclude the known Ipy/Dlr assemblies from
> the GAC check.
>
> ** **
>
> +1 on what Jeff said as well, I’d just add an overload instead of doing
> the default value thing.  
>
> ** **
>
> Now I’m going to have to think more about pyc support for PTVS.
>
> ** **
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *
> Slide
> *Sent:* Thursday, February 23, 2012 7:55 PM
> *To:* [email protected]
> *Subject:* [Ironpython-users] Patch
>
> ** **
>
> Just wanted to get this out for review before I push it. I would have done
> it through my fork on github and issued a pull request, but my fork is
> currently messed up. Let me know if you see anything out of the ordinary.*
> ***
>
> ** **
>
> Fixes 32288 and 26706
>
> ** **
>
> Thanks,
>
> ** **
>
> slide
>
> ** **
>
>
> 
>
> ** **
>
> --
> Website: http://earl-of-code.com
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Patch

2012-02-24 Thread Slide
Yeah, I ran into an issue even with having the
AppDomain.CurrentDomain.AssemblyResolve += ... in the same method as the
call to PythonOps because it's at the beginning of the method that the
runtime resolves the methods called, that's why I moved it to a static
constructor.

On Thu, Feb 23, 2012 at 11:20 PM, Dino Viehland  wrote:

>  Forget that moving AssemblyResolve to PythonOps comment… chicken, egg,
> etc… J
>
> ** **
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Dino
> Viehland
> *Sent:* Thursday, February 23, 2012 10:16 PM
> *To:* Slide; [email protected]
> *Subject:* Re: [Ironpython-users] Patch
>
> ** **
>
> This is awesome, a couple comments:
>
> Can AssemblyResolve be moved into PythonOps?  It looks
> like it keys off of Assembly.GetEntryAssembly() and so doesn’t rely on
> anything in the generated assembly.  That’d make it easier to read and
> update the code.  Maybe I missed something that depends upon the assembly,
> but if that’s the case the assembly could be passed into a class which has
> the AssemblyResolve method.
>
> ** **
>
> I think the GlobalAssemblyCache check is too strong.  Ipy
> install via the MSI will go into the GAC and so I think it won’t be
> embedded.  This should probably exclude the known Ipy/Dlr assemblies from
> the GAC check.
>
> ** **
>
> +1 on what Jeff said as well, I’d just add an overload instead of doing
> the default value thing.  
>
> ** **
>
> Now I’m going to have to think more about pyc support for PTVS.
>
> ** **
>
> *From:* [email protected]
> [mailto:[email protected]] *On
> Behalf Of *Slide
> *Sent:* Thursday, February 23, 2012 7:55 PM
> *To:* [email protected]
> *Subject:* [Ironpython-users] Patch
>
> ** **
>
> Just wanted to get this out for review before I push it. I would have done
> it through my fork on github and issued a pull request, but my fork is
> currently messed up. Let me know if you see anything out of the ordinary.*
> ***
>
> ** **
>
> Fixes 32288 and 26706
>
> ** **
>
> Thanks,
>
> ** **
>
> slide
>
> ** **
>
>
> 
>
> ** **
>
> --
> Website: http://earl-of-code.com
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Distributing apps

2012-03-02 Thread Slide
Do we currently have a wiki?

On Fri, Mar 2, 2012 at 9:37 AM, Jeff Hardy  wrote:

> On Fri, Mar 2, 2012 at 7:37 AM,   wrote:
> > Apologies in advance for the newbie question, especially if this has
> > been covered 73 times already (I did spend a hour searching online and
> > in the IPy documentation before resorting to this mailing list)...
>
> It does come up once in a while, and maybe someday I'll write some
> documentation explaining how to do it. Also, it's a lot better in
> 2.7.2, so things have changed a bit in the last month.
>
> >
> > I see the reference to the new pyc.py in the 2.7.2 beta, but I'm not
> > sure if that's what I need or how to use it.
>
> That's exactly what you need. What you want is something similar to:
>
> ipy %ipyroot%\Tools\Scripts\pyc.py /target:exe /standalone
> /main:foo.py bar.py etc.py
>
> Replace %ipyroot% with wherever you have IronPython installed. And let
> us know if it doesn't work for you, either.
>
> >
> > Sorry for the long-winded question, but I just wanted to be clear that
> > I've gotten a ways and worked on this for a while, so if I'm missing
> > something really obvious, I'm going to be very embarrassed... :)
>
> No, it's not obvious, nor is it documented. It's one of things I'd
> like to see done before 2.7.2 final.
>
> - Jeff
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython 2.7.2 RC Available

2012-03-04 Thread Slide
Jeff,

As always a big thanks for your continued hard work in keeping IronPython
alive and well!

Thanks!

Slide
On Mar 4, 2012 4:53 AM, "Jeff Hardy"  wrote:

> On behalf of the IronPython team, I'm happy to announce the first (and
> probably only) release candidate for IronPython 2.7.2. Only
> showstopping bugs will be fixed before the release.
>
> You can download IronPython 2.7.2 RC from
> http://ironpython.codeplex.com/releases/view/81331.
>
> Like all IronPython 2.7-series releases, .NET 4 is required to install
> it. Installing this release will replace any existing IronPython
> 2.7-series installation.
>
> Unlike previous releases, the assemblies for all supported platforms
> are included in the installer as well as the zip package. IronPython
> 2.7.2 RC includes support for .NET 3.5, .NET 4, Silverlight 4,
> Silverlight 5, Mono for Android 4.0, and Windows Phone 7.5. Check the
> "Platforms" directory for the required assemblies. Any feedback on the
> supported platforms, especially for Android and Windows Phone, is
> greatly appreciated. For 2.7.2, the mobile platforms should be treated
> as previews, and expect them to change for 2.7.3.
>
> The biggest improvements in IronPython 2.7.2 are support for the
> zipimport module, thanks to Alex Earl, and the sqlite3 module. The
> pyc.py compiler can now generate standalone executables by embedding
> the IronPython assemblies. Many other bugs have been fixed as well.
>
> IronPython 2.7.2 RC 1 is also available on NuGet. To add it to your
> project, run Install-Package IronPython -IncludePrerelease (and
> Install-Package IronPython.StdLib -IncludePrerelease if you want the
> standard library as well) from the Package Manager Console. Because
> it's a prerelease package, it won't show up in the Package Manager UI.
>
> The final release of IronPython 2.7.2 is currently set for March 11.
> Also, Check out the new IronPython blog at http://blog.ironpython.net!
>
> - Jeff
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] setuptools

2012-03-07 Thread Slide
Just as an FYI, I committed some fixes today that should allow setuptools
to be used with IronPython. I was able to bootstrap setuptools correctly
with these fixes.

https://github.com/IronLanguages/main/commit/f975d2f68412fd761939d19f0bfbb44fffea0fcc


-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] exceptions

2012-03-08 Thread Slide
I'm at the point again where I need to implement a custom exception in a C#
module. This exception actually appears like a tuple (if you do err[0] is
gives you part of the error info). What is the best way to do something
like this? Looking at the exception implementation, it seems like its all
tied in with the runtime and not extendable in this way, am I completely
wrong?

Thanks,

slide

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IronPython 2.7.2 Released

2012-03-12 Thread Slide
This is a great idea, this functionality does not currently exist, could
you please file a new issue at http://ironpython.codeplex.com?

Thanks,

slide

On Sun, Mar 11, 2012 at 11:23 PM, Keith Rome  wrote:

> Thanks for the great work!
>
> Regarding the new zipimport functionality - is it possible to specify an
> embedded resource name for the path to the zip? For example, if I wanted to
> distribute a library by just packaging it up within an assembly? Or is it
> necessary to write the resource out to a file on disk first?
>
> Example:
> Instead of: sys.path.insert(0, '/path/lib.zip')
> Something like: sys.path.insert(0, 'resource:path.lib.zip')
>
> The primary reason behind wanting to deliver via embedded resource is to
> prevent tinkering/tampering by end users. But there are additional reasons
> such as simpler deployment under Silverlight and not having to deal with
> versioning of extra "satellite" external resources when using our scripting
> runtime environment in multiple projects. All of those issues go away when
> we can package everything directly within the assembly(s).
>
> I am currently using a custom PlatformAdaptationLayer to supply the file
> contents at runtime and msbuild wildcard inclusion of the libraries and all
> subfolders to embed them as resources (something that msbuild tolerates,
> but Visual Studio does not). It would be much cleaner to just use
> zipimport, as well as much easier to maintain (and the distributed assembly
> would also be much smaller due to zip compression).
>
>
> Keith Rome
> Senior Consultant and Architect
> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
> Wintellect | 770.617.4016 | [email protected]
> www.wintellect.com
>
> -Original Message-
> From: [email protected] [mailto:
> [email protected]] On Behalf Of
> Jeff Hardy
> Sent: Monday, March 12, 2012 12:53 AM
> To: [email protected]
> Subject: [Ironpython-users] IronPython 2.7.2 Released
>
> On behalf of the IronPython team, I'm happy to announce the final
> release IronPython 2.7.2
> (http://ironpython.codeplex.com/releases/view/74478). This release
> includes everything from IronPython 2.7 and 2.7.1 as well. Like all
> IronPython 2.7-series releases, .NET 4 is required to install it.
> Installing this release will replace any existing IronPython
> 2.7-series installation.
>
> Unlike previous releases, the assemblies for all supported platforms
> are included in the installer as well as the zip package, in the
> "Platforms" directory. IronPython 2.7.2 includes support for .NET 3.5,
> .NET 4, Silverlight 4, and Silverlight 5, and preliminary releases for
> Mono for Android 4.0 and Windows Phone 7.5. For 2.7.2, the mobile
> platforms are previews; they have known issues, and expect them to
> change for 2.7.3.
>
> The biggest improvements in IronPython 2.7.2 are:
> support for loading libraries from zip archives (the zipimport module);
> the sqlite3 module;
> many improvements to the pyc.py compiler, such as the ability generate
> standalone executables by embedding the IronPython assemblies;
> and numerous other bug fixes.
>
> IronPython 2.7.2 is also available for embedding via NuGet. The main
> package is IronPython, and the standard library is in
> IronPython.StdLib.
>
> A huge thanks to everyone who helped make this release possible; this
> wouldn't have been nearly as big a release without your help!
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] sys.version_info in 2.7.2

2012-03-12 Thread Slide
FYI, I filed an issue on this today as I ran into it while trying to get
Trac working with IronPython.

http://ironpython.codeplex.com/workitem/32400

slide

On Mon, Mar 12, 2012 at 8:45 PM, Jeff Hardy  wrote:

> On Mon, Mar 12, 2012 at 10:19 AM, Daniel Munch 
> wrote:
> > Hi,
> >
> > congratulations for the new IronPython release 2.7.2. I just updated from
> > RC1 and unfortunatly it seems like there's some change of behaviour
> > concerning sys.version_info. I got some 3rd party scripts which are
> > stumbling over the line "sys.version_info < (2, 4): " which happily
> returns
> > 'False' on RC1, but a NotImplemented Exception in 2.7.2. Could anybody
> > please verify this? I just signed up to the mailing list just for this
> > problem, so I don't now if for bug reports it's better to directly file
> an
> > issue on Codeplex.
>
> First off, bugs are best on codeplex, because we can track them more
> easily. However, drawing attention to them on the list isn't a bad
> idea.
>
> Second, I think I know what caused this. (2,4) > sys.version_info
> works just fine. I made a last-minute fix that clearly broke stuff in
> a big way (it looks like
>
> https://github.com/IronLanguages/main/commit/f8cce37420838b8197f31eedb1e04ae3a2e102ac
> is the culprit). I'll check it out and spin an updated release as soon
> as I figure it out.
>
> - Jeff
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] setuptools

2012-03-13 Thread Slide
It does not seem to work with distribute (it exits with a
StackOverflowException). I'll dig into it a little more.

slide

On Wed, Mar 7, 2012 at 3:59 PM, Jeff Hardy  wrote:

> On Wed, Mar 7, 2012 at 2:54 PM, Slide  wrote:
> > Just as an FYI, I committed some fixes today that should allow
> setuptools to
> > be used with IronPython. I was able to bootstrap setuptools correctly
> with
> > these fixes.
>
> Can you try it with distribute (http://pypi.python.org/pypi/distribute)
> as well?
>
> I gave pip a spin a little while back and it seemed to work fine after
> I made some changes to tarfile. I just can't remember if I ever pushed
> those changes...
>
> - Jeff
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] (no subject)

2012-03-13 Thread Slide
If you remove IronPython from the app and do the same thing, do you still
get the error? I've never seen that error before.
On Mar 13, 2012 6:21 PM, "surangika ranathunga" 
wrote:

> Hi All,
> I am using Ironpython (2.7)  to call a python script from my C# console
> application. The code executes fine. But when I try to terminate the
> console by clicking 'X' , I get the below error message:
> ---
> Intel(r) Visual Fortran run-time error
> ---
> forrtl: error (200): program aborting due to window-CLOSE event
>
> Image  PCRoutineLine
> Source
> linalg.DLL 0B17D91A  Unknown   Unknown  Unknown
> linalg.DLL 0B17B0F8  Unknown   Unknown  Unknown
> linalg.DLL 0B166B04  Unknown   Unknown  Unknown
> linalg.DLL 0B16C608  Unknown   Unknown  Unknown
> KERNEL32.dll   7C87655C  Unknown   Unknown  Unknown
> KERNEL32.dll   7C80B729  Unknown   Unknown  Unknown
>
> ---
> OK
> ---
>
> This is how I call the python code in my C# file:
> private ObjectOperations ops;
> private object method;
>
> var lang = Python.CreateLanguageSetup(null);
> lang.Options["Frames"] = ScriptingRuntimeHelpers.True;
> var setup = new ScriptRuntimeSetup();
> setup.LanguageSetups.Add(lang);
> var runtime = new ScriptRuntime(setup);
> var engine = runtime.GetEngine("py");
>
> ScriptScope scope = runtime.CreateScope();
> ops = engine.Operations;
>
> ScriptSource source =
> engine.CreateScriptSourceFromFile("nlp.py");
> source.Execute(scope);
> object[] parameters = new object[1];
> object klass = scope.GetVariable("nlp");
> object instance = ops.Invoke(klass);
> method = ops.GetMember(instance, "create_classifier");
>object output = ops.Invoke(method);
>
> What am I doing wrong here? Can somebody help me out?
> /Sura
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] __future__.py

2012-03-13 Thread Slide
Jeff or Dino (or anyone else who might knows),

Is there any specific reason we aren't using the __future__.py directly
from the stdlib? I ran into an issue today with doctest when it was
extracting future flags, nested_scopes was not defined in the __future__.py
that is located at Languages/IronPython/IronPython/Lib

It IS the correct __future__.py in the
External.LCA_RESTRICTED/Languages/IronPython/27/Lib version though. When I
copied the version from there to the other location, doctest ran correctly,
so I was just wondering if there was something else that required a
different __future__.py.

Thanks,

slide

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IPY 2.7.2.1. Using pyc.py for standalone exe

2012-03-15 Thread Slide
There is no need to use the CPython stdlib, the IP installer comes with a
stdlib that has some mods for it to work better. Check the Lib directory
where you installed IP. Also, you can set IRONPYTHONPATH to have it find
things.
On Mar 15, 2012 5:49 AM,  wrote:

>  Thursday, March 15, 2012, 3:49:36 AM, you wrote:
>
>
>  I am not sure whether this should be expected to work or not, nor if I
> am using this correctly...
>
> I tried to generate a standalone exe for a tool I have (3 modules) but it
> bombs out at startup with:
>
> Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No
> module named os
>at DLRCachedCode.__main__$1(CodeContext $globalContext, FunctionCode
> $functionCode)
>at IronPython.Compiler.OnDiskScriptCode.Run()
>at IronPython.Runtime.PythonContext.InitializeModule(String fileName,
> ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)
>at IronPython.Runtime.ModuleLoader.load_module(CodeContext context,
> String fullName)
>at
> Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame
> frame)
>at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame
> frame)
>at
> Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0,
> T1 arg1, T2 arg2, T3 arg3)
>
> I can reproduce with this simple foo.py module
>
> # foo.py
> import os
> print "Hello"
> print "OS:",os.name
> print "Bye"
> #end foo.py
>
> which I compile with the following:
>
> ipy -m pyc /standalone /main:foo.py /target:exe /out:foo
> or
> ipy -m pyc /main:foo.py /target:exe /out:foo2
>
> Starting either foo.exe or foo2.exe fails with above error.
>
> If I remove the import os and the line that uses on.name, I get an
> executable that works...
>
> Is this a bug or a misunderstanding in what I expect to work?
> If so what are the correct steps?
>
> Thanks for your help
>
> D.
>
> 
> # Dominique de Waleffe
> # ddewaleffe -at- gmail -dot- com
> # domi -at- dewaleffe -dot- org
> 
>
> I'll try to help, since I got a lot of help with something similar
> recently.  Congratulations - you got further before asking for help than I
> did...
>
> It seems that you don't have the path to your CPython directory in your
> environment variables.  I thought installing IronPython automatically set
> those variables, but maybe CPython got moved or something?  In any case,
> you can add it like this:
>
> import sys
> sys.path.append(r"c:\python24\lib")
>
> And if you plan on distributing the exe to another machine that doesn't
> have CPython installed, you need to put a copy of all the modules your
> script needs in a zip file located in the same directory as the exe and put
> the line
>
> sys.path.append('zipfile.zip')
>
> in your script before importing those modules...
>
> Mark
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] IPY 2.7.2.1. Using pyc.py for standalone exe

2012-03-15 Thread Slide
I also need to add in a try/catch around the call to the Python module and
output better error messages. :-)

On Thu, Mar 15, 2012 at 8:16 AM, Dominique de Waleffe
wrote:

>
> Will try your suggestion and I will also spend a bit of time to construct
> the list of needed dependencies so that pyc can do a better job...
>
> Will also file an issue later on today.
>
>
> D.
> 
> # Dominique de Waleffe
> # ddewaleffe -at- gmail -dot- com
> # domi -at- dewaleffe -dot- org
> 
>
>
> On Thu, Mar 15, 2012 at 3:24 PM, Slide  wrote:
>
>> There is no need to use the CPython stdlib, the IP installer comes with a
>> stdlib that has some mods for it to work better. Check the Lib directory
>> where you installed IP. Also, you can set IRONPYTHONPATH to have it find
>> things.
>> On Mar 15, 2012 5:49 AM,  wrote:
>>
>>>  Thursday, March 15, 2012, 3:49:36 AM, you wrote:
>>>
>>>
>>>  I am not sure whether this should be expected to work or not, nor if I
>>> am using this correctly...
>>>
>>> I tried to generate a standalone exe for a tool I have (3 modules) but
>>> it bombs out at startup with:
>>>
>>> Unhandled Exception: IronPython.Runtime.Exceptions.ImportException: No
>>> module named os
>>>at DLRCachedCode.__main__$1(CodeContext $globalContext, FunctionCode
>>> $functionCode)
>>>at IronPython.Compiler.OnDiskScriptCode.Run()
>>>at IronPython.Runtime.PythonContext.InitializeModule(String fileName,
>>> ModuleContext moduleContext, ScriptCode scriptCode, ModuleOptions options)
>>>at IronPython.Runtime.ModuleLoader.load_module(CodeContext context,
>>> String fullName)
>>>at
>>> Microsoft.Scripting.Interpreter.FuncCallInstruction`4.Run(InterpretedFrame
>>> frame)
>>>at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame
>>> frame)
>>>at
>>> Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0,
>>> T1 arg1, T2 arg2, T3 arg3)
>>>
>>> I can reproduce with this simple foo.py module
>>>
>>> # foo.py
>>> import os
>>> print "Hello"
>>> print "OS:",os.name
>>> print "Bye"
>>> #end foo.py
>>>
>>> which I compile with the following:
>>>
>>> ipy -m pyc /standalone /main:foo.py /target:exe /out:foo
>>> or
>>> ipy -m pyc /main:foo.py /target:exe /out:foo2
>>>
>>> Starting either foo.exe or foo2.exe fails with above error.
>>>
>>> If I remove the import os and the line that uses on.name, I get an
>>> executable that works...
>>>
>>> Is this a bug or a misunderstanding in what I expect to work?
>>> If so what are the correct steps?
>>>
>>> Thanks for your help
>>>
>>> D.
>>>
>>> 
>>> # Dominique de Waleffe
>>> # ddewaleffe -at- gmail -dot- com
>>> # domi -at- dewaleffe -dot- org
>>> 
>>>
>>> I'll try to help, since I got a lot of help with something similar
>>> recently.  Congratulations - you got further before asking for help than I
>>> did...
>>>
>>> It seems that you don't have the path to your CPython directory in your
>>> environment variables.  I thought installing IronPython automatically set
>>> those variables, but maybe CPython got moved or something?  In any case,
>>> you can add it like this:
>>>
>>> import sys
>>> sys.path.append(r"c:\python24\lib")
>>>
>>> And if you plan on distributing the exe to another machine that doesn't
>>> have CPython installed, you need to put a copy of all the modules your
>>> script needs in a zip file located in the same directory as the exe and put
>>> the line
>>>
>>> sys.path.append('zipfile.zip')
>>>
>>> in your script before importing those modules...
>>>
>>> Mark
>>>
>>> ___
>>> Ironpython-users mailing list
>>> [email protected]
>>> http://mail.python.org/mailman/listinfo/ironpython-users
>>>
>>>
>


-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Startup performance

2012-03-16 Thread Slide
How long does it take if you run in script form? Just wondering for
comparison.

slide

On Fri, Mar 16, 2012 at 8:55 AM,  wrote:

> Since the question of performance with regard to zipimport was just
> raised, it prompted me to ask a related question.
>
> I have a script that I've compiled to an console app exe, which
> retrieves some data from an SQL db, does quite a bit of simple
> analysis and produces some files containing the resuts. It's used by 6
> other people and they've all commented on the fact that it takes
> almost 10 seconds (usually) to display its first message (which is a
> "print 'Loading...'" statement that is the first non-comment line in
> the script, to test this very issue), but usually 2 seconds or less to
> retrieve 4,000 records, process them, and create the output files.
>
> Since the print statement I refer to happens before first import, or
> anything else, for that matter, I'm just curious if anyone has any
> observations on this. Are there any techniques to reduce this time?
>
> Thanks,
>
> Mark
>
>
>
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython

2012-03-16 Thread Slide
Getting more information about the errors would be necessary.

Thanks,

slide

On Fri, Mar 16, 2012 at 9:09 AM,  wrote:

> I have a need to run a WPF application written in IronPython on the client
> computer without the install IronPython.
>  I try to create a C # thin client (. Exe), using IronPython.dll. If I can
> not load the XAML - everything is fine. But when loading XAML error
> occurs.
>  Does anyone have any information on this topic (link)? Thank you.
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Passing an IronPython function to C#

2012-03-17 Thread Slide
I'm just glad to see more people engaged in using IronPython!

Thanks,

Slide
On Mar 17, 2012 5:16 PM, "Doug Blank"  wrote:

> On Sat, Mar 17, 2012 at 6:51 PM, Dino Viehland 
> wrote:
> >
> >
> > Jeff wrote:
> >> IronPython's conversion code is, um, interesting -- Dino might
> understand it all,
> >> but I don't know if anyone else does -- so it's possible two different
> sets of
> >> conversions are being chosen. Now, this
> >> *shouldn't* be the case, but it's my hypothesis.
> >
> > Ha!  Overload resolution is like Conway's game of life, you can know the
> rules,
> > but knowing the behavior is another time entirely...  Luckily this
> doesn't so much deal with
> > that rather than how our IList wrapper is implemented in
> ConversionWrappers.cs.
> > The indexer is just doing a C# cast from the value to the T type.  That
> could easily
> > be changed to do a full Python conversion.
> >
> > I think doing an is check first and only doing the conversion if it's
> not already the proper
> > type would be an alright change.  But it could be a little surprising in
> that sometimes you
> > could get a new instance each time you access an element (e.g. a new
> delegate could be
> > created each time).
>
> Thanks for the hints! I was able to get the functionality I was
> seeking. Here is the relevant code I ended up with:
>
>public static List doTogether (IList functions)
>{
>foreach (dynamic function in functions) {
>Func func =
> IronPython.Runtime.Converter.Convert>(function);
>...
>
> I need to do some more testing to make sure that this will always do
> the right thing. For example, I would want this function to be able to
> take, say, an IronRuby function and coerce it into the correct type as
> well.
>
> It does seem like these two functions should behave similarly:
>
> public void function1(params Func [] functions) {
>foreach (Func function in functions) {
>function();
>}
> }
> public void function2(IList> functions) {
>foreach (Func function in functions) {
>function();
>}
> }
>
> [I'll put that in the issue tracker and y'all can decide what the best
> thing to do is.]
>
> FYI, the interface I was working on was an easy way for users to run
> code in parallel (using Threads from behind). The function
> doTogether() (based on an Alice block of the same name) now allows the
> following:
>
> doTogether(f1, f2, ...): will run f1(), f2() at the same time and
> return their results in a list
> doTogether([f1, f2, ...], arg): will run f1(arg), f2(arg) at the same
> and return their results in a list
> doTogether(f1, [arg1, arg2, ...]): will run f1(arg1), f1(arg2) at the
> same time and return their results in a list
> doTogether([f1, arg1, ...], [f2, arg2, ...], ...): will run f1(arg1),
> f2(arg2) at the same time and return their results in a list
>
> I've used this in class to compose music (each function is an
> instrument), robot dancing (each argument is a robot), and parallel
> computation, among other mundane uses (such as initialize a bunch of
> serial ports in parallel). (The last example there would look better
> with lambdas (making a "thunk" in Scheme lingo) and then using the
> first example, but we're trying to allow some flexibility in when we
> must introduce additional concepts.) Full code available in the Myro
> library [1].
>
> Thanks again!
>
> -Doug
>
> [1] - http://svn.cs.brynmawr.edu/viewvc/Calico/trunk/modules/Myro/Myro.cs
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython

2012-03-19 Thread Slide
Setting /target:winexe should not show any console window. Are you sure its
a console window that is being shown?

Thanks,

slide

2012/3/19 

> Thank you, Matt Ward :).
>  It worked :)). You're a real expert.
>  Just one more thing, a window appears and then disappears. I guess,
> because the console is closed.
>  Maybe after the text of the program in primer.py something else should be?
>
> from avalon import *
> import calculator
> w = Window()
> w.Title = "My Avalon Application"
> w.Content = LoadXaml("calc.xaml")
> calculator.enliven(w)
> w.Show()
> ??
>
> > If you use the /target:winexe with pyc.py it will add the STAThread
> > attribute to your main method. That should fix the exception.
> >
> > In the C# console app you can add the STAThread attribute to the main
> > method:
> >
> > class Program
> > {
> > [STAThread]
> > static void Main(string[] args)
> > {
> >
> > On 19 March 2012 08:17,   wrote:
> >> I have a need to run a WPF application written in IronPython on the
> >> client
> >> without installing IronPython.
> >> В Technology to try to debug a standard example of WPF
> >> .\IronPython-2.7.2.1\Tutorial.
> >> В Baseline data:
> >>
> >> 1) The computer is not installed IronPython. From IronPython-2.7.2.1.zip
> >> (download program) extracted in C:\IronPython
> >>
> >> 2) Create a C:\IronPython subdirectory pyc_d.
> >>
> >> 3) In the C:\IronPython\pyc_d created a file primer.py:
> >>
> >> from avalon import *
> >> import calculator
> >> w = Window()
> >> w.Title = "My Avalon Application"
> >> w.Content = LoadXaml("calc.xaml")
> >> calculator.enliven(w)
> >> w.Show()
> >>
> >> 4)pyc_d contains:
> >>
> >> IronPython.dll
> >> IronPython.Modules.dll
> >> IronPython.Wpf.dll
> >> Microsoft.Scripting.dll
> >>
> >> avalon.py
> >> Calc.xaml
> >> calculator.py
> >> primer.py
> >> pyc.py
> >>
> >> 5) Run ipy.exe, sequentially enter commands from the primer.py, it works
> >> :).
> >>
> >> 6) Next:
> >> c:\IronPython\ipy.exe pyc.py /main:primer.py /target:exe /platform:x86
> >> /standalone
> >> I get primer.exe (4,09 РњР‘).
> >>
> >> 7) Run from the console, I get:
> >> C:\IronPython\pyc_d>primer.exe
> >>
> >> An unhandled exception: System.InvalidOperationException: The calling
> >> thread must be STA, because many UI components require this.
> >> В  РІ
> >> Microsoft.Scripting.Interpreter.NewInstruction.Run(InterpretedFrame
> >> frame)
> >> В  РІ Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame
> >> frame)
> >> В  РІ Microsoft.Scripting.Interpreter.LightLambda.Run3[T0,T1,T2,TRet](T0
> >> arg0, T1 arg1, T2 arg2)
> >> В
>
> ...
> >> В All is not enumerate
> >>
> >> It seems to do everything correctly. I take an example from the
> >> Tutorial,
> >> the files from the Tutorial, to be going smoothly, but ... What is the
> >> problem?
> >>
> >> 8)Try another option. Make a thin client in C #.
> >> В Create a console C # project, and Program.cs:
> >>
> >> using System;
> >> using IronPython.Hosting;
> >> using Microsoft.Scripting.Hosting;
> >> using System.Reflection;
> >> using System.IO;
> >>
> >> namespace ConsoleApplication1
> >> {
> >>  class Program
>{
> >>static void Main(string[] args)
> >>{
> >>  string path = Assembly.GetExecutingAssembly().Location;
> >>  string dir = Directory.GetParent(path).FullName;
> >>
> >>  ScriptEngine engine = Python.CreateEngine();
> >>  ScriptSource source =
> >> engine.CreateScriptSourceFromFile(Path.Combine(dir, args[0]));
> >>  CompiledCode compiled = source.Compile();
> >>  ScriptScope scope = engine.CreateScope();
> >>  compiled.Execute(scope);
> >>   }
> >>  }
> >> }
> >>
> >> 9) run:
> >> C:\IronPython\pyc_d>ConsoleApplication1.exe primer.py
> >>
> >> the same result: (Unhandled exception: System.InvalidOperationException:
> >> The calling thread must be STA, because many UI components require
> >> this.)
> >> В What is the problem?
> >> В Are there any experts who can create learning (from Tutorial) WPF
> >> application and run it on a machine without installing IronPython from
> >> the console?
> >> В Thank you.)
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Run a WPF application written in IronPython on the client computer without the install IronPython

2012-03-19 Thread Slide
Hmmm, do you have Visual Studio installed so that you could possibly debug
the application when it fails at the end and pinpoint the spot of failure?

Thanks,

slide

2012/3/19 

> Hello).
> With the advice Matt Ward, thanks to him, the problem was solved as
> follows:
> 1) had to change avalon.py as follows:
> commented out 2 lines
> .
> t = Thread(ThreadStart(start))
> t.IsBackground = True
> t.ApartmentState = ApartmentState.STA
> #t.Start()
> #are.WaitOne()
> ..
>
> 2) changed the file primer.py:
> from avalon import *
> import calculator
> global app
> global dispatcher
> app = Application()
> app.Startup += on_startup
> w = Window()
> w.Title = "My Avalon Application"
> w.Content = LoadXaml("calc.xaml")
> calculator.enliven(w)
> app.Run(w)
> w.Show()
>
> 3) after compilation:
> c:\IronPython\ipy.exe pyc.py /main: primer.py /target: winexe /platform:
> x86 /standalone
> was working primer.exe
> but ...
> not without nuance):
> after closing the window appears the system error message:
> primer.exe - an error is detected. The application will be closed. We are
> We apologize for any inconvenience.
> If the work was not finished, operational data may be lost.
> This message did not have to be.
> Maybe there is someone the idea.)
>
> Thank you.
>
> > You will need to keep the message pump alive by using Application.Run.
> > The following code should work (new first line and last two lines):
> >
> > from System.Windows import Application
> >
> > from avalon import *
> > import calculator
> > w = Window()
> > w.Title = "My Avalon Application"
> > w.Content = LoadXaml("calc.xaml")
> > calculator.enliven(w)
> >
> > app = Application()
> > app.Run(w)
> >
> > On 19 March 2012 09:29,   wrote:
> >> Thank you, Matt Ward :).
> >> В It worked :)). You're a real expert.
> >> В Just one more thing, a window appears and then disappears. I guess,
> >> because the console is closed.
> >> В Maybe after the text of the program in primer.py something else should
> >> be?
> >>
> >> from avalon import *
> >> import calculator
> >> w = Window()
> >> w.Title = "My Avalon Application"
> >> w.Content = LoadXaml("calc.xaml")
> >> calculator.enliven(w)
> >> w.Show()
> >> ??
> >>
> >>> If you use the /target:winexe with pyc.py it will add the STAThread
> >>> attribute to your main method. That should fix the exception.
> >>>
> >>> In the C# console app you can add the STAThread attribute to the main
> >>> method:
> >>>
> >>>   class Program
> >>>   {
> >>> [STAThread]
> >>> static void Main(string[] args)
> >>> {
> >>>
> >>> On 19 March 2012 08:17, В  wrote:
> >>>> I have a need to run a WPF application written in IronPython on the
> >>>> client
> >>>> without installing IronPython.
> >>>> Technology to try to debug a standard example of WPF
> >>>> .\IronPython-2.7.2.1\Tutorial.
> >>>> Baseline data:
> >>>>
> >>>> 1) The computer is not installed IronPython. From
> >>>> IronPython-2.7.2.1.zip
> >>>> (download program) extracted in C:\IronPython
> >>>>
> >>>> 2) Create a C:\IronPython subdirectory pyc_d.
> >>>>
> >>>> 3) In the C:\IronPython\pyc_d created a file primer.py:
> >>>>
> >>>> from avalon import *
> >>>> import calculator
> >>>> w = Window()
> >>>> w.Title = "My Avalon Application"
> >>>> w.Content = LoadXaml("calc.xaml")
> >>>> calculator.enliven(w)
> >>>> w.Show()
> >>>>
> >>>> 4)pyc_d contains:
> >>>>
> >>>> IronPython.dll
> >>>> IronPython.Modules.dll
> >>>> IronPython.Wpf.dll
> >>>> Microsoft.Scripting.dll
> >>>>
> >>>> avalon.py
> >>>> Calc.xaml
> >>>> calculator.py
> >>>> primer.py
> >>>> pyc.py
> >>>>
> >>>> 5) Run ipy.exe, sequentially enter commands from the primer.py, it
> >>>> works
> >>>> :).
> >>>>
> >>&

Re: [Ironpython-users] Sandbox support for IronPython console

2012-03-19 Thread Slide
Cesar,

I think this sounds like a pretty good idea for debugging stuff. Are you
familiar with how we work with patches should you get something going?

Thanks,

slide

On Mon, Mar 19, 2012 at 1:35 PM, Cesar Mello  wrote:

> Hi,
>
> I would like to know if someone other than me would find useful to have a
> command line argument for sandboxing the ipy console.
>
> I'm trying to implement this but I'm not sure if it is worth. For me it
> would make easier to debug and reproduce stuff.
>
> Also I'm curious to know how many people are using IronPython with
> Internet-zone sandbox.
>
> Thanks!
>
> Best regards
> Mello
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>
>


-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Sandbox support for IronPython console

2012-03-19 Thread Slide
Yes, a pull request would be preferred. It makes it very easy to review the
code and then incorporate it into the master.

As for the command line argument, -X:Sandbox or something like that. I
think the name of the parameter is less of a concern until its all up and
working.

slide

On Mon, Mar 19, 2012 at 2:26 PM, Cesar Mello  wrote:

> Actually if you find interesting for me to pull this through a command
> line argument, do you have any suggestions on what argument should I create
> for it?
>
> Thanks
>
> Best regards
> Mello
>
>
> On Mon, Mar 19, 2012 at 6:21 PM, Cesar Mello  wrote:
>
>> Hi Slide,
>>
>> You mean I should do a pull request when I'm finished?
>>
>> But I'm still just playing around. I've hard-coded a sandboxed appdomain
>> here just for testing the idea:
>>
>>
>> https://github.com/cmello/IronLanguages-main/commit/3241688e4917c70a6db4c1b671f42c4144e8bf96
>>
>>
>> But I get remoting exceptions as soon as the PythonContext is requested
>> here:
>>
>> Microsoft.Scripting.Hosting.Providers.HostingHelpers
>>
>> public static LanguageContext GetLanguageContext(ScriptEngine
>> engine) {
>> ContractUtils.RequiresNotNull(engine, "engine");
>> return engine.LanguageContext;
>> }
>>
>>
>> I don't know what could be done here...
>>
>> Thanks for the attention!
>>
>> Best regards
>> Mello
>>
>>
>> On Mon, Mar 19, 2012 at 6:10 PM, Slide  wrote:
>>
>>> Cesar,
>>>
>>> I think this sounds like a pretty good idea for debugging stuff. Are you
>>> familiar with how we work with patches should you get something going?
>>>
>>> Thanks,
>>>
>>> slide
>>>
>>> On Mon, Mar 19, 2012 at 1:35 PM, Cesar Mello  wrote:
>>>
>>>> Hi,
>>>>
>>>> I would like to know if someone other than me would find useful to have
>>>> a command line argument for sandboxing the ipy console.
>>>>
>>>> I'm trying to implement this but I'm not sure if it is worth. For me it
>>>> would make easier to debug and reproduce stuff.
>>>>
>>>> Also I'm curious to know how many people are using IronPython with
>>>> Internet-zone sandbox.
>>>>
>>>> Thanks!
>>>>
>>>> Best regards
>>>> Mello
>>>>
>>>> ___
>>>> Ironpython-users mailing list
>>>> [email protected]
>>>> http://mail.python.org/mailman/listinfo/ironpython-users
>>>>
>>>>
>>>
>>>
>>> --
>>> Website: http://earl-of-code.com
>>>
>>
>>
>


-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Why does this happen?

2012-03-24 Thread Slide
I am implementing a module in C#. This module does some comparison
operations. One of the tests for this module has something like the
following:

class CmpErr:
def __cmp__(self, other):
raise ZeroDivisionError

x = [CmpErr(), CmpErr(), CmpErr()]
cSharpMethod(x)

Inside cSharpMethod is when I do the comparison. The way I am doing the
comparison is taken from how its done in List.cs

IComparer comparer =
PythonContext.GetContext(context).GetComparer(null,
GetComparisonType(context, list));

Then I call comparer.Compare on the two items. In List.sort, this
eventually calls the __cmp__ method if I try adding a call to x.sort()
instead of cSharpMethod, but from inside cSharpMethod, __cmp__ is never
called and I can't figure out why.

Any ideas on why this might be occuring?

Thanks,

slide

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] [main] -X:Sandbox command line argument (#61)

2012-03-27 Thread Slide
Moving this to the mailing list

Are you (the OP) developing something that is going to run in ASP.NET? For
this type of thing, I believe you can host the ASP.NET runtime in an
application, so that may be the way to go for that.

slide


On Tue, Mar 27, 2012 at 8:14 AM, Jeff Hardy <
reply+i-3734327-e72caf099069ec510a8bcf5eda4b8e84f5c86061-55...@reply.github.com
> wrote:

> Sorry about that, I've been busy the last couple of days.
>
> I think it's a feature that would be really useful, but without knowing
> how to extend it to cover different sandboxes it would be best to hold off.
> What you can do is create a new branch in your git repo, push it to github,
> and then if if you (or someone else) gets ambitious they can take it up and
> run with it.
>
> If you need some help with the git commands let me know. I'm going to
> close this for now, but I really do appreciate the work you've put into
> this. I just don't think the problem space is understood well enough to
> implement it yet.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/IronLanguages/main/pull/61#issuecomment-4718614
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Why does this happen?

2012-03-29 Thread Slide
Is Dino on vacation? He usually has good answers for these sorts of
things :-) I still can't get the callsite to end up calling __cmp__
like List.sort does. I'm not sure why that is the case. It looks like
even the Python version of bisect has a similar issue though (it never
calls __cmp__ either), so I think there is a bug somewhere.

On Sat, Mar 24, 2012 at 8:51 PM, Slide  wrote:
>
> I am implementing a module in C#. This module does some comparison 
> operations. One of the tests for this module has something like the following:
>
> class CmpErr:
>     def __cmp__(self, other):
>         raise ZeroDivisionError
>
> x = [CmpErr(), CmpErr(), CmpErr()]
> cSharpMethod(x)
>
> Inside cSharpMethod is when I do the comparison. The way I am doing the 
> comparison is taken from how its done in List.cs
>
> IComparer comparer = PythonContext.GetContext(context).GetComparer(null, GetComparisonType(context, list));
>
> Then I call comparer.Compare on the two items. In List.sort, this eventually 
> calls the __cmp__ method if I try adding a call to x.sort() instead of 
> cSharpMethod, but from inside cSharpMethod, __cmp__ is never called and I 
> can't figure out why.
>
> Any ideas on why this might be occuring?
>
> Thanks,
>
> slide
>
> --
> Website: http://earl-of-code.com




--
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Why does this happen?

2012-03-30 Thread Slide
Here's the expression for my case

{IIF(CallSiteBinder(Convert($arg0).__eq__(Convert(Unbox($arg1, 0,
IIF(CallSiteBinder(op_LessThan(Convert($arg0),
Convert(Unbox($arg1, -1,
IIF(CallSiteBinder(op_GreaterThan(Convert($arg0),
Convert(Unbox($arg1, 1, IIF((Not(((coerceResult =
Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext),
Convert(Unbox($arg1 Is OldInstance)) AndAlso ((coerceTuple =
ValidateCoerceResult(coerceResult)) != null)), {var callres; ... },
Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext),
Convert(Unbox($arg1}

Here is the expression for the List.sort case

{IIF((Not(((coerceResult =
Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext),
Convert($arg1))) Is OldInstance)) AndAlso ((coerceTuple =
ValidateCoerceResult(coerceResult)) != null)), {var callres; ... },
Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext),
Convert($arg1}

Is there more information from the DynamicMetaObject that would be helpful?

Thanks for your time, I appreciate you helping out those like me who
don't know much about the internals of IronPython.

slide


On Thu, Mar 29, 2012 at 10:07 PM, Dino Viehland  wrote:
> I'm actually not sure why it would happen.  The only thought I have is if 
> you're
> only doing one comparison, and comparing the same instance, there's an object
> identity test which would prevent the __cmp__ call from happening.  But I'm 
> guessing
> that's not what's happening...
>
> Can you put a breakpoint in PythonProtocol.Operations.cs in 
> MakeSortComparisonRule
> and see what's returned from the call to bodybuilder.GetMetaObject?  That'll 
> give you
> the full expression tree of the rule for doing the comparison.  There's 
> supposed to be
> some calls to __cmp__ in there - if they're not there maybe what is will 
> provide some
> enlightenment.
>
>> -Original Message-
>> From: [email protected]
>> [mailto:[email protected]] On
>> Behalf Of Slide
>> Sent: Thursday, March 29, 2012 8:49 PM
>> To: [email protected]
>> Subject: Re: [Ironpython-users] Why does this happen?
>>
>> Is Dino on vacation? He usually has good answers for these sorts of things 
>> :-) I
>> still can't get the callsite to end up calling __cmp__ like List.sort does. 
>> I'm not
>> sure why that is the case. It looks like even the Python version of bisect 
>> has a
>> similar issue though (it never calls __cmp__ either), so I think there is a 
>> bug
>> somewhere.
>>
>> On Sat, Mar 24, 2012 at 8:51 PM, Slide  wrote:
>> >
>> > I am implementing a module in C#. This module does some comparison
>> operations. One of the tests for this module has something like the 
>> following:
>> >
>> > class CmpErr:
>> >     def __cmp__(self, other):
>> >         raise ZeroDivisionError
>> >
>> > x = [CmpErr(), CmpErr(), CmpErr()]
>> > cSharpMethod(x)
>> >
>> > Inside cSharpMethod is when I do the comparison. The way I am doing
>> > the comparison is taken from how its done in List.cs
>> >
>> > IComparer comparer =
>> > PythonContext.GetContext(context).GetComparer(null,
>> > GetComparisonType(context, list));
>> >
>> > Then I call comparer.Compare on the two items. In List.sort, this 
>> > eventually
>> calls the __cmp__ method if I try adding a call to x.sort() instead of
>> cSharpMethod, but from inside cSharpMethod, __cmp__ is never called and I
>> can't figure out why.
>> >
>> > Any ideas on why this might be occuring?
>> >
>> > Thanks,
>> >
>> > slide
>> >
>> > --
>> > Website: http://earl-of-code.com
>>
>>
>>
>>
>> --
>> Website: http://earl-of-code.com
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
>
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Why does this happen?

2012-03-30 Thread Slide
The types that are being compared are as follows:

class CmpErr:
"Dummy element that always raises an error during comparison"
def __cmp__(self, other):
raise ZeroDivisionError

And an Int32. The bisect test creates a list of the CmpErr objects and
then tries to insert the number 10, so a CmpErr instance (OldInstance)
is being compared to an Int32.

The DebugView IS much easier and explains a lot about what is being
generated. I need to review the semantics for the rich comparison in
the CPython code, I was looking at it earlier today on my phone (which
ends up not being a very good way to view code). I'll compare it to
what the IronPython code is doing.

Here is some code that reproduces the issue. On CPython this code
prints "Pass" and on IronPython it prints "Fail"


import bisect

class CmpErr:
"Dummy element that always raises an error during comparison"
def __cmp__(self, other):
raise ZeroDivisionError

seq = [CmpErr(), CmpErr(), CmpErr()]

try:
bisect.bisect_left(seq, 10)
except ZeroDivisionError:
print "Pass"
else:
print "Fail"

I'm going to file an issue on this, because its looks like a
compatibility problem.

Thanks,

slide

On Fri, Mar 30, 2012 at 5:26 PM, Dino Viehland  wrote:
> First off just to make your life easier in the future the DebugView
> property on the expression is much better than the other view - it produces
> something that looks like C#.
>
> Ok, I think the types are actually different and the LHS is succeeding on
> one of ==, <, or >.  I say that because in MakeSortComparisonRule we do:
>
> if (xType == yType && cTarget != SlotOrFunction.Empty) {
>
> And if they were both old instances we'd do the ShouldCoerce check (which
> would be true) and we'd generate the code which looks like the list.sort()
> case.  You can check xType and yType in the debugger.  Better yet you can
> drill into the meta objects in the types array and see the actual values the
> rule is being created for.
>
> The problem type I think is xType and it's probably some IronPython runtime
> type (because it defines __eq__ as well as op_LessThan and op_GreaterThan).
> But I have no guesses as to what it is - every type I tried still went down 
> the
> __cmp__ path.
>
> So look at xType and those methods...  If it somehow is really an OldInstance
> then something really strange is going on and it'd be interesting to see if 
> xType
> and yType are somehow different when they should be the same.
>
>> -Original Message-
>> From: [email protected]
>> [mailto:[email protected]] On
>> Behalf Of Slide
>> Sent: Friday, March 30, 2012 5:08 AM
>> To: [email protected]
>> Subject: Re: [Ironpython-users] Why does this happen?
>>
>> Here's the expression for my case
>>
>> {IIF(CallSiteBinder(Convert($arg0).__eq__(Convert(Unbox($arg1, 0,
>> IIF(CallSiteBinder(op_LessThan(Convert($arg0),
>> Convert(Unbox($arg1, -1,
>> IIF(CallSiteBinder(op_GreaterThan(Convert($arg0),
>> Convert(Unbox($arg1, 1, IIF((Not(((coerceResult =
>> Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext),
>> Convert(Unbox($arg1 Is OldInstance)) AndAlso ((coerceTuple =
>> ValidateCoerceResult(coerceResult)) != null)), {var callres; ... },
>> Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext),
>> Convert(Unbox($arg1}
>>
>> Here is the expression for the List.sort case
>>
>> {IIF((Not(((coerceResult =
>> Convert($arg0).__coerce__(value(IronPython.Runtime.CodeContext),
>> Convert($arg1))) Is OldInstance)) AndAlso ((coerceTuple =
>> ValidateCoerceResult(coerceResult)) != null)), {var callres; ... },
>> Convert(Convert($arg0).__cmp__(value(IronPython.Runtime.CodeContext),
>> Convert($arg1}
>>
>> Is there more information from the DynamicMetaObject that would be helpful?
>>
>> Thanks for your time, I appreciate you helping out those like me who don't 
>> know
>> much about the internals of IronPython.
>>
>> slide
>>
>>
>> On Thu, Mar 29, 2012 at 10:07 PM, Dino Viehland 
>> wrote:
>> > I'm actually not sure why it would happen.  The only thought I have is
>> > if you're only doing one comparison, and comparing the same instance,
>> > there's an object identity test which would prevent the __cmp__ call
>> > from happening.  But I'm guessing that's not what's happening...
>> >
>> > Can you put a breakpoint in PythonProtocol.

Re: [Ironpython-users] Resource-based ZIP importer / meta_path importer

2012-04-02 Thread Slide
Also, even if its not python compatible, its a good feature idea and
so filing an issue would be appreciated. IronPython is in between .NET
and Python, you can import .NET namespaces and use them, so something
like this is not out of character and provides a benefit.

slide

On Mon, Apr 2, 2012 at 1:20 PM, Keith Rome  wrote:
> Following up on this topic from a few weeks ago….
>
>
>
> I did not file an issue on it, because it isn’t directly a part of the
> python spec, so it’s more “something I would like to see” and less
> “something isn’t working right”.
>
>
>
> Anyhow, I have been doing some tinkering.  I feel like I am right at the
> goal line, and just need a tiny bit of help to cross over it.
>
>
>
> The zipimport module is an implementation of “PEP 273: Import Modules from
> Zip Archives”. My first tinkerings were with modifying the zipimport class
> and ZimImportModule class to facilitate using a URI path as in my suggestion
> in the previous email. I ran into a brick wall with this however, because
> PythonContext.InitializeModule() still makes calls to both System.IO.Path
> directly as well as the GetFullPath() method of the current PAL. Both of
> those things prevent me from being able to use anything but a path value
> that is valid on the current file system (i.e., I can’t use a
> “:///” scheme).
>
>
>
> In reading the details of PEP 273, I also learned about “PEP 302: New Import
> Hooks” (http://www.python.org/dev/peps/pep-0302/). This PEP looks to be
> exactly what I want, because it is totally transparent to sys.path, and
> therefore has no need for any of the path canonicalization workarounds that
> I was running into with a PEP 273 solution. PEP 302 appears to already be
> implemented in IronPython… at least sys.meta_path is there, and the
> IronPython.Runtime.Importer class attempts to make use of it.
>
>
>
> So I fully implemented a zip resource based meta_path importer by following
> the example of zipimport but adapting it for how meta_path is intended to
> work. It appears to work fine for simple imports. But there is a major
> problem I have encountered. The meta_path functionality does not appear to
> be re-entrant, and I have not yet been able to figure out why.
>
>
>
> Implementing a meta_path importer is fairly simple (easier than a path hook
> importer like zipimport). I just have to implement find_module() and
> load_module() and append my importer to sys.meta_path. These work as
> expected. But the final step of the importer protocol dictates that “If the
> module is a Python module (as opposed to a built-in module or a dynamically
> loaded extension), it should execute the module's code in the module's
> global name space (module.__dict__).” This is easy enough, and works exactly
> like in zipimport. PythonContext.CompileModule() produces an executable
> ScriptCode object, and I simply Run() it using the module’s Scope.
>
>
>
> This then proceeds to execute the module initialization code, which
> invariably does some imports of its own. As a test case, I use the following
> script: “from multiprocessing import process”. The multiprocessing module
> attempts to “import os” among other things. I would expect this to invoke
> find_module(‘os’) and subsequently load_module(‘os’) on my meta_path
> importer. But it does not. For whatever reason, when initializing a module,
> any internal attempts to resolve further imports seem to be ignoring
> meta_path importers. These imports fail because they should have been
> serviced by my meta_path importer, which was not invoked.
>
>
>
> 1.   Has anyone implemented a meta_path importer in IronPython that
> could maybe shed some light on this?
>
> 2.   Is this working as intended? (doesn’t seem to be)
>
> 3.   Is the PEP 302 support perhaps incomplete?
>
> 4.   Am I maybe missing a step somewhere?
>
>
>
> I have followed the advice in PEP 302. In addition to everything zipimport
> does, I am also setting __file__ to “”, and setting __path__ to an
> empty List. I also ensure that the module is added to sys.modules before
> executing the initialization code, and I check sys.modules at the very start
> of my load_module() method to prevent double-loading. Although it would seem
> that none of those things would have any bearing on this particular issue.
>
>
>
>
>
> Keith Rome
>
> Senior Consultant and Architect
>
> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>
> Wintellect | 770.617.4016 | [email protected]
>
> www.wintellect.com
>
>
>
> From: Slide [mailto:[email protected]]
> Sent: Monday, March 12, 2012 10:03 AM
> To: Keith Rome
> Cc: [email protected]
> Subject: 

Re: [Ironpython-users] Resource-based ZIP importer / meta_path importer

2012-04-02 Thread Slide
I actually started implementing the zipimport updates to support
res:// urls, I haven't run into the same issue you have, I get the
call to zipimporter with the res:// just fine. Where specifically were
you running into issues with this?

slide

On Mon, Apr 2, 2012 at 1:20 PM, Keith Rome  wrote:
> Following up on this topic from a few weeks ago….
>
>
>
> I did not file an issue on it, because it isn’t directly a part of the
> python spec, so it’s more “something I would like to see” and less
> “something isn’t working right”.
>
>
>
> Anyhow, I have been doing some tinkering.  I feel like I am right at the
> goal line, and just need a tiny bit of help to cross over it.
>
>
>
> The zipimport module is an implementation of “PEP 273: Import Modules from
> Zip Archives”. My first tinkerings were with modifying the zipimport class
> and ZimImportModule class to facilitate using a URI path as in my suggestion
> in the previous email. I ran into a brick wall with this however, because
> PythonContext.InitializeModule() still makes calls to both System.IO.Path
> directly as well as the GetFullPath() method of the current PAL. Both of
> those things prevent me from being able to use anything but a path value
> that is valid on the current file system (i.e., I can’t use a
> “:///” scheme).
>
>
>
> In reading the details of PEP 273, I also learned about “PEP 302: New Import
> Hooks” (http://www.python.org/dev/peps/pep-0302/). This PEP looks to be
> exactly what I want, because it is totally transparent to sys.path, and
> therefore has no need for any of the path canonicalization workarounds that
> I was running into with a PEP 273 solution. PEP 302 appears to already be
> implemented in IronPython… at least sys.meta_path is there, and the
> IronPython.Runtime.Importer class attempts to make use of it.
>
>
>
> So I fully implemented a zip resource based meta_path importer by following
> the example of zipimport but adapting it for how meta_path is intended to
> work. It appears to work fine for simple imports. But there is a major
> problem I have encountered. The meta_path functionality does not appear to
> be re-entrant, and I have not yet been able to figure out why.
>
>
>
> Implementing a meta_path importer is fairly simple (easier than a path hook
> importer like zipimport). I just have to implement find_module() and
> load_module() and append my importer to sys.meta_path. These work as
> expected. But the final step of the importer protocol dictates that “If the
> module is a Python module (as opposed to a built-in module or a dynamically
> loaded extension), it should execute the module's code in the module's
> global name space (module.__dict__).” This is easy enough, and works exactly
> like in zipimport. PythonContext.CompileModule() produces an executable
> ScriptCode object, and I simply Run() it using the module’s Scope.
>
>
>
> This then proceeds to execute the module initialization code, which
> invariably does some imports of its own. As a test case, I use the following
> script: “from multiprocessing import process”. The multiprocessing module
> attempts to “import os” among other things. I would expect this to invoke
> find_module(‘os’) and subsequently load_module(‘os’) on my meta_path
> importer. But it does not. For whatever reason, when initializing a module,
> any internal attempts to resolve further imports seem to be ignoring
> meta_path importers. These imports fail because they should have been
> serviced by my meta_path importer, which was not invoked.
>
>
>
> 1.   Has anyone implemented a meta_path importer in IronPython that
> could maybe shed some light on this?
>
> 2.   Is this working as intended? (doesn’t seem to be)
>
> 3.   Is the PEP 302 support perhaps incomplete?
>
> 4.   Am I maybe missing a step somewhere?
>
>
>
> I have followed the advice in PEP 302. In addition to everything zipimport
> does, I am also setting __file__ to “”, and setting __path__ to an
> empty List. I also ensure that the module is added to sys.modules before
> executing the initialization code, and I check sys.modules at the very start
> of my load_module() method to prevent double-loading. Although it would seem
> that none of those things would have any bearing on this particular issue.
>
>
>
>
>
> Keith Rome
>
> Senior Consultant and Architect
>
> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>
> Wintellect | 770.617.4016 | [email protected]
>
> www.wintellect.com
>
>
>
> From: Slide [mailto:[email protected]]
> Sent: Monday, March 12, 2012 10:03 AM
> To: Keith Rome
> Cc: [email protected]
> Subject: Re: [Ironpython-users] Iron

Re: [Ironpython-users] scope get/set variable and invoking python function

2012-04-04 Thread Slide
The Test1 inside the function is not the same as the Test1 outside the
function, you need to make the Test1 in the function a reference to
the global Test1 for the scope. Try this

def TestFunction()
global Test1
Test1 = 4

On Wed, Apr 4, 2012 at 9:38 PM, Bill  wrote:
> I am having a problem in ironpython 2.7.2.1 with executing a python
> function that changes variables set in the scope via SetVariable. The
> problem is these variables are never actually updated on the c# side
> after the python function executes. Here is a couple different
> examples, all of which don't work:
>
> The python code:
>
> def TestFunction():
>    Test1 = 4
>
> The c# code:
>
> Example 1:
>
> ScriptEngine sEng = Python.CreateEngine();
> ScriptScope scope;
> dynamic fHand;
>
> scope = sEng.Runtime.CreateScope();
>
> scope.SetVariable("Test1", 0);
>
> fHand = sEng.ExecuteFile("c:\test.py"); // Contains python code listed above
> if (scope.ContainsVariable("TestFunction"))
>    fHand.TestFunction();
>
> int result = scope.GetVariable("Test1"); // This is still set to
> 0 when it should be set to 4 now.
>
> Example 2:
>
> ScriptScope scope = Python.CreateRuntime().UseFile("c:\test.py");
> dynamic fHand = scope;
> scope.SetVariable("Test1", 0);
>
> if (scope.ContainsVariable("TestFunction"))
>    fHand.TestFunction();
>
> int result = scope.GetVariable("Test1"); // This is still set to
> 0 when it should be set to 4 now.
>
>
> What am I missing here? Is it really that python functions cannot
> update variables set in the scope? Python code outside of functions
> are able to update them without any issues.
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] scope get/set variable and invoking python function

2012-04-04 Thread Slide
FYI, if you only want to READ the global variable, you don't need to
do what I said below, but to write to it, you have to "declare" it as
a global before writing to it inside the function.

On Wed, Apr 4, 2012 at 9:40 PM, Slide  wrote:
> The Test1 inside the function is not the same as the Test1 outside the
> function, you need to make the Test1 in the function a reference to
> the global Test1 for the scope. Try this
>
> def TestFunction()
>    global Test1
>    Test1 = 4
>
> On Wed, Apr 4, 2012 at 9:38 PM, Bill  wrote:
>> I am having a problem in ironpython 2.7.2.1 with executing a python
>> function that changes variables set in the scope via SetVariable. The
>> problem is these variables are never actually updated on the c# side
>> after the python function executes. Here is a couple different
>> examples, all of which don't work:
>>
>> The python code:
>>
>> def TestFunction():
>>    Test1 = 4
>>
>> The c# code:
>>
>> Example 1:
>>
>> ScriptEngine sEng = Python.CreateEngine();
>> ScriptScope scope;
>> dynamic fHand;
>>
>> scope = sEng.Runtime.CreateScope();
>>
>> scope.SetVariable("Test1", 0);
>>
>> fHand = sEng.ExecuteFile("c:\test.py"); // Contains python code listed above
>> if (scope.ContainsVariable("TestFunction"))
>>    fHand.TestFunction();
>>
>> int result = scope.GetVariable("Test1"); // This is still set to
>> 0 when it should be set to 4 now.
>>
>> Example 2:
>>
>> ScriptScope scope = Python.CreateRuntime().UseFile("c:\test.py");
>> dynamic fHand = scope;
>> scope.SetVariable("Test1", 0);
>>
>> if (scope.ContainsVariable("TestFunction"))
>>    fHand.TestFunction();
>>
>> int result = scope.GetVariable("Test1"); // This is still set to
>> 0 when it should be set to 4 now.
>>
>>
>> What am I missing here? Is it really that python functions cannot
>> update variables set in the scope? Python code outside of functions
>> are able to update them without any issues.
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
>
>
>
> --
> Website: http://earl-of-code.com



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Startup performance

2012-04-10 Thread Slide
Agreed, I think what I need to do is have a couple REQUIRED libraries
similar to how csc does it (mscorlib, etc are referenced automatically
unless told not to) and then other libraries will be embedded with a
/ref param or something. I'll take a look.

On Fri, Mar 16, 2012 at 9:31 AM, Jeff Hardy  wrote:
> On Fri, Mar 16, 2012 at 9:12 AM, Slide  wrote:
>> How long does it take if you run in script form? Just wondering for
>> comparison.
>
> Yeah, that would be a good comparison - .NET will have to JIT all of
> IronPython as it loads, which can take some time. The installer runs
> NGEN to reduce this pretty significantly. Plus the compiled exes are
> pretty big, which is a lot of code to load from disk.
>
> Alex, it might be worth having an option to exclude
> IronPython.Modules/Sqlite/Wpf just to reduce the disk size a bit.
>
> - Jeff



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Module as member of another module

2012-04-16 Thread Slide
I am getting back to my pyexpat implementation and one of the things
in pyexpat is that the errors member is a module with the errors and a
way to convert an error number to a message. So, print pyexpat.errors
should print out that it is a module to be compatible with CPython, I
am just not sure how to achieve that since PythonModule's are
generally static classes in C#. Should I just generate the module on
the fly and fill in the __dict__?

Thanks,

slide

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Problem with embedding IronPython into Silverlight Application

2012-04-18 Thread Slide
Please make sure you have 2.5.2.1 and not just 2.5.2.

On Wed, Apr 18, 2012 at 12:16 PM, Mattias Ahlenius
 wrote:
> Thanks for your quick reply Keith,
>
> Tried you code and I still get the same Exception:
>
> "Attempt by security transparent method
> 'IronPython.Modules.SysModule.GetPrefix()' to access security critical
> method 'System.Reflection.Assembly.get_Location()' failed."
>
> /Mattias
>
>
>
> 2012/4/18 Keith Rome 
>>
>> Does this not work for you?
>>
>>
>>
>> using IronPython.Hosting;
>>
>> // ...
>>
>> _python = Python.CreateEngine();
>>
>>
>>
>> I believe that should handle the simple/typical scenarios, unless you need
>> to alter the environment (such as plugging in a custom Host/PAL).
>>
>>
>>
>> If you need to customize the environment, then this should work:
>>
>>
>>
>> var options = new Dictionary();
>>
>> ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(options);
>>
>> _runtime = new ScriptRuntime(setup);
>>
>> _python = Python.GetEngine(_runtime);
>>
>>
>>
>>
>>
>> This code should work exactly the same on desktop CLR and Silverlight.
>>
>>
>>
>>
>>
>>
>>
>> Keith Rome
>>
>> Senior Consultant and Architect
>>
>> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>>
>> Wintellect | 770.617.4016 | [email protected]
>>
>> www.wintellect.com
>>
>>
>>
>> From: [email protected]
>> [mailto:[email protected]] On Behalf
>> Of Mattias Ahlenius
>> Sent: Wednesday, April 18, 2012 2:41 PM
>> To: [email protected]
>> Subject: [Ironpython-users] Problem with embedding IronPython into
>> Silverlight Application
>>
>>
>>
>> Hi,
>>
>>
>>
>> I'm new to scripting and would like to add support for IronPython to our
>> Silverlight application, I have tried to find an answer on the net but could
>> not find anyone else facing the same problem. The app is an out of browser
>> application.
>>
>>
>>
>> I've added the latest release (2.7.2) from nuget, checked that the
>> binaries being used is from the SL5 libs-catalog: IronPython.2.7.2\lib\Sl5
>>
>>
>>
>> The code I use to create the scripting engine is the following:
>>
>>
>>
>> ..
>>
>>
>> _runtime = new ScriptRuntime(DynamicEngine.CreateRuntimeSetup(true));
>>
>> _python = _runtime.GetEngine("py");
>>
>> ..
>>
>>
>>
>> When GetEngine is executed I'll the following secutiry exception:
>>
>> "{System.MethodAccessException: Attempt by security transparent method
>> 'IronPython.Modules.SysModule.GetPrefix()' to access security critical
>> method 'System.Reflection.Assembly.get_Location()' failed.
>>
>>    at IronPython.Modules.SysModule.GetPrefix()
>>
>>    at IronPython.Modules.SysModule..cctor()}"
>>
>> When checking the code at GitHub for the method: GetPrefix()
>>
>>
>>
>> There are code checking a compiler-constant that seems to be if you
>> running in "silverlight" (don't have diskaccess to the libs), but the code
>> seems to be executed anyway, which makes me wonder if I still doesn't use
>> the correct libs for Silverlight.
>>
>>
>>
>>
>>
>> Would really appreciate if someone could point me in the right direction.
>>
>>
>>
>>
>>
>> Have a nice day!
>>
>> --
>>
>> Best regards,
>>
>>
>>
>> Mattias Ahlenius
>>
>> 031 - 788 19 25
>>
>>
>>
>> Good Solutions AB
>>
>> http://www.goodsolutions.se
>>
>>
>
>
>
>
> --
>
> Med vänlig hälsning,
>
> Mattias Ahlenius
> 031 - 788 19 25
>
> Good Solutions AB
> http://www.goodsolutions.se
>
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Problem with embedding IronPython into Silverlight Application

2012-04-18 Thread Slide
This really sounds like the assemblies you are referencing are not really
the SL assemblies, can you open the assembly in ILSpy and decompile
GetPrefix and see what you have?

slide

On Wed, Apr 18, 2012 at 1:44 PM, Mattias Ahlenius
wrote:

> Same exception even if I use the 2.7.2.1 bins: (I support you mean 2.7..
> and not 2.5..)
>
> Message: Failed to load language 'IronPython 2.7.2.1': The type
> initializer for 'IronPython.Modules.SysModule' threw an exception.
>
> InnerException:
>
> "Attempt by security transparent method
> 'IronPython.Modules.SysModule.GetPrefix()' to access security critical
> method 'System.Reflection.Assembly.get_Location()' failed."
>
> /Mattias
>
> 2012/4/18 Slide 
>
>> Please make sure you have 2.5.2.1 and not just 2.5.2.
>>
>> On Wed, Apr 18, 2012 at 12:16 PM, Mattias Ahlenius
>>  wrote:
>> > Thanks for your quick reply Keith,
>> >
>> > Tried you code and I still get the same Exception:
>> >
>> > "Attempt by security transparent method
>> > 'IronPython.Modules.SysModule.GetPrefix()' to access security critical
>> > method 'System.Reflection.Assembly.get_Location()' failed."
>> >
>> > /Mattias
>> >
>> >
>> >
>> > 2012/4/18 Keith Rome 
>> >>
>> >> Does this not work for you?
>> >>
>> >>
>> >>
>> >> using IronPython.Hosting;
>> >>
>> >> // ...
>> >>
>> >> _python = Python.CreateEngine();
>> >>
>> >>
>> >>
>> >> I believe that should handle the simple/typical scenarios, unless you
>> need
>> >> to alter the environment (such as plugging in a custom Host/PAL).
>> >>
>> >>
>> >>
>> >> If you need to customize the environment, then this should work:
>> >>
>> >>
>> >>
>> >> var options = new Dictionary();
>> >>
>> >> ScriptRuntimeSetup setup = Python.CreateRuntimeSetup(options);
>> >>
>> >> _runtime = new ScriptRuntime(setup);
>> >>
>> >> _python = Python.GetEngine(_runtime);
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> This code should work exactly the same on desktop CLR and Silverlight.
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >>
>> >> Keith Rome
>> >>
>> >> Senior Consultant and Architect
>> >>
>> >> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>> >>
>> >> Wintellect | 770.617.4016 | [email protected]
>> >>
>> >> www.wintellect.com
>> >>
>> >>
>> >>
>> >> From: [email protected]
>> >> [mailto:[email protected]] On
>> Behalf
>> >> Of Mattias Ahlenius
>> >> Sent: Wednesday, April 18, 2012 2:41 PM
>> >> To: [email protected]
>> >> Subject: [Ironpython-users] Problem with embedding IronPython into
>> >> Silverlight Application
>> >>
>> >>
>> >>
>> >> Hi,
>> >>
>> >>
>> >>
>> >> I'm new to scripting and would like to add support for IronPython to
>> our
>> >> Silverlight application, I have tried to find an answer on the net but
>> could
>> >> not find anyone else facing the same problem. The app is an out of
>> browser
>> >> application.
>> >>
>> >>
>> >>
>> >> I've added the latest release (2.7.2) from nuget, checked that the
>> >> binaries being used is from the SL5
>> libs-catalog: IronPython.2.7.2\lib\Sl5
>> >>
>> >>
>> >>
>> >> The code I use to create the scripting engine is the following:
>> >>
>> >>
>> >>
>> >> ..
>> >>
>> >>
>> >>
>> _runtime = new 
>> ScriptRuntime(DynamicEngine.CreateRuntimeSetup(true));
>> >>
>> >> _python = _runtime.GetEngine("py");
>> >>
>> >> ..
>> >>
>> >>
>> >>
>> >> When GetEngine is executed I'll the following secutiry exception:
>> >>
>> >> "{S

Re: [Ironpython-users] Solutions/IronPython.Mono.sln

2012-04-18 Thread Slide
You shouldn't need to use the IronPython.Mono.sln file anymore, you
should be able to use the vanilla IronPython solution file. Does that
not work for you?

Thanks,

slide

On Wed, Apr 18, 2012 at 4:16 PM, Eddy Pronk  wrote:
> I'm trying to build IronPython on mono 2.10 (Debian)
>
> I followed these instructions:
> http://ironpython.codeplex.com/wikipage?title=IronPython%20on%20Mono
>
> There used to be a solution for building on mono.
>
> $ git log --diff-filter=D -- Solutions/IronPython.Mono.sln
> commit d8d9765d43b9cc265ed07c9115564253e11b348d
> Author: Tomas Matousek 
> Date:   Fri Dec 30 14:11:36 2011 +0100
>
>    Fix Debug and SL4 build, IronStudio and move Chiron to Debug/Release dir.
>
>
> I can build this one from source with mono 2.10
> IronLanguages-main-ipy-2.7-0-g4fb2552.zip
>
> How do I build the latest release?
> IronLanguages-main-ipy-2.7.2-0-gce90110.zip
>
> Eddy
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Solutions/IronPython.Mono.sln

2012-04-18 Thread Slide
You probably want to set the configuration you want to build via
/p:Configuration=Debug /p:Platform="Any CPU" or if you want a release
version, try /p:Configuration=Release. The full solution builds a
large number of configurations which may not work to build on mono.

slide


On Wed, Apr 18, 2012 at 9:02 PM, Eddy Pronk  wrote:
> No luck with the vanilla IronPython solution file.
>
> There is a dependency on Silverlight?
> http://pastebin.com/11rZTC3F
>
> This documentation is also out of date:
> https://github.com/IronLanguages/main/wiki/Building#wiki-wiki_building-mono
>
> On Thu, Apr 19, 2012 at 1:47 PM, Slide  wrote:
>> You shouldn't need to use the IronPython.Mono.sln file anymore, you
>> should be able to use the vanilla IronPython solution file. Does that
>> not work for you?
>>
>> Thanks,
>>
>> slide



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Problem with embedding IronPython into Silverlight Application

2012-04-19 Thread Slide
No, that is correct, SL5 does include the FEATURE_ASSEMBLY_LOCATION
property in the build, so you should be getting that code when you
disassemble. Can you check if there is anything in the InnerException when
you catch it?

On Thu, Apr 19, 2012 at 7:28 AM, Mattias Ahlenius
wrote:

> Do I do something fundamentally wrong here... The below is what I get do a
> disasm on the SL5 assembly in the latest distribution (2.7.2.1)
>
> Greatful for any help I could get in the right direction.
>
> Best regards,
>
> Mattias
>
>
> 2012/4/18 Mattias Ahlenius 
>
>>
>> I get the following when I make a disam in Reflector, the exception
>> (System.MethodAccessException) that I'm getting is not subclassing neither
>> SecurityException or ArgumentException which is catched and handled.
>>
>>
>>  *private static string 
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.String>
>>  GetPrefix 
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://IronPython:2.7.1300.40:7f709c5b713576e1/IronPython.Modules.SysModule/GetPrefix():String>()
>> {
>> try
>> {
>> return Path 
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.IO.Path>.GetDirectoryName
>>  
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.IO.Path/GetDirectoryName(String):String>(Assembly
>>  
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.Reflection.Assembly>.GetExecutingAssembly
>>  
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.Reflection.Assembly/GetExecutingAssembly():System.Reflection.Assembly>().Location
>>  
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Reflection.Assembly/property:Location:String>);
>> }
>> catch (SecurityException 
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.Security.SecurityException>)
>> {
>> return string 
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.String>.Empty
>>  
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.String/Empty>;
>> }
>> catch (ArgumentException 
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.ArgumentException>)
>> {
>>     return string 
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.String>.Empty
>>  
>> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.String/Empty>;
>> }
>> }*
>>
>> **/Mattias
>> *
>> *
>>
>> 2012/4/18 Slide 
>>
>>> This really sounds like the assemblies you are referencing are not
>>> really the SL assemblies, can you open the assembly in ILSpy and decompile
>>> GetPrefix and see what you have?
>>>
>>> slide
>>>
>>>
>>> On Wed, Apr 18, 2012 at 1:44 PM, Mattias Ahlenius <
>>> [email protected]> wrote:
>>>
>>>> Same exception even if I use the 2.7.2.1 bins: (I support you mean
>>>> 2.7.. and not 2.5..)
>>>>
>>>> Message: Failed to load language 'IronPython 2.7.2.1': The type
>>>> initializer for 'IronPython.Modules.SysModule' threw an exception.
>>>>
>>>> InnerException:
>>>>
>>>> "Attempt by security transparent method
>>>> 'IronPython.Modules.SysModule.GetPrefix()' to access security critical
>>>> method 'System.Reflection.Assembly.get_Location()' failed."
>>>>
>>>> /Mattias
>>>>
>>>> 2012/4/18 Slide 
>>>>
>>>>> Please make sure you have 2.5.2.1 and not just 2.5.2.
>>>>>
>>>>> On Wed, Apr 18, 2012 at 12:16 PM, Mattias Ahlenius
>>>>>  wrote:
>>>>> > Thanks for your quick reply Keith,
>>>>> >
>>>>> > Tried you code and I still get the same Exception:
>>>>> >
>>>>> > "Attempt by security transparent method
>>>>> > 'IronPy

Re: [Ironpython-users] Problem with embedding IronPython into Silverlight Application

2012-04-19 Thread Slide
It's not throwing a SecurityException, its throws a
MemberAccessException (which does NOT inherit from SecurityException
either).

slide

On Thu, Apr 19, 2012 at 10:05 AM, Jeff Hardy  wrote:
>
> On Thu, Apr 19, 2012 at 7:45 AM, Slide  wrote:
>>
>> No, that is correct, SL5 does include the FEATURE_ASSEMBLY_LOCATION
>> property in the build, so you should be getting that code when you
>> disassemble. Can you check if there is anything in the InnerException when
>> you catch it?
>
>
> SL5 has Assembly.Location, but it looks like it's not allowed to be used in
> a browser context (desktop/trusted SL might be different).
>
> We could remove the FEATURE, but then trusted apps would be less functional
> (not sure this is an issue). Or, we catch the SecurityException and proceed
> without the prefix.
>
> Mattias, can you open an issue for this please?
> (http://ironpython.codeplex.com/WorkItem/Create). Ideally include a small,
> self-contained reproduction (the whole VS project, if possible).
>
> - Jeff



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Problem with embedding IronPython into Silverlight Application

2012-04-19 Thread Slide
Since modules aren't loaded from the file system the same way on SL, I
think it shouldn't cause too much of an issue. You can rebuild IP with the
change and see if it causes any other issues.

On Thu, Apr 19, 2012 at 3:34 PM, Keith Rome  wrote:

>  We were able to confirm that this problem affects our product as well.
> It shows up in both Silverlight 4 and 5 builds. I didn’t see an issue
> ticket created on CodePlex yet, so I created one.
>
> ** **
>
> Is the best “fix” going to be to catch MethodAccessException and return an
> empty string from GetPrefix()? I am not familiar with the importance of
> that call.
>
> ** **
>
> ** **
>
> *Keith Rome*
>
> *Senior Consultant and Architect*
>
> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>
> Wintellect | 770.617.4016 | [email protected] 
>
> www.wintellect.com
>
> ** **
>
> *From:* Mattias Ahlenius [mailto:[email protected]]
> *Sent:* Thursday, April 19, 2012 2:16 PM
> *To:* Slide
> *Cc:* Keith Rome; [email protected]
> *Subject:* Re: [Ironpython-users] Problem with embedding IronPython into
> Silverlight Application
>
> ** **
>
> I've put together a small testproject, when I build it with target SL4 I
> get the same error as with the IronPython bins, but it works fine when I
> compile it to target SL5, I've attached a testproject as a .zip (just
> rename it from sip)
>
> ** **
>
> /Mattias
>
> 2012/4/19 Mattias Ahlenius 
>
> I think the binaries under: lib\Sl5 is compiled with SL4 as target and not
> with SL5, not sure but that may be the issue.
>
> ** **
>
> /Mattias
>
> ** **
>
>  
>
> ** **
>
> 2012/4/19 Slide 
>
> No, that is correct, SL5 does include the FEATURE_ASSEMBLY_LOCATION
> property in the build, so you should be getting that code when you
> disassemble. Can you check if there is anything in the InnerException when
> you catch it?
>
> ** **
>
> On Thu, Apr 19, 2012 at 7:28 AM, Mattias Ahlenius <
> [email protected]> wrote:
>
> Do I do something fundamentally wrong here... The below is what I get do a
> disasm on the SL5 assembly in the latest distribution (2.7.2.1)
>
> ** **
>
> Greatful for any help I could get in the right direction.
>
> ** **
>
> Best regards,
>
> ** **
>
> Mattias
>
> ** **
>
> 2012/4/18 Mattias Ahlenius 
>
> ** **
>
> I get the following when I make a disam in Reflector, the exception
> (System.MethodAccessException) that I'm getting is not subclassing neither
> SecurityException or ArgumentException which is catched and handled.
>
> ** **
>
> ** **
>
> *private static string 
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.String>
>  GetPrefix 
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://IronPython:2.7.1300.40:7f709c5b713576e1/IronPython.Modules.SysModule/GetPrefix():String>()*
>
> *{*
>
> *try*
>
> *{*
>
> *return Path 
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.IO.Path>.GetDirectoryName
>  
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.IO.Path/GetDirectoryName(String):String>(Assembly
>  
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.Reflection.Assembly>.GetExecutingAssembly
>  
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.Reflection.Assembly/GetExecutingAssembly():System.Reflection.Assembly>().Location
>  
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:4.0.0.0:b77a5c561934e089/System.Reflection.Assembly/property:Location:String>);*
>
> *}*
>
> *catch (SecurityException 
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.Security.SecurityException>)*
>
> *{*
>
> *return string 
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.String>.Empty
>  
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.String/Empty>;*
>
> *}*
>
> *catch (ArgumentException 
> <http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://mscorlib:5.0.5.0:7cec85d7bea7798e/System.ArgumentException>)*
>
> *{*
>
> *return string 
> <http://www.aisto.

Re: [Ironpython-users] ctypes module in version 2.7.2 can't create Union values

2012-04-20 Thread Slide
I am unable to reproduce this, I am also running Win7 x64

Running with ipy64.exe

IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.261 (64-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> class foo(Union):
... __fields__ = [("t", c_uint), ("b", c_float)]
...
>>> bar = foo()
>>> bar.t = 1
>>>

Running with ipy.exe

IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import *
>>> class foo(Union):
... __fields__ = [("t", c_uint), ("b", c_float)]
...
>>> bar = foo()
>>> bar.t = 1
>>>


On Fri, Apr 20, 2012 at 6:45 AM,   wrote:
> Dear all,
>
> on a 64-bit Windows 7 machine (other platforms untested), I find myself
> unable to create a
> ctypes.Union-based class wrapper for a C type.
> Regardless of what kind of Union I create, it always ends up with a
> "object reference not set to an instance of an object" error from .NET. Find
> below a brief
> command line example including the necessary .NET and IronPython
> information.
>
> IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit)
> Type "help", "copyright", "credits" or "license" for more information.

 from ctypes import *
 class foo(Union):
>
> ...     _fields_ = [("t", c_uint), ("b", c_float)]
> ...

 bar = foo()
 bar.t = 1
>
> Traceback (most recent call last):
>  File "", line 1, in 
> SystemError: Object reference not set to an instance of an object.
>
> I'm not subscribed to this list, in case you require more information please
> keep me in CC.
>
> Regards
> Marcus
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] ctypes module in version 2.7.2 can't create Union values

2012-04-20 Thread Slide
As I mentioned, I ran both ipy64.exe and ipy.exe (you can see from my
output that is shows a 64-bit runtime for ipy64 and a 32-bit runtime
for ipy.exe and it made no difference. They both worked for me.

slide

On Fri, Apr 20, 2012 at 1:46 PM, Bruce Bromberek
 wrote:
> Looks like you are running 32bit python on a 64 bit OS
>
> On 4/20/12, Slide  wrote:
>> I am unable to reproduce this, I am also running Win7 x64
>>
>> Running with ipy64.exe
>>
>> IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.261 (64-bit)
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> from ctypes import *
>>>>> class foo(Union):
>> ...     __fields__ = [("t", c_uint), ("b", c_float)]
>> ...
>>>>> bar = foo()
>>>>> bar.t = 1
>>>>>
>>
>> Running with ipy.exe
>>
>> IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit)
>> Type "help", "copyright", "credits" or "license" for more information.
>>>>> from ctypes import *
>>>>> class foo(Union):
>> ...     __fields__ = [("t", c_uint), ("b", c_float)]
>> ...
>>>>> bar = foo()
>>>>> bar.t = 1
>>>>>
>>
>>
>> On Fri, Apr 20, 2012 at 6:45 AM,   wrote:
>>> Dear all,
>>>
>>> on a 64-bit Windows 7 machine (other platforms untested), I find myself
>>> unable to create a
>>> ctypes.Union-based class wrapper for a C type.
>>> Regardless of what kind of Union I create, it always ends up with a
>>> "object reference not set to an instance of an object" error from .NET.
>>> Find
>>> below a brief
>>> command line example including the necessary .NET and IronPython
>>> information.
>>>
>>> IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit)
>>> Type "help", "copyright", "credits" or "license" for more information.
>>>>>>
>>>>>> from ctypes import *
>>>>>> class foo(Union):
>>>
>>> ...     _fields_ = [("t", c_uint), ("b", c_float)]
>>> ...
>>>>>>
>>>>>> bar = foo()
>>>>>> bar.t = 1
>>>
>>> Traceback (most recent call last):
>>>  File "", line 1, in 
>>> SystemError: Object reference not set to an instance of an object.
>>>
>>> I'm not subscribed to this list, in case you require more information
>>> please
>>> keep me in CC.
>>>
>>> Regards
>>> Marcus
>>>
>>> ___
>>> Ironpython-users mailing list
>>> [email protected]
>>> http://mail.python.org/mailman/listinfo/ironpython-users
>>
>>
>>
>> --
>> Website: http://earl-of-code.com
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
>>
>
> --
> Sent from my mobile device



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] ctypes module in version 2.7.2 can't create Union values

2012-04-20 Thread Slide
Just a question, is the CPython stdlib in your IRONPYTHONPATH or added
to sys.path?

slide

On Fri, Apr 20, 2012 at 2:18 PM, Dino Viehland  wrote:
> I'd suggest running w/ -X:ExceptionDetail and sending back the stack trace 
> that you
> get as that'll tell us where the exception is coming from.
>
>> -Original Message-
>> From: [email protected]
>> [mailto:[email protected]] On
>> Behalf Of [email protected]
>> Sent: Friday, April 20, 2012 6:46 AM
>> To: [email protected]
>> Subject: [Ironpython-users] ctypes module in version 2.7.2 can't create Union
>> values
>>
>> Dear all,
>>
>> on a 64-bit Windows 7 machine (other platforms untested), I find myself 
>> unable
>> to create a ctypes.Union-based class wrapper for a C type.
>> Regardless of what kind of Union I create, it always ends up with a "object
>> reference not set to an instance of an object" error from .NET. Find below a
>> brief command line example including the necessary .NET and IronPython
>> information.
>>
>> IronPython 2.7.2.1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit) Type "help",
>> "copyright", "credits" or "license" for more information.
>> >>> from ctypes import *
>> >>> class foo(Union):
>> ...     _fields_ = [("t", c_uint), ("b", c_float)]
>> ...
>> >>> bar = foo()
>> >>> bar.t = 1
>> Traceback (most recent call last):
>>    File "", line 1, in 
>> SystemError: Object reference not set to an instance of an object.
>>
>> I'm not subscribed to this list, in case you require more information please 
>> keep
>> me in CC.
>>
>> Regards
>> Marcus
>>
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
>>
>>
>
>
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Welcome Aboard

2012-04-23 Thread Slide
Looks like we have a new contributor KeithJRome. Welcome aboard!

slide

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Mono and Ironpython

2012-04-23 Thread Slide
Please post the build errors. IronPython.Mono.sln does not exist
anymore, you should be able to use the normal sln file. You may need
to set /p:Configuration="SOMETHING" /p:Platform="SOMETHING". To
determine the SOMETHING's check the Common.csproj for the different
configurations and platforms.

slide

On Mon, Apr 23, 2012 at 12:25 PM, Pratik Paranjape
 wrote:
> I am trying to install IronPython over Mono, on CentOS in my Home folder.
>
>
> Trying to follow instruction here:
> https://github.com/IronLanguages/main/wiki/Building
>
>
>
>
> But...IronPython.Mono.sln does not exist.
>
> Building with IronPython.sln gives errors.
>
> Am I doing something wrong or there are updated instructions somewhere?
>
> Thanks.
>
>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Mono and Ironpython

2012-04-23 Thread Slide
Do you have the 4.0 BCL and what not installed?

slide

On Mon, Apr 23, 2012 at 2:58 PM, Pratik Paranjape
 wrote:
> Thanks for reply.
>
> command I was using:
> $> xbuild /p:Configuration=Release Solutions/IronPython.sln
>
> I checked common.proj, but I am not sure what platform to choose. CentOS
> Mono 2.10.
>
> Error stack:
>
> Errors:
>
> /home/user/ironpysource/IronLanguages-main-77f5251/Solutions/IronPython.sln
> (default targets) ->
> (Build target) ->
> /home/user/ironpysource/IronLanguages-main-77f5251/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj
> (default targets) ->
> /home/user/lib/mono/4.0/Microsoft.CSharp.targets (CoreCompile target) ->
>
>     Generation/CompilerHelpers.cs(198,44): error CS1061: Type
> `System.Reflection.MethodInfo' does not contain a definition for
> `GetRuntimeBaseDefinition' and no extension method
> `GetRuntimeBaseDefinition' of type `System.Reflection.MethodInfo' could be
> found (are you missing a using directive or an assembly reference?)
>     Utils/ReflectionUtils.cs(389,41): error CS0103: The name
> `RuntimeReflectionExtensions' does not exist in the current context
>     Utils/ReflectionUtils.cs(389,37): error CS1502: The best overloaded
> method match for
> `System.Collections.Generic.HashSet.Add(System.Reflection.MethodInfo)'
> has some invalid arguments
>     Utils/ReflectionUtils.cs(389,37): error CS1503: Argument `#1' cannot
> convert `object' expression to type `System.Reflection.MethodInfo'
>     Utils/ReflectionUtils.cs(445,41): error CS0103: The name
> `RuntimeReflectionExtensions' does not exist in the current context
>     Utils/ReflectionUtils.cs(445,37): error CS1502: The best overloaded
> method match for
> `System.Collections.Generic.HashSet.Add(System.Reflection.MethodInfo)'
> has some invalid arguments
>     Utils/ReflectionUtils.cs(445,37): error CS1503: Argument `#1' cannot
> convert `object' expression to type `System.Reflection.MethodInfo'
>     Utils/ReflectionUtils.cs(495,41): error CS0103: The name
> `RuntimeReflectionExtensions' does not exist in the current context
>     Utils/ReflectionUtils.cs(495,37): error CS1502: The best overloaded
> method match for
> `System.Collections.Generic.HashSet.Add(System.Reflection.MethodInfo)'
> has some invalid arguments
>     Utils/ReflectionUtils.cs(495,37): error CS1503: Argument `#1' cannot
> convert `object' expression to type `System.Reflection.MethodInfo'
>
>      2 Warning(s)
>      10 Error(s)
>
>
>
>
>
>
> On Tue, Apr 24, 2012 at 2:51 AM, Slide  wrote:
>>
>> Please post the build errors. IronPython.Mono.sln does not exist
>> anymore, you should be able to use the normal sln file. You may need
>> to set /p:Configuration="SOMETHING" /p:Platform="SOMETHING". To
>> determine the SOMETHING's check the Common.csproj for the different
>> configurations and platforms.
>>
>> slide
>>
>> On Mon, Apr 23, 2012 at 12:25 PM, Pratik Paranjape
>>  wrote:
>> > I am trying to install IronPython over Mono, on CentOS in my Home
>> > folder.
>> >
>> >
>> > Trying to follow instruction here:
>> > https://github.com/IronLanguages/main/wiki/Building
>> >
>> >
>> >
>> >
>> > But...IronPython.Mono.sln does not exist.
>> >
>> > Building with IronPython.sln gives errors.
>> >
>> > Am I doing something wrong or there are updated instructions somewhere?
>> >
>> > Thanks.
>> >
>> >
>> > ___
>> > Ironpython-users mailing list
>> > [email protected]
>> > http://mail.python.org/mailman/listinfo/ironpython-users
>> >
>>
>>
>>
>> --
>> Website: http://earl-of-code.com
>
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Mono and Ironpython

2012-04-24 Thread Slide
What about context.LanguageContext.SystemStateModules?

On Tue, Apr 24, 2012 at 9:37 AM, Keith Rome  wrote:
> That one was my fault, as it wasn’t obvious to me how to reach sys.modules
> otherwise. There is a pull request pending to drop the dynamic usage (it
> worked on desktop CLR but not others). I changed it to use this method
> instead (which seems to work on all platforms):
>
>
>
> (PythonDictionary)context.LanguageContext.SystemState.__dict__.get("modules")
>
>
>
> Is there a better way to reach sys.modules when all I have is a CodeContext?
>
>
>
>
>
> Keith Rome
>
> Senior Consultant and Architect
>
> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>
> Wintellect | 770.617.4016 | [email protected]
>
> www.wintellect.com
>
>
>
> From: Tomas Matousek [mailto:[email protected]]
> Sent: Tuesday, April 24, 2012 12:27 PM
> To: Tomas Matousek; Keith Rome; [email protected]; Slide
> Cc: [email protected]
> Subject: RE: [Ironpython-users] Mono and Ironpython
>
>
>
> Fixed.
>
>
>
> There is one remaining error when building for Silverlight4 (that is not my
> fault):
>
>
>
> ResourceMetaPathImporter.load_module uses “dynamic” keyword. The C# runtime
> binder isn’t referenced by Silverlight4 build.
>
> I’m wondering why dynamic is used there.
>
>
>
> Tomas
>
>
>
>
>
> From: [email protected]
> [mailto:[email protected]] On
> Behalf Of Tomas Matousek
> Sent: Tuesday, April 24, 2012 9:12 AM
> To: Keith Rome; [email protected]; Slide
>
>
> Cc: [email protected]
> Subject: Re: [Ironpython-users] Mono and Ironpython
>
>
>
> Looks like my fault. Sorry about that. Fixing.
>
>
>
> Tomas
>
>
>
> From: [email protected]
> [mailto:[email protected]] On
> Behalf Of Keith Rome
> Sent: Tuesday, April 24, 2012 8:00 AM
> To: [email protected]; Slide
> Cc: [email protected]
> Subject: Re: [Ironpython-users] Mono and Ironpython
>
>
>
> I have also been having problems getting Microsoft.Dynamic to build for the
> Silverlight targets. If I revert commit
> 4d99cbae91724fc9b982b581d5ad79193991439e “Win8 build fixes” from around 10
> days ago, then it builds for me. Build output is similar, but not exactly
> the same:
>
>
>
> -- Build started: Project: Microsoft.Dynamic, Configuration:
> Silverlight5Release Any CPU --
>
> C:\Users\krome\main\Runtime\Microsoft.Dynamic\Generation\CompilerHelpers.cs(198,44):
> error CS1061: 'System.Reflection.MethodInfo' does not contain a definition
> for 'GetRuntimeBaseDefinition' and no extension method
> 'GetRuntimeBaseDefinition' accepting a first argument of type
> 'System.Reflection.MethodInfo' could be found (are you missing a using
> directive or an assembly reference?)
>
> C:\Users\krome\main\Runtime\Microsoft.Dynamic\Utils\ReflectionUtils.cs(389,41):
> error CS0103: The name 'RuntimeReflectionExtensions' does not exist in the
> current context
>
> C:\Users\krome\main\Runtime\Microsoft.Dynamic\Utils\ReflectionUtils.cs(445,41):
> error CS0103: The name 'RuntimeReflectionExtensions' does not exist in the
> current context
>
> C:\Users\krome\main\Runtime\Microsoft.Dynamic\Utils\ReflectionUtils.cs(495,41):
> error CS0103: The name 'RuntimeReflectionExtensions' does not exist in the
> current context
>
>
>
>
>
> Perhaps this might help shed light on the issue.
>
>
>
>
>
>
>
> Keith Rome
>
> Senior Consultant and Architect
>
> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>
> Wintellect | 770.617.4016 | [email protected]
>
> www.wintellect.com
>
>
>
> From: [email protected]
> [mailto:[email protected]] On Behalf
> Of Pratik Paranjape
> Sent: Monday, April 23, 2012 5:59 PM
> To: Slide
> Cc: [email protected]
> Subject: Re: [Ironpython-users] Mono and Ironpython
>
>
>
> Thanks for reply.
>
> command I was using:
> $> xbuild /p:Configuration=Release Solutions/IronPython.sln
>
> I checked common.proj, but I am not sure what platform to choose. CentOS
> Mono 2.10.
>
> Error stack:
>
> Errors:
>
> /home/user/ironpysource/IronLanguages-main-77f5251/Solutions/IronPython.sln
> (default targets) ->
> (Build target) ->
> /home/user/ironpysource/IronLanguages-ma

Re: [Ironpython-users] Mono and Ironpython

2012-04-25 Thread Slide
What version of CentOS and Mono?
On Apr 25, 2012 4:56 AM, "Pratik Paranjape" 
wrote:

> Thank you all for taking it up.
>
> I am still getting errors (like close to 2000) building latest trunk and
> and tag 2.7.2.1, CentOS Mono.
>
> I think the platform combination is out of usual ipy use?
>
> I will try working with binaries or some workaround. My aim is to use a
> .NET library with Django as
> front end. The library works fine with mono, was hoping to use ipy to call
> it in Django views.
>
> Thanks again.
>
>
>
> On Wed, Apr 25, 2012 at 5:48 AM, Keith Rome  wrote:
>
>> Yes, it seems that is a much better way to go, and appears to work for
>> SL4/5 and v2 profiles where dynamic was causing issues.
>>
>> Even though I know my way around a little, there is still a lot to be
>> learned. I didn't even notice the existence of that property before.
>>
>>
>> Keith Rome
>> Senior Consultant and Architect
>> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>> Wintellect | 770.617.4016 | [email protected]
>> www.wintellect.com
>>
>>
>> -Original Message-
>> From: Slide [mailto:[email protected]]
>> Sent: Tuesday, April 24, 2012 12:43 PM
>> To: Keith Rome
>> Cc: Tomas Matousek; [email protected];
>> [email protected]
>> Subject: Re: [Ironpython-users] Mono and Ironpython
>>
>> What about context.LanguageContext.SystemStateModules?
>>
>> On Tue, Apr 24, 2012 at 9:37 AM, Keith Rome  wrote:
>> > That one was my fault, as it wasn't obvious to me how to reach
>> > sys.modules otherwise. There is a pull request pending to drop the
>> > dynamic usage (it worked on desktop CLR but not others). I changed it
>> > to use this method instead (which seems to work on all platforms):
>> >
>> >
>> >
>> > (PythonDictionary)context.LanguageContext.SystemState.__dict__.get("mo
>> > dules")
>> >
>> >
>> >
>> > Is there a better way to reach sys.modules when all I have is a
>> CodeContext?
>> >
>> >
>> >
>> >
>> >
>> > Keith Rome
>> >
>> > Senior Consultant and Architect
>> >
>> > MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>> >
>> > Wintellect | 770.617.4016 | [email protected]
>> >
>> > www.wintellect.com
>> >
>> >
>> >
>> > From: Tomas Matousek [mailto:[email protected]]
>> > Sent: Tuesday, April 24, 2012 12:27 PM
>> > To: Tomas Matousek; Keith Rome; [email protected]; Slide
>> > Cc: [email protected]
>> > Subject: RE: [Ironpython-users] Mono and Ironpython
>> >
>> >
>> >
>> > Fixed.
>> >
>> >
>> >
>> > There is one remaining error when building for Silverlight4 (that is
>> > not my
>> > fault):
>> >
>> >
>> >
>> > ResourceMetaPathImporter.load_module uses "dynamic" keyword. The C#
>> > runtime binder isn't referenced by Silverlight4 build.
>> >
>> > I'm wondering why dynamic is used there.
>> >
>> >
>> >
>> > Tomas
>> >
>> >
>> >
>> >
>> >
>> > From: [email protected]
>> > [mailto:[email protected]
>> > rg] On Behalf Of Tomas Matousek
>> > Sent: Tuesday, April 24, 2012 9:12 AM
>> > To: Keith Rome; [email protected]; Slide
>> >
>> >
>> > Cc: [email protected]
>> > Subject: Re: [Ironpython-users] Mono and Ironpython
>> >
>> >
>> >
>> > Looks like my fault. Sorry about that. Fixing.
>> >
>> >
>> >
>> > Tomas
>> >
>> >
>> >
>> > From: [email protected]
>> > [mailto:[email protected]
>> > rg] On Behalf Of Keith Rome
>> > Sent: Tuesday, April 24, 2012 8:00 AM
>> > To: [email protected]; Slide
>> > Cc: [email protected]
>> > Subject: Re: [Ironpython-users] Mono and Ironpython
>> >
>> >
>> >
>> > I have also been having problems getting Microsoft.Dynamic to build
>> > for the Silverlight targets. If I revert commit
>> > 4d99cbae91724fc9b982b581d5ad791

Re: [Ironpython-users] Mono and Ironpython

2012-04-25 Thread Slide
64-bit or 32-bit?

On Wed, Apr 25, 2012 at 6:19 AM, Pratik Paranjape
 wrote:
> On Wed, Apr 25, 2012 at 5:58 PM, Slide  wrote:
>>
>> What version of CentOS and Mono?
>
>
> CentOS : 5.8 (Final)
> Mono: 2.10.2
>
>
>
>>
>> On Apr 25, 2012 4:56 AM, "Pratik Paranjape" 
>> wrote:
>>>
>>> Thank you all for taking it up.
>>>
>>> I am still getting errors (like close to 2000) building latest trunk and
>>> and tag 2.7.2.1, CentOS Mono.
>>>
>>> I think the platform combination is out of usual ipy use?
>>>
>>> I will try working with binaries or some workaround. My aim is to use a
>>> .NET library with Django as
>>> front end. The library works fine with mono, was hoping to use ipy to
>>> call it in Django views.
>>>
>>> Thanks again.
>>>
>>>
>>>
>>> On Wed, Apr 25, 2012 at 5:48 AM, Keith Rome  wrote:
>>>>
>>>> Yes, it seems that is a much better way to go, and appears to work for
>>>> SL4/5 and v2 profiles where dynamic was causing issues.
>>>>
>>>> Even though I know my way around a little, there is still a lot to be
>>>> learned. I didn't even notice the existence of that property before.
>>>>
>>>>
>>>> Keith Rome
>>>> Senior Consultant and Architect
>>>> MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>>>> Wintellect | 770.617.4016 | [email protected]
>>>> www.wintellect.com
>>>>
>>>>
>>>> -Original Message-
>>>> From: Slide [mailto:[email protected]]
>>>> Sent: Tuesday, April 24, 2012 12:43 PM
>>>> To: Keith Rome
>>>> Cc: Tomas Matousek; [email protected];
>>>> [email protected]
>>>> Subject: Re: [Ironpython-users] Mono and Ironpython
>>>>
>>>> What about context.LanguageContext.SystemStateModules?
>>>>
>>>> On Tue, Apr 24, 2012 at 9:37 AM, Keith Rome  wrote:
>>>> > That one was my fault, as it wasn't obvious to me how to reach
>>>> > sys.modules otherwise. There is a pull request pending to drop the
>>>> > dynamic usage (it worked on desktop CLR but not others). I changed it
>>>> > to use this method instead (which seems to work on all platforms):
>>>> >
>>>> >
>>>> >
>>>> > (PythonDictionary)context.LanguageContext.SystemState.__dict__.get("mo
>>>> > dules")
>>>> >
>>>> >
>>>> >
>>>> > Is there a better way to reach sys.modules when all I have is a
>>>> > CodeContext?
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > Keith Rome
>>>> >
>>>> > Senior Consultant and Architect
>>>> >
>>>> > MCPD-EAD, MCSD, MCDBA, MCTS-WPF, MCTS-TFS, MCTS-WSS
>>>> >
>>>> > Wintellect | 770.617.4016 | [email protected]
>>>> >
>>>> > www.wintellect.com
>>>> >
>>>> >
>>>> >
>>>> > From: Tomas Matousek [mailto:[email protected]]
>>>> > Sent: Tuesday, April 24, 2012 12:27 PM
>>>> > To: Tomas Matousek; Keith Rome; [email protected]; Slide
>>>> > Cc: [email protected]
>>>> > Subject: RE: [Ironpython-users] Mono and Ironpython
>>>> >
>>>> >
>>>> >
>>>> > Fixed.
>>>> >
>>>> >
>>>> >
>>>> > There is one remaining error when building for Silverlight4 (that is
>>>> > not my
>>>> > fault):
>>>> >
>>>> >
>>>> >
>>>> > ResourceMetaPathImporter.load_module uses "dynamic" keyword. The C#
>>>> > runtime binder isn't referenced by Silverlight4 build.
>>>> >
>>>> > I'm wondering why dynamic is used there.
>>>> >
>>>> >
>>>> >
>>>> > Tomas
>>>> >
>>>> >
>>>> >
>>>> >
>>>> >
>>>> > From: [email protected]
>>>> > [mailto:[email protected]
>>>> > rg] On Behalf Of Tomas Ma

Re: [Ironpython-users] Codeplex says "No Documentation"

2012-04-30 Thread Slide
This sounds like a great idea Jeff. Let me know if there is anything I
can do to help out.

Thanks,

slide

On Mon, Apr 30, 2012 at 8:57 AM, Jeff Hardy  wrote:
> Here's what my thinking has been on documentation for the past little
> while. I just haven't had a chance to put it all together.
>
> First off, there's a great site called readthedocs.org (RTD) that
> hosts softwsre documentation (for free). I believe it works with any
> sort of documentation if you set it up right, but it's designed for
> Sphinx (http://sphinx.pocoo.org/) documentation. Sphinx, as it
> happens, was originally written to manage Python's documentation, so
> all of the existing Python documentation is written for Sphinx and
> thus works quite nicely with RTD.
>
> RTD also has a handy feature where you can have it pull from a git
> repo, and GitHub has a hook that will tell RTD when your documentation
> has changed. GitHub also supports editing files directly from its
> website, and supports merging changes directly from the website as
> well.
>
> OK, enough meandering background. :) My idea was that we would take a
> copy of the Python documentation, store in a git repo (say,
> https://github.com/IronLanguages/ironpython-docs), and make any
> IronPython-specific changes there, such as notes on the standard
> library (what IronPython does/doesn't support, etc.) and IP-specific
> documentation on creating modules, embedding IronPython, and
> interoperating with .NET code. When the repo's master is updated the
> docs will automatically get rebuilt and pushed live. GitHub even
> provides a 'fork-and-edit' operation that we can link to - click it,
> edit the page, submit a pull request, merge online, new docs show up
> ~1 hour later.
>
> Like a wiki, it can be edited online, merge requests can be handled
> online, everything - and pretty docs will automatically get built. RTD
> also supports CNAMEs, so the docs would eventually live at
> docs.ironpython.net.
>
> You can see what they might look like at
> http://readthedocs.org/docs/ironpython-test/en/latest/index.html.
>
> I'd be very glad to get some help with this if it makes sense to you,
> Vernon. It offers a lot of advantages over the Codeplex wiki, and none
> of the downsides as far as I can see.
>
> - Jeff
>
> On Sun, Apr 29, 2012 at 11:57 AM, Vernon Cole  wrote:
>> I noticed today that IronPython's codeplex page has an empty "Documentation"
>> tab.  It just says: "There is no documentation yet."  I wish to fix that
>> problem.
>>
>> Is http://ironpython.net/documentation/ actually our official
>> documentation?  If so, the site needs some updating. Who can do that?
>>
>> Or is it https://github.com/IronLanguages/ironpython-docs ? If so, user
>> access needs to be a bit more friendly.
>>
>> Or did I miss something entirely that everyone else already knows?
>>
>> I am an editor on the codeplex project page. I will make appropriate updates
>> based on the consensus of replies to this message.
>> --
>> Vernon Cole
>>
>>
>>
>> ___
>> Ironpython-users mailing list
>> [email protected]
>> http://mail.python.org/mailman/listinfo/ironpython-users
>>
> ___
> Ironpython-users mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/ironpython-users



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Mono and Ironpython

2012-04-30 Thread Slide
For what its worth, I am able to build the latest trunk with mono
2.10.2 on CentOS 5.8.

On Mon, Apr 23, 2012 at 2:58 PM, Pratik Paranjape
 wrote:
> Thanks for reply.
>
> command I was using:
> $> xbuild /p:Configuration=Release Solutions/IronPython.sln
>
> I checked common.proj, but I am not sure what platform to choose. CentOS
> Mono 2.10.
>
> Error stack:
>
> Errors:
>
> /home/user/ironpysource/IronLanguages-main-77f5251/Solutions/IronPython.sln
> (default targets) ->
> (Build target) ->
> /home/user/ironpysource/IronLanguages-main-77f5251/Runtime/Microsoft.Dynamic/Microsoft.Dynamic.csproj
> (default targets) ->
> /home/user/lib/mono/4.0/Microsoft.CSharp.targets (CoreCompile target) ->
>
>     Generation/CompilerHelpers.cs(198,44): error CS1061: Type
> `System.Reflection.MethodInfo' does not contain a definition for
> `GetRuntimeBaseDefinition' and no extension method
> `GetRuntimeBaseDefinition' of type `System.Reflection.MethodInfo' could be
> found (are you missing a using directive or an assembly reference?)
>     Utils/ReflectionUtils.cs(389,41): error CS0103: The name
> `RuntimeReflectionExtensions' does not exist in the current context
>     Utils/ReflectionUtils.cs(389,37): error CS1502: The best overloaded
> method match for
> `System.Collections.Generic.HashSet.Add(System.Reflection.MethodInfo)'
> has some invalid arguments
>     Utils/ReflectionUtils.cs(389,37): error CS1503: Argument `#1' cannot
> convert `object' expression to type `System.Reflection.MethodInfo'
>     Utils/ReflectionUtils.cs(445,41): error CS0103: The name
> `RuntimeReflectionExtensions' does not exist in the current context
>     Utils/ReflectionUtils.cs(445,37): error CS1502: The best overloaded
> method match for
> `System.Collections.Generic.HashSet.Add(System.Reflection.MethodInfo)'
> has some invalid arguments
>     Utils/ReflectionUtils.cs(445,37): error CS1503: Argument `#1' cannot
> convert `object' expression to type `System.Reflection.MethodInfo'
>     Utils/ReflectionUtils.cs(495,41): error CS0103: The name
> `RuntimeReflectionExtensions' does not exist in the current context
>     Utils/ReflectionUtils.cs(495,37): error CS1502: The best overloaded
> method match for
> `System.Collections.Generic.HashSet.Add(System.Reflection.MethodInfo)'
> has some invalid arguments
>     Utils/ReflectionUtils.cs(495,37): error CS1503: Argument `#1' cannot
> convert `object' expression to type `System.Reflection.MethodInfo'
>
>      2 Warning(s)
>      10 Error(s)
>
>
>
>
>
>
> On Tue, Apr 24, 2012 at 2:51 AM, Slide  wrote:
>>
>> Please post the build errors. IronPython.Mono.sln does not exist
>> anymore, you should be able to use the normal sln file. You may need
>> to set /p:Configuration="SOMETHING" /p:Platform="SOMETHING". To
>> determine the SOMETHING's check the Common.csproj for the different
>> configurations and platforms.
>>
>> slide
>>
>> On Mon, Apr 23, 2012 at 12:25 PM, Pratik Paranjape
>>  wrote:
>> > I am trying to install IronPython over Mono, on CentOS in my Home
>> > folder.
>> >
>> >
>> > Trying to follow instruction here:
>> > https://github.com/IronLanguages/main/wiki/Building
>> >
>> >
>> >
>> >
>> > But...IronPython.Mono.sln does not exist.
>> >
>> > Building with IronPython.sln gives errors.
>> >
>> > Am I doing something wrong or there are updated instructions somewhere?
>> >
>> > Thanks.
>> >
>> >
>> > ___
>> > Ironpython-users mailing list
>> > [email protected]
>> > http://mail.python.org/mailman/listinfo/ironpython-users
>> >
>>
>>
>>
>> --
>> Website: http://earl-of-code.com
>
>



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Codeplex says "No Documentation"

2012-05-02 Thread Slide
I have seem to have access, I haven't tried pushing anything yet. I'll
take a look at the Extending section and what I can do help out there.

Thanks,

slide

On Mon, Apr 30, 2012 at 12:00 PM, Jeff Hardy  wrote:
> On Mon, Apr 30, 2012 at 9:05 AM, Slide  wrote:
>> This sounds like a great idea Jeff. Let me know if there is anything I
>> can do to help out.
>
> The "Extending and Embedding" section needs to be wiped out and
> completely rewritten (since none of it applies to IronPython). I know
> it's a lot to ask, but you had mentioned wanting to write about
> creating modules - if you want to work on the "Extending" section,
> that would be a great start (I'm thinking of adapting the "Embedding"
> section from the existing DLR docs as much as possible).
>
> You should have write access to ironpython-docs repo already, but let
> me know if you don't.
>
> - Jeff



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] RuntimeReflectionExtensions

2012-05-19 Thread Slide
It looks like Microsoft.Dynamic was updated to use something that is
only available in 4.5. I'm looking in ReflectionUtils.cs at the
following code:

private static bool IncludeMethod(MethodInfo member, Type
reflectedType, HashSet baseDefinitions, bool
flattenHierarchy) {
if (member.IsVirtual) {
if
(baseDefinitions.Add(RuntimeReflectionExtensions.GetRuntimeBaseDefinition(member)))
{
return true;
}
} else if (member.DeclaringType == reflectedType) {
return true;
} else if (!member.IsPrivate && (!member.IsStatic ||
flattenHierarchy)) {
return true;
}

return false;
}

Looking at RuntimeReflectionExtensions on MSDN it says its only
supported in 4.5?

slide

-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] RuntimeReflectionExtensions

2012-05-19 Thread Slide
Nevermind on this, it looks like my solution and projects got
corrupted somehow so the wrong preprocessor items were being defined.

On Sat, May 19, 2012 at 7:05 AM, Slide  wrote:
> It looks like Microsoft.Dynamic was updated to use something that is
> only available in 4.5. I'm looking in ReflectionUtils.cs at the
> following code:
>
> private static bool IncludeMethod(MethodInfo member, Type
> reflectedType, HashSet baseDefinitions, bool
> flattenHierarchy) {
>            if (member.IsVirtual) {
>                if
> (baseDefinitions.Add(RuntimeReflectionExtensions.GetRuntimeBaseDefinition(member)))
> {
>                    return true;
>                }
>            } else if (member.DeclaringType == reflectedType) {
>                return true;
>            } else if (!member.IsPrivate && (!member.IsStatic ||
> flattenHierarchy)) {
>                return true;
>            }
>
>            return false;
>        }
>
> Looking at RuntimeReflectionExtensions on MSDN it says its only
> supported in 4.5?
>
> slide
>
> --
> Website: http://earl-of-code.com



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Poor performance of a c# - Ironpython

2012-05-23 Thread Slide
Hmmm, you are right of course. :-)

On Wed, May 23, 2012 at 10:45 AM, Jeff Hardy  wrote:
> On Wed, May 23, 2012 at 10:22 AM, Alex Earl  wrote:
>> Dynamic is pretty slow as well since it involves reflection. What is
>> the real type of the object you are returning, is it a function or
>> something? You may want to save it off as a delegate instance instead
>> of dynamic of that is the case.
>
> C# dynamic doesn't involve reflection, it invokes the usual DLR
> mechanisms. There shouldn't be any advantage to avoiding it.
>
> - Jeff



-- 
Website: http://earl-of-code.com
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Unable to load assembly 'Microsoft�€

2012-05-29 Thread Slide
Yes, I understand, but AddReference is just basically a wrapper around
Assembly.Load, which does not search. You can try using
clr.AddReferenceToFile with the directory you get from the find method
added to sys.path.

slide

On Tue, May 29, 2012 at 12:04 PM, Furqan Malik1E07
 wrote:
> Hi Alex,
>
> Thanks for you reply.
> Actually my question is different.
> I am using clr or load the dll
> Import clr
> clr.AddReference("'Microsoft.VisualStudio.TestTools.UITesting")
> and there I am having error.
> : Unable to find assembly 'Microsoft.VisualStudio.Test= Tools.UITesting'.
>
> Clr.FindAssembly("'Microsoft.VisualStudio.TestTools.UITesting")
> It is returning correct path
>
> -Original Message-
> From: Alex Earl [mailto:[email protected]]
> Sent: May-29-12 2:39 PM
> To: Furqan Malik1E07; [email protected]
> Subject: RE: [Ironpython-users] Unable to load assembly 'Microsoft�€
>
>  =?utf-8?Q?=8B.VisualStu=E2=80=8Bdio.TestTo=E2=80=8Bols.UITest=E2=80=8Bing?=
>
>  =?utf-8?Q?'_in_Python?=
> MIME-Version: 1.0
> Content-Type: multipart/mixed; boundary="===1122901385=="
>
> --===1122901385==
> Content-Type: multipart/alternative;
>        
> boundary="_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_"
>
> --_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_
> Content-Type: text/plain; charset="utf-8"
> Content-Transfer-Encoding: quoted-printable
>
> Unless it's in the GAC you probably need to use the method that takes a full 
> path.
>
> Sent from my Windows Phone
> From: Furqan Malik1E07
> Sent: 5/29/2012 11:34 AM
> To: [email protected]
> Subject: [Ironpython-users] Unable to load assembly 'Microsoft=E2=80=8B.Vis= 
> ualStu dio.TestTo=E2=80=8Bols.UITest=E2=80=8Bing' in Python I have automated 
> my whole framework in Ironpython and it's working pretty g= ood and stable.
>
> Recently, my company has implemented Drag and Drop functionality to automat= 
> e.
>
> I found one Dll( 'Microsoft.VisualStudio.TestTools.UITesting.dll') which ha= 
> s class mouse and that class has method called mouse.startdragging() and mo= 
> use.stopdragging().
>
> But unfortunately, I am unable to add the reference of this Dll. I am getti= 
> ng following error
>
> " clr.AddReference("Microsoft.VisualStudio.TestTools.UITesting") System.IO.=
> FileNotFoundException: Unable to find assembly 'Microsoft.VisualStudio.Test= 
> Tools.UITesting'. at Python.Runtime.CLRModule.AddReference(String name) in = 
> C:\Users\Barton\Documents\Visual Studio 2008\Projects\PySharp\trunk\pythonn=
> et\src\runtime\moduleobject.cs:line 375 "
>
> I would truly appreciate if anyone can help me, I am middle of my project
>
> --_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_
> Content-Type: text/html; charset="utf-8"
> Content-Transfer-Encoding: quoted-printable
>
>  ent-Type"> font-size: 11pt;">Unless it's in the GAC you probably need to use the metho= 
> d that takes a full path.Sent from my Windows Phone= 
>  ight: bold;">From:  nt-size: 10pt;">Furqan Malik1E07 ma,sans-serif; font-size: 10pt; font-weight: bold;">Sent:  e=3D"font-family: Tahoma,sans-serif; font-size: 10pt;">5/29/2012 11:34 AM span> span>fo=
> nt-weight: bold;">To:   font-size: 10pt;">[email protected] t-family: Tahoma,sans-serif; font-size: 10pt; font-weight: bold;">Subject: = 
> [Ir= 
> onpython-users] Unable to load assembly 'Microsoft=E2=80=8B.VisualStu=E2=80=
> =8Bdio.TestTo=E2=80=8Bols.UITest=E2=80=8Bing' in Python y> y>charset=3D=
> utf-8">
>  osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" = 
> xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml"; xmlns=3D"http:= 
> //www.w3.org/TR/REC-html40"> ft Word 14 (filtered medium)"><!--
> /* Font Definitions */
> @font-face
> =09{font-family:"Cambria Math";
> =09panose-1:2 4 5 3 5 4 6 3 2 4;}
> @font-face
> =09{font-family:Calibri;
> =09panose-1:2 15 5 2 2 2 4 3 2 4;}
> /* Style Definitions */
> p.MsoNormal, li.MsoNormal, div.MsoNormal =09{margin:0cm; 
> =09margin-bottom:.0001pt; =09font-size:11.0pt; 
> =09font-family:"Calibri","sans-serif";
> =09mso-fareast-language:EN-US;}
> a:link, span.MsoHyperlink
> =09{mso-style-priority:99;
> =09color:blue;
> =09text-decoration:underline;}
> a:visited, span.MsoHyperlinkFollowed
> =09{mso-style-priority:99;
> =09color:purple;
> =09text-decoration:unde

Re: [Ironpython-users] Unable to load assembly 'Microsoft�€

2012-05-29 Thread Slide
What version of IP are you using? Also, what do you get if you do a
dir(clr) in the interactive console?

slide

On Tue, May 29, 2012 at 1:05 PM, Furqan Malik1E07
 wrote:
> Thanks Slide,
>
> I am getting following error now,
>
> clr.AddReferenceToFile('MicrosoftVisualStudioTestToolsUITesting.dll')
> AttributeError: AddReferenceToFile
>
> -Original Message-
> From: Slide [mailto:[email protected]]
> Sent: May-29-12 3:21 PM
> To: Furqan Malik1E07
> Cc: [email protected]
> Subject: Re: [Ironpython-users] Unable to load assembly 'Microsoft�€
>
> Yes, I understand, but AddReference is just basically a wrapper around 
> Assembly.Load, which does not search. You can try using 
> clr.AddReferenceToFile with the directory you get from the find method added 
> to sys.path.
>
> slide
>
> On Tue, May 29, 2012 at 12:04 PM, Furqan Malik1E07 
>  wrote:
>> Hi Alex,
>>
>> Thanks for you reply.
>> Actually my question is different.
>> I am using clr or load the dll
>> Import clr
>> clr.AddReference("'Microsoft.VisualStudio.TestTools.UITesting")
>> and there I am having error.
>> : Unable to find assembly 'Microsoft.VisualStudio.Test= Tools.UITesting'.
>>
>> Clr.FindAssembly("'Microsoft.VisualStudio.TestTools.UITesting")
>> It is returning correct path
>>
>> -Original Message-
>> From: Alex Earl [mailto:[email protected]]
>> Sent: May-29-12 2:39 PM
>> To: Furqan Malik1E07; [email protected]
>> Subject: RE: [Ironpython-users] Unable to load assembly 'Microsoft €
>>
>>
>> =?utf-8?Q?=8B.VisualStu=E2=80=8Bdio.TestTo=E2=80=8Bols.UITest=E2=80=8B
>> ing?=
>>
>>  =?utf-8?Q?'_in_Python?=
>> MIME-Version: 1.0
>> Content-Type: multipart/mixed; boundary="===1122901385=="
>>
>> --===1122901385==
>> Content-Type: multipart/alternative;
>>        
>> boundary="_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_"
>>
>> --_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_
>> Content-Type: text/plain; charset="utf-8"
>> Content-Transfer-Encoding: quoted-printable
>>
>> Unless it's in the GAC you probably need to use the method that takes a full 
>> path.
>>
>> Sent from my Windows Phone
>> From: Furqan Malik1E07
>> Sent: 5/29/2012 11:34 AM
>> To: [email protected]
>> Subject: [Ironpython-users] Unable to load assembly 'Microsoft=E2=80=8B.Vis= 
>> ualStu dio.TestTo=E2=80=8Bols.UITest=E2=80=8Bing' in Python I have automated 
>> my whole framework in Ironpython and it's working pretty g= ood and stable.
>>
>> Recently, my company has implemented Drag and Drop functionality to automat= 
>> e.
>>
>> I found one Dll( 'Microsoft.VisualStudio.TestTools.UITesting.dll') which ha= 
>> s class mouse and that class has method called mouse.startdragging() and mo= 
>> use.stopdragging().
>>
>> But unfortunately, I am unable to add the reference of this Dll. I am
>> getti= ng following error
>>
>> " clr.AddReference("Microsoft.VisualStudio.TestTools.UITesting")
>> System.IO.=
>> FileNotFoundException: Unable to find assembly
>> 'Microsoft.VisualStudio.Test= Tools.UITesting'. at
>> Python.Runtime.CLRModule.AddReference(String name) in =
>> C:\Users\Barton\Documents\Visual Studio
>> 2008\Projects\PySharp\trunk\pythonn=
>> et\src\runtime\moduleobject.cs:line 375 "
>>
>> I would truly appreciate if anyone can help me, I am middle of my
>> project
>>
>> --_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_
>> Content-Type: text/html; charset="utf-8"
>> Content-Transfer-Encoding: quoted-printable
>>
>> > http-equiv=3D"Cont= ent-Type">> style=3D"font-family: Calibri,sans-serif; =
>> font-size: 11pt;">Unless it's in the GAC you probably need to use the
>> metho= d that takes a full path.Sent from my Windows
>> Phone= > Tahoma,sans-serif; font-size: 10pt; font-we=
>> ight: bold;">From: > Tahoma,sans-serif; fo=
>> nt-size: 10pt;">Furqan Malik1E07> Taho= ma,sans-serif; font-size: 10pt; font-weight: bold;">Sent:
>> > e=3D"font-family: Tahoma,sans-serif; font-size: 10pt;">5/29/2012 11:34
>> AM> span>> span>10pt; fo=
>> nt-weight: bold;">To: > Tahoma,sans-serif;=
>>  font-size: 10pt;">[email protected]> style=3D&qu

Re: [Ironpython-users] Unable to load assembly 'Microsoft�€

2012-05-29 Thread Slide
Can you give the full version displayed when you run ipy.exe or ipy64.exe?

slide

On Tue, May 29, 2012 at 1:28 PM, Furqan Malik1E07
 wrote:
> I am using Python 2.7
> And that's what I get when I run dir(clr)
> ['AddReference', 'FindAssembly', 'ListAssemblies', '__doc__', '__file__', 
> '__name__', 'getPreload', 'setPreload']
>
> -Original Message-
> From: Slide [mailto:[email protected]]
> Sent: May-29-12 4:09 PM
> To: Furqan Malik1E07
> Cc: [email protected]
> Subject: Re: [Ironpython-users] Unable to load assembly 'Microsoft�€
>
> What version of IP are you using? Also, what do you get if you do a
> dir(clr) in the interactive console?
>
> slide
>
> On Tue, May 29, 2012 at 1:05 PM, Furqan Malik1E07 
>  wrote:
>> Thanks Slide,
>>
>> I am getting following error now,
>>
>> clr.AddReferenceToFile('MicrosoftVisualStudioTestToolsUITesting.dll')
>> AttributeError: AddReferenceToFile
>>
>> -Original Message-
>> From: Slide [mailto:[email protected]]
>> Sent: May-29-12 3:21 PM
>> To: Furqan Malik1E07
>> Cc: [email protected]
>> Subject: Re: [Ironpython-users] Unable to load assembly 'Microsoft €
>>
>> Yes, I understand, but AddReference is just basically a wrapper around 
>> Assembly.Load, which does not search. You can try using 
>> clr.AddReferenceToFile with the directory you get from the find method added 
>> to sys.path.
>>
>> slide
>>
>> On Tue, May 29, 2012 at 12:04 PM, Furqan Malik1E07 
>>  wrote:
>>> Hi Alex,
>>>
>>> Thanks for you reply.
>>> Actually my question is different.
>>> I am using clr or load the dll
>>> Import clr
>>> clr.AddReference("'Microsoft.VisualStudio.TestTools.UITesting")
>>> and there I am having error.
>>> : Unable to find assembly 'Microsoft.VisualStudio.Test= Tools.UITesting'.
>>>
>>> Clr.FindAssembly("'Microsoft.VisualStudio.TestTools.UITesting")
>>> It is returning correct path
>>>
>>> -Original Message-
>>> From: Alex Earl [mailto:[email protected]]
>>> Sent: May-29-12 2:39 PM
>>> To: Furqan Malik1E07; [email protected]
>>> Subject: RE: [Ironpython-users] Unable to load assembly 'Microsoft €
>>>
>>>
>>> =?utf-8?Q?=8B.VisualStu=E2=80=8Bdio.TestTo=E2=80=8Bols.UITest=E2=80=8
>>> B
>>> ing?=
>>>
>>>  =?utf-8?Q?'_in_Python?=
>>> MIME-Version: 1.0
>>> Content-Type: multipart/mixed; boundary="===1122901385=="
>>>
>>> --===1122901385==
>>> Content-Type: multipart/alternative;
>>>        
>>> boundary="_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_"
>>>
>>> --_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_
>>> Content-Type: text/plain; charset="utf-8"
>>> Content-Transfer-Encoding: quoted-printable
>>>
>>> Unless it's in the GAC you probably need to use the method that takes a 
>>> full path.
>>>
>>> Sent from my Windows Phone
>>> From: Furqan Malik1E07
>>> Sent: 5/29/2012 11:34 AM
>>> To: [email protected]
>>> Subject: [Ironpython-users] Unable to load assembly 
>>> 'Microsoft=E2=80=8B.Vis= ualStu dio.TestTo=E2=80=8Bols.UITest=E2=80=8Bing' 
>>> in Python I have automated my whole framework in Ironpython and it's 
>>> working pretty g= ood and stable.
>>>
>>> Recently, my company has implemented Drag and Drop functionality to 
>>> automat= e.
>>>
>>> I found one Dll( 'Microsoft.VisualStudio.TestTools.UITesting.dll') which 
>>> ha= s class mouse and that class has method called mouse.startdragging() 
>>> and mo= use.stopdragging().
>>>
>>> But unfortunately, I am unable to add the reference of this Dll. I am
>>> getti= ng following error
>>>
>>> " clr.AddReference("Microsoft.VisualStudio.TestTools.UITesting")
>>> System.IO.=
>>> FileNotFoundException: Unable to find assembly
>>> 'Microsoft.VisualStudio.Test= Tools.UITesting'. at
>>> Python.Runtime.CLRModule.AddReference(String name) in =
>>> C:\Users\Barton\Documents\Visual Studio
>>> 2008\Projects\PySharp\trunk\pythonn=
>>> et\src\runtime\moduleobject.cs:line 375 "
>>>
>

Re: [Ironpython-users] Unable to load assembly 'Microsoft�€

2012-05-29 Thread Slide
Wait, you are trying to use the clr module in normal CPython?

On Tue, May 29, 2012 at 1:42 PM, Furqan Malik1E07
 wrote:
> Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on 
> win32
>
> -Original Message-----
> From: Slide [mailto:[email protected]]
> Sent: May-29-12 4:37 PM
> To: Furqan Malik1E07
> Cc: [email protected]
> Subject: Re: [Ironpython-users] Unable to load assembly 'Microsoft�€
>
> Can you give the full version displayed when you run ipy.exe or ipy64.exe?
>
> slide
>
> On Tue, May 29, 2012 at 1:28 PM, Furqan Malik1E07 
>  wrote:
>> I am using Python 2.7
>> And that's what I get when I run dir(clr) ['AddReference',
>> 'FindAssembly', 'ListAssemblies', '__doc__', '__file__', '__name__',
>> 'getPreload', 'setPreload']
>>
>> -Original Message-
>> From: Slide [mailto:[email protected]]
>> Sent: May-29-12 4:09 PM
>> To: Furqan Malik1E07
>> Cc: [email protected]
>> Subject: Re: [Ironpython-users] Unable to load assembly 'Microsoft €
>>
>> What version of IP are you using? Also, what do you get if you do a
>> dir(clr) in the interactive console?
>>
>> slide
>>
>> On Tue, May 29, 2012 at 1:05 PM, Furqan Malik1E07 
>>  wrote:
>>> Thanks Slide,
>>>
>>> I am getting following error now,
>>>
>>> clr.AddReferenceToFile('MicrosoftVisualStudioTestToolsUITesting.dll')
>>> AttributeError: AddReferenceToFile
>>>
>>> -Original Message-
>>> From: Slide [mailto:[email protected]]
>>> Sent: May-29-12 3:21 PM
>>> To: Furqan Malik1E07
>>> Cc: [email protected]
>>> Subject: Re: [Ironpython-users] Unable to load assembly 'Microsoft €
>>>
>>> Yes, I understand, but AddReference is just basically a wrapper around 
>>> Assembly.Load, which does not search. You can try using 
>>> clr.AddReferenceToFile with the directory you get from the find method 
>>> added to sys.path.
>>>
>>> slide
>>>
>>> On Tue, May 29, 2012 at 12:04 PM, Furqan Malik1E07 
>>>  wrote:
>>>> Hi Alex,
>>>>
>>>> Thanks for you reply.
>>>> Actually my question is different.
>>>> I am using clr or load the dll
>>>> Import clr
>>>> clr.AddReference("'Microsoft.VisualStudio.TestTools.UITesting")
>>>> and there I am having error.
>>>> : Unable to find assembly 'Microsoft.VisualStudio.Test= Tools.UITesting'.
>>>>
>>>> Clr.FindAssembly("'Microsoft.VisualStudio.TestTools.UITesting")
>>>> It is returning correct path
>>>>
>>>> -Original Message-
>>>> From: Alex Earl [mailto:[email protected]]
>>>> Sent: May-29-12 2:39 PM
>>>> To: Furqan Malik1E07; [email protected]
>>>> Subject: RE: [Ironpython-users] Unable to load assembly 'Microsoft €
>>>>
>>>>
>>>> =?utf-8?Q?=8B.VisualStu=E2=80=8Bdio.TestTo=E2=80=8Bols.UITest=E2=80=
>>>> 8
>>>> B
>>>> ing?=
>>>>
>>>>  =?utf-8?Q?'_in_Python?=
>>>> MIME-Version: 1.0
>>>> Content-Type: multipart/mixed; boundary="===1122901385=="
>>>>
>>>> --===1122901385==
>>>> Content-Type: multipart/alternative;
>>>>        
>>>> boundary="_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_"
>>>>
>>>> --_000_54452F9818FBEE498D2A1EDA8425A68D0C5256F3B6TBXCH06SSVVbb_
>>>> Content-Type: text/plain; charset="utf-8"
>>>> Content-Transfer-Encoding: quoted-printable
>>>>
>>>> Unless it's in the GAC you probably need to use the method that takes a 
>>>> full path.
>>>>
>>>> Sent from my Windows Phone
>>>> From: Furqan Malik1E07
>>>> Sent: 5/29/2012 11:34 AM
>>>> To: [email protected]
>>>> Subject: [Ironpython-users] Unable to load assembly 
>>>> 'Microsoft=E2=80=8B.Vis= ualStu dio.TestTo=E2=80=8Bols.UITest=E2=80=8Bing' 
>>>> in Python I have automated my whole framework in Ironpython and it's 
>>>> working pretty g= ood and stable.
>>>>
>>>> Recently, my company has implemented Drag and Drop functionality to 
>>>> auto

  1   2   3   >