From 0edfe8266fd2f129f4063f3d63e994865876cea0 Mon Sep 17 00:00:00 2001 From: Matt Ward Date: Mon, 29 Jun 2009 18:42:57 +0000 Subject: [PATCH] Added some missing IronPython files. git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4366 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../BackendBindings/Python/PythonBinding.sln | 2 +- .../PythonBinding/Project/Lib/__future__.py | 19 ++++++++++++ .../Python/PythonBinding/Project/Lib/runpy.py | 31 +++++++++++++++++++ .../Python/PythonBinding/Project/Lib/site.py | 14 +++++++++ .../Project/PythonBinding.csproj | 10 ++++++ src/Setup/Files.wxs | 11 +++++++ src/Setup/Setup.wxs | 5 ++- 7 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/__future__.py create mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/runpy.py create mode 100644 src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/site.py diff --git a/src/AddIns/BackendBindings/Python/PythonBinding.sln b/src/AddIns/BackendBindings/Python/PythonBinding.sln index bfe33e2da5..d0391b5695 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding.sln +++ b/src/AddIns/BackendBindings/Python/PythonBinding.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 -# SharpDevelop 3.0.0.3800 +# SharpDevelop 3.1.0.4070 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PythonBinding", "PythonBinding\Project\PythonBinding.csproj", "{8D732610-8FC6-43BA-94C9-7126FD7FE361}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PythonBinding.Tests", "PythonBinding\Test\PythonBinding.Tests.csproj", "{23B517C9-1ECC-4419-A13F-0B7136D085CB}" diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/__future__.py b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/__future__.py new file mode 100644 index 0000000000..3f3bdd2bb5 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/__future__.py @@ -0,0 +1,19 @@ +##################################################################################### +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# This source code is subject to terms and conditions of the Microsoft Public License. A +# copy of the license can be found in the License.html file at the root of this distribution. If +# you cannot locate the Microsoft Public License, please send an email to +# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound +# by the terms of the Microsoft Public License. +# +# You must not remove this notice, or any other, from this software. +# +# +##################################################################################### + +division=1 +with_statement=1 +generators=1 +absolute_import=1 diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/runpy.py b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/runpy.py new file mode 100644 index 0000000000..451562244f --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/runpy.py @@ -0,0 +1,31 @@ +##################################################################################### +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# This source code is subject to terms and conditions of the Microsoft Public License. A +# copy of the license can be found in the License.html file at the root of this distribution. If +# you cannot locate the Microsoft Public License, please send an email to +# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound +# by the terms of the Microsoft Public License. +# +# You must not remove this notice, or any other, from this software. +# +# +##################################################################################### + +""" +Fake runpy.py which emulates what CPython does to properly support the '-m' flag. +If you have access to the CPython standard library, you most likely do not need this. +""" + +import sys, nt + +def run_module(modToRun, init_globals=None, run_name = '__main__', alter_sys = True): + if alter_sys: + for o in sys.path: + libpath = o + '\\' + modToRun + '.py' + if nt.access(libpath, nt.F_OK): + sys.argv[0] = libpath + break + + __import__(modToRun) diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/site.py b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/site.py new file mode 100644 index 0000000000..07581427f6 --- /dev/null +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/Lib/site.py @@ -0,0 +1,14 @@ +##################################################################################### +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# This source code is subject to terms and conditions of the Microsoft Public License. A +# copy of the license can be found in the License.html file at the root of this distribution. If +# you cannot locate the Microsoft Public License, please send an email to +# ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound +# by the terms of the Microsoft Public License. +# +# You must not remove this notice, or any other, from this software. +# +# +##################################################################################### diff --git a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj index 8be94990a5..5886a3817f 100644 --- a/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj +++ b/src/AddIns/BackendBindings/Python/PythonBinding/Project/PythonBinding.csproj @@ -115,6 +115,15 @@ + + Always + + + Always + + + Always + Always @@ -145,6 +154,7 @@ + diff --git a/src/Setup/Files.wxs b/src/Setup/Files.wxs index 491c88d3f2..2d86e02d90 100644 --- a/src/Setup/Files.wxs +++ b/src/Setup/Files.wxs @@ -1312,6 +1312,17 @@ + + + + + + + + + + + diff --git a/src/Setup/Setup.wxs b/src/Setup/Setup.wxs index 25d01a174d..bbcae7df15 100644 --- a/src/Setup/Setup.wxs +++ b/src/Setup/Setup.wxs @@ -421,7 +421,10 @@ - + + + +