Re: [IronPython] clrtype: How to subclass ClrClass?

2010-03-12 Thread Shri Borde
\Microsoft.Scripting.Core\ Microsoft.Scripting.Core.csproj" (default targets) -- FAILED. From: Lukas Cenovsky [mailto:cenov...@bakalari.cz] Sent: Friday, March 12, 2010 7:47 AM To: Shri Borde Subject: Re: [IronPython] clrtype: How to subclass ClrClass? Unfortunately I am unable to build IronPython for Silverlig

Re: [IronPython] clrtype: How to subclass ClrClass?

2010-02-18 Thread Shri Borde
[mailto:cenov...@bakalari.cz] Sent: Thursday, February 18, 2010 5:29 AM To: Shri Borde Subject: Re: [IronPython] clrtype: How to subclass ClrClass? Hello Shri, have you had chance to look at this bug? -- -- Lukáš Shri Borde wrote: It is a know bug. I can take a look next week. -Original

Re: [IronPython] clrtype: How to subclass ClrClass?

2010-02-06 Thread Shri Borde
It is a know bug. I can take a look next week. -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Saturday, February 06, 2010 4:10 AM To: Discussion of IronPython Subject: Re: [IronPython] clrtype: How t

Re: [IronPython] Calling a System DLL In IronPython?

2010-01-25 Thread Shri Borde
] Calling a System DLL In IronPython? On 25/01/2010 21:23, Shri Borde wrote: > Its in Samples.zip on > http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=12482. > There have been a few bug fixes since that are not in Samples.zip, but it > does not affect pinvoke. &g

Re: [IronPython] Calling a System DLL In IronPython?

2010-01-25 Thread Shri Borde
Its in Samples.zip on http://ironpython.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=12482. There have been a few bug fixes since that are not in Samples.zip, but it does not affect pinvoke. -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.

Re: [IronPython] .NET attributes for methods

2009-11-13 Thread Shri Borde
un it I don't see any items in the listbox. When I check the name, it is a property: py> a.root.listbox1.Items[0] => py> a.root.listbox1.Items[0].GetType().GetProperties() => Array[PropertyInfo](()) Whe I used the old clrtype with _clrproperties = {'name': str, ...

Re: [IronPython] .NET attributes for methods

2009-11-12 Thread Shri Borde
.html use any feature not available in Silverlight? From: Lukas Cenovsky [mailto:cenov...@bakalari.cz] Sent: Thursday, November 12, 2009 8:09 AM To: Shri Borde Subject: Re: [IronPython] .NET attributes for methods Thanks, that works! What do you think would be the best approach to create notif

Re: [IronPython] .NET attributes for methods

2009-11-10 Thread Shri Borde
.skydrive.live.com/self.aspx/DevHawk%20Content/IronPython%20Stuff/%5E_%5E_clrtype%5E_%5E_/SL%20databinding%20demo.zip> Shri Borde wrote: The following files extend DevHawk's blog and adds support for typed methods with attributes. It will be available as part of the samples released with t

Re: [IronPython] Safe execution of python scripts on my .net application

2009-11-04 Thread Shri Borde
ing.Hosting.ScriptRuntimeSetup,Microsoft.Scripting. Any ideas? 2009/11/3 Nicolás Buttarelli mailto:nbuttare...@gmail.com>> Thanks Shri, I will try. In addition, I found this open issue: http://dlr.codeplex.com/WorkItem/View.aspx?WorkItemId=2816. I think that it is related. On

Re: [IronPython] Safe execution of python scripts on my .net application

2009-11-03 Thread Shri Borde
I think this happens if the new appdomain cannot load the required assembly. By default, the new appdomain should inherit its BaseDirectory property from the creating domain and should be able to load Microsoft.Scripting.dll. Is your exe and all the dlls in the same folder? If not, can you try t

Re: [IronPython] .NET attributes for methods

2009-11-02 Thread Shri Borde
ter adding such support to clrtype) and building a .dll from the interface class, this class can be used from c#? -- -- Lukáš Shri Borde wrote: The clrtype module could be extended to make it possible to declare CLR interfaces in Python code. Something like: class IFoo(object):

Re: [IronPython] .NET attributes for methods

2009-10-30 Thread Shri Borde
/07/simulate-users-input.html> :-) -- -- Lukáš Shri Borde wrote: The following files extend DevHawk's blog and adds support for typed methods with attributes. It will be available as part of the samples released with the 2.6 RTM (over the next month). Do let us know if it works for you.

Re: [IronPython] .NET attributes for methods

2009-10-25 Thread Shri Borde
The following files extend DevHawk's blog and adds support for typed methods with attributes. It will be available as part of the samples released with the 2.6 RTM (over the next month). Do let us know if it works for you. Also, I would be curious to know what scenario you need method attribute

Re: [IronPython] Overriding .NET methods within IronPython

2009-10-23 Thread Shri Borde
See the section on "Overriding methods" in http://ironpython.codeplex.com/SourceControl/changeset/view/60398#1011839 (IronPython_Main\Doc\dotnet-integration.rst) for more details on overriding, like dealing with ref params. We are working on making the info easily accessible, but for now, you c

Re: [IronPython] Reflection.Emit from IronPython: What is the equivalent of typeof() in C# ?

2009-08-06 Thread Shri Borde
You can also just use the type like "System.String" to avoid having to create an instance of the type. >>> import System >>> import clr >>> clr.GetClrType(System.String) -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of

Re: [IronPython] Ironpython & COM vs Jscript.Net & COM

2009-06-18 Thread Shri Borde
IronPython 2.0 supports dynamic COM servers. See http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Michel Claveau Sent: Wednesd

[IronPython] Response may be slow from the IronPython team...

2009-06-04 Thread Shri Borde
Dino is OOF through Monday, and a few others are attending some talks. -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Thursday, June 04, 2009 12:30 PM To: Discussion of IronPython Subject: Re: [IronP

Re: [IronPython] Urgent : Unable to open MS Word file from Python

2009-06-03 Thread Shri Borde
Try using this workaround. import clr r = clr.Reference[str]() r.Value = source_filename word_application.Documents.Open(r) You should not have to do this with IPy 2.6, and probably even with 2.0. Using a str directly works for me. What version of IronPython are you using? I think the workaroun

Re: [IronPython] can anyone help me with COM access in ironpython?

2009-05-15 Thread Shri Borde
Have you tried "import System" followed by System.Activator.CreateInstance(System.Type.GetTypeFromProgID("QBXMLRP2.RequestProcessor")? This should more closely resemble the behavior of the pywin32 code of win32com.client.Dispatch("QBXMLRP2.RequestProcessor"). See http://blogs.msdn.com/shrib/arc

Re: [IronPython] IronPython in Action Out!

2009-04-10 Thread Shri Borde
Congratulations! This is very exciting! -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of Michael Foord Sent: Friday, April 10, 2009 11:17 AM To: Discussion of IronPython Subject: [IronPython] IronPython in Action Out! He

Re: [IronPython] Logging module

2009-02-17 Thread Shri Borde
Foord Sent: Tuesday, February 17, 2009 10:07 AM To: Discussion of IronPython Subject: Re: [IronPython] Logging module Shri Borde wrote: > The proposal is to catch the ValueError exception using a try-except in the > log function. Raising a ValueError is not going to be good for perf as > ex

Re: [IronPython] Logging module

2009-02-17 Thread Shri Borde
The proposal is to catch the ValueError exception using a try-except in the log function. Raising a ValueError is not going to be good for perf as exception handling on the CLR is relatively slow and meant for really exceptional circumstances. Ideally, the results of the first call will be cache

Re: [IronPython] py to ip

2009-02-04 Thread Shri Borde
Sent: Wednesday, February 04, 2009 12:49 AM To: Discussion of IronPython Subject: Re: [IronPython] py to ip Shri Borde ha scritto: > See > http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx > for the details. > > Thank you Shri, i've don

Re: [IronPython] py to ip

2009-02-03 Thread Shri Borde
See http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx for the details. >>> import System >>> t = System.Type.GetTypeFromProgID("Excel.Application") >>> excel = System.Activator.CreateInstance(t) >>> wb = excel.Workbooks.Add() -Original Message---

[IronPython] Welcome David DiCato

2008-12-05 Thread Shri Borde
Please welcome David DiCato to the IronPython team. He has his first shelveset in the Snap queue (queue.__init__ calls clear) already. You should hopefully hear more from him in the mailing list. Here is his intro in his own words. Hi everyone, I'm David DiCato, the new Dev on the IronPython tea

Re: [IronPython] Re strict imports

2008-09-02 Thread Shri Borde
The CLR doesn't dump out full exception information on SecurityExceptions in partial trust - you can get a lot more information if you look at the exception in a debugger, or if you Assert for FullTrust before doing a ToString on the permission. Once you do that, you should be able to get more

Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Shri Borde
| BindingFlags.IgnoreReturn t = clr.GetClrType(type(p)) from System import Array, Byte a = Array[Byte](map(lambda c: ord(c),elem)) t.InvokeMember("AppendChunk", bindingFlags, None, p, Array[object]([a]) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Shri Borde
System.Scripting.Com.VarEnumSelector.GetManagedMarshalType does not deal with VT_ARRAY. Curt, I believe we need to add code to handle this. Vernon, could you open a CodePlex bug please? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher Sen

Re: [IronPython] What is .AppendChunk expecting?

2008-08-27 Thread Shri Borde
I think you are going to need Curt's solution #2 and explicitly create a "byte array". Let us know if that works. If it does, we could also consider adding to IronPython.Runtime.PythonBuffer (the class which implements buffer) an implicit

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

2008-08-27 Thread Shri Borde
Using clr.Reference[int] should work if ra is an in-out (VT_BYREF) parameter. Note that not many OleAut APIs use VT_BYREF. Jscript does not support in-out parameters and the API would not be usable form Jscript. We do have the option of returning a tuple with the recordset and the number of rec

Re: [IronPython] How do I determine whether a database supports transactions?

2008-08-21 Thread Shri Borde
IPy does intend to support COM well. See http://blogs.msdn.com/shrib/archive/2008/07/30/idispatch-support-on-in-ironpython-beta-4.aspx. If something does not work, please do report a bug. The following worked for me. So using the natural indexing syntax is what you need. c:\vsl\Merlin\Main>ipy

Re: [IronPython] [OT] x64 vs x86 (was: RE: Informal Poll: measuring IronPython performance under x64 OSes)

2008-08-20 Thread Shri Borde
For throughput performance, the Just-in-time compilers used by the CLR on x86 and x64 are different code bases, and so have different perf characteristics So in this case, yes, the x64 compiler is not as mature for this environment (JIT compilation). It something that can change going forward. I

Re: [IronPython] Patched, profiling IronPython executable?

2008-08-15 Thread Shri Borde
Have you tried using the VS profiler on a precompiled dll? I don't know how well it works, but VS profiler needs IL on disk, and with precompilation, you have that. There is still IL generated on the fly for rules, but you might be able to get some reasonable numbers. Thanks, Shri -Origin

Re: [IronPython] Horrible performance regression of exec on IP2

2008-08-11 Thread Shri Borde
Done Thanks, Shri -Original Message- From: Dino Viehland Sent: Monday, August 11, 2008 1:54 PM To: Shri Borde Subject: RE: [IronPython] Horrible performance regression of exec on IP2 Sounds like a good plan - do you want to add those comments to the bug? :) -Original Message

[IronPython] CLS compilation

2008-07-23 Thread Shri Borde
I am changing the subject to better reflect the discussion. I have posted a blog at http://blogs.msdn.com/shrib/archive/2008/07/24/cls-compilation-of-ironpython.aspx discussing some issues I see. Keith, as far as exposing IronPython types as System.Type, its not just a question of inheriting f

Re: [IronPython] IronPython 1.1.2 eta?

2008-07-02 Thread Shri Borde
> Not being able to build with VS 2005 will be a pain as installing VS > 2008 breaks our build environment (last time we tried anyway). I can probably > build it > at home though. :-) I don't think you actually need VS2008. If you have .NET 3.5 on the machine, it will have the same version of ms

Re: [IronPython] Viewlets: Any F# experts here?

2008-06-26 Thread Shri Borde
Subject: Re: [IronPython] Viewlets: Any F# experts here? Shri Borde wrote: > Michael, what is the CLR stack trace (-X:ShowClrExceptions)? > Not much more useful I'm afraid. C:\compile\VSLab>C:\compile\IronPython-2.0B3\ipy.exe -X:ShowClrExceptions viewle t.py Traceback (most re

Re: [IronPython] Viewlets: Any F# experts here?

2008-06-26 Thread Shri Borde
Michael, what is the CLR stack trace (-X:ShowClrExceptions)? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jimmy Schementi Sent: Thursday, June 26, 2008 3:04 PM To: Discussion of IronPython Cc: Luke Hoban Subject: Re: [IronPython] Viewlets: Any F# expert

Re: [IronPython] The slow part of IronPython

2008-06-26 Thread Shri Borde
Dan, you could try turning on interpretation for all of your scripts. It might hurt your throughput (depending on how compute-intensive your script is), but it would be an interesting exercise to see how much it helps startup. The way to do this on the desktop is to use "ipy.exe -X:Interpret".

Re: [IronPython] DLR documentation

2008-06-24 Thread Shri Borde
Take a look at http://blogs.msdn.com/ironpython/archive/2008/03/16/dlr-resources.aspx as well for a list of useful links. Thanks, Shri From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Curt Hagenlocher Sent: Tuesday, June 24, 2008 7:31 AM To: Discussion of IronPython Subject: Re: [

[IronPython] Welcome Curt to the IronPython team

2008-05-07 Thread Shri Borde
That was subtle indeed. So to fix that, I am pleased to welcome Curt to the IronPython team. Curt has been active in both the IronPython and IronRuby mailing lists, and we are excited to have him officially be working on these projects. Curt already has a fix in socket support which he should b

Re: [IronPython] PreferComDispatch - Odd Behaviour

2008-04-14 Thread Shri Borde
We infer that the object implements IWshShell3 which declared the CurrentDirectory property. From the TLB info, we know about CurrentDirectory right away. However, SpecialFolders is declared on the base interface IWhsShell. Looks like we just need to walk up the class hierarchy. We currently do

Re: [IronPython] COM Late Binding in IronPython

2008-04-10 Thread Shri Borde
I am not sure what the exact question is. However, I have posted the following at http://blogs.msdn.com/shrib/archive/2008/04/10/ole-automation-idispatch-support-in-ironpython.aspx to help understand what -X:PreferComDispatch does. OLE automation (IDispatch) support in IronPython IronPython 1.X

Re: [IronPython] UI Automation and ControlTypeProperty

2008-03-24 Thread Shri Borde
To: users@lists.ironpython.com Subject: Re: [IronPython] UI Automation and ControlTypeProperty On Mar 24, 7:14 am, Shri Borde <[EMAIL PROTECTED]> wrote: > UI Automation did have a problem with IronPython. > Seehttp://blogs.msdn.com/shrib/archive/2008/03/24/ironpython-cannot-call

Re: [IronPython] UI Automation and ControlTypeProperty

2008-03-23 Thread Shri Borde
UI Automation did have a problem with IronPython. See http://blogs.msdn.com/shrib/archive/2008/03/24/ironpython-cannot-call-automationelement-fromhandle.aspx. I am not sure if the issue has been fixed yet by the UI Automation team. Or if you are running into that same issue or something else. T

[IronPython] DLR resources

2008-03-16 Thread Shri Borde
I have started compiling a list of DLR resources in this blog - http://blogs.msdn.com/ironpython/archive/2008/03/16/dlr-resources.aspx. I will try and keep it updated so that folks have one place to start when hunting for DLR information. If you have other links that I should add, send them my w

Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch

2007-12-22 Thread Shri Borde
Hi, Could you include the following information please: 1. Is this with the modified registry or without? 2. Can you show the complete output with -X:ExceptionDetail? 3. If you do "dir(e)" before doing "e.Visible = True", does that change the behavior? 4. What happens if you do *not* use -X:P

[IronPython] Half the team OOF this week

2007-11-19 Thread Shri Borde
Btw, half of our team is out this week for the Thanksgiving weekend. Dino is OOF starting Tuesday. So you may not get a prompt response this week. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dino Viehland Sent: Monday, November 19, 2007 4:16 PM To: Di

Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch

2007-11-16 Thread Shri Borde
Misha said - "I should add that having the registry keys alone would only help if Excel PIAs are in the GAC as well (when installing Excel - you would choose .NET Interoperability support)." You probably do not have the PIAs installed. The problem is just a matter of initialiazation order. The I

Re: [IronPython] AttributeError: '__ComObject' object has no attribute 'Visible' with -X:PreferComDispatch

2007-11-15 Thread Shri Borde
The behavior currently depends on whether or not the RCW gets strongly-typed when it enters the managed world. As a workaround, the following registry script Misha provided could "fix" your machine by registering the PIA: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\CLSID\{00024500-0

Re: [IronPython] i thought this is odd: using Interop on Microsoft Word

2007-11-02 Thread Shri Borde
This could be fixed in IronPython but currently its expected. docs[1] is calling into this indexer in Microsoft.Office.Interop.Word.dll. The indexer method takes the index by-reference. Ie as "object&" instead of just "object". .method instance class Microsoft.Office.Interop.Word.Document

Re: [IronPython] Good example of with statement usage in IronPython/COM

2007-10-27 Thread Shri Borde
statement usage in IronPython/COM 2007/10/28, Shri Borde <[EMAIL PROTECTED]>: > There was a leak in IronPython where we were keeping COM objects alive once > the IPy code manipulated the COM object. The code in the blog seems to be > dealing with this bug with the use of th

Re: [IronPython] Good example of with statement usage in IronPython/COM

2007-10-27 Thread Shri Borde
There was a leak in IronPython where we were keeping COM objects alive once the IPy code manipulated the COM object. The code in the blog seems to be dealing with this bug with the use of the auto method which calls Marshal.ReleaseComObject in the finally. The bug is fixed in the 2.0 tree and s

[IronPython] Hosting APIs walkthrough document

2007-09-28 Thread Shri Borde
http://compilerlab.members.winisp.net/hosting-tour.doc has a good walk through of the hosting APIs in IPy 2.0. It may be a little out of sync with the current sources, but its still a very good source of information. There have been questions on using the hosting APIs, and this should help with

Re: [IronPython] Multiple engine instances in IP 2.0 and beyond (was IronPython 2.0 Alpha 1 Released)

2007-06-05 Thread Shri Borde
PROTECTED] On Behalf Of Fuzzyman Sent: Tuesday, June 05, 2007 2:30 AM To: Discussion of IronPython Subject: Re: [IronPython] Multiple engine instances in IP 2.0 and beyond (was IronPython 2.0 Alpha 1 Released) Shri Borde said: >>Have you looked at moving to 2.0? Dino had mentioned a workarou

Re: [IronPython] Multiple engine instances in IP 2.0 and beyond (was IronPython 2.0 Alpha 1 Released)

2007-06-05 Thread Shri Borde
IronPython Subject: Re: [IronPython] Multiple engine instances in IP 2.0 and beyond (was IronPython 2.0 Alpha 1 Released) Shri Borde wrote: >Michael, how does multiple engines help you when several pieces of user-code >are running concurrently? It seems that if you are willing to live wit

Re: [IronPython] Multiple engine instances in IP 2.0 and beyond (was IronPython 2.0 Alpha 1 Released)

2007-06-04 Thread Shri Borde
easier by formalizing this design pattern, but you may be able to achieve your required semantics of only redirecting stdout without that. We have not finalized on the single engine story yet, but we are leaning towards it at the moment. Shri Borde said: > Have you looked at moving to 2.0? Dino

Re: [IronPython] Backporting of bugs to 1.1

2007-06-04 Thread Shri Borde
bugs to 1.1 Shri Borde wrote: > We are focusing most of our efforts on the 2.0 branch and the DLR. We are not > automatically backporting bug fixes to 1.1. We will consider doing that for > specific bugs based on priority and how much it affects customers. However, > given our limi

[IronPython] Dino is OOF for a couple of weeks

2007-06-04 Thread Shri Borde
Until June 15th. The rest of the team will to answer as many questions as possible, but FYI, in case you wonder why there are no responses from Dino. ___ users mailing list users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpyt

[IronPython] Backporting of bugs to 1.1

2007-06-04 Thread Shri Borde
We are focusing most of our efforts on the 2.0 branch and the DLR. We are not automatically backporting bug fixes to 1.1. We will consider doing that for specific bugs based on priority and how much it affects customers. However, given our limited resources and wanting to keep 1.1 as stable as p

Re: [IronPython] Using CLR bound COM interfaces

2007-02-26 Thread Shri Borde
Using isinstance should be the right way to check if an object is an interface. However, this does not currently work. http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=8121 tracks this issue. The (admittedly ugly) workaround that is also mentioned in the bug is: >>>

Re: [IronPython] Calling Methods from other Methods

2006-12-22 Thread Shri Borde
This is quite non-intuitive, but it is by-design. It is happening because of using a locals dictionary which is different than the globals dictionary. Note that top-level code in a .py file executes with the same locals and globals dictionary. The following Python snippet shows that a similar i

Re: [IronPython] embedded debugging

2006-11-30 Thread Shri Borde
2539 tracks this issue. From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Ivan Chelubeev [EMAIL PROTECTED] Sent: Monday, November 27, 2006 8:19 AM To: Discussion of IronPython Subject: Re: [IronPython] embedded debugging Shri Borde wrote: > I belie

Re: [IronPython] embedded debugging

2006-11-11 Thread Shri Borde
I believe your breakpoint is in top-level global code of the module. In that case, this is a known limitation.   VisualStudio will display local variables of functions defined in IronPython. However, if you are executing top-level global code, the Python global variables are implemented

[IronPython] New - PythonEngine documentation

2006-09-08 Thread Shri Borde
In case you hadn’t noticed, there is a new IronPythonApiReference.chm in the Doc folder in the zip 1.0 RTM zip files, both bin and src. This should help answer many of the questions which come up about the specifics of the hosting APIs.   Thanks, Shri   PS: I thought I had sent this em

Re: [IronPython] if __name__ == '__main__' broken in RC2?

2006-08-30 Thread Shri Borde
hink I get the how, but I don't understand the why.  If I execute a python file using PythonEngine.Execute(), why doesn't it just do the right thing?  Why do I have to instruct the embedded engine to behave like the CPython implementation.  Why doesn't it just do it? Shri Borde wrot

Re: [IronPython] if __name__ == '__main__' broken in RC2?

2006-08-30 Thread Shri Borde
pythonEngine.Execute(“print __name__”) is exactly the same as doing pythonEngine.Execute(“print __name__”, pythonEngine.DefaultModule). The issue is that the name of pythonEngine.DefaultModule is not “__main__”. Also, it is not published in sys.modules since its upto the host to determine w

Re: [IronPython] Debugging support PythonEngine

2006-08-19 Thread Shri Borde
om: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shri Borde Sent: Thursday 17 August 2006 23:49 To: Discussion of IronPython Subject: Re: [IronPython] Debugging support PythonEngine   The first issue is probably the same that IL offset 0 does not have any debug information.   Calling th

Re: [IronPython] Debugging support PythonEngine

2006-08-19 Thread Shri Borde
t loud that e.g. the code running when using the console seems to be different than what is obtained using the IronPython.Compiler, etc. How concerned should we be when we learn that the code paths are very different? At 05:49 PM 8/17/2006, Shri Borde wrote >The first issue is probably the sam

Re: [IronPython] Debugging support PythonEngine

2006-08-17 Thread Shri Borde
d. Setting a breakpoint in the Python function stops the execution at that point in both cases.     From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shri Borde Sent: Thursday 17 August 2006 20:25 To: Discussion of IronPython Subject: Re: [IronPython] Debugging support PythonEng

Re: [IronPython] Debugging support PythonEngine

2006-08-17 Thread Shri Borde
o know if it’s possible to make the debugger skip these lines. Maybe this is why you need the changes to the platform? From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shri Borde Sent: Friday 11 August 2006 21:04 To: Discussion of IronPython Subject: Re: [IronPython] Debugging suppor

Re: [IronPython] Debugging support PythonEngine

2006-08-16 Thread Shri Borde
PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shri Borde Sent: Friday 11 August 2006 21:04 To: Discussion of IronPython Subject: Re: [IronPython] Debugging support PythonEngine   Yes, we will definitely be working on improving the debugging support as it is a critical part of the developme

Re: [IronPython] expose some namespaces of own application

2006-08-16 Thread Shri Borde
Could you use mark the types as internal and public depending on whether you wanted to prevent or allow access from IronPython? IronPython code will not be able to access types or methods marked as internal in your C# code. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTEC

Re: [IronPython] Debugging support PythonEngine

2006-08-11 Thread Shri Borde
or me. I’m not going to be using global variables frequently, but mostly functions loaded in the PythonEngine that are called from C#.   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Shri Borde Sent: Friday 11 August 2006 0:30 To: Discussion of IronPython Cc: Glenn Hackney S

Re: [IronPython] Embedding Question

2006-08-10 Thread Shri Borde
Another alternative is: ClrModule clr = (ClrModule)engine.Import("clr"); clr.AddReference(typeof(SomeAutoCadType).Assembly); This is similar to doing "engine.LoadAssembly(typeof(SomeAutoCadType).Assembly)", but is more robust since it also updates "clr.References". PythonEngine.LoadAssembly sho

Re: [IronPython] PythonEngine.RunFile

2006-08-10 Thread Shri Borde
__name___ == "__main__": is a convention enforced by ipy.exe. The PythonEngine itself does not directly support this concept. However, you can achieve that result (just like ipy.exe does) by using code like this:   PythonEngine engine = new PythonEngine(); EngineModule module = engine.Cr

Re: [IronPython] Debugging support PythonEngine

2006-08-10 Thread Shri Borde
If EngineOptions.ClrDebuggingEnabled is set, we use AssemblyBuilder, TypeBuilder, etc for PythonEngine.Executed. The code generated by AssemblyBuilder, TypeBuilder, etc supports PDB debug information tracking for the methods, and so you will be able to set breakpoints in the code. However,

Re: [IronPython] PythonEngine.Import()

2006-08-02 Thread Shri Borde
These are good suggstions. I have opened this bug (http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=1547) for it.   Since we locking down for V1, we are unlikely to fix this for V1. Please let us know if it is a critical issue for you.   Do you w

Re: [IronPython] SetGlobal and GetGlobal in IPbeta 9

2006-07-12 Thread Shri Borde
Hi Joe, The model for the hostig APIs is that a module (represented by EngineModule) is basically an IDictionary, just like in Python (for the most part). The user can create a IDictionary if she wants a customized implementation of a dictionary. This will allow the user to override reads and

Re: [IronPython] Constructor overloading

2006-07-05 Thread Shri Borde
I have opened http://www.codeplex.com/WorkItem/View.aspx?ProjectName=IronPython&WorkItemId=794 to track this. Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -Original Message-

Re: [IronPython] __main__ module and global variables issue...

2006-07-03 Thread Shri Borde
There should be nothing special about the default scope, other than the fact that all the PythonEngine APIs like Evaluate, Execute have an overload that implicitly operate on the default scope. The DefaultScope is created just like any other scope. Is it possible that you are executing some cod

Re: [IronPython] IP v8 Hosting question...

2006-06-28 Thread Shri Borde
engine.Sys.modules.Remove(SymbolTable.StringToId(myModuleName)); ? > -Original Message- > From: [EMAIL PROTECTED] [mailto:users- > [EMAIL PROTECTED] On Behalf Of Shri Borde > Sent: Wednesday, 28 June 2006 3:05 p.m. > To: Discussion of IronPython > Subject: Re: [IronPython] I

Re: [IronPython] IP v8 Hosting question...

2006-06-27 Thread Shri Borde
> -Original Message- > From: [EMAIL PROTECTED] [mailto:users- > [EMAIL PROTECTED] On Behalf Of Shri Borde > Sent: Wednesday, 28 June 2006 9:55 a.m. > To: Discussion of IronPython > Subject: Re: [IronPython] IP v8 Hosting question... > > We will are taking a look at

Re: [IronPython] Python console control for WPF

2006-06-27 Thread Shri Borde
Hi Kristof,   You can call a Python method as such.   public delegate int IntIntDelegate(int arg); engine.Execute("def IntIntMethod(a): return a * 100"); IntIntDelegate d = engine.Evaluate("IntIntMethod");   Console.WriteLine(d(2)); // This prints “200”     I have

Re: [IronPython] IP v8 Hosting question...

2006-06-27 Thread Shri Borde
We will are taking a look at the API and will be changing it a bit. The current way of doing this as follows: PythonEngine engine = new PythonEngine(); SymbolId id = SymbolTable.StringToId("Message"); ModuleScope scope1 = new ModuleScope("Junk1"); scope1.SetGlobal(id, "hello"); ModuleScope sco

Re: [IronPython] OnVarChanged() - Repost

2006-06-21 Thread Shri Borde
> -Original Message----- > From: [EMAIL PROTECTED] [mailto:users- > [EMAIL PROTECTED] On Behalf Of Shri Borde > Sent: Wednesday, June 21, 2006 2:00 PM > To: Discussion of IronPython > Subject: Re: [IronPython] OnVarChanged > > You should be able to declare a type that inher

Re: [IronPython] OnVarChanged

2006-06-21 Thread Shri Borde
You should be able to declare a type that inherits from ModuleScope, and override ModuleScope.Get/SetGlobal. That should be the hook you need. Then you can use engine.Execute("a=1", myCustomModuleScope). Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers

Re: [IronPython] IronPython Live on CodePlex! - Migration of previously reported bugs

2006-06-10 Thread Shri Borde
We will be working on the migration over the next couple of weeks. You need not bother opening workitems on CodePlex for previously reported issues as we had already captured all reported issues, and these will eventually make their way to CodePlex automatically. But do open new bugs directly

Re: [IronPython] IronPython and LINQ

2006-05-11 Thread Shri Borde
Hi Kevin, IronPython 1.0 will not support LINQ. We have started to look at it, but will seriously look at it after the summer. It is a meaty issue given that many of the concepts in LINQ are based on static typing. Here is the LINQ information for those who haven't seen it yet - http://msdn.mi

Re: [IronPython] pasting into interactive console causes double-indentation

2006-03-15 Thread Shri Borde
IronPython supports IRONPYTHONSTARTUP. "ironpythonconsole.exe -?" lists all the supported environment variables. A new option sounds like the best approach for auto-indentation so everyone gets just what they ask for. I shall take a look at this for the next beta. Do you want to help develop Dy

Re: [IronPython] pasting into interactive console cause double-indentation

2006-03-13 Thread Shri Borde
“IronPythonConsole.exe -X:TabCompletion” supports auto-indentation so that you do not have to type the indentation for multi-line statements. This works nicely for interactive manual typing. However, if you paste text blocks (which will already have indentation in them), it will lead to dou