[Ironpython-users] q: how to configure site-packages folder for ironpython/asp.net

2011-10-24 Thread Bernd Viehmann
Hi,

currently i am trying to get a mongo-db running in an asp.net
application written in ironpython. I am trying to use the
python-driver pymongo.

I have installed the modules in the site-packages folder and i am able
to use it in my python25- and also in my ironpython- commandline
interpreter. I can connect to the db and play with it.

But its is not working in my asp.net application. When i fstart the
webform i get following error message:

 Parser Error Message: No module named collections

Here is my test code-behind:

webform.aspx.py
from pymongo import Connection

def Page_Load(sender, e):
connection = Connection()

def Button1_Click(sender, e):
pass
---
In the Global.py I have made following configuration:

def Application_Start():
' Code that runs on application startup'
# if you want to use stdrt-py-libs in yout iron-python app add the folder
import sys
sys.path.append('C:\\Python25\\Lib')
sys.path.append('C:\\Python25\\Lib\\site-packages')


Anyone here who can tell me what's wrong?

And BTW does someone here tried the mongo-db with ipy and the clr-driver?

Thanks much for your help & kind regards

 Bernd




-- 

Mit freundlichen Grüßen

Bernd Viehmann
Mahrweg 46
41836 Hückelhoven

Tel.: 02433 9640 100
Fax: 02433 9640 109
___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


Re: [Ironpython-users] Getting started reference

2011-10-24 Thread Igor Brejc
Hi Bruce,

I have not done any WPF myself, but there are a lot of resources on the web:

   - http://www.ironpython.info/index.php/WPF_Example
   - google "ironpython wpf"

I can also recommend "IronPython in Action" book, it has a chapter on WPF.
As for "label1.contents", shouldn't it be "label1.Content" ?

Igor

On Sun, Oct 16, 2011 at 10:33 PM, Bruce Anderson wrote:

> I've done some WPF in C# using VisualStudio 2010 and I've done some Python
> in IDLE, but I've never done IronPython using WPF in VS2010.
>
> Are there any references or web pages to help people get to First base?
> (I'm looking specifically for IronPython WPF using VS2010 - I've found so
> many generic pages that my eyes are tired - but absolutely nada about what I
> need to get started.)  I have Foorde's book - but it pre-dates the
> integration of WPF, VS and IronPython, so it doesn't seem to help.
>
> For example, I fired up VS2010, built an IronPython WPF application and
> added a button and a label. I have the XAML code and the PY code.
>
> But how do I reference the controls from my Python code-behind? I've tried
> the way I would do it from C# (e.g. label1.contents = "Hello World") - but
> that just gives me an "Unbound Name Exception" unhandled error. I even tried
> setting properties of "self" in the button_click handler - but that didn't
> work either.
>
> This has got to be simple - can someone point me in the right direction?
>
> Bruce Anderson
>
> ___
> 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] IronPython, Daily Digest 10/23/2011

2011-10-24 Thread no_reply
Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [Status update] Typo
2. [Status update] ArgumentException when using SetTrace
3. [Status update] Lib/config directory not present in zip distribution.
4. [Status update] Update ElementTree to IronPython compatible version

--

ISSUES

1. [Status update] Typo
http://ironpython.codeplex.com/workitem/28772
User jdhardy has updated the issue:
Status has changed from Fixed to Closed with the following comment, 

"Fixed in 2.7.1 RC."-

2. [Status update] ArgumentException when using SetTrace
http://ironpython.codeplex.com/workitem/31308
User jdhardy has updated the issue:
Status has changed from Fixed to Closed with the following comment, 

"Fixed in 2.7.1 RC."-

3. [Status update] Lib/config directory not present in zip distribution.
http://ironpython.codeplex.com/workitem/31417
User jdhardy has updated the issue:
Status has changed from Fixed to Closed with the following comment, 

"Fixed in 2.7.1 RC."-

4. [Status update] Update ElementTree to IronPython compatible version
http://ironpython.codeplex.com/workitem/31579
User jdhardy has updated the issue:
Status has changed from Fixed to Closed with the following comment, 

"Fixed in 2.7.1."
--



--
You are receiving this email because you subscribed to notifications on 
CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue 
Tracker. You can unsubscribe or change your issue notification settings on 
CodePlex.com.___
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users


[Ironpython-users] Unhandled .Net Exception

2011-10-24 Thread John Dickinson
Hello, I was looking at adding a handler for otherwise-uncaught .Net
exceptions, and had found this page:
http://www.ironpython.info/index.php/Handling_Unhandled_Exceptions useful.
However, the code shown falls over where he's trying to get a nicely
formatted python exception here:

from IronPython.Hosting import PythonEngine
pyE = PythonEngine()
print pyE.FormatException(event.Exception)

where I get "ImportError: No module named Hosting". At the bottom he has a
note saying:

"For IronPython 2.0, the code to format the exception from a PythonEngine
is slightly different:

import clr
clr.AddReference('IronPython')
from IronPython.Hosting import PythonEngine
PythonEngine.CurrentEngine.FormatException(someException)

"

which gives me "ImportError: Cannot import name PythonEngine".

I'm using IronPython 2.7.0.40 with .Net 4.0.30319.239. I assume the API has
changed here; can anyone tell me if there is a way to do something like
this FormatException in IronPython 2.7?

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


Re: [Ironpython-users] Unhandled .Net Exception

2011-10-24 Thread Dino Viehland
This should do it - the hosting APIs changed quite a bit between 2.0 and 2.7:
import clr
clr.AddReference('IronPython')
from IronPython.Runtime import PythonContext
import System
clr.GetCurrentRuntime().GetLanguage(PythonContext).FormatException(System.Exception())

There could be other variations such as using GetLanguageByExtension and not 
needing to add a ref to IronPython but those will require that the script 
runtime has the languages properly registered.

From: [email protected] 
[mailto:[email protected]] On 
Behalf Of John Dickinson
Sent: Monday, October 24, 2011 9:52 AM
To: [email protected]
Subject: [Ironpython-users] Unhandled .Net Exception

Hello, I was looking at adding a handler for otherwise-uncaught .Net 
exceptions, and had found this page: 
http://www.ironpython.info/index.php/Handling_Unhandled_Exceptions useful. 
However, the code shown falls over where he's trying to get a nicely formatted 
python exception here:

from IronPython.Hosting import PythonEngine

pyE = PythonEngine()

print pyE.FormatException(event.Exception)
where I get "ImportError: No module named Hosting". At the bottom he has a note 
saying:

"For IronPython 2.0, the code to format the exception from a PythonEngine is 
slightly different:

import clr

clr.AddReference('IronPython')

from IronPython.Hosting import PythonEngine

PythonEngine.CurrentEngine.FormatException(someException)
"

which gives me "ImportError: Cannot import name PythonEngine".

I'm using IronPython 2.7.0.40 with .Net 4.0.30319.239. I assume the API has 
changed here; can anyone tell me if there is a way to do something like this 
FormatException in IronPython 2.7?

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