[Ironpython-users] IronPython, Daily Digest 12/18/2011

2011-12-19 Thread no_reply
Hi ironpython,

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

In today's digest:ISSUES

1. [New comment] Console color choice is bad for bright consoles
2. [New comment] Console color choice is bad for bright consoles
3. [New comment] Console exit behavior on OSX/Mono in 2.7A1
4. [New comment] Console exit behavior on OSX/Mono in 2.7A1
5. [New comment] Console exit behavior on OSX/Mono in 2.7A1
6. [New comment] Converting large float to int produces Int64 (which is not int 
or long)

--

ISSUES

1. [New comment] Console color choice is bad for bright consoles
http://ironpython.codeplex.com/workitem/31872
User jdhardy has commented on the issue:

"Looking into this further, if you're not running with -X:ColorfulConsole the 
console should use the foreground colour.

The ColorfulConsole option could choose between a light and dark them depending 
on what the background is."-

2. [New comment] Console color choice is bad for bright consoles
http://ironpython.codeplex.com/workitem/31872
User jdhardy has commented on the issue:

"Fixed in ba0ee88/d21c6c3. The console will choose its colours based on the 
background."-

3. [New comment] Console exit behavior on OSX/Mono in 2.7A1
http://ironpython.codeplex.com/workitem/28248
User jdhardy has commented on the issue:

"I can reproduce this on Linux/Mono. Oddly, when launched from Visual Studio 
(debugger attached or not), I get the same issue. Running the same build from 
the command line works as expected."-

4. [New comment] Console exit behavior on OSX/Mono in 2.7A1
http://ironpython.codeplex.com/workitem/28248
User jdhardy has commented on the issue:

"To make things more interesting, 'help' doesn't work properly, and 'credits', 
'copyright', and 'license' do not work when run under VS 
either."-

5. [New comment] Console exit behavior on OSX/Mono in 2.7A1
http://ironpython.codeplex.com/workitem/28248
User jdhardy has commented on the issue:

"exit, help, credits, copyright, and license are all actually set in site.py, 
not IronPython itself. However, IronPython's site.py is empty be default.

Fixed in 75a2467/2964728."-

6. [New comment] Converting large float to int produces Int64 (which is not int 
or long)
http://ironpython.codeplex.com/workitem/31549
User jdhardy has commented on the issue:

"For some reason, float.__int__ would produce in Int64.

Fixed in 7ea0730/fca526c."
--



--
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


Re: [Ironpython-users] PythonAst

2011-12-19 Thread Rutger Koperdraad
Hi Dino,

 

Thanks a lot. It's working reasonably well now. It would be nice to have
more comprehensive documentation of these classes, as it is quite a hassle
to extract the variables. I'm now extracting the assignment statements from
the script, but excluding those that are inside function bodies. In the
expression, I get al name expressions and then remove the function names
(call expressions targets) and the global variables. Thanks a lot for your
help.

 

With best regards,

Rutger Koperdraad

  _  

The ExchangeIt Support Team

 

Description: cid:[email protected]

 

EUR:O:  +31 (0)20 893 2601   |  F:  +31 (0)172 413 746   

USA:O:  +1 (925) 208 4716

 

Support request only via our online support ticket system at
 www.ExchangeIt24.eu 

SALES:   [email protected]

WEB: www.ExchangeIt24.eu  

FORUM:    www.CardExchange.eu

 

... Solving today's card production problems, with tomorrow in mind!

 

IT'S HERE! CHECK OUT THE NEW CARDEXCHANGER 6!
 Click here to download a FREE trial version

 

This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error please notify the system manager.
This message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.

 

From: Dino Viehland [mailto:[email protected]] 
Sent: Thursday, 15 December, 2011 14:07
To: Rutger Koperdraad; [email protected]
Subject: RE: [Ironpython-users] PythonAst

 

I'd suggest adding a method in the walker which handles AssignmentStatements
and looks to see if the left-hand side is a NameExpression.  If it is then
you can add it to a list of excluded variable names which you can remove
from clnVariableNames after the walk is finished.

 

From: [email protected]
[mailto:[email protected]] On Behalf
Of Rutger Koperdraad
Sent: Thursday, December 15, 2011 8:34 AM
To: [email protected]
Subject: [Ironpython-users] PythonAst

 

Hi,

 

I'm writing an application in Visual Basic .NET that allows the users to
write scripts in IronPython for some specialized customization needs. Users
provide a script, a number of variable names and values, and an expression.
For example, to customize the displaying of dates, they could provide the
following script, variables and expressions:

 

Script:

dateformat = ' d  '

prefix = 'Birth date: '

 

def format(d):

  import System

  dd = System.DateTime.Parse(d)

  return dd.ToString(dateformat)

 

Variables:

birthdate = '10/04/1968'

 

Expression:

prefix + format(birthdate)

 

In Visual Basic .NET I create a ScriptRuntime, ScriptEngine, ScriptSource
and ScriptScope. I add the variables to the ScriptScope, execute the script
and evaluate the expression. That's working like a charm.

 

I would like to add functionality that automatically detects which variables
need to be defined. In the above example, I would like the user to specify
the script and the expression and the software to detect that the variable
"birthdate" is needed and prompt for a value. I tried to do so with
PythonAst, but I cannot find sufficient documentation on internet to get it
working in general. The functions below work to some extent. They get all
the names from the expression and then remove "format" for being a function
name and not a variable name. But this function still returns "prefix",
which it shouldn't. Any help or documentation would be appreciated.

 

Public Function GetVariableNames(ByVal strExpression As String) As
StringCollection

Try

If Not String.IsNullOrEmpty(strExpression) Then

 

' Create a script runtime if needed

If m_objScriptRuntime Is Nothing Then

m_objScriptRuntime =
ScriptRuntime.CreateFromConfiguration()

End If

 

' Create the objects needed by the expression walker

Dim objEngine As ScriptEngine =
m_objScriptRuntime.GetEngine(ScriptLanguage)

Dim objSource As ScriptSource =
objEngine.CreateScriptSourceFromString(strExpression,
SourceCodeKind.Expression)

Dim objSourceUnit As SourceUnit =
Providers.HostingHelpe