Skip to content

Commit ad777c2

Browse files
authored
Merge pull request #136 from chuongmep/ironpython3
Support Ironpython3.4
2 parents fb99f5a + de8e678 commit ad777c2

21 files changed

+62
-38
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# Changelog
2+
- 2022-12-16 **2.0.0**
3+
- Add support IronPython 3.4 [#136](https://github.com/architecture-building-systems/revitpythonshell/pull/136)
4+
- Please follow [Upgrade from IronPython2 to IronPython 3](https://github.com/IronLanguages/ironpython3/blob/master/Documentation/upgrading-from-ipy2.md) to upgrade your code.
5+
- 2022-09-22 **1.0.2**
6+
- Fix set CollectorExt.m_app error. [#128](https://github.com/architecture-building-systems/revitpythonshell/pull/128)
27
- 2022-06-27 **1.0.1**
38
- Add Process CI/CD Automatic.
49
- Fix Problem show owner window.

Installer/Installer.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
const string projectName = "RevitPythonShell";
1313
const string outputName = "RevitPythonShell";
1414
const string outputDir = "output";
15-
const string version = "1.0.1";
15+
const string version = "2.0.0";
1616

1717
var fileName = new StringBuilder().Append(outputName).Append("-").Append(version);
1818
var project = new Project

Installer/Installer.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
</PropertyGroup>
1313
<ItemGroup>
1414
<PackageReference Include="WixSharp.bin">
15-
<Version>1.19.*</Version>
15+
<Version>1.20.2</Version>
1616
</PackageReference>
1717
<PackageReference Include="WixSharp.wix.bin">
18-
<Version>3.11.*</Version>
18+
<Version>3.11.2</Version>
1919
</PackageReference>
2020
</ItemGroup>
2121
</Project>

PythonConsoleControl/PythonConsoleCompletionDataProvider.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ protected void PopulateFromPythonType(List<PythonCompletionData> items, string n
157157
//string dirCommand = "dir(" + objectName + ")";
158158
string dirCommand = "sorted([m for m in dir(" + name + ") if not m.startswith('__')], key = str.lower) + sorted([m for m in dir(" + name + ") if m.startswith('__')])";
159159
object value = commandLine.ScriptScope.Engine.CreateScriptSourceFromString(dirCommand, SourceCodeKind.Expression).Execute(commandLine.ScriptScope);
160-
foreach (object member in (value as IronPython.Runtime.List))
160+
foreach (object member in (value as IronPython.Runtime.PythonList))
161161
{
162162
bool isInstance = false;
163163

PythonConsoleControl/PythonConsoleControl.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
</PropertyGroup>
1515
<ItemGroup>
1616
<PackageReference Include="AvalonEdit" Version="6.0.1" />
17+
<PackageReference Include="IronPython" Version="3.4.0" />
1718
</ItemGroup>
1819
<ItemGroup>
1920
<Reference Include="IronPython">

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,24 @@ database exploration tool to become a Revit API Ninja :)
3131
- `lookup()` function for snooping `Element`, `ElementSet` and `ElementId` objects
3232
in [RevitLookup](https://github.com/jeremytammik/RevitLookup)
3333

34+
## IronPython 3
35+
36+
IronPython 3.4 uses Python 3.4 syntax and standard libraries and so your Python code will need to be updated accordingly. There are numerous tools and guides available on the web to help porting from Python 2 to 3.
37+
38+
IronPython 3 targets Python 3, including the re-organized standard library, Unicode strings, and all of the other new features.with user upgrade from **IronPython 2** to **IronPython 3**, please follow [Upgrade from IronPython 2 to IronPython 3](https://github.com/IronLanguages/ironpython3/blob/master/Documentation/upgrading-from-ipy2.md).
39+
40+
Various differences between IronPython and CPython can follow at [Differences IronPython and CPython](https://github.com/IronLanguages/ironpython3/blob/master/Documentation/differences-from-c-python.md).
41+
3442
## Installation
3543

3644
Please follow last release at section [Release](https://github.com/architecture-building-systems/revitpythonshell/releases/latest) support version Support From Revit 2018-2023.
3745

3846
Older versions:
39-
- [Installer for Autodesk Revit 2018 to Revit 2023](https://github.com/architecture-building-systems/revitpythonshell/releases/tag/1.0.1)
47+
- [Installer for Autodesk Revit 2022](https://github.com/architecture-building-systems/revitpythonshell/releases/download/2021.06.20/2021.06.20_Setup_RevitPythonShell_2022.exe)
48+
- [Installer for Autodesk Revit 2021](https://github.com/architecture-building-systems/revitpythonshell/releases/download/2021.03.22/2021.03.22_Setup_RevitPythonShell_2021.exe)
49+
- [Installer for Autodesk Revit 2020](https://github.com/architecture-building-systems/revitpythonshell/releases/download/2019.01.27/2020.01.19_Setup_RevitPythonShell_2020.exe)
50+
- [Installer for Autodesk Revit 2019](https://github.com/architecture-building-systems/revitpythonshell/releases/download/2018.09.19/2018.09.19_Setup_RevitPythonShell_2019.exe)
51+
- [Installer for Autodesk Revit 2018 (and 2018.1)](https://github.com/architecture-building-systems/revitpythonshell/releases/download/2017.07.24/2017.07.24_Setup_RevitPythonShell_2018.exe)
4052
- [Installer for Autodesk Revit 2017](https://github.com/architecture-building-systems/revitpythonshell/releases/download/2017.04.06/2017.04.06_Setup_RevitPythonShell_2017.exe)
4153
- [Installer for Autodesk Revit 2016](https://github.com/architecture-building-systems/revitpythonshell/releases/download/2017.03.07/2017.03.07_Setup_RevitPythonShell_2016.exe)
4254
- [Installer for Autodesk Revit 2015](https://github.com/architecture-building-systems/revitpythonshell/releases/download/2017.03.07/2017.03.07_Setup_RevitPythonShell_2015.exe)
-734 KB
Binary file not shown.
-622 KB
Binary file not shown.

RequiredLibraries/IronPython.Wpf.dll

-7 KB
Binary file not shown.

RequiredLibraries/IronPython.dll

-1.7 MB
Binary file not shown.
-46.2 KB
Binary file not shown.
-987 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
-135 KB
Binary file not shown.
Binary file not shown.

RequiredLibraries/WPG.dll

-155 KB
Binary file not shown.

RevitPythonShell/Examples/helloworld.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
helloworld.py - example RevitPythonShell script
33
for testing the DeployRpsAddin program.
44
'''
5-
print 'hello, world :)'
5+
print("Hello World!")
4.52 MB
Binary file not shown.

RpsRuntime/RpsRuntime.csproj

+35-30
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,16 @@
5252
<PublishTrimmed>true</PublishTrimmed>
5353
</PropertyGroup>
5454
<ItemGroup>
55-
<Reference Include="PresentationCore"/>
56-
<Reference Include="PresentationFramework"/>
57-
<Reference Include="WindowsBase"/>
55+
<Reference Include="PresentationCore" />
56+
<Reference Include="PresentationFramework" />
57+
<Reference Include="WindowsBase" />
5858
</ItemGroup>
5959
<ItemGroup>
60-
<PackageReference Include="Nice3point.Revit.Api.RevitAPI" Version="$(RevitVersion).*"/>
61-
<PackageReference Include="Nice3point.Revit.Api.RevitAPIUI" Version="$(RevitVersion).*"/>
62-
<PackageReference Include="AvalonEdit" Version="6.0.1"/>
60+
<PackageReference Include="DynamicLanguageRuntime" Version="1.3.3" />
61+
<PackageReference Include="IronPython" Version="3.4.0" />
62+
<PackageReference Include="Nice3point.Revit.Api.RevitAPI" Version="$(RevitVersion).*" />
63+
<PackageReference Include="Nice3point.Revit.Api.RevitAPIUI" Version="$(RevitVersion).*" />
64+
<PackageReference Include="AvalonEdit" Version="6.0.1" />
6365
</ItemGroup>
6466
<ItemGroup>
6567
<Reference Include="IronPython">
@@ -82,34 +84,34 @@
8284
</Reference>
8385
</ItemGroup>
8486
<ItemGroup>
85-
<Reference Include="PresentationCore"/>
86-
<Reference Include="System"/>
87-
<Reference Include="System.Core"/>
88-
<Reference Include="System.Drawing"/>
89-
<Reference Include="System.Windows.Forms"/>
90-
<Reference Include="System.Xaml"/>
91-
<Reference Include="System.Xml.Linq"/>
92-
<Reference Include="System.Data.DataSetExtensions"/>
93-
<Reference Include="System.Data"/>
94-
<Reference Include="System.Xml"/>
95-
<Reference Include="WindowsBase"/>
87+
<Reference Include="PresentationCore" />
88+
<Reference Include="System" />
89+
<Reference Include="System.Core" />
90+
<Reference Include="System.Drawing" />
91+
<Reference Include="System.Windows.Forms" />
92+
<Reference Include="System.Xaml" />
93+
<Reference Include="System.Xml.Linq" />
94+
<Reference Include="System.Data.DataSetExtensions" />
95+
<Reference Include="System.Data" />
96+
<Reference Include="System.Xml" />
97+
<Reference Include="WindowsBase" />
9698
</ItemGroup>
9799
<ItemGroup>
98-
<Compile Include="ExternalCommandAssemblyBuilder.cs"/>
99-
<Compile Include="IRpsConfig.cs"/>
100-
<Compile Include="RpsConfig.cs"/>
101-
<Compile Include="RpsExternalApplicationBase.cs"/>
102-
<Compile Include="RpsExternalCommandBase.cs"/>
103-
<Compile Include="RpsExternalCommandScriptBase.cs"/>
104-
<Compile Include="ScriptExecutor.cs"/>
100+
<Compile Include="ExternalCommandAssemblyBuilder.cs" />
101+
<Compile Include="IRpsConfig.cs" />
102+
<Compile Include="RpsConfig.cs" />
103+
<Compile Include="RpsExternalApplicationBase.cs" />
104+
<Compile Include="RpsExternalCommandBase.cs" />
105+
<Compile Include="RpsExternalCommandScriptBase.cs" />
106+
<Compile Include="ScriptExecutor.cs" />
105107
<Compile Include="ScriptOutput.cs">
106108
<SubType>Form</SubType>
107109
</Compile>
108110
<Compile Include="ScriptOutput.Designer.cs">
109111
<DependentUpon>ScriptOutput.cs</DependentUpon>
110112
</Compile>
111-
<Compile Include="ScriptOutputStream.cs"/>
112-
<Compile Include="SettingsDictionary.cs"/>
113+
<Compile Include="ScriptOutputStream.cs" />
114+
<Compile Include="SettingsDictionary.cs" />
113115
</ItemGroup>
114116
<ItemGroup>
115117
<EmbeddedResource Include="ScriptOutput.resx">
@@ -118,15 +120,18 @@
118120
</EmbeddedResource>
119121
</ItemGroup>
120122
<ItemGroup>
121-
<EmbeddedResource Include="Resources\PythonScript16x16.png"/>
123+
<EmbeddedResource Include="Resources\PythonScript16x16.png" />
122124
</ItemGroup>
123125
<ItemGroup>
124-
<EmbeddedResource Include="Resources\PythonScript32x32.png"/>
126+
<EmbeddedResource Include="Resources\PythonScript32x32.png" />
125127
</ItemGroup>
126128
<ItemGroup>
127-
<EmbeddedResource Include="Resources\python_27_lib.zip"/>
129+
<EmbeddedResource Include="Resources\python_27_lib.zip" />
128130
</ItemGroup>
129131
<ItemGroup>
130-
<Folder Include="Properties\"/>
132+
<Folder Include="Properties\" />
133+
</ItemGroup>
134+
<ItemGroup>
135+
<EmbeddedResource Include="Resources\IronPython.3.4.0.zip" />
131136
</ItemGroup>
132137
</Project>

RpsRuntime/ScriptExecutor.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@ private void AddEmbeddedLib(ScriptEngine engine)
131131
{
132132
// use embedded python lib
133133
var asm = this.GetType().Assembly;
134-
var resQuery = from name in asm.GetManifestResourceNames()
135-
where name.ToLowerInvariant().EndsWith("python_27_lib.zip")
134+
string[] resourceNames = asm.GetManifestResourceNames();
135+
var resQuery = from name in resourceNames
136+
where name.ToLowerInvariant().EndsWith("ironpython.3.4.0.zip")
136137
select name;
137138
var resName = resQuery.Single();
138139
var importer = new IronPython.Modules.ResourceMetaPathImporter(asm, resName);

0 commit comments

Comments
 (0)