Skip to content

Commit 2b77c0b

Browse files
committed
Updated the Delphi.pyd library project for Python 3.x
1 parent be97514 commit 2b77c0b

File tree

6 files changed

+160
-167
lines changed

6 files changed

+160
-167
lines changed

PythonForDelphi/Components/Sources/Core/WrapDelphi.pas

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
Contributors:
99
Morgan Martinet ([email protected])
1010
11-
Features: P
12-
Check our Wiki at: http://py4d.pbwiki.com/.
13-
11+
Features:
1412
Published properties and methods compiled with {$METHODINFO ON} are
1513
handled automatically (Note that METHODINFO can be used only with Delphi7
1614
or later, but all the other wrapping features will work with previous

PythonForDelphi/Modules/Delphi/Delphi.dof

Lines changed: 0 additions & 161 deletions
This file was deleted.

PythonForDelphi/Modules/Delphi/Delphi.dpr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ uses
2020
{$I Definition.Inc}
2121

2222
exports
23-
initDelphi;
23+
PyInit_Delphi;
2424
{$IFDEF MSWINDOWS}
2525
{$E pyd}
2626
{$ENDIF}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<ProjectGuid>{7E56095C-46B8-4F28-87A2-EEA8D9D2448D}</ProjectGuid>
4+
<MainSource>Delphi.dpr</MainSource>
5+
<Base>True</Base>
6+
<Config Condition="'$(Config)'==''">Debug</Config>
7+
<TargetedPlatforms>4099</TargetedPlatforms>
8+
<AppType>Library</AppType>
9+
<FrameworkType>None</FrameworkType>
10+
<ProjectVersion>18.8</ProjectVersion>
11+
<Platform Condition="'$(Platform)'==''">Win64</Platform>
12+
</PropertyGroup>
13+
<PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
14+
<Base>true</Base>
15+
</PropertyGroup>
16+
<PropertyGroup Condition="('$(Platform)'=='Android64' and '$(Base)'=='true') or '$(Base_Android64)'!=''">
17+
<Base_Android64>true</Base_Android64>
18+
<CfgParent>Base</CfgParent>
19+
<Base>true</Base>
20+
</PropertyGroup>
21+
<PropertyGroup Condition="('$(Platform)'=='Win32' and '$(Base)'=='true') or '$(Base_Win32)'!=''">
22+
<Base_Win32>true</Base_Win32>
23+
<CfgParent>Base</CfgParent>
24+
<Base>true</Base>
25+
</PropertyGroup>
26+
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Base)'=='true') or '$(Base_Win64)'!=''">
27+
<Base_Win64>true</Base_Win64>
28+
<CfgParent>Base</CfgParent>
29+
<Base>true</Base>
30+
</PropertyGroup>
31+
<PropertyGroup Condition="'$(Config)'=='Release' or '$(Cfg_1)'!=''">
32+
<Cfg_1>true</Cfg_1>
33+
<CfgParent>Base</CfgParent>
34+
<Base>true</Base>
35+
</PropertyGroup>
36+
<PropertyGroup Condition="'$(Config)'=='Debug' or '$(Cfg_2)'!=''">
37+
<Cfg_2>true</Cfg_2>
38+
<CfgParent>Base</CfgParent>
39+
<Base>true</Base>
40+
</PropertyGroup>
41+
<PropertyGroup Condition="('$(Platform)'=='Android64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Android64)'!=''">
42+
<Cfg_2_Android64>true</Cfg_2_Android64>
43+
<CfgParent>Cfg_2</CfgParent>
44+
<Cfg_2>true</Cfg_2>
45+
<Base>true</Base>
46+
</PropertyGroup>
47+
<PropertyGroup Condition="('$(Platform)'=='OSX64' and '$(Cfg_2)'=='true') or '$(Cfg_2_OSX64)'!=''">
48+
<Cfg_2_OSX64>true</Cfg_2_OSX64>
49+
<CfgParent>Cfg_2</CfgParent>
50+
<Cfg_2>true</Cfg_2>
51+
<Base>true</Base>
52+
</PropertyGroup>
53+
<PropertyGroup Condition="('$(Platform)'=='Win64' and '$(Cfg_2)'=='true') or '$(Cfg_2_Win64)'!=''">
54+
<Cfg_2_Win64>true</Cfg_2_Win64>
55+
<CfgParent>Cfg_2</CfgParent>
56+
<Cfg_2>true</Cfg_2>
57+
<Base>true</Base>
58+
</PropertyGroup>
59+
<PropertyGroup Condition="'$(Base)'!=''">
60+
<DCC_E>false</DCC_E>
61+
<DCC_F>false</DCC_F>
62+
<DCC_K>false</DCC_K>
63+
<DCC_N>false</DCC_N>
64+
<DCC_S>false</DCC_S>
65+
<DCC_ImageBase>00400000</DCC_ImageBase>
66+
<GenDll>true</GenDll>
67+
<SanitizedProjectName>Delphi</SanitizedProjectName>
68+
<VerInfo_Locale>1033</VerInfo_Locale>
69+
<VerInfo_Keys>CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName=</VerInfo_Keys>
70+
<DCC_Namespace>System;Xml;Data;Datasnap;Web;Soap;Vcl;$(DCC_Namespace)</DCC_Namespace>
71+
</PropertyGroup>
72+
<PropertyGroup Condition="'$(Base_Android64)'!=''">
73+
<EnabledSysJars>android-support-v4.dex.jar;cloud-messaging.dex.jar;com-google-android-gms.play-services-ads-base.17.2.0.dex.jar;com-google-android-gms.play-services-ads-identifier.16.0.0.dex.jar;com-google-android-gms.play-services-ads-lite.17.2.0.dex.jar;com-google-android-gms.play-services-ads.17.2.0.dex.jar;com-google-android-gms.play-services-analytics-impl.16.0.8.dex.jar;com-google-android-gms.play-services-analytics.16.0.8.dex.jar;com-google-android-gms.play-services-base.16.0.1.dex.jar;com-google-android-gms.play-services-basement.16.2.0.dex.jar;com-google-android-gms.play-services-gass.17.2.0.dex.jar;com-google-android-gms.play-services-identity.16.0.0.dex.jar;com-google-android-gms.play-services-maps.16.1.0.dex.jar;com-google-android-gms.play-services-measurement-base.16.4.0.dex.jar;com-google-android-gms.play-services-measurement-sdk-api.16.4.0.dex.jar;com-google-android-gms.play-services-stats.16.0.1.dex.jar;com-google-android-gms.play-services-tagmanager-v4-impl.16.0.8.dex.jar;com-google-android-gms.play-services-tasks.16.0.1.dex.jar;com-google-android-gms.play-services-wallet.16.0.1.dex.jar;com-google-firebase.firebase-analytics.16.4.0.dex.jar;com-google-firebase.firebase-common.16.1.0.dex.jar;com-google-firebase.firebase-iid-interop.16.0.1.dex.jar;com-google-firebase.firebase-iid.17.1.1.dex.jar;com-google-firebase.firebase-measurement-connector.17.0.1.dex.jar;com-google-firebase.firebase-messaging.17.5.0.dex.jar;fmx.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar</EnabledSysJars>
74+
</PropertyGroup>
75+
<PropertyGroup Condition="'$(Base_Win32)'!=''">
76+
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace)</DCC_Namespace>
77+
<BT_BuildType>Debug</BT_BuildType>
78+
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
79+
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
80+
<VerInfo_Locale>1033</VerInfo_Locale>
81+
<Icon_MainIcon>Delphi_Icon.ico</Icon_MainIcon>
82+
</PropertyGroup>
83+
<PropertyGroup Condition="'$(Base_Win64)'!=''">
84+
<Icon_MainIcon>Delphi_Icon.ico</Icon_MainIcon>
85+
<DCC_Namespace>Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace)</DCC_Namespace>
86+
<BT_BuildType>Debug</BT_BuildType>
87+
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
88+
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
89+
</PropertyGroup>
90+
<PropertyGroup Condition="'$(Cfg_1)'!=''">
91+
<DCC_Define>RELEASE;$(DCC_Define)</DCC_Define>
92+
<DCC_DebugInformation>0</DCC_DebugInformation>
93+
<DCC_LocalDebugSymbols>false</DCC_LocalDebugSymbols>
94+
<DCC_SymbolReferenceInfo>0</DCC_SymbolReferenceInfo>
95+
</PropertyGroup>
96+
<PropertyGroup Condition="'$(Cfg_2)'!=''">
97+
<DCC_Define>DEBUG;$(DCC_Define)</DCC_Define>
98+
<DCC_Optimize>false</DCC_Optimize>
99+
<DCC_GenerateStackFrames>true</DCC_GenerateStackFrames>
100+
</PropertyGroup>
101+
<PropertyGroup Condition="'$(Cfg_2_Android64)'!=''">
102+
<BT_BuildType>Debug</BT_BuildType>
103+
</PropertyGroup>
104+
<PropertyGroup Condition="'$(Cfg_2_OSX64)'!=''">
105+
<BT_BuildType>Debug</BT_BuildType>
106+
</PropertyGroup>
107+
<PropertyGroup Condition="'$(Cfg_2_Win64)'!=''">
108+
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
109+
<VerInfo_Keys>CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=</VerInfo_Keys>
110+
<Manifest_File>(None)</Manifest_File>
111+
</PropertyGroup>
112+
<ItemGroup>
113+
<DelphiCompile Include="$(MainSource)">
114+
<MainSource>MainSource</MainSource>
115+
</DelphiCompile>
116+
<DCCReference Include="uMain.pas"/>
117+
<BuildConfiguration Include="Debug">
118+
<Key>Cfg_2</Key>
119+
<CfgParent>Base</CfgParent>
120+
</BuildConfiguration>
121+
<BuildConfiguration Include="Base">
122+
<Key>Base</Key>
123+
</BuildConfiguration>
124+
<BuildConfiguration Include="Release">
125+
<Key>Cfg_1</Key>
126+
<CfgParent>Base</CfgParent>
127+
</BuildConfiguration>
128+
</ItemGroup>
129+
<ProjectExtensions>
130+
<Borland.Personality>Delphi.Personality.12</Borland.Personality>
131+
<Borland.ProjectType/>
132+
<BorlandProject>
133+
<Delphi.Personality>
134+
<Source>
135+
<Source Name="MainSource">Delphi.dpr</Source>
136+
</Source>
137+
<Excluded_Packages>
138+
<Excluded_Packages Name="$(BDSBIN)\dcloffice2k260.bpl">Microsoft Office 2000 Sample Automation Server Wrapper Components</Excluded_Packages>
139+
<Excluded_Packages Name="$(BDSBIN)\dclofficexp260.bpl">Microsoft Office XP Sample Automation Server Wrapper Components</Excluded_Packages>
140+
</Excluded_Packages>
141+
</Delphi.Personality>
142+
<Platforms>
143+
<Platform value="Android64">False</Platform>
144+
<Platform value="Linux64">False</Platform>
145+
<Platform value="OSX32">False</Platform>
146+
<Platform value="OSX64">True</Platform>
147+
<Platform value="Win32">True</Platform>
148+
<Platform value="Win64">True</Platform>
149+
</Platforms>
150+
</BorlandProject>
151+
<ProjectFileVersion>12</ProjectFileVersion>
152+
</ProjectExtensions>
153+
<Import Project="$(BDS)\Bin\CodeGear.Delphi.Targets" Condition="Exists('$(BDS)\Bin\CodeGear.Delphi.Targets')"/>
154+
<Import Project="$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj" Condition="Exists('$(APPDATA)\Embarcadero\$(BDSAPPDATABASEDIR)\$(PRODUCTVERSION)\UserTools.proj')"/>
155+
</Project>
596 Bytes
Binary file not shown.

PythonForDelphi/Modules/Delphi/uMain.pas

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ interface
44

55
uses PythonEngine, WrapDelphi, WrapDelphiVCL;
66

7-
procedure initDelphi; cdecl;
7+
function PyInit_Delphi: PPyObject; cdecl;
88

99
var
1010
gEngine : TPythonEngine;
@@ -13,7 +13,7 @@ procedure initDelphi; cdecl;
1313

1414
implementation
1515

16-
procedure initDelphi;
16+
function PyInit_Delphi: PPyObject;
1717
begin
1818
try
1919
gEngine := TPythonEngine.Create(nil);
@@ -30,6 +30,7 @@ procedure initDelphi;
3030
gEngine.LoadDll;
3131
except
3232
end;
33+
Result := gModule.Module;
3334
end;
3435

3536
initialization

0 commit comments

Comments
 (0)