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

2007-06-05 Thread Eric Larson
I would suppose getting these libs to work would also make httplib2
work as well. httplib2 is a *great* library that does an excellent job
with caching, etags and authentication, all of which are huge
regarding RESTful services (ie Atom Publishing Protocol).

I only mention it in hopes of fueling the fire to get these things working :)

Thanks!

Eric Larson

On 6/5/07, Fuzzyman [EMAIL PROTECTED] wrote:
 Hello all,

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

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

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

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


 Many Thanks


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

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


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

2007-06-05 Thread Eric Larson
On 6/5/07, Sanghyeon Seo [EMAIL PROTECTED] wrote:
 2007/6/6, Eric Larson [EMAIL PROTECTED]:
  I would suppose getting these libs to work would also make httplib2
  work as well. httplib2 is a *great* library that does an excellent job
  with caching, etags and authentication, all of which are huge
  regarding RESTful services (ie Atom Publishing Protocol).
 
  I only mention it in hopes of fueling the fire to get these things working 
  :)

 I must mention that httplib2 already works with IPCE. Actually I
 submitted a patch for that in December 2006!

 See
 http://sourceforge.net/mailarchive/forum.php?thread_name=5b0248170612180038x2eb2d8c9t3a655e0d5eff1060%40mail.gmail.comforum_name=httplib2-discuss


Of course they work with IPCE! It would just be nice if they could
work out of the box :)

Eric

**FWIW, I do use IPCE and it rocks!
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


[IronPython] __getattr__ overflow

2006-09-18 Thread Eric Larson
Hi, I was trying to wrap a rather verbose library to something more concise. Essentially, I have a module with a bunch of static functions and I wanted to create an object that automatically adds a prefix to the function calls. For example:
my_wrapper.CallFunction(*args)Would be like:myapi.F_ApiPrefixCallFunction(*args)In CPython I could do something like this:class wrap(myapi): def __getattr__(self, method):
 prefix_method = F_ApiPrefix + method return self.prefix_methodc = wrap()c.CallFunction() This returns the right thing.In IronPython it gives a buffer overflow. I have posted the following code I used to test this out.
 class C:... def __getattr__(self, var):... pre_name = say_ + str(var)... return self.pre_name... def hello(self, name):... print Hello %s! % name
... c = C() c.hello('eric')Hello eric!Sorry if this has already been posted/reported. I took a quick glance at the codeplex database, but I didn't know if it was the same issue reported for other __getattr__ bugs. 
Thanks!Eric
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


Re: [IronPython] A SourceForge project?

2006-09-18 Thread Eric Larson
+1 for sourceforge. On 9/15/06, David Fraser [EMAIL PROTECTED] wrote:
Sanghyeon Seo wrote: I am thinking about creating a SourceForge project, to host files under http://sparcs.kaist.ac.kr/~tinuviel/fepy/ directory.
 So that you can keep up-to-date just by doing svn update. So that I can release IPCE zip to mirrors with beefy bandwidths, not to a feeble webserver of my former university's computer society. Maybe one of you
 can join me and I can give you a write access. What do you think? Do you have a hosting recommendation over SourceForge? (CodePlex is no-no for me, I don't have TFS client.)I'm up for a sourceforge project - lots of open source developers (like
me :-) ) have accounts there, svn is good and they have good downloadmirrors although the upload mechanism is a pain :-) - and you can set upa web site for it.I'm davidfraser on sourceforge if you want to add me as a developer :-)
Would be nice if the IronPython source repository could somehow bemirrored into subversion... any projects that do that from Team Foundation?CheersDavid___
users mailing listusers@lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com

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


Re: [IronPython] Trying (unsuccessfully) to subclass Gtk.Widget class

2006-09-18 Thread Eric Larson
I think you might have to set your module your of your PythonEngine to __main__. For example:PythonEngine myPyEngine = new PythonEngine(someEngineOptions);EngineModule mainModule = myPyEngine.CreateModule
(__main__, someVariables, true);myPyEngine.ExecuteFile(someScriptFile, mainModule);There are some extra there such as the someVariables but hopefully that might get you going in the right direction.
HTHEricOn 9/15/06, Michael Welch [EMAIL PROTECTED] wrote:
Hello,I'm running IPython 1.0 on mono on Linux. I'm importing the gtk-sharpdll and I want to subclass the Gtk.Widget class(
http://www.go-mono.com/docs/[EMAIL PROTECTED]).Here is my script:clr.AddReference(gtk-sharp)clr.AddReference(gnome-sharp)from Gtk import *
from Gnome import *Application.Init()class Table: passclass Sheet(Widget): def __init__(self, table): Widget.__init__(self)Here is my ipy session where I try to use SheetIronPython 
1.0.2432 on .NET 2.0.50727.42Copyright (c) Microsoft Corporation. All rights reserved. import sheet from sheet import * t = Table() s = Sheet(t)Traceback (most recent call last):
TypeError: no overloads of Sheet could match (type, Table)Sheet(type, IntPtr)Sheet(type, GType)It tells me it can't find an appropriate overload for Sheet and thengives me what looks like the only two possible candidates. However,
the candidates it lists looks like they are from the parent classWidget. Does IronPython hava a constraint that the __init__ methodmust take the same parameters as the parent class? Here is the list ofconstructors for Widget:
http://www.go-mono.com/docs/[EMAIL PROTECTED]If I remove the parameter from __init__ it works. I've tested this
scenario with made up classes and it works. CPython documentationseems to indicate that a child class can have different parameters onits __init__method then the parent class. Any help? Is there somethingwrong with the gt-sharp library (I don't think so, as I could write a
C# app that did this same thing and it worked).I'm convinced this must be user-error and I'm just not seeing the problemThanks,Michael___users mailing list
users@lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com

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


Re: [IronPython] Implementing WSGI server as ASP.NET handler

2006-03-30 Thread Eric Larson
That is rad. :)On 3/30/06, Sanghyeon Seo [EMAIL PROTECTED] wrote:
Hello, I got a proof-of-concept WSGI server as ASP.NET handlerworking, using IronPython.My development environment is Debian GNU/Linux with latest Mono andXSP, and IronPython 1.0
 Beta 4 with patches.All the relevant codes are here. I will write a nice HOWTO when I gotsome more time.http://sparcs.kaist.ac.kr/~tinuviel/fepy/
Extract IronPython release and copy CPython's Lib directory over. Thendownload wsgi.py from lib directory to Lib directory.Create a directory (this will be ASP.NET application root directory).
Download web.config and wsgi_hello.py from example directory.Create bin directory inside the application root directory. Makesymbolic links to IronMath.dll, IronPython.dll, and copied-over Lib
directory there. Then download WSGI.cs and its Makefile from srcdirectory, and build WSGI.dll.Now just run xsp2 (xsp is for .NET 1.x, and won't work withIronPython) from the application root directory. You should see
something like:xsp2Listening on port: 8080 (non-secure)Listening on address: 0.0.0.0Root directory: /home/tinuviel/devel/fepy/wsgiHit Return to stop the server.
Do not hit return.Open http://localhost:8080/wsgi_hello.py in your web browser and get greeted.Seo Sanghyeon___
users mailing listusers@lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com

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


Re: [IronPython] .NET Attributes

2006-03-27 Thread Eric Larson
On the topic of decorators and integrating with .NET, it seems that in order to keep IronPython as close to CPython, it would be a good idea to consider adding .NET specific pieces as a library instead of an addition to the language. That way people could write python code that works in IronPython and CPython equally well without changing radically how the code is written. For example, if I wanted to make a class serializable, it seems logical to inherit from some serializable base class. 
from clr.netisms import IPSerializableclass MyClass(IPSerializable):This may be an obvious solution, but it seems to make more sense to add IronPython specific libraries to help integrate with .NET than to pollute the language. I mention this because one of the great things about Python is the batteries included mentality. There are many great libraries that would be excellent to run using IronPython (ZODB for example) that may conflict if the language gets massaged to fit into .NET perfectly. Often times writing to the lowest common denominator can be bad (SQL portability for example), but I believe in the case of Python, whatever can be done to work with the massive amount of libraries will be the most beneficial.
I apologize if this is already addressed. I am thinking about issues such as these from a python programmer's perspective.Great work!EricOn 3/27/06, 
Dino Viehland [EMAIL PROTECTED] wrote:
This is a tough problem...There are two issues here.But the executive summary here is I'd say the earliest you should *expect* to see this is 1.1, but if (somehow) we end up with some extra time we might have something in the 
1.0 timeframe (but don't hold your breath!).The first issue here is that when your code gets compiled we don't create what are truly .NET classes.Let's forget about old-style classes for a second (as those are REALLY not .NET classes, and never will be) and instead focus on new-style classes.
When you define a class we'll see if anyone else has inherited from the same set of base-types (including .NET interfaces).If someone has then we'll use that class instead of creating a new class.If they haven't we'll derive a new class from your base-class set, overriding all of the virtual methods, and creating some new fields like __dict__ and __class__.Those fields allow us to both allow you to change the type of your classes at runtime as well as attach new properties to instances.They also allow us to create a limited number of CLR types (which aren't garbage collected) which means long-running programs creating lots of types don't leak.
In the end there's not really anything good for us to attach the attributes to.To get that we'd need to move to a more static-compilation model while at the same time retaining the ability to do all the great dynamic stuff with Python.It's a hard problem and one that we simply haven't solved yet.
The second problem is also just as tough, but it's completely different.How do you even express an attribute on a class?There's no Python syntax for this so we'd have to add something new.It'd be great if we could use decorators here, but they don't apply to classes.So maybe that's something like __attributes__ = [Serializable, ...] or something along those lines but it's not clear what's the best way to go here...
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-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
] On Behalf Of Andrzej KrzywdaSent: Monday, March 27, 2006 4:55 AMTo: users@lists.ironpython.comSubject: [IronPython] .NET AttributesHi,When there will be support for .NET Attributes in IronPython?
Is there any way currently to mark my class as Serializable?--Andrzej___users mailing listusers@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com___users mailing list
users@lists.ironpython.comhttp://lists.ironpython.com/listinfo.cgi/users-ironpython.com

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


[IronPython] Visual Studio Integration

2006-02-10 Thread Eric Larson
I was curious how/if I can use Visual Studio 2005 with IronPython. I realize that I probably *can* use it of course, but I was wondering about the obvious niceties such as intellisense and code highlighting. Great Stuff!
Eric
___
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com