diff --git a/PythonForDelphi/Components/PyDelphi.ico b/PythonForDelphi/Components/PyDelphi.ico new file mode 100644 index 00000000..1146af01 Binary files /dev/null and b/PythonForDelphi/Components/PyDelphi.ico differ diff --git a/PythonForDelphi/Components/Python_D10_2.dpk b/PythonForDelphi/Components/Python_D10_2.dpk new file mode 100644 index 00000000..6bf14f05 --- /dev/null +++ b/PythonForDelphi/Components/Python_D10_2.dpk @@ -0,0 +1,57 @@ +package Python_D10_2; + +{$R *.res} +{$R 'Sources\Core\PythonEngine.dcr'} +{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS ON} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION OFF} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO ON} +{$SAFEDIVIDE OFF} +{$STACKFRAMES ON} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$IMAGEBASE $400000} +{$DEFINE DEBUG} +{$ENDIF IMPLICITBUILDING} +{$DESCRIPTION 'Components for Python'} +{$IMPLICITBUILD OFF} + +requires + rtl, + vcl, + dbrtl; + +contains + MethodCallBack in 'Sources\Core\MethodCallBack.pas', + PythonEngine in 'Sources\Core\PythonEngine.pas', + PythonGUIInputOutput in 'Sources\Core\PythonGUIInputOutput.pas', + WrapDelphi in 'Sources\Core\WrapDelphi.pas', + WrapDelphiActnList in 'Sources\Core\WrapDelphiActnList.pas', + WrapDelphiButtons in 'Sources\Core\WrapDelphiButtons.pas', + WrapDelphiClasses in 'Sources\Core\WrapDelphiClasses.pas', + WrapDelphiComCtrls in 'Sources\Core\WrapDelphiComCtrls.pas', + WrapDelphiControls in 'Sources\Core\WrapDelphiControls.pas', + WrapDelphiExtCtrls in 'Sources\Core\WrapDelphiExtCtrls.pas', + WrapDelphiForms in 'Sources\Core\WrapDelphiForms.pas', + WrapDelphiGraphics in 'Sources\Core\WrapDelphiGraphics.pas', + WrapDelphiGrids in 'Sources\Core\WrapDelphiGrids.pas', + WrapDelphiStdCtrls in 'Sources\Core\WrapDelphiStdCtrls.pas', + WrapDelphiTypes in 'Sources\Core\WrapDelphiTypes.pas', + WrapDelphiVCL in 'Sources\Core\WrapDelphiVCL.pas', + WrapDelphiWindows in 'Sources\Core\WrapDelphiWindows.pas', + pyDBFireDac in 'Sources\FireDAC\pyDBFireDac.pas'; + +end. diff --git a/PythonForDelphi/Components/Python_D10_2.dproj b/PythonForDelphi/Components/Python_D10_2.dproj new file mode 100644 index 00000000..4be24aa7 --- /dev/null +++ b/PythonForDelphi/Components/Python_D10_2.dproj @@ -0,0 +1,611 @@ + + + {1E7BC104-3E7C-43AE-8152-901DA2AEB8C3} + Python_D10_2.dpk + True + Debug + 3 + Package + VCL + 18.3 + Win32 + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + false + false + false + false + false + 00400000 + true + true + Python_D10_2 + Components for Python + true + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;System.Win;$(DCC_Namespace) + 1031 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= + .\dcu\$(Platform)\$(Config) + .\dcp\$(Platform)\$(Config) + .\bpl\$(Platform)\$(Config) + + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + android-support-v4.dex.jar;cloud-messaging.dex.jar;fmx.dex.jar;google-analytics-v2.dex.jar;google-play-billing.dex.jar;google-play-licensing.dex.jar;google-play-services.dex.jar + rtl;dbrtl;$(DCC_UsePackage) + + + rtl;dbrtl;$(DCC_UsePackage) + + + rtl;dbrtl;$(DCC_UsePackage) + + + rtl;dbrtl;$(DCC_UsePackage) + + + rtl;dbrtl;$(DCC_UsePackage) + + + Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + rtl;vcl;dbrtl;$(DCC_UsePackage) + + + Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + rtl;vcl;dbrtl;$(DCC_UsePackage) + + + RELEASE;$(DCC_Define) + 0 + false + 0 + + + true + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + + + true + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + DEBUG;$(DCC_Define) + false + true + + + Debug + + + true + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + + + true + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + + + + + + + + + + + + + + + + + + + + + + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + Delphi.Personality.12 + Package + + + + Python_D10_2.dpk + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + False + False + True + True + + + + + Python_D10_2.bpl + true + + + + + 1 + + + Contents\MacOS + 0 + + + + + classes + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + 1 + + + 0 + + + + + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + 12 + + + + + diff --git a/PythonForDelphi/Components/Python_D10_2.dres b/PythonForDelphi/Components/Python_D10_2.dres new file mode 100644 index 00000000..e980306b Binary files /dev/null and b/PythonForDelphi/Components/Python_D10_2.dres differ diff --git a/PythonForDelphi/Components/Python_D10_2.res b/PythonForDelphi/Components/Python_D10_2.res new file mode 100644 index 00000000..92d6551b Binary files /dev/null and b/PythonForDelphi/Components/Python_D10_2.res differ diff --git a/PythonForDelphi/Components/Python_D10_2Resource.rc b/PythonForDelphi/Components/Python_D10_2Resource.rc new file mode 100644 index 00000000..09404fde --- /dev/null +++ b/PythonForDelphi/Components/Python_D10_2Resource.rc @@ -0,0 +1 @@ +Icon_1 ICON "PyDelphi.ico" diff --git a/PythonForDelphi/Components/Sources/Core/Definition.Inc b/PythonForDelphi/Components/Sources/Core/Definition.Inc index 8b83a1d0..83d3a1cc 100644 --- a/PythonForDelphi/Components/Sources/Core/Definition.Inc +++ b/PythonForDelphi/Components/Sources/Core/Definition.Inc @@ -37,7 +37,7 @@ //{$DEFINE PYTHON33} //{$DEFINE PYTHON34} //{$DEFINE PYTHON35} -//{$DEFINE PYTHON36} +{$DEFINE PYTHON36} //{$DEFINE PYTHON37} ///////////////////////////////////////////////////////////////////////////// diff --git a/PythonForDelphi/Components/Sources/Core/PythonEngine.pas b/PythonForDelphi/Components/Sources/Core/PythonEngine.pas index 7516faa8..2dfbaf99 100644 --- a/PythonForDelphi/Components/Sources/Core/PythonEngine.pas +++ b/PythonForDelphi/Components/Sources/Core/PythonEngine.pas @@ -78,6 +78,9 @@ interface SysUtils, SyncObjs, Variants, +//DAV>>> + System.AnsiStrings, Data.SqlTimSt, +//DAV<<< {$IFDEF DELPHI2005_OR_HIGHER} {$IFNDEF UNICODE} WideStrings, @@ -138,7 +141,12 @@ interface (DllName: 'python33.dll'; RegVersion: '3.3'; APIVersion: 1013; CanUseLatest: True), (DllName: 'python34.dll'; RegVersion: '3.4'; APIVersion: 1013; CanUseLatest: True), (DllName: 'python35.dll'; RegVersion: '3.5'; APIVersion: 1013; CanUseLatest: True), +{$IFDEF DEBUG} + // (DllName: 'python36_d.dll'; RegVersion: '3.6'; APIVersion: 1013; CanUseLatest: True) ); (DllName: 'python36.dll'; RegVersion: '3.6'; APIVersion: 1013; CanUseLatest: True), +{$ELSE} + (DllName: 'python36.dll'; RegVersion: '3.6'; APIVersion: 1013; CanUseLatest: True), +{$ENDIF} (DllName: 'python37.dll'; RegVersion: '3.7'; APIVersion: 1013; CanUseLatest: True) ); {$ENDIF} {$IFDEF LINUX} @@ -193,12 +201,14 @@ interface {$IFDEF PYTHON36} COMPILED_FOR_PYTHON_VERSION_INDEX = 12; {$ENDIF} -{$IFDEF PYTHON36} +{$IFDEF PYTHON37} COMPILED_FOR_PYTHON_VERSION_INDEX = 13; {$ENDIF} - PYT_METHOD_BUFFER_INCREASE = 10; - PYT_MEMBER_BUFFER_INCREASE = 10; - PYT_GETSET_BUFFER_INCREASE = 10; +//DAV>>> !!! ReallocMethods, ReallocMembers, ReallocGetSets don't work correctly !!! + PYT_METHOD_BUFFER_INCREASE = 100; + PYT_MEMBER_BUFFER_INCREASE = 100; + PYT_GETSET_BUFFER_INCREASE = 100; +//DAV<<< METH_VARARGS = $0001; METH_KEYWORDS = $0002; @@ -1389,7 +1399,7 @@ EPyWindowsError = class (EPyOSError); {$IF not Defined(FPC) and (CompilerVersion >= 23)} [ComponentPlatformsAttribute(pidWin32 or pidWin64)] - {$IFEND} + {$ENDIF} TPythonInputOutput = class(TComponent) protected FMaxLines : Integer; @@ -1916,6 +1926,7 @@ TPythonInterface=class(TDynamicDll) _PyObject_New:function (obt:PPyTypeObject;ob:PPyObject):PPyObject; cdecl; _PyString_Resize:function (var ob:PPyObject;i:NativeInt):integer; cdecl; Py_Finalize : procedure; cdecl; + Py_FinalizeEx : function : Integer; PyErr_ExceptionMatches : function ( exc : PPyObject) : Integer; cdecl; PyErr_GivenExceptionMatches : function ( raised_exc, exc : PPyObject) : Integer; cdecl; PyEval_EvalCode : function ( co : PPyCodeObject; globals, locals : PPyObject) : PPyObject; cdecl; @@ -2130,7 +2141,7 @@ TPythonTraceback = class {$IF not Defined(FPC) and (CompilerVersion >= 23)} [ComponentPlatformsAttribute(pidWin32 or pidWin64)] - {$IFEND} + {$ENDIF} TPythonEngine = class(TPythonInterface) private FInitScript: TStrings; @@ -2598,7 +2609,7 @@ TErrors = class(TCollection) {$IF not Defined(FPC) and (CompilerVersion >= 23)} [ComponentPlatformsAttribute(pidWin32 or pidWin64)] - {$IFEND} + {$ENDIF} TPythonModule = class(TMethodsContainer) protected FModuleName : AnsiString; @@ -2633,6 +2644,9 @@ TPythonModule = class(TMethodsContainer) procedure SetVar( const varName : AnsiString; value : PPyObject ); function GetVar( const varName : AnsiString ) : PPyObject; procedure DeleteVar( const varName : AnsiString ); +//DAV>>> + procedure ClearVars; +//DAV<<< procedure SetVarFromVariant( const varName : AnsiString; const value : Variant ); function GetVarAsVariant( const varName: AnsiString ) : Variant; @@ -2863,7 +2877,7 @@ TTypeServices = class(TPersistent) // that creates instances of itself. {$IF not Defined(FPC) and (CompilerVersion >= 23)} [ComponentPlatformsAttribute(pidWin32 or pidWin64)] - {$IFEND} + {$ENDIF} TPythonType = class(TGetSetContainer) protected FType : PyTypeObject; @@ -2951,7 +2965,7 @@ TPythonType = class(TGetSetContainer) {$IF not Defined(FPC) and (CompilerVersion >= 23)} [ComponentPlatformsAttribute(pidWin32 or pidWin64)] - {$IFEND} + {$ENDIF} TPythonDelphiVar = class( TEngineClient ) protected FModule : AnsiString; @@ -4002,6 +4016,8 @@ procedure TPythonInterface.MapDll; else _PyString_Resize :=Import('_PyBytes_Resize'); Py_Finalize :=Import('Py_Finalize'); + if IsPython3000 then + Py_FinalizeEx :=Import('Py_FinalizeEx'); if getProcAddress( FDLLHandle, 'PyCode_Addr2Line' ) <> nil then DLL_PyCode_Addr2Line := Import('PyCode_Addr2Line'); if getProcAddress( FDLLHandle, 'PyImport_ExecCodeModule' ) <> nil then @@ -4614,13 +4630,16 @@ procedure TPythonEngine.Finalize; Finalize; end; // Then finalize Python, if we have to - if Initialized and FAutoFinalize then + if Initialized and FAutoFinalize then begin try - FFinalizing := True; - Py_Finalize; - finally - FFinalizing := False; - end; + try + FFinalizing := True; + Py_Finalize; + finally + FFinalizing := False; + end; + except end; + end; // Detach our clients, when engine is beeing destroyed or one of its clients. canDetachClients := csDestroying in ComponentState; if not canDetachClients then @@ -4899,48 +4918,37 @@ procedure TPythonEngine.Notification( AComponent: TComponent; procedure TPythonEngine.CheckRegistry; {$IFDEF MSWINDOWS} var - key : string; - Path : string; - NewPath : string; - MajorVersion : integer; - MinorVersion : integer; - VersionSuffix: string; + key : String; + path : String; {$ENDIF} begin {$IFDEF MSWINDOWS} - if Assigned( FOnPathInitialization ) then try - with TRegistry.Create(KEY_ALL_ACCESS and not KEY_NOTIFY) do + with TRegistry.Create(KEY_READ and not KEY_NOTIFY) do try - MajorVersion := StrToInt(RegVersion[1]); - MinorVersion := StrToInt(RegVersion[3]); - VersionSuffix := ''; -{$IFDEF CPUX86} - if (MajorVersion > 3) or ((MajorVersion = 3) and (MinorVersion >= 5)) then - VersionSuffix := '-32'; -{$ENDIF} - key := Format('\Software\Python\PythonCore\%s%s\PythonPath', [RegVersion, VersionSuffix]); - + //Access := KEY_READ; // works only with Delphi5 or greater RootKey := HKEY_LOCAL_MACHINE; + key := Format('\Software\Python\PythonCore\%s\PythonPath', [RegVersion]); if not KeyExists( key ) then - begin - // try a current user installation - RootKey := HKEY_CURRENT_USER; - if not KeyExists( key ) then Exit; - end; - // Key found - OpenKey( key, True ); - try - Path := ReadString(''); - NewPath := Path; - FOnPathInitialization( Self, NewPath ); - if NewPath <> Path then begin - WriteString( '', NewPath ); + // try a current user installation + RootKey := HKEY_CURRENT_USER; + if not KeyExists( key ) then + begin + if Assigned( FOnPathInitialization ) then + begin + path := ''; + FOnPathInitialization( Self, path ); + if path <> '' then + begin + //Access := KEY_ALL_ACCESS; // works only with Delphi5 or greater + OpenKey( key, True ); + WriteString( '', path ); + CloseKey; + end; + end; + end; end; - finally - CloseKey; - end; finally Free; end; @@ -5731,6 +5739,9 @@ function TPythonEngine.VariantAsPyObject( const V : Variant ) : PPyObject; Disp : IDispatch; DispID : Integer; args : PPyObject; +//DAV>>> + l_dtSQLTimeStamp: TSQLTimeStamp; +//DAV<<< begin Disp := nil; //Dereference Variant @@ -5829,22 +5840,51 @@ function TPythonEngine.VariantAsPyObject( const V : Variant ) : PPyObject; Result := ReturnNone; end else - try - Disp := DeRefV; - wStr := '__asPPyObject__'; - // detect if the variant supports this special property - if Assigned(Disp) and (Disp.GetIDsOfNames(GUID_NULL, @wStr, 1, 0, @DispID) = S_OK) then - begin - myInt := DeRefV.__asPPyObject__; //Returns the address to PPyObject as integer. (See impl. in PythonAtom.pas) - Result := PPyObject(myInt); - Py_XIncRef(Result); +//DAV>>> + if VarIsSQLTimeStamp(V) then begin + l_dtSQLTimeStamp := VarToSQLTimeStamp(V); + dt := SQLTimeStampToDateTime(l_dtSQLTimeStamp); + DecodeDate( dt, y, m, d ); + DecodeTime( dt, h, mi, sec, ms ); + if (DatetimeConversionMode = dcmToTuple) then begin + wd := (DayOfWeek( dt ) + 7 - 2) mod 7; // In Python, Monday is the first day (=0) + jd := Round(EncodeDate(y,m,d)-EncodeDate(y,1,1))+1; // This shoud be the Julian day, the day in a year (0-366) + dl := -1; // This is daylight save... + Result := ArrayToPyTuple( [y, m, d, h, mi, sec, wd, jd, dl] ); + end + else if (DatetimeConversionMode = dcmToDatetime) then begin + if not Assigned(FPyDateTime_DateTimeType) then + raise EPythonError.Create('dcmToDatetime DatetimeConversionMode cannot be used with this version of python. Missing module datetime'); + args := ArrayToPyTuple([y, m, d, h, mi, sec, ms*1000]); + try + Result := PyEval_CallObjectWithKeywords(FPyDateTime_DateTimeType, args, nil); + CheckError(False); + finally + Py_DecRef(args); + end; end - else //If variant don't implement __asPPyObject__, then we have to return nothing. + else + raise EPythonError.Create('Invalid DatetimeConversionMode'); + end + else begin +//DAV<<< + try + Disp := DeRefV; + wStr := '__asPPyObject__'; + // detect if the variant supports this special property + if Assigned(Disp) and (Disp.GetIDsOfNames(GUID_NULL, @wStr, 1, 0, @DispID) = S_OK) then + begin + myInt := DeRefV.__asPPyObject__; //Returns the address to PPyObject as integer. (See impl. in PythonAtom.pas) + Result := PPyObject(myInt); + Py_XIncRef(Result); + end + else //If variant don't implement __asPPyObject__, then we have to return nothing. + Result := ReturnNone; + except + // if something went wrong, just return none! Result := ReturnNone; - except - // if something went wrong, just return none! - Result := ReturnNone; - end; // of try + end; // of try + end; end; // of case end; @@ -6029,7 +6069,7 @@ function TPythonEngine.VarRecAsPyObject( v : TVarRec ) : PPyObject; vtString: begin if Assigned(v.VString) then - Result := PyString_FromString( StrPCopy( buff, v.VString^) ) + Result := PyString_FromString( System.AnsiStrings.StrPCopy( buff, v.VString^) ) else Result := PyString_FromString( '' ); end; @@ -6155,7 +6195,7 @@ function TPythonEngine.ArrayToPyDict( items : array of const) : PPyObject; vtAnsiString: begin if Assigned(v.VAnsiString) then - Result := StrPas(PAnsiChar(Ansistring(v.VAnsiString))) + Result := System.AnsiStrings.StrPas(PAnsiChar(Ansistring(v.VAnsiString))) else Result := ''; end; @@ -6807,8 +6847,9 @@ function TMethodsContainer.AddMethod( AMethodName : PAnsiChar; AMethod : PyCFunction; ADocString : PAnsiChar ) : PPyMethodDef; begin - if FMethodCount = FAllocatedMethodCount then + if FMethodCount = FAllocatedMethodCount then begin ReallocMethods; + end; Result := Methods[ MethodCount ]; Result^.ml_name := AMethodName; Result^.ml_meth := AMethod; @@ -7582,6 +7623,19 @@ procedure TPythonModule.DeleteVar( const varName : AnsiString ); raise EPythonError.CreateFmt( 'Can''t delete var "%s" in module "%s", because it is not yet initialized', [varName, ModuleName] ); end; +//DAV>>> +procedure TPythonModule.ClearVars; +var + dict : PPyObject; +begin + if Assigned(FEngine) and Assigned( FModule ) then + with Engine do begin + dict := PyModule_GetDict( Module ); + PyDict_Clear(dict); + end; +end; +//DAV<<< + procedure TPythonModule.SetVarFromVariant( const varName : AnsiString; const value : Variant ); var obj : PPyObject; diff --git a/PythonForDelphi/Components/Sources/Core/VarPyth.pas b/PythonForDelphi/Components/Sources/Core/VarPyth.pas index f313d041..b0aeb6d0 100644 --- a/PythonForDelphi/Components/Sources/Core/VarPyth.pas +++ b/PythonForDelphi/Components/Sources/Core/VarPyth.pas @@ -42,7 +42,7 @@ interface uses - Variants, PythonEngine; + Variants, System.AnsiStrings, PythonEngine; type TSequenceType = (stTuple, stList); @@ -145,7 +145,7 @@ TPythonVariantType = class(TInvokeableVariantType, IVarInstanceReference) function VarDataToPythonObject( AVarData : TVarData ) : PPyObject; procedure PythonObjectToVarData( var Dest : TVarData; AObject : PPyObject; APythonAtomCompatible : Boolean ); procedure PyhonVarDataCreate( var Dest : TVarData; AObject : PPyObject ); - {$IFNDEF USESYSTEMDISPINVOKE} + {$IFNDEF USESYSTEMDISPINVOKE} procedure DoDispInvoke(Dest: PVarData; const Source: TVarData; CallDesc: PCallDesc; Params: Pointer); virtual; function GetPropertyWithArg(var Dest: TVarData; const V: TVarData; @@ -182,8 +182,8 @@ TPythonVariantType = class(TInvokeableVariantType, IVarInstanceReference) const AName: string): Boolean; override; function SetProperty(const V: TVarData; const AName: string; const Value: TVarData): Boolean; override; - procedure DispInvoke(Dest: PVarData; const Source: TVarData; - CallDesc: PCallDesc; Params: Pointer); override; + procedure DispInvoke(Dest: PVarData; [Ref] const Source: TVarData; + CallDesc: PCallDesc; Params: Pointer); override; end; var @@ -932,9 +932,9 @@ procedure SetClearVarToEmptyParam(var V: TVarData); CPropertySet = $04; {$IFDEF USESYSTEMDISPINVOKE} -procedure TPythonVariantType.DispInvoke(Dest: PVarData; - const Source: TVarData; CallDesc: PCallDesc; Params: Pointer); -{$IFDEF DELPHIXE2_OR_HIGHER} +procedure TPythonVariantType.DispInvoke(Dest: PVarData; [Ref] const Source: TVarData; + CallDesc: PCallDesc; Params: Pointer); +{$IFDEF DELPHIXE2} // Modified to correct memory leak QC102387 procedure PatchedDispInvoke(Dest: PVarData; const Source: TVarData; CallDesc: PCallDesc; Params: Pointer); @@ -1029,7 +1029,7 @@ TStringDesc = record for I := Low(VarParams) to High(VarParams) do VarDataClear(VarParams[I]); end; -{$ENDIF DELPHIXE2_OR_HIGHER} +{$ENDIF DELPHIXE2} procedure GetNamedParams; var @@ -1042,7 +1042,7 @@ TStringDesc = record SetLength(fNamedParams, CallDesc^.NamedArgCount); // Skip function Name for I := 0 to CallDesc^.NamedArgCount - 1 do begin - LNamePtr := LNamePtr + Succ(StrLen(LNamePtr)); + LNamePtr := LNamePtr + Succ(System.AnsiStrings.StrLen(LNamePtr)); fNamedParams[I].Index := I+LNamedArgStart; fNamedParams[I].Name := AnsiString(LNamePtr); end; @@ -1056,17 +1056,17 @@ TStringDesc = record if (CallDesc^.CallType = CPropertyGet) and (CallDesc^.ArgCount = 1) then begin NewCallDesc := CallDesc^; NewCallDesc.CallType := CDoMethod; - {$IFDEF DELPHIXE2_OR_HIGHER} + {$IFDEF DELPHIXE2} PatchedDispInvoke(Dest, Source, @NewCallDesc, Params); - {$ELSE DELPHIXE2_OR_HIGHER} + {$ELSE DELPHIXE2} inherited DispInvoke(Dest, Source, @NewCallDesc, Params); - {$ENDIF DELPHIXE2_OR_HIGHER} + {$ENDIF DELPHIXE2} end else - {$IFDEF DELPHIXE2_OR_HIGHER} + {$IFDEF DELPHIXE2} PatchedDispInvoke(Dest, Source, CallDesc, Params); - {$ELSE DELPHIXE2_OR_HIGHER} + {$ELSE DELPHIXE2} inherited; - {$ENDIF DELPHIXE2_OR_HIGHER} + {$ENDIF DELPHIXE2} finally if CallDesc^.NamedArgCount > 0 then SetLength(fNamedParams, 0); end; @@ -2186,10 +2186,10 @@ function TPythonData.Equal(const Right: TPythonData): Boolean; function TPythonData.GetAsAnsiString: AnsiString; begin - if Assigned(PyObject) and GetPythonEngine.PyString_CheckExact(PyObject) then - Result := GetPythonEngine.PyString_AsString(PyObject) - else - result := GetAsString; + if Assigned(PyObject) and GetPythonEngine.PyString_CheckExact(PyObject) then + Result := GetPythonEngine.PyString_AsString(PyObject) + else + Result := AnsiString(GetAsString); end; function TPythonData.GetAsString: String; diff --git a/PythonForDelphi/Components/Sources/Core/WrapDelphi.pas b/PythonForDelphi/Components/Sources/Core/WrapDelphi.pas index 5e632be7..947b21e2 100644 --- a/PythonForDelphi/Components/Sources/Core/WrapDelphi.pas +++ b/PythonForDelphi/Components/Sources/Core/WrapDelphi.pas @@ -1202,9 +1202,9 @@ constructor TContainerAccess.Create(AWrapper: TPyDelphiWrapper; AContainer: TObject); begin inherited Create; - Assert(Assigned(AWrapper)); + //DAV>>> Assert(Assigned(AWrapper)); Assert(Assigned(AContainer)); - Assert(AContainer.InheritsFrom(ExpectedContainerClass), Format('Class %s expects a container of class %s', [ClassName, ExpectedContainerClass.ClassName])); + //DAV>>> Assert(AContainer.InheritsFrom(ExpectedContainerClass), Format('Class %s expects a container of class %s', [ClassName, ExpectedContainerClass.ClassName])); fWrapper := AWrapper; fContainer := AContainer; end; @@ -1517,7 +1517,7 @@ function TPyDelphiObject.GetAttrO(key: PPyObject): PPyObject; Finally call inherited which calls PyObject_GenericGetAttr *) var - Name: ShortString; + Name: String; {$IFNDEF FPC} Info: PMethodInfoHeader; {$ENDIF} @@ -1526,7 +1526,7 @@ function TPyDelphiObject.GetAttrO(key: PPyObject): PPyObject; begin Result := nil; if GetPythonEngine.PyString_Check(Key) then - Name := ShortString(GetPythonEngine.PyString_AsDelphiString(Key)) + Name := GetPythonEngine.PyString_AsDelphiString(Key) else Name := ''; diff --git a/PythonForDelphi/Components/Sources/Core/WrapDelphiClasses.pas b/PythonForDelphi/Components/Sources/Core/WrapDelphiClasses.pas index 8bd1932f..c2a9e78b 100644 --- a/PythonForDelphi/Components/Sources/Core/WrapDelphiClasses.pas +++ b/PythonForDelphi/Components/Sources/Core/WrapDelphiClasses.pas @@ -342,7 +342,7 @@ function TPyDelphiPersistent.Assign_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if PyArg_ParseTuple( args, 'O:Assign',@_obj ) <> 0 then + if PyArg_ParseTuple( args, PAnsiChar('O:Assign'), @_obj ) <> 0 then Result := Self.Assign(_obj) else Result := nil; @@ -365,7 +365,7 @@ function TPyDelphiPersistent.GetNamePath_Wrapper( with GetPythonEngine do begin // We adjust the transmitted self argument Adjust(@Self); - if PyArg_ParseTuple( args, ':GetNamePath' ) <> 0 then begin + if PyArg_ParseTuple( args, PAnsiChar(':GetNamePath') ) <> 0 then begin Result := PyString_FromString(PAnsiChar(AnsiString(DelphiObject.GetNamePath))) end else Result := nil; @@ -376,12 +376,12 @@ class procedure TPyDelphiPersistent.RegisterMethods( PythonType: TPythonType); begin inherited; - PythonType.AddMethod('Assign', @TPyDelphiPersistent.Assign_Wrapper, - 'TPersistent.Assign(persistent)'#10 + - 'Assigns to this object the values of another TPersistent object'); - PythonType.AddMethod('GetNamePath', @TPyDelphiPersistent.GetNamePath_Wrapper, - 'TPersistent.GetNamePath()'#10 + - 'Returns the name of the object as it appears in the Object Inspector.'); + PythonType.AddMethod(PAnsiChar('Assign'), @TPyDelphiPersistent.Assign_Wrapper, + PAnsiChar('TPersistent.Assign(persistent)'#10 + + 'Assigns to this object the values of another TPersistent object')); + PythonType.AddMethod(PAnsiChar('GetNamePath'), @TPyDelphiPersistent.GetNamePath_Wrapper, + PAnsiChar('TPersistent.GetNamePath()'#10 + + 'Returns the name of the object as it appears in the Object Inspector.')); end; procedure TPyDelphiPersistent.SetDelphiObject(const Value: TPersistent); @@ -459,7 +459,7 @@ function TPyDelphiCollection.Add_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, ':Add' ) <> 0 then + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar(':Add') ) <> 0 then Result := Wrap(DelphiObject.Add) else Result := nil; @@ -470,7 +470,7 @@ function TPyDelphiCollection.BeginUpdate_Wrapper( begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, ':BeginUpdate' ) <> 0 then begin + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar(':BeginUpdate') ) <> 0 then begin DelphiObject.BeginUpdate; Result := GetPythonEngine.ReturnNone; end else @@ -481,7 +481,7 @@ function TPyDelphiCollection.Clear_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, ':Clear') <> 0 then begin + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar(':Clear')) <> 0 then begin (DelphiObject as TCollection).Clear; Result := GetPythonEngine.ReturnNone; end else @@ -494,7 +494,7 @@ function TPyDelphiCollection.Delete_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, 'i:Delete',@Index ) <> 0 then + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar('i:Delete'),@Index ) <> 0 then begin if not CheckIndex(Index, DelphiObject.Count) then Result := nil @@ -517,7 +517,7 @@ function TPyDelphiCollection.EndUpdate_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, ':EndUpdate') <> 0 then begin + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar(':EndUpdate')) <> 0 then begin DelphiObject.EndUpdate; Result := GetPythonEngine.ReturnNone; end else @@ -566,7 +566,7 @@ function TPyDelphiCollection.Insert_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, 'i:Insert',@Index ) <> 0 then + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar('i:Insert'),@Index ) <> 0 then Result := Wrap(DelphiObject.Insert(Index)) else Result := nil; @@ -577,12 +577,12 @@ class procedure TPyDelphiCollection.RegisterGetSets(PythonType: TPythonType); inherited; with PythonType do begin - AddGetSet('Count', @TPyDelphiCollection.Get_Count, nil, - 'Returns the count of collection items', nil); - AddGetSet('Items', @TPyDelphiCollection.Get_Items, nil, - 'Returns an iterator over the collection items', nil); - AddGetSet('Owner', @TPyDelphiCollection.Get_Owner, nil, - 'Returns the Owner of the collection', nil); + AddGetSet(PAnsiChar('Count'), @TPyDelphiCollection.Get_Count, nil, + PAnsiChar('Returns the count of collection items'), nil); + AddGetSet(PAnsiChar('Items'), @TPyDelphiCollection.Get_Items, nil, + PAnsiChar('Returns an iterator over the collection items'), nil); + AddGetSet(PAnsiChar('Owner'), @TPyDelphiCollection.Get_Owner, nil, + PAnsiChar('Returns the Owner of the collection'), nil); end; end; @@ -590,24 +590,24 @@ class procedure TPyDelphiCollection.RegisterMethods( PythonType: TPythonType); begin inherited; - PythonType.AddMethod('Insert', @TPyDelphiCollection.Insert_Wrapper, - 'TCollection.Insert(Index)'#10 + - 'Inserts a new collection item to the collection at the Index position'); - PythonType.AddMethod('Add', @TPyDelphiCollection.Add_Wrapper, - 'TCollection.Add()'#10 + - 'Adds a collection item to the collection'); - PythonType.AddMethod('Clear', @TPyDelphiCollection.Clear_Wrapper, - 'TCollection.Clear()'#10 + - 'Clears all collection items'); - PythonType.AddMethod('Delete', @TPyDelphiCollection.Delete_Wrapper, - 'TCollection.Delete(Index)'#10 + - 'Deletes a single item from the collection.'); - PythonType.AddMethod('BeginUpdate', @TPyDelphiCollection.BeginUpdate_Wrapper, - 'TCollection.BeginUpdate()'#10 + - 'Suspends screen repainting.'); - PythonType.AddMethod('EndUpdate', @TPyDelphiCollection.EndUpdate_Wrapper, - 'TCollection.EndUpdate()'#10 + - 'Re-enables screen repainting.'); + PythonType.AddMethod(PAnsiChar('Insert'), @TPyDelphiCollection.Insert_Wrapper, + PAnsiChar('TCollection.Insert(Index)'#10 + + 'Inserts a new collection item to the collection at the Index position')); + PythonType.AddMethod(PAnsiChar('Add'), @TPyDelphiCollection.Add_Wrapper, + PAnsiChar('TCollection.Add()'#10 + + 'Adds a collection item to the collection')); + PythonType.AddMethod(PAnsiChar('Clear'), @TPyDelphiCollection.Clear_Wrapper, + PAnsiChar('TCollection.Clear()'#10 + + 'Clears all collection items')); + PythonType.AddMethod(PAnsiChar('Delete'), @TPyDelphiCollection.Delete_Wrapper, + PAnsiChar('TCollection.Delete(Index)'#10 + + 'Deletes a single item from the collection.')); + PythonType.AddMethod(PAnsiChar('BeginUpdate'), @TPyDelphiCollection.BeginUpdate_Wrapper, + PAnsiChar('TCollection.BeginUpdate()'#10 + + 'Suspends screen repainting.')); + PythonType.AddMethod(PAnsiChar('EndUpdate'), @TPyDelphiCollection.EndUpdate_Wrapper, + PAnsiChar('TCollection.EndUpdate()'#10 + + 'Re-enables screen repainting.')); end; procedure TPyDelphiCollection.SetDelphiObject(const Value: TCollection); @@ -736,7 +736,7 @@ function TPyDelphiComponent.BindMethodsToEvents(args: PPyObject): PPyObject; Adjust(@Self); Result := nil; s := nil; - if PyArg_ParseTuple( args, '|O:BindMethodsToEvents',@s ) <> 0 then + if PyArg_ParseTuple( args, PAnsiChar('|O:BindMethodsToEvents'),@s ) <> 0 then begin if Assigned(S) then _prefix := PyString_AsDelphiString(s); @@ -869,7 +869,7 @@ function TPyDelphiComponent.GetParentComponent_Wrapper( with GetPythonEngine do begin // We adjust the transmitted self argument Adjust(@Self); - if PyArg_ParseTuple( args, ':GetParentComponent') <> 0 then begin + if PyArg_ParseTuple( args, PAnsiChar(':GetParentComponent')) <> 0 then begin Result := Wrap(DelphiObject.GetParentComponent) end else Result := nil; @@ -881,7 +881,7 @@ function TPyDelphiComponent.HasParent_Wrapper(args: PPyObject): PPyObject; with GetPythonEngine do begin // We adjust the transmitted self argument Adjust(@Self); - if PyArg_ParseTuple( args, ':HasParent') <> 0 then begin + if PyArg_ParseTuple( args, PAnsiChar(':HasParent')) <> 0 then begin Result := VariantAsPyObject(DelphiObject.HasParent) end else Result := nil; @@ -926,12 +926,12 @@ class procedure TPyDelphiComponent.RegisterGetSets( inherited; with PythonType do begin - AddGetSet('ComponentCount', @TPyDelphiComponent.Get_ComponentCount, nil, - 'Returns the owned component count', nil); - AddGetSet('Owner', @TPyDelphiComponent.Get_Owner, nil, - 'Returns the Component Owner', nil); - AddGetSet('Components', @TPyDelphiComponent.Get_Components, nil, - 'Returns an iterator over the owned components', nil); + AddGetSet(PAnsiChar('ComponentCount'), @TPyDelphiComponent.Get_ComponentCount, nil, + PAnsiChar('Returns the owned component count'), nil); + AddGetSet(PAnsiChar('Owner'), @TPyDelphiComponent.Get_Owner, nil, + PAnsiChar('Returns the Component Owner'), nil); + AddGetSet(PAnsiChar('Components'), @TPyDelphiComponent.Get_Components, nil, + PAnsiChar('Returns an iterator over the owned components'), nil); end; end; @@ -939,18 +939,18 @@ class procedure TPyDelphiComponent.RegisterMethods( PythonType: TPythonType); begin inherited; - PythonType.AddMethod('GetParentComponent', @TPyDelphiComponent.GetParentComponent_Wrapper, - 'TComponent.GetParentComponent()'#10 + - 'Returns the parent of a component.'); - PythonType.AddMethod('HasParent', @TPyDelphiComponent.HasParent_Wrapper, - 'TComponent.HasParent()'#10 + - 'Indicates whether the component has a parent to handle its filing.'); - PythonType.AddMethod('BindMethodsToEvents', @TPyDelphiComponent.BindMethodsToEvents, - 'TComponent.BindMethodsToEvents(prefix)'#10 + + PythonType.AddMethod(PAnsiChar('GetParentComponent'), @TPyDelphiComponent.GetParentComponent_Wrapper, + PAnsiChar('TComponent.GetParentComponent()'#10 + + 'Returns the parent of a component.')); + PythonType.AddMethod(PAnsiChar('HasParent'), @TPyDelphiComponent.HasParent_Wrapper, + PAnsiChar('TComponent.HasParent()'#10 + + 'Indicates whether the component has a parent to handle its filing.')); + PythonType.AddMethod(PAnsiChar('BindMethodsToEvents'), @TPyDelphiComponent.BindMethodsToEvents, + PAnsiChar('TComponent.BindMethodsToEvents(prefix)'#10 + 'Connects methods to component events if they are named using the following patter: Prefix_ComponentName_EventName.'+#10+ 'Example: def handle_button1_OnClick(Sender): pass'+#10+ 'The function returns a list of tuples. Each tuple contains the name of the component, the name of the event and the method object assigned to the event.'+#10+ - 'Note that the prefix parameter is optional and will default to "handle_".'); + 'Note that the prefix parameter is optional and will default to "handle_".')); end; class procedure TPyDelphiComponent.SetupType(PythonType: TPythonType); @@ -993,7 +993,7 @@ function TPyDelphiComponent.MpSubscript(obj: PPyObject): PPyObject; else begin Result := nil; - PyErr_SetString (PyExc_KeyError^, 'Key must be a string'); + PyErr_SetString (PyExc_KeyError^, PAnsiChar('Key must be a string')); end; end; end; @@ -1028,7 +1028,7 @@ constructor TPyDelphiComponent.CreateWith(APythonType: TPythonType; _owner : TObject; begin inherited; - if APythonType.Engine.PyArg_ParseTuple( args, 'O:Create',@_obj ) <> 0 then + if APythonType.Engine.PyArg_ParseTuple( args, PAnsiChar('O:Create'),@_obj ) <> 0 then begin _owner := nil; if CheckObjAttribute(_obj, 'Owner', TComponent, _owner) then @@ -1096,7 +1096,7 @@ function TStringsAccess.SetItem(AIndex: Integer; AValue: PPyObject): Boolean; else begin Result := False; - PyErr_SetString (PyExc_AttributeError^, 'You can only assign strings to TStrings items'); + PyErr_SetString (PyExc_AttributeError^, PAnsiChar('You can only assign strings to TStrings items')); end; end end; @@ -1160,7 +1160,7 @@ function TStringsObjectsAccess.SetItem(AIndex: Integer; AValue: PPyObject): Bool else begin Result := False; - PyErr_SetString (PyExc_AttributeError^, 'You can only assign Delphi wrappers to Objects items'); + PyErr_SetString (PyExc_AttributeError^, PAnsiChar('You can only assign Delphi wrappers to Objects items')); end; end end; @@ -1176,7 +1176,7 @@ function TPyDelphiStrings.AddObject_Wrapper(args: PPyObject): PPyObject; // We adjust the transmitted self argument Adjust(@Self); with GetPythonEngine do - if PyArg_ParseTuple( args, 'OO:AddObject',@PStr, @_obj ) <> 0 then + if PyArg_ParseTuple( args, PAnsiChar('OO:AddObject'),@PStr, @_obj ) <> 0 then begin if CheckObjAttribute(_obj, 'The second argument of AddObject', TObject, _value) then Result := PyInt_FromLong(DelphiObject.AddObject(PyString_AsDelphiString(PStr), _value)) @@ -1236,7 +1236,7 @@ function TPyDelphiStrings.BeginUpdate_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, ':BeginUpdate') <> 0 then begin + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar(':BeginUpdate')) <> 0 then begin DelphiObject.BeginUpdate; Result := GetPythonEngine.ReturnNone; end else @@ -1247,7 +1247,7 @@ function TPyDelphiStrings.Clear_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, ':Clear') <> 0 then begin + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar(':Clear')) <> 0 then begin DelphiObject.Clear; Result := GetPythonEngine.ReturnNone; end else @@ -1260,7 +1260,7 @@ function TPyDelphiStrings.Delete_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, 'i:Delete',@Index ) <> 0 then + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar('i:Delete'),@Index ) <> 0 then begin if CheckIndex(Index, DelphiObject.Count) then begin @@ -1283,7 +1283,7 @@ function TPyDelphiStrings.EndUpdate_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, ':EndUpdate') <> 0 then begin + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar(':EndUpdate')) <> 0 then begin DelphiObject.EndUpdate; Result := GetPythonEngine.ReturnNone; end else @@ -1333,7 +1333,7 @@ function TPyDelphiStrings.IndexOf_Wrapper(args: PPyObject): PPyObject; // We adjust the transmitted self argument Adjust(@Self); with GetPythonEngine do - if PyArg_ParseTuple( args, 'O:IndexOf',@PStr ) <> 0 then + if PyArg_ParseTuple( args, PAnsiChar('O:IndexOf'),@PStr ) <> 0 then Result := GetPythonEngine.PyInt_FromLong(DelphiObject.IndexOf(PyString_AsDelphiString(PStr))) else Result := nil; @@ -1345,7 +1345,7 @@ function TPyDelphiStrings.LoadFromFile_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, 's:LoadFromFile',@PStr ) <> 0 then + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar('s:LoadFromFile'),@PStr ) <> 0 then begin DelphiObject.LoadFromFile(String(PStr)); Result := GetPythonEngine.ReturnNone; @@ -1383,7 +1383,7 @@ function TPyDelphiStrings.MpSubscript(obj: PPyObject): PPyObject; Result := nil; end; end else with GetPythonEngine do begin - PyErr_SetString (PyExc_KeyError^, ''); + PyErr_SetString (PyExc_KeyError^, ('')); Result := nil; end; end; @@ -1395,45 +1395,45 @@ class procedure TPyDelphiStrings.RegisterGetSets(PythonType: TPythonType); inherited; with PythonType do begin - AddGetSet('Capacity', @TPyDelphiStrings.Get_Capacity, @TPyDelphiStrings.Set_Capacity, - 'Indicates the number of strings the TStrings object can hold.', nil); - AddGetSet('Text', @TPyDelphiStrings.Get_Text, @TPyDelphiStrings.Set_Text, - 'Lists the strings in the TStrings object as a single string with the individual strings delimited by carriage returns and line feeds.', nil); - AddGetSet('Objects', @TPyDelphiStrings.Get_Objects, nil, - 'Represents a set of objects that are associated one with each of the strings in the Strings property.', nil); + AddGetSet(PAnsiChar('Capacity'), @TPyDelphiStrings.Get_Capacity, @TPyDelphiStrings.Set_Capacity, + PAnsiChar('Indicates the number of strings the TStrings object can hold.'), nil); + AddGetSet(PAnsiChar('Text'), @TPyDelphiStrings.Get_Text, @TPyDelphiStrings.Set_Text, + PAnsiChar('Lists the strings in the TStrings object as a single string with the individual strings delimited by carriage returns and line feeds.'), nil); + AddGetSet(PAnsiChar('Objects'), @TPyDelphiStrings.Get_Objects, nil, + PAnsiChar('Represents a set of objects that are associated one with each of the strings in the Strings property.'), nil); end; end; class procedure TPyDelphiStrings.RegisterMethods(PythonType: TPythonType); begin inherited; - PythonType.AddMethod('Add', @TPyDelphiStrings.Add_Wrapper, - 'TStrings.Add(s)'#10 + - 'Adds a string to the TStrings object and returns the index position'); - PythonType.AddMethod('AddObject', @TPyDelphiStrings.AddObject_Wrapper, - 'TStrings.AddObject(s, delphiobject)'#10 + - 'Adds a string and an associated Delphi object to the Strings and returns the index position'); - PythonType.AddMethod('Clear', @TPyDelphiStrings.Clear_Wrapper, - 'TStrings.Clear()'#10 + - 'Clears all strings from a TStrings (and the associated objects'); - PythonType.AddMethod('Delete', @TPyDelphiStrings.Delete_Wrapper, - 'TStrings.Delete(i)'#10 + - 'Deletes the string at Index i (and the associated object'); - PythonType.AddMethod('IndexOf', @TPyDelphiStrings.IndexOf_Wrapper, - 'TStrings.IndexOf(s)'#10 + - 'Returns the Index of a string s or -1 if not found'); - PythonType.AddMethod('BeginUpdate', @TPyDelphiStrings.BeginUpdate_Wrapper, - 'TStrings.BeginUpdate()'#10 + - 'Enables the TStrings object to track when the list of strings is changing.'); + PythonType.AddMethod(PAnsiChar('Add'), @TPyDelphiStrings.Add_Wrapper, + PAnsiChar('TStrings.Add(s)'#10 + + 'Adds a string to the TStrings object and returns the index position')); + PythonType.AddMethod(PAnsiChar('AddObject'), @TPyDelphiStrings.AddObject_Wrapper, + PAnsiChar('TStrings.AddObject(s, delphiobject)'#10 + + 'Adds a string and an associated Delphi object to the Strings and returns the index position')); + PythonType.AddMethod(PAnsiChar('Clear'), @TPyDelphiStrings.Clear_Wrapper, + PAnsiChar('TStrings.Clear()'#10 + + 'Clears all strings from a TStrings (and the associated objects')); + PythonType.AddMethod(PAnsiChar('Delete'), @TPyDelphiStrings.Delete_Wrapper, + PAnsiChar('TStrings.Delete(i)'#10 + + 'Deletes the string at Index i (and the associated object')); + PythonType.AddMethod(PAnsiChar('IndexOf'), @TPyDelphiStrings.IndexOf_Wrapper, + PAnsiChar('TStrings.IndexOf(s)'#10 + + 'Returns the Index of a string s or -1 if not found')); + PythonType.AddMethod(PAnsiChar('BeginUpdate'), @TPyDelphiStrings.BeginUpdate_Wrapper, + PAnsiChar('TStrings.BeginUpdate()'#10 + + 'Enables the TStrings object to track when the list of strings is changing.')); PythonType.AddMethod('EndUpdate', @TPyDelphiStrings.EndUpdate_Wrapper, - 'TStrings.EndUpdate()'#10 + - 'Enables the TStrings object to keep track of when the list of strings has finished changing.'); - PythonType.AddMethod('LoadFromFile', @TPyDelphiStrings.LoadFromFile_Wrapper, - 'TStrings.LoadFromFile(filename)'#10 + - 'Fills the list with the lines of text in a specified file.'); - PythonType.AddMethod('SaveToFile', @TPyDelphiStrings.SaveToFile_Wrapper, - 'TStrings.SaveToFile(filename)'#10 + - 'Saves the strings in the list to the specified file.'); + PAnsiChar('TStrings.EndUpdate()'#10 + + 'Enables the TStrings object to keep track of when the list of strings has finished changing.')); + PythonType.AddMethod(PAnsiChar('LoadFromFile'), @TPyDelphiStrings.LoadFromFile_Wrapper, + PAnsiChar('TStrings.LoadFromFile(filename)'#10 + + 'Fills the list with the lines of text in a specified file.')); + PythonType.AddMethod(PAnsiChar('SaveToFile'), @TPyDelphiStrings.SaveToFile_Wrapper, + PAnsiChar('TStrings.SaveToFile(filename)'#10 + + 'Saves the strings in the list to the specified file.')); end; function TPyDelphiStrings.Repr: PPyObject; @@ -1449,7 +1449,7 @@ function TPyDelphiStrings.SaveToFile_Wrapper(args: PPyObject): PPyObject; begin // We adjust the transmitted self argument Adjust(@Self); - if GetPythonEngine.PyArg_ParseTuple( args, 's:SaveToFile',@PStr ) <> 0 then + if GetPythonEngine.PyArg_ParseTuple( args, PAnsiChar('s:SaveToFile'),@PStr ) <> 0 then begin DelphiObject.SaveToFile(String(PStr)); Result := GetPythonEngine.ReturnNone; @@ -1481,7 +1481,7 @@ function TPyDelphiBasicAction.Execute_Wrapper(args: PPyObject): PPyObject; with GetPythonEngine do begin // We adjust the transmitted self argument Adjust(@Self); - if PyArg_ParseTuple( args, ':Execute') <> 0 then begin + if PyArg_ParseTuple( args, PAnsiChar(':Execute')) <> 0 then begin Result := VariantAsPyObject( DelphiObject.Execute ); end else Result := nil; @@ -1507,8 +1507,8 @@ class procedure TPyDelphiBasicAction.RegisterGetSets( inherited; with PythonType do begin - AddGetSet('ActionComponent', @TPyDelphiBasicAction.Get_ActionComponent, @TPyDelphiBasicAction.Set_ActionComponent, - 'Indicates the client component that caused this action to execute.', nil); + AddGetSet(PAnsiChar('ActionComponent'), @TPyDelphiBasicAction.Get_ActionComponent, @TPyDelphiBasicAction.Set_ActionComponent, + PAnsiChar('Indicates the client component that caused this action to execute.'), nil); end; end; @@ -1516,12 +1516,12 @@ class procedure TPyDelphiBasicAction.RegisterMethods( PythonType: TPythonType); begin inherited; - PythonType.AddMethod('Execute', @TPyDelphiBasicAction.Execute_Wrapper, - 'TBasicAction.Execute()'#10 + - 'Generates an OnExecute event.'); - PythonType.AddMethod('Update', @TPyDelphiBasicAction.Update_Wrapper, - 'TBasicAction.Update()'#10 + - 'Provides an opportunity to execute centralized code when an application is idle.'); + PythonType.AddMethod(PAnsiChar('Execute'), @TPyDelphiBasicAction.Execute_Wrapper, + PAnsiChar('TBasicAction.Execute()'#10 + + 'Generates an OnExecute event.')); + PythonType.AddMethod(PAnsiChar('Update'), @TPyDelphiBasicAction.Update_Wrapper, + PAnsiChar('TBasicAction.Update()'#10 + + 'Provides an opportunity to execute centralized code when an application is idle.')); end; procedure TPyDelphiBasicAction.SetDelphiObject(const Value: TBasicAction); @@ -1551,7 +1551,7 @@ function TPyDelphiBasicAction.Update_Wrapper(args: PPyObject): PPyObject; with GetPythonEngine do begin // We adjust the transmitted self argument Adjust(@Self); - if PyArg_ParseTuple( args, ':Update') <> 0 then begin + if PyArg_ParseTuple( args, PAnsiChar(':Update')) <> 0 then begin Result := VariantAsPyObject( DelphiObject.Update ); end else Result := nil; @@ -1593,5 +1593,6 @@ function TPyDelphiStrings.Set_Text(AValue: PPyObject; end; initialization - RegisteredUnits.Add(TClassesRegistration.Create); + RegisteredUnits.Add(TClassesRegistration.Create); + end. diff --git a/PythonForDelphi/Components/Sources/FireDAC/pyDBFireDac.pas b/PythonForDelphi/Components/Sources/FireDAC/pyDBFireDac.pas new file mode 100644 index 00000000..1d2510ea --- /dev/null +++ b/PythonForDelphi/Components/Sources/FireDAC/pyDBFireDac.pas @@ -0,0 +1,2788 @@ +{$REGION 'Licence'} +{ +Very important: We need text buffer for AnsiString's +==============================================================================} +{$ENDREGION} +unit pyDBFireDac; + +interface + +uses + Classes, SysUtils, Variants, PythonEngine, WrapDelphi, WrapDelphiClasses, + Windows, System.AnsiStrings, System.Rtti, DB, + FireDAC.Stan.Intf, FireDAC.Stan.Option, FireDAC.Stan.Error, FireDAC.UI.Intf, + FireDAC.Phys.Intf, FireDAC.Stan.Def, FireDAC.Stan.Pool, FireDAC.Stan.Async, + FireDAC.Phys, FireDAC.FMXUI.Wait, FireDAC.Stan.Param, FireDAC.DatS, + FireDAC.DApt.Intf, FireDAC.DApt, FireDAC.Comp.Client, FireDAC.Comp.DataSet, + FireDAC.Comp.UI, FireDAC.Stan.ExprFuncs; + +type + +TPyDBDataset = class; + +TCallBackSplit = record + method: Pointer; + self: TObject; +end; + +TPyDBSharedObject = class +protected + FRefCount : Integer; + FData : TObject; + FOwner : Boolean; + procedure DoDecRef; + procedure SetData( value : TObject ); +public + constructor Create; + constructor CreateWith( value : TObject; isOwner : Boolean ); + destructor Destroy; override; + procedure IncRef; + procedure DecRef; + procedure FreeData; + property Data: TObject read FData write SetData; + property Owner: Boolean read FOwner write FOwner; +end; + +TPyDBCommon = class(TPyObject) + function GetProperties : PPyObject; + procedure AppendProperties( List : PPyObject ); virtual; + procedure AppendProp( List : PPyObject; const prop : String ); + function GetAttr(key : PAnsiChar) : PPyObject; override; + procedure RaiseDBError( E : Exception ); + function EventBelongsToObject( Event : TCallbackSplit ) : Boolean; +end; + +TPyDBField = class(TPyDBCommon) +private + m_arAnsiTextBuf: TArray; +public + FField : TField; + FOnChange : PPyObject; + FOnGetText : PPyObject; + FOnSetText : PPyObject; + FOnValidate : PPyObject; + constructor Create( APythonType : TPythonType ); override; + constructor CreateWith( PythonType : TPythonType; args : PPyObject ); override; + // + class var PyDBFieldType: TPythonType; + // + destructor Destroy; override; + function GetAttr(key : PAnsiChar) : PPyObject; override; + function SetAttr(key : PAnsiChar; value : PPyObject) : Integer; override; + function Repr : PPyObject; override; + class procedure RegisterMethods( PythonType : TPythonType ); override; + function CheckField : Boolean; + procedure AppendProperties( List : PPyObject ); override; + // Do-Methods + function Do_Clear( args : PPyObject ) : PPyObject; cdecl; + function Do_FocusControl( args : PPyObject ) : PPyObject; cdecl; + function Do_IsValidChar( args : PPyObject ) : PPyObject; cdecl; + function Do_RefreshLookupList( args : PPyObject ) : PPyObject; cdecl; + // Events + procedure OnChange( Sender : TField ); + procedure OnGetText( Sender: TField; var Text: String; DisplayText: Boolean ); + procedure OnSetText( Sender : TField; const Text: String ); + procedure OnValidate( Sender : TField ); +end; + +TPyDBVarArg = class(TPyObject) +public + FValue : PPyObject; + constructor CreateWith( APythonType : TPythonType; args : PPyObject ); override; + destructor Destroy; override; + // + class var PyDBVarArgType: TPythonType; + // + function GetAttr(key : PAnsiChar) : PPyObject; override; + function SetAttr(key : PAnsiChar; value : PPyObject) : Integer; override; + function Repr : PPyObject; override; +end; + +{ +TPyDSRowsRegistration = class(TRegisteredUnit) +public + function Name(): String; override; + procedure RegisterWrappers(aPyDelphiWrapper: TPyDelphiWrapper); override; + procedure DefineVars(aPyDelphiWrapper: TPyDelphiWrapper); override; +end; +} + +TDSRowsAccess = class(TContainerAccess) +private + function GetContainer: TPyDBDataset; +public + function GetItem(AIndex : Integer) : PPyObject; override; + function GetSize : Integer; override; + function IndexOf(AValue : PPyObject) : Integer; override; + + class function ExpectedContainerClass : TClass; override; + class function SupportsIndexOf : Boolean; override; + class function Name : String; override; +end; + +{DAV>>> $M+ <<; + // Methods + procedure RaiseDBError( E : Exception ); +public + FSharedObject: TPyDBSharedObject; + constructor Create( aPythonType: TPythonType ); override; + constructor CreateWith( aPythonType : TPythonType; args : PPyObject ); override; + destructor Destroy; override; + // + function CreateContainerAccess : TContainerAccess; override; + // + // Class methodes + class function DelphiObjectClass : TClass; override; + class function GetContainerAccessClass : TContainerAccessClass; override; + class procedure RegisterGetSets( PythonType : TPythonType ); override; + class procedure RegisterMembers( PythonType : TPythonType ); override; + class procedure RegisterMethods( PythonType : TPythonType ); override; + // + // Property Getters + function Get_RowsCount( AContext : Pointer) : PPyObject; cdecl; + function Get_Rows( AContext : Pointer) : PPyObject; cdecl; + // + // Attributes + function GetAttr(key : PAnsiChar) : PPyObject; override; + function SetAttr(key : PAnsiChar; value : PPyObject) : Integer; override; + // + // Methods + function Do_Fields( args : PPyObject ): PPyObject; cdecl; + function Do_FieldByName( args : PPyObject ): PPyObject; cdecl; + function Do_FieldNamesAsTuple( args: PPyObject): PPyObject; cdecl; + function Do_FieldsAsTuple( args: PPyObject): PPyObject; cdecl; + function Do_FieldsAsDict( args: PPyObject): PPyObject; cdecl; + function Do_First( args : PPyObject ) : PPyObject; cdecl; + function Do_Last( args : PPyObject ) : PPyObject; cdecl; + function Do_Next( args : PPyObject ) : PPyObject; cdecl; + function Do_Prior( args : PPyObject ) : PPyObject; cdecl; + function Do_Locate( args : PPyObject ) : PPyObject; cdecl; + function Do_Lookup( args : PPyObject ) : PPyObject; cdecl; + function Do_Refresh( args : PPyObject ) : PPyObject; cdecl; + function Do_FindKey( args : PPyObject ) : PPyObject; cdecl; + function Do_FindNearest( args : PPyObject ) : PPyObject; cdecl; + // + property DelphiObject: TFDDataset read GetDelphiObject write SetDelphiObject; +end; + +{DAV>>> $M+ <<>> $M+ << 0 then begin + aAnsiStrBuf := AnsiString(aStr); + Result := PAnsiChar(aAnsiStrBuf); + end + else begin + aAnsiStrBuf := ''; + Result := Nil; + end; +end; + +// ----------------------- TPyDBSharedObject ----------------------------------- + +procedure TPyDBSharedObject.DoDecRef; +begin + if FRefCount > 0 then + Dec(FRefCount); + if (FRefCount = 0) then + FreeData; +end; + +procedure TPyDBSharedObject.SetData( value : TObject ); +begin + DoDecRef; + FRefCount := 0; + FData := value; + IncRef; +end; + +constructor TPyDBSharedObject.Create; +begin + inherited; + Owner := True; +end; + +constructor TPyDBSharedObject.CreateWith( value : TObject; isOwner : Boolean ); +begin + inherited; + Data := value; + Owner := isOwner; +end; + +destructor TPyDBSharedObject.Destroy; +begin + FreeData; + inherited; +end; + +procedure TPyDBSharedObject.IncRef; +begin + Inc(FRefCount); +end; + +procedure TPyDBSharedObject.DecRef; +begin + if not Assigned(Self) then + Exit; + DoDecRef; + if (FRefCount = 0) then + Free; +end; + +procedure TPyDBSharedObject.FreeData; +begin + if Owner and Assigned(FData) then + FData.Free; + FData := nil; +end; + +// ----------------------- TPyDBCommon ----------------------------------------- + +function TPyDBCommon.GetProperties : PPyObject; +begin + with GetPythonEngine do begin + Result := PyList_New(0); + AppendProperties( Result ); + PyList_Sort(Result); + end; +end; + +procedure TPyDBCommon.AppendProperties( List : PPyObject ); +begin + // Override this method in the subclasses and add your + // properties to the list +end; + +procedure TPyDBCommon.AppendProp( List : PPyObject; const prop : String ); +var + obj : PPyObject; +begin + with GetPythonEngine do begin + obj := PyString_FromString(PAnsiChar(AnsiString(prop))); + PyList_Append( List, obj ); + Py_XDecRef(obj); + end; +end; + +function TPyDBCommon.GetAttr(key : PAnsiChar) : PPyObject; +begin + try + if (CompareText( String(key), '__properties__' ) = 0) or + (CompareText( String(key), '__members__' ) = 0) then + Result := GetProperties + else + Result := inherited GetAttr(key); + except // Remap Delphi exception to a Python exception + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; +end; + +procedure TPyDBCommon.RaiseDBError( E : Exception ); +begin + if GetModule <> nil then + GetModule.RaiseError( AnsiString('DBError'), AnsiString(E.Message) ); +end; + +function TPyDBCommon.EventBelongsToObject( Event : TCallbackSplit ) : Boolean; +begin + Result := Event.Self = Self; +end; + +// ----------------------- TPyDBField ------------------------------------------ + +constructor TPyDBField.Create( APythonType : TPythonType ); +begin + inherited; + SetLength(m_arAnsiTextBuf,0); +end; + +constructor TPyDBField.CreateWith( PythonType : TPythonType; args : PPyObject ); +begin + inherited; + SetLength(m_arAnsiTextBuf,0); +end; + +destructor TPyDBField.Destroy; +begin + SetLength(m_arAnsiTextBuf,0); + if Assigned(FField) then begin + if EventBelongsToObject( TCallbackSplit(FField.OnChange) ) then + FField.OnChange := nil; + if EventBelongsToObject( TCallbackSplit(FField.OnGetText) ) then + FField.OnGetText := nil; + if EventBelongsToObject( TCallbackSplit(FField.OnSetText) ) then + FField.OnSetText := nil; + if EventBelongsToObject( TCallbackSplit(FField.OnValidate) ) then + FField.OnValidate := nil; + end; + FField := nil; + ClearEvent( FOnChange ); + ClearEvent( FOnGetText ); + ClearEvent( FOnSetText ); + ClearEvent( FOnValidate ); + inherited; +end; + +// Then we override the needed services + +function TPyDBField.GetAttr(key : PAnsiChar) : PPyObject; +var + l_pAnsiChar: PAnsiChar; + l_sUpperKey, l_sStr: String; +begin + with GetPythonEngine do begin + if not CheckField then begin + Result := nil; + Exit; + end; + try + l_sUpperKey := UpperCase(String(key)); + if CompareText(l_sUpperKey, 'ALIGNMENT' ) = 0 then + Result := VariantAsPyObject( Integer(FField.Alignment) ) + else if CompareText(l_sUpperKey, 'ASBOOLEAN' ) = 0 then + Result := VariantAsPyObject( FField.AsBoolean ) + else if CompareText(l_sUpperKey, 'ASDATETIME' ) = 0 then + Result := VariantAsPyObject( FField.AsDateTime ) + else if CompareText(l_sUpperKey, 'ASFLOAT' ) = 0 then + Result := VariantAsPyObject( FField.AsFloat ) + else if CompareText(l_sUpperKey, 'ASINTEGER' ) = 0 then + Result := VariantAsPyObject( FField.AsInteger ) + else if CompareText(l_sUpperKey, 'ASSTRING' ) = 0 then + Result := VariantAsPyObject( FField.AsString ) + else if CompareText(l_sUpperKey, 'CANMODIFY' ) = 0 then + Result := VariantAsPyObject( FField.CanModify ) + else if CompareText(l_sUpperKey, 'ConstraintErrorMessage' ) = 0 then + Result := VariantAsPyObject( FField.ConstraintErrorMessage ) + else if CompareText(l_sUpperKey, 'CurValue' ) = 0 then + Result := VariantAsPyObject( FField.CurValue ) + else if CompareText(l_sUpperKey, 'CustomConstraint' ) = 0 then + Result := VariantAsPyObject( FField.CustomConstraint ) + else if CompareText(l_sUpperKey, 'DATASIZE' ) = 0 then + Result := VariantAsPyObject( FField.DataSize ) + else if CompareText(l_sUpperKey, 'DATATYPE' ) = 0 then + Result := VariantAsPyObject( FField.DataType ) + else if CompareText(l_sUpperKey, 'DefaultExpression' ) = 0 then + Result := VariantAsPyObject( FField.DefaultExpression ) + else if CompareText(l_sUpperKey, 'DISPLAYLABEL' ) = 0 then + Result := VariantAsPyObject( FField.DisplayLabel ) + else if CompareText(l_sUpperKey, 'DISPLAYNAME' ) = 0 then + Result := VariantAsPyObject( FField.DisplayName ) + else if CompareText(l_sUpperKey, 'DISPLAYTEXT' ) = 0 then + Result := VariantAsPyObject( FField.DisplayText ) + else if CompareText(l_sUpperKey, 'DISPLAYWIDTH' ) = 0 then + Result := VariantAsPyObject( FField.DisplayWidth ) + else if CompareText(l_sUpperKey, 'EDITMASK' ) = 0 then + Result := VariantAsPyObject( FField.EditMask ) + else if CompareText(l_sUpperKey, 'FIELDKIND' ) = 0 then + Result := VariantAsPyObject( FField.FieldKind ) + else if CompareText(l_sUpperKey, 'FIELDNAME' ) = 0 then + Result := VariantAsPyObject( FField.FieldName) + else if CompareText(l_sUpperKey, 'FIELDNO' ) = 0 then + Result := VariantAsPyObject( FField.FieldNo ) + else if CompareText(l_sUpperKey, 'HASCONSTRAINTS' ) = 0 then + Result := VariantAsPyObject( FField.HasConstraints ) + else if CompareText(l_sUpperKey, 'IMPORTEDCONSTRAINT' ) = 0 then + Result := VariantAsPyObject( FField.ImportedConstraint ) + else if CompareText(l_sUpperKey, 'INDEX' ) = 0 then + Result := VariantAsPyObject( FField.Index ) + else if CompareText(l_sUpperKey, 'ISBLOB' ) = 0 then + Result := VariantAsPyObject( FField.IsBlob) + else if CompareText(l_sUpperKey, 'ISINDEXFIELD' ) = 0 then + Result := VariantAsPyObject( FField.IsIndexField ) + else if CompareText(l_sUpperKey, 'ISNULL' ) = 0 then + Result := VariantAsPyObject( FField.IsNull ) + else if CompareText(l_sUpperKey, 'KEYFFIELDS' ) = 0 then + Result := VariantAsPyObject( FField.KeyFields ) + else if CompareText(l_sUpperKey, 'LOOKUP' ) = 0 then + Result := VariantAsPyObject( FField.Lookup ) + else if CompareText(l_sUpperKey, 'LOOKUPCACHE' ) = 0 then + Result := VariantAsPyObject( FField.LookupCache ) + else if CompareText(l_sUpperKey, 'LOOKUPDATASET' ) = 0 then + Result := ReturnNone + else if CompareText(l_sUpperKey, 'LOOKUPKeyFields' ) = 0 then + Result := VariantAsPyObject( FField.LookupKeyFields ) + else if CompareText(l_sUpperKey, 'LOOKUPLIST' ) = 0 then + Result := ReturnNone + else if CompareText(l_sUpperKey, 'LOOKUPRESULTFIELD' ) = 0 then + Result := VariantAsPyObject( FField.LookupResultField ) + else if CompareText(l_sUpperKey, 'NEWVALUE' ) = 0 then + Result := VariantAsPyObject( FField.NewValue ) + else if CompareText(l_sUpperKey, 'OFFSET' ) = 0 then + Result := VariantAsPyObject( FField.Offset ) + else if CompareText(l_sUpperKey, 'OLDVALUE' ) = 0 then + Result := VariantAsPyObject( FField.OldValue ) + else if CompareText(l_sUpperKey, 'ORIGIN' ) = 0 then + Result := VariantAsPyObject( FField.Origin ) + else if CompareText(l_sUpperKey, 'READONLY' ) = 0 then + Result := VariantAsPyObject( FField.ReadOnly ) + else if CompareText(l_sUpperKey, 'REQUIRED' ) = 0 then + Result := VariantAsPyObject( FField.Required ) + else if CompareText(l_sUpperKey, 'SIZE' ) = 0 then + Result := VariantAsPyObject( FField.Size ) + else if CompareText(l_sUpperKey, 'TEXT' ) = 0 then + Result := VariantAsPyObject( FField.Text ) + else if CompareText(l_sUpperKey, 'VALIDCHARS' ) = 0 then + Result := ReturnNone + else if CompareText(l_sUpperKey, 'VALUE' ) = 0 then begin + if (FField.DataType = ftString) or (FField.DataType = ftWideString) then begin + SetLength(m_arAnsiTextBuf,1); + l_sStr := FField.AsString; + l_pAnsiChar := _PAnsiChar(l_sStr, m_arAnsiTextBuf[0]); + Result := PyString_FromString( l_pAnsiChar ); + end + else + Result := VariantAsPyObject( FField.Value ); + end + else if CompareText(l_sUpperKey, 'VISIBLE' ) = 0 then + Result := VariantAsPyObject( FField.Visible ) + else if CompareText(l_sUpperKey, 'ONCHANGE' ) = 0 then + Result := ReturnEvent( FOnChange ) + else if CompareText(l_sUpperKey, 'ONGETTEXT' ) = 0 then + Result := ReturnEvent( FOnGetText ) + else if CompareText(l_sUpperKey, 'ONSETTEXT' ) = 0 then + Result := ReturnEvent( FOnSetText ) + else if CompareText(l_sUpperKey, 'ONVALIDATE' ) = 0 then + Result := ReturnEvent( FOnValidate ) + else + Result := inherited GetAttr(key); + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBField.SetAttr(key : PAnsiChar; value : PPyObject) : Integer; +var + l_sUpperKey: String; +begin + Result := -1; + with GetPythonEngine do begin + if not CheckField then + Exit; + try + l_sUpperKey := UpperCase(String(key)); + if CompareText(l_sUpperKey, 'ALIGNMENT' ) = 0 then begin + FField.Alignment := TAlignment(PyObjectAsVariant( value )); + Result := 0; + end + else if CompareText(l_sUpperKey, 'ASBOOLEAN' ) = 0 then begin + FField.AsBoolean := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'ASDATETIME' ) = 0 then begin + FField.AsDateTime := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'ASFLOAT' ) = 0 then begin + FField.AsFloat := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'ASINTEGER' ) = 0 then begin + FField.AsInteger := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'ASSTRING' ) = 0 then begin + FField.AsString := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'CANMODIFY' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'CONSTRAINTERRORMESSAGE' ) = 0 then begin + FField.ConstraintErrorMessage := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'CURVALUE' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'CUSTOMCONSTRAINT' ) = 0 then begin + FField.CustomConstraint := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'DATASIZE' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'DATATYPE' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'DEFAULTEXPRESSION' ) = 0 then begin + FField.DefaultExpression := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'DISPLAYLABEL' ) = 0 then begin + FField.DisplayLabel := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'DISPLAYNAME' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'DISPLAYTEXT' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'DISPLAYWIDTH' ) = 0 then begin + FField.DisplayWidth := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'EDITMASK' ) = 0 then begin + FField.EditMask := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'FIELDKIND' ) = 0 then begin + FField.FieldKind := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'FIELDNAME' ) = 0 then begin + FField.FieldName:= PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'FIELDNO' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'HASCONSTRAINTS' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'IMPORTEDCONSTRAINT' ) = 0 then begin + FField.ImportedConstraint := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'INDEX' ) = 0 then begin + FField.Index := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'ISBLOB' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'ISINDEXFIELD' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'ISNULL' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'KEYFIELDS' ) = 0 then begin + FField.KeyFields := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'LOOKUP' ) = 0 then begin + FField.Lookup := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'LOOKUPCACHE' ) = 0 then begin + FField.LookupCache := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'LOOKUPDATASET' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'LOOKUPKEYFIELDS' ) = 0 then begin + FField.LookupKeyFields := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'LOOKUPLIST' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'LOOKUPRESULTFIELD' ) = 0 then begin + FField.LookupResultField := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'NEWVALUE' ) = 0 then begin + FField.NewValue := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'OFFSET' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'OLDVALUE' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'ORIGIN' ) = 0 then begin + FField.Origin := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'READONLY' ) = 0 then begin + FField.ReadOnly := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'REQUIRED' ) = 0 then begin + FField.Required := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'SIZE' ) = 0 then begin + FField.Size := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'TEXT' ) = 0 then begin + FField.Text := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'VALIDCHARS' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'VALUE' ) = 0 then begin + FField.Value := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'VISIBLE' ) = 0 then begin + FField.Visible := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'ONCHANGE' ) = 0 then begin + SetEvent( FOnChange, Value, 'OnChange', 'TField' ); + if Assigned(FOnChange) then + FField.OnChange := OnChange + else + FField.OnChange := nil; + Result := 0; + end + else if CompareText(l_sUpperKey, 'ONGETTEXT' ) = 0 then begin + SetEvent( FOnGetText, Value, 'OnGetText', 'TField' ); + if Assigned(FOnGetText) then + FField.OnGetText := OnGetText + else + FField.OnGetText := nil; + Result := 0; + end + else if CompareText(l_sUpperKey, 'ONSETTEXT' ) = 0 then begin + SetEvent( FOnSetText, Value, 'OnSetText', 'TField' ); + if Assigned(FOnSetText) then + FField.OnSetText := OnSetText + else + FField.OnSetText := nil; + Result := 0; + end + else if CompareText(l_sUpperKey, 'ONVALIDATE' ) = 0 then begin + SetEvent( FOnValidate, Value, 'OnValidate', 'TField' ); + if Assigned(FOnValidate) then + FField.OnValidate := OnValidate + else + FField.OnValidate := nil; + Result := 0; + end + else + Result := inherited SetAttr(key, value); + except + on E : Exception do begin + RaiseDBError( E ); + Result := -1; + end; + end; + end; +end; + +function TPyDBField.Repr: PPyObject; +begin + Result := inherited Repr; +end; + +class procedure TPyDBField.RegisterMethods( PythonType : TPythonType ); +begin + inherited; + with PythonType do begin + AddMethod(AnsiString('Clear'), @TPyDBField.Do_Clear, + AnsiString('DBField.Clear() -> None') ); + AddMethod(AnsiString('FocusControl'), @TPyDBField.Do_FocusControl, + AnsiString('DBField.FocusControl() -> None') ); + AddMethod(AnsiString('IsValidChar'), @TPyDBField.Do_IsValidChar, + AnsiString('DBField.IsValidChar( InputChar : String ) -> True or False') ); + AddMethod(AnsiString('RefreshLookupList'), @TPyDBField.Do_RefreshLookupList, + AnsiString('DBField.RefreshLookupList() -> None') ); + end; +end; + +function TPyDBField.CheckField : Boolean; +begin + if not Assigned(FField) then begin + Result := False; + with GetPythonEngine do + PyErr_SetString (PyExc_RuntimeError^, PAnsiChar('No field defined !') ); + end + else + Result := True; + Result := Result; +end; + +procedure TPyDBField.AppendProperties( List : PPyObject ); +begin + inherited; + AppendProp( List, 'Alignment'); + AppendProp( List, 'AsBoolean'); + AppendProp( List, 'AsDateTime'); + AppendProp( List, 'AsFloat'); + AppendProp( List, 'AsInteger'); + AppendProp( List, 'AsString'); + AppendProp( List, 'CanModify'); + AppendProp( List, 'ConstraintErrorMessage'); + AppendProp( List, 'CurValue'); + AppendProp( List, 'CustomConstraint'); + AppendProp( List, 'DataSize'); + AppendProp( List, 'DataType'); + AppendProp( List, 'DefaultExpression'); + AppendProp( List, 'DisplayLabel'); + AppendProp( List, 'DisplayName'); + AppendProp( List, 'DisplayText'); + AppendProp( List, 'DisplayWidth'); + AppendProp( List, 'EditMask'); + AppendProp( List, 'FieldKind'); + AppendProp( List, 'FieldName'); + AppendProp( List, 'FieldNo'); + AppendProp( List, 'HasConstraints'); + AppendProp( List, 'ImportedConstraint'); + AppendProp( List, 'Index'); + AppendProp( List, 'IsBlob'); + AppendProp( List, 'IsIndexField'); + AppendProp( List, 'IsNull'); + AppendProp( List, 'KeyFields'); + AppendProp( List, 'Lookup'); + AppendProp( List, 'LookupCache'); + AppendProp( List, 'LookupDataset'); + AppendProp( List, 'LookupKeyFields'); + AppendProp( List, 'LookupList'); + AppendProp( List, 'LookupResultField'); + AppendProp( List, 'NewValue'); + AppendProp( List, 'Offset'); + AppendProp( List, 'OldValue'); + AppendProp( List, 'Origin'); + AppendProp( List, 'ReadOnly'); + AppendProp( List, 'Required'); + AppendProp( List, 'Size'); + AppendProp( List, 'Text'); + AppendProp( List, 'ValidChars'); + AppendProp( List, 'Value'); + AppendProp( List, 'Visible'); +end; + +function TPyDBField.Do_Clear( args : PPyObject ) : PPyObject; +begin + with GetPythonEngine do begin + Adjust(@Self); // <- adjust the transmitted self argument + try + if CheckField then begin + FField.Clear; + Result := ReturnNone; + end + else + Result := nil; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBField.Do_FocusControl( args : PPyObject ) : PPyObject; +begin + with GetPythonEngine do begin + Adjust(@Self); // <- adjust the transmitted self argument + try + if CheckField then begin + FField.FocusControl; + Result := ReturnNone; + end + else + Result := nil; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBField.Do_IsValidChar( args : PPyObject ) : PPyObject; +var + c : Char; + s : PAnsiChar; + str : AnsiString; +begin + with GetPythonEngine do begin + Adjust(@Self); // <- adjust the transmitted self argument + try + if CheckField then begin + if PyArg_ParseTuple( args, 's:TField.IsValidChar',@s ) <> 0 then begin + str := s; + if Length(str) > 0 then + c := Char(str[1]) + else + c := #0; + Result := VariantAsPyObject( FField.IsValidChar( c ) ) + end + else + Result := nil; + end + else + Result := nil; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBField.Do_RefreshLookupList( args : PPyObject ) : PPyObject; +begin + with GetPythonEngine do begin + Adjust(@Self); // <- adjust the transmitted self argument + try + if CheckField then begin + FField.RefreshLookupList; + Result := ReturnNone; + end + else + Result := nil; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +procedure TPyDBField.OnChange( Sender : TField ); +begin + IncRef; + ExecuteEvent( FOnChange, [GetSelf] ); +end; + +procedure TPyDBField.OnGetText( Sender: TField; var Text: String; DisplayText: Boolean ); +var + v : PPyObject; +begin + IncRef; + with GetPythonEngine do begin + v := TPyDBVarArg.PyDBVarArgType.CreateInstanceWith( VariantAsPyObject( Text ) ); + Py_XIncRef(v); + try + ExecuteEvent( FOnGetText, [GetSelf, v, DisplayText] ); + with PythonToDelphi(v) as TPyDBVarArg do + Text := PyObjectAsVariant(FValue); + finally + Py_XDecRef(v); + end; + end; +end; + +procedure TPyDBField.OnSetText( Sender : TField; const Text: String ); +begin + IncRef; + ExecuteEvent( FOnSetText, [GetSelf, Text] ); +end; + +procedure TPyDBField.OnValidate( Sender : TField ); +begin + IncRef; + ExecuteEvent( FOnValidate, [GetSelf] ); +end; + +// ----------------------- TPyDBVarArg ----------------------------------------- + +constructor TPyDBVarArg.CreateWith( APythonType : TPythonType; args : PPyObject ); +begin + inherited; + with GetPythonEngine do begin + if PyTuple_Check(args) and (PyTuple_Size(args)>=1) then begin + FValue := PyTuple_GetItem( args, 0 ); + Py_XIncRef(FValue); + end; + end; +end; + +destructor TPyDBVarArg.Destroy; +begin + with GetPythonEngine do + Py_XDecRef(FValue); + inherited; +end; + +function TPyDBVarArg.GetAttr(key : PAnsiChar) : PPyObject; +begin + with GetPythonEngine do begin + if CompareText(String(key), 'Value' ) = 0 then begin + Result := FValue; + if not Assigned(Result) then + Result := Py_None; + Py_XIncRef(Result); + end + else + Result := inherited GetAttr(key); + end; +end; + +function TPyDBVarArg.SetAttr(key : PAnsiChar; value : PPyObject) : Integer; +begin + with GetPythonEngine do begin + if CompareText(String(key), 'Value' ) = 0 then begin + Py_XDecRef(FValue); + FValue := value; + Py_XIncRef(FValue); + Result := 0; + end + else + Result := inherited SetAttr(key, value); + end; +end; + +function TPyDBVarArg.Repr : PPyObject; +begin + with GetPythonEngine do + Result := PyString_FromString( PAnsiChar(AnsiString(PyObjectAsString(FValue))) ); +end; + +// ----------------------- TDSRowsAccess --------------------------------------- + +class function TDSRowsAccess.ExpectedContainerClass: TClass; +begin + Result := TPyDBDataset; +end; + +function TDSRowsAccess.GetContainer: TPyDBDataset; +begin + Result := TPyDBDataset(inherited Container); +end; + +function TDSRowsAccess.GetItem(aIndex: Integer): PPyObject; +var + i : Integer; + l_sStr: String; + l_pAnsiChar: PAnsiChar; + l_oDataset: TFDDataset; +begin + Result := nil; + l_oDataset := GetContainer.GetDelphiObject; + if (aIndex >= 0) and (aIndex < l_oDataset.RecordCount) then begin + with GetPythonEngine do begin + try + l_oDataset.RecNo := AIndex + 1; + Result := PyTuple_New(l_oDataset.FieldCount); + for i := 0 to l_oDataset.FieldCount - 1 do begin + with l_oDataset.Fields[i] do begin + PyTuple_SetItem( Result, i, VariantAsPyObject( Value ) ); + end; + end; + except + on E : Exception do begin + raise Exception.CreateFmt('Exception in TDSRowsAccess.GetItem - Index=%d', [AIndex]); + end; + end; + end; + end; +end; + +function TDSRowsAccess.GetSize: Integer; +var + l_oDataset: TFDDataset; +begin + l_oDataset := GetContainer.GetDelphiObject; + Result := l_oDataset.RecordCount; +end; + +function TDSRowsAccess.IndexOf(AValue: PPyObject): Integer; +var + i : Integer; + S : string; + _obj : TPyObject; + _value : TObject; + _ds : TFDDataset; +begin + Result := -1; + { + with GetPythonEngine do + begin + if PyString_Check(AValue) then + begin + S := PyString_AsDelphiString(AValue); + for i := 0 to Container.ControlCount-1 do + if SameText( Container.Controls[i].Name, S) then + begin + Result := i; + Break; + end; + end + else if IsDelphiObject(AValue) then + begin + _obj := PythonToDelphi(AValue); + if _obj is TPyDelphiObject then + begin + _value := TPyDelphiObject(_obj).DelphiObject; + if _value is TControl then + begin + _ctrl := TControl(_value); + for i := 0 to Container.ControlCount-1 do + if Container.Controls[i] = _ctrl then + begin + Result := i; + Break; + end; + end; + end; + end; + end; + } +end; + +class function TDSRowsAccess.Name: String; +begin + Result := 'DSRows'; +end; + +class function TDSRowsAccess.SupportsIndexOf: Boolean; +begin + Result := True; +end; + +// ----------------------- TPyDBDataset ------------------------------------ + +constructor TPyDBDataset.Create( aPythonType : TPythonType ); +begin + inherited; + if not Assigned(DelphiObject) then + DelphiObject := TFDDataset.Create(Nil); +end; + +constructor TPyDBDataset.CreateWith( aPythonType : TPythonType; args : PPyObject ); +begin + inherited; + if not Assigned(DelphiObject) then + DelphiObject := TFDDataset.Create(Nil); +end; + +destructor TPyDBDataset.Destroy; +var + l_oDataset: TFDDataset; +begin + l_oDataset := DelphiObject; + if Assigned(l_oDataset) then begin + if not ((l_oDataset is TFDTable) or (l_oDataset is TFDQuery)) then begin + DelphiObject := Nil; // <- implizit Free!!! + end; + end; + SetLength(m_arAnsiTextBuf,0); + inherited; +end; + +function TPyDBDataset.GetDelphiObject: TFDDataset; +begin + Result := TFDDataset(inherited DelphiObject); +end; + +procedure TPyDBDataset.SetDelphiObject(const Value: TFDDataset); +begin + inherited DelphiObject := Value; +end; + +function TPyDBDataset.CreateContainerAccess : TContainerAccess; +var + l_ContainerAccessClass : TContainerAccessClass; +begin + l_ContainerAccessClass := TDSRowsAccess; + Result := l_ContainerAccessClass.Create(PyDelphiWrapper, self) +end; + +class function TPyDBDataset.DelphiObjectClass : TClass; +begin + Result := TFDDataset; +end; + +class function TPyDBDataset.GetContainerAccessClass : TContainerAccessClass; +begin + Result := TDSRowsAccess; +end; + +function TPyDBDataset.Get_RowsCount(AContext: Pointer): PPyObject; +begin + with GetPythonEngine do begin + Adjust(@Self); + Result := PyInt_FromLong(DelphiObject.RecordCount); + end; +end; + +function TPyDBDataset.Get_Rows(AContext: Pointer): PPyObject; +begin + with GetPythonEngine do begin + Adjust(@Self); + Result := Self.PyDelphiWrapper.DefaultContainerType.CreateInstance; + with PythonToDelphi(Result) as TPyDelphiContainer do + Setup(Self.PyDelphiWrapper, TDSRowsAccess.Create(Self.PyDelphiWrapper, Self.DelphiObject)); + end; +end; + +class procedure TPyDBDataset.RegisterGetSets( PythonType : TPythonType ); +begin + inherited; + PythonType.AddGetSet(PAnsiChar('RowsCount'), @TPyDBDataset.Get_RowsCount, nil, + PAnsiChar('Returns the count of contained dataset rows'), nil); + PythonType.AddGetSet(PAnsiChar('Rows'), @TPyDBDataset.Get_Rows, nil, + PAnsiChar('Returns an iterator over contained dataset rows'), nil); +end; + +class procedure TPyDBDataset.RegisterMembers( PythonType : TPythonType ); +begin + inherited; +end; + +class procedure TPyDBDataset.RegisterMethods( PythonType : TPythonType ); +begin + inherited; + with PythonType do begin + AddMethod(AnsiString('Fields'), @TPyDBDataset.Do_Fields, + AnsiString('DBDataset.Fields( index : Integer ) -> TField') ); + AddMethod(AnsiString('FieldByName'), @TPyDBDataset.Do_FieldByName, + AnsiString('DBDataset.FieldByName(FieldName: String) -> DBField') ); + AddMethod(AnsiString('FieldNamesAsTuple'), @TPyDBDataset.Do_FieldNamesAsTuple, + AnsiString('DBDataset.FieldNamesAsTuple() -> a tuple containing all field names') ); + AddMethod(AnsiString('FieldsAsTuple'), @TPyDBDataset.Do_FieldsAsTuple, + AnsiString('DBDataset.FieldsAsTuple() -> a tuple containing all TFields') ); + AddMethod(AnsiString('FieldsAsDict'), @TPyDBDataset.Do_FieldsAsDict, + AnsiString('DBDataset.FieldsAsDict() -> a dictionary containing all TFields, with FieldName as Key, and TField as Value') ); + AddMethod(AnsiString('First'), @TPyDBDataset.Do_First, + AnsiString('DBDataset.First() -> None') ); + AddMethod(AnsiString('Last'), @TPyDBDataset.Do_Last, + AnsiString('DBDataset.Last() -> None') ); + AddMethod(AnsiString('Next'), @TPyDBDataset.Do_Next, + AnsiString('DBDataset.Next() -> None') ); + AddMethod(AnsiString('Prior'), @TPyDBDataset.Do_Prior, + AnsiString('DBDataset.Prior() -> None') ); + AddMethod(AnsiString('Locate'), @TPyDBDataset.Do_Locate, + AnsiString('DBDataset.Locate( KeyFields : String, KeyValues : Object or Sequence, Options : TLocateOptions ) -> True or False') ); + AddMethod(AnsiString('Lookup'), @TPyDBDataset.Do_Lookup, + AnsiString('DBDataset.Lookup( KeyFields : String, KeyValues : Object or Sequence, ResultFields : String ) -> a list containing all Result fields') ); + AddMethod(AnsiString('FindKey'), @TPyDBDataset.Do_FindKey, + AnsiString('DBDataset.FindKey( KeyValues : Sequence ) -> True or False') ); + AddMethod(AnsiString('FindNearest'), @TPyDBDataset.Do_FindNearest, + AnsiString('DBDataset.FindNearest( KeyValues : Sequence ) -> None') ); + + end; +end; + +function TPyDBDataset.GetAttr(key : PAnsiChar) : PPyObject; +var + l_sUpperKey: String; + l_oDataset: TFDDataset; +begin + Result := nil; + with GetPythonEngine do begin + try + l_oDataset := DelphiObject; + l_sUpperKey := UpperCase(String(key)); + if CompareText(l_sUpperKey, 'BOF' ) = 0 then + Result := VariantAsPyObject( l_oDataset.BOF ) + else if CompareText(l_sUpperKey, 'CANMODIFY' ) = 0 then + Result := VariantAsPyObject( l_oDataset.CanModify ) + else if CompareText(l_sUpperKey, 'EOF' ) = 0 then + Result := VariantAsPyObject( l_oDataset.EOF ) + else if CompareText( string(key), 'FIELDCOUNT' ) = 0 then + Result := VariantAsPyObject( l_oDataset.FieldCount ) + else if CompareText( string(key), 'RECNO' ) = 0 then + Result := VariantAsPyObject( l_oDataset.RecNo ) + else + Result := inherited GetAttr(key); + except + on E : Exception do begin + RaiseDBError( E ); + Result := Nil; + end; + end; + end; +end; + +function TPyDBDataset.SetAttr(key : PAnsiChar; value : PPyObject) : Integer; +var + l_sUpperKey: String; + l_oDataset: TFDDataset; +begin + Result := -1; + with GetPythonEngine do begin + try + l_oDataset := DelphiObject; + l_sUpperKey := UpperCase(String(key)); + if CompareText(l_sUpperKey, 'FILTER' ) = 0 then begin + l_oDataset.Filter := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'FILTERED' ) = 0 then begin + l_oDataset.Filtered := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'BOF' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'CanModify' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'EOF' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'RECNO' ) = 0 then begin + l_oDataset.RecNo := PyObjectAsVariant( value ); + Result := 0; + end + else + Result := inherited SetAttr(key, value); + except + on E : Exception do begin + RaiseDBError( E ); + Result := -1; + end; + end; + end; +end; + +// Methods + +procedure TPyDBDataset.RaiseDBError( E : Exception ); +begin + if self.GetModule <> nil then + GetModule.RaiseError( AnsiString('DBError'), AnsiString(E.Message) ); +end; + +function TPyDBDataset.Do_Fields( args : PPyObject ): PPyObject; +var + idx : Integer; + fld : TField; + F : TPyDBField; + l_oDataset: TFDDataset; +begin + with GetPythonEngine do begin + // We adjust the transmitted self argument + Adjust(@Self); + l_oDataset := DelphiObject; + try + if PyArg_ParseTuple( args, 'i:DBDataset.Fields',@idx ) <> 0 then begin + if (idx >= 0) and (idx < l_oDataset.FieldCount) then begin + Result := TPyDBField.PyDBFieldType.CreateInstance; + F := PythonToDelphi(Result) as TPyDBField; + F.FField := l_oDataset.Fields[idx]; + end + else begin + Result := nil; + PyErr_SetString (PyExc_AttributeError^, PAnsiChar(AnsiString(Format('Value out of range : %d', [idx])))); + end; + end + else + Result := nil; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_FieldByName( args : PPyObject ) : PPyObject; +var + l_sAStr: AnsiString; + s : PAnsiChar; + fld : TField; + F : TPyDBField; + l_oDataset: TFDDataset; +begin + with GetPythonEngine do begin + // We adjust the transmitted self argument + Adjust(@Self); + l_oDataset := DelphiObject; + try + if (PyArg_ParseTuple( args, PAnsiChar('s:DBDataset.FieldByName'),@s ) <> 0) then begin + l_sAStr := AnsiString(s); + fld := l_oDataset.FieldByName(String(l_sAStr)); + if Assigned(fld) then begin + Result := TPyDBField.PyDBFieldType.CreateInstance; + F := PythonToDelphi(Result) as TPyDBField; + F.FField := fld; + end + else begin + Result := nil; + PyErr_SetString (PyExc_AttributeError^, PAnsiChar(AnsiString(Format('Unknown field "%s"', [String(s)]))) ); + end; + end + else + Result := nil; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_FieldNamesAsTuple( args: PPyObject): PPyObject; +var + i : Integer; + l_sStr: String; + l_pAnsiChar: PAnsiChar; + l_oDataset: TFDDataset; +begin + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + Result := PyTuple_New(l_oDataset.FieldCount); + SetLength(m_arAnsiTextBuf,l_oDataset.FieldCount); + for i := 0 to l_oDataset.FieldCount - 1 do begin + with l_oDataset.Fields[i] do begin + l_sStr := FieldName; + l_pAnsiChar := _PAnsiChar(l_sStr, m_arAnsiTextBuf[i]); + PyTuple_SetItem( Result, i, PyString_FromString( l_pAnsiChar ) ); + end; + end; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_FieldsAsTuple( args: PPyObject): PPyObject; +var + i : Integer; + l_sStr: String; + l_pAnsiChar: PAnsiChar; + l_oDataset: TFDDataset; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); // <- adjust the transmitted self argument + l_oDataset := DelphiObject; + try + Result := PyTuple_New(l_oDataset.FieldCount); + SetLength(m_arAnsiTextBuf,l_oDataset.FieldCount); + for i := 0 to l_oDataset.FieldCount - 1 do begin + if (l_oDataset.Fields[i].DataType = ftString) or + (l_oDataset.Fields[i].DataType = ftWideString) then begin + l_sStr := l_oDataset.Fields[i].AsString; + l_pAnsiChar := _PAnsiChar(l_sStr, m_arAnsiTextBuf[i]); + PyTuple_SetItem( Result, i, PyString_FromString( l_pAnsiChar ) ); + end + else + PyTuple_SetItem( Result, i, VariantAsPyObject( l_oDataset.Fields[i].AsVariant ) ); + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBDataset.Do_FieldsAsDict( args: PPyObject): PPyObject; +var + i : Integer; + l_sStr: String; + l_pAnsiChar: PAnsiChar; + l_oDataset: TFDDataset; + obj : PPyObject; + _fieldName : PPyObject; +begin + with GetPythonEngine do begin + Adjust(@Self); // <- adjust the transmitted self argument + l_oDataset := DelphiObject; + try + Result := PyDict_New; + for i := 0 to l_oDataset.FieldCount - 1 do + with l_oDataset.Fields[i] do begin + obj := VariantAsPyObject( AsVariant ); + _fieldName := VariantAsPyObject(Variant(FieldName)); + PyDict_SetItem( Result, _fieldName, obj ); + Py_XDecRef(obj); + Py_XDecRef(_fieldName); + end; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_First( args : PPyObject ) : PPyObject; +var + l_oDataset: TFDDataset; +begin + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + l_oDataset.First; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_Last( args : PPyObject ) : PPyObject; +var + l_oDataset: TFDDataset; +begin + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + l_oDataset.Last; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_Next( args : PPyObject ) : PPyObject; +var + l_oDataset: TFDDataset; +begin + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + l_oDataset.Next; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_Prior( args : PPyObject ) : PPyObject; +var + l_oDataset: TFDDataset; +begin + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + l_oDataset.Prior; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_Locate( args : PPyObject ) : PPyObject; +var + l_oDataset: TFDDataset; + keyFields : PAnsiChar; + keyValues, options : PPyObject; + rslt : Boolean; + vvalues : Variant; + opt : TLocateOptions; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + if PyArg_ParseTuple( args, 'sOO:DBDataset.Locate',@keyFields, @keyValues, @options ) <> 0 then begin + if PySequence_Check(options) = 0 then + PyErr_SetString (PyExc_AttributeError^, 'Third argument of Locate must be a sequence.') + else begin + // Prepare the locate options + ListToSet( options, @opt, sizeof(opt) ); + // Create a variant containing the key values + vvalues := PyObjectAsVariant( keyValues ); + // Execute the locate + rslt := l_oDataset.Locate( String(keyFields), vvalues, opt ); + // Return its result + Result := VariantAsPyObject( rslt ); + end; + end; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_Lookup( args : PPyObject ) : PPyObject; +var + l_oDataset: TFDDataset; + keyFields, resultFields : PAnsiChar; + keyValues : PPyObject; + rslt : Variant; + vvalues : Variant; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + if PyArg_ParseTuple( args, 'sOs:DBDataset.Lookup',@keyFields, @keyValues, @resultFields ) <> 0 then begin + // Create a variant containing the key values + vvalues := PyObjectAsVariant( keyValues ); + // Execute the lookup + rslt := l_oDataset.Lookup( String(keyFields), vvalues, String(resultFields) ); + // Return its result + Result := VariantAsPyObject( rslt ); + end; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_Refresh( args : PPyObject ) : PPyObject; +var + l_oDataset: TFDDataset; +begin + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + l_oDataset.Refresh(); + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBDataset.Do_FindKey( args : PPyObject ) : PPyObject; +var + i : Integer; + V : Variant; + l_oDataset: TFDDataSet; + KeyValues : PPyObject; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + if PyArg_ParseTuple( args, 'O:DBDataset.FindKey',@KeyValues ) <> 0 then begin + if PySequence_Check( KeyValues ) <> 0 then begin + V := PyObjectAsVariant( KeyValues ); + l_oDataset.CheckBrowseMode; + l_oDataset.SetKey; + for i := 0 to VarArrayHighBound(V, 1) do + l_oDataset.IndexFields[i].AsVariant := V[i]; + Result := VariantAsPyObject( l_oDataset.GotoKey ); + end + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBDataset.Do_FindNearest( args : PPyObject ) : PPyObject; +var + i : Integer; + V : Variant; + l_oDataset: TFDDataset; + KeyValues : PPyObject; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oDataset := DelphiObject; + try + if PyArg_ParseTuple( args, 'O:DBDataset.FindNearest',@KeyValues ) <> 0 then begin + if PySequence_Check( KeyValues ) <> 0 then begin + V := PyObjectAsVariant( KeyValues ); + l_oDataset.CheckBrowseMode; + l_oDataset.SetKey; + for i := 0 to VarArrayHighBound(V, 1) do + l_oDataset.IndexFields[i].AsVariant := V[i]; + l_oDataset.GotoNearest; + end; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +// ----------------------- TPyDBTable ------------------------------------ + +constructor TPyDBTable.Create( aPythonType : TPythonType ); +begin + if not Assigned(DelphiObject) then begin + DelphiObject := TFDTable.Create(Nil); + self.Owned := True; + end; + inherited; +end; + +constructor TPyDBTable.CreateWith( aPythonType : TPythonType; args : PPyObject ); +begin + if not Assigned(DelphiObject) then begin + DelphiObject := TFDTable.Create(Nil); + self.Owned := True; + end; + inherited; +end; + +destructor TPyDBTable.Destroy; +var + l_oTbl: TFDTable; +begin + l_oTbl := DelphiObject; + if Assigned(l_oTbl) then begin + if l_oTbl.Active then + l_oTbl.Close(); + DelphiObject := Nil; // <- implizit Free!!! + end; + inherited; +end; + +function TPyDBTable.GetDelphiObject: TFDTable; +begin + Result := TFDTable(inherited DelphiObject); +end; + +procedure TPyDBTable.SetDelphiObject(const Value: TFDTable); +begin + inherited DelphiObject := Value; +end; + +class function TPyDBTable.DelphiObjectClass: TClass; +begin + Result := TFDTable; +end; + +class procedure TPyDBTable.RegisterMethods( PythonType : TPythonType ); +begin + inherited; + with PythonType do begin + AddMethod(AnsiString('Open'), @TPyDBTable.Do_Open, + AnsiString('FDTable.Open() -> None') ); + AddMethod(AnsiString('Close'), @TPyDBTable.Do_Close, + AnsiString('FDTable.Close() -> None') ); + AddMethod(AnsiString('Edit'), @TPyDBTable.Do_Edit, + AnsiString('FDTable.Edit() -> None') ); + AddMethod(AnsiString('Insert'), @TPyDBTable.Do_Insert, + AnsiString('FDTable.Insert() -> None') ); + AddMethod(AnsiString('Append'), @TPyDBTable.Do_Append, + AnsiString('FDTable.Append() -> None') ); + AddMethod(AnsiString('Post'), @TPyDBTable.Do_Post, + AnsiString('FDTable.Post() -> None') ); + AddMethod(AnsiString('Cancel'), @TPyDBTable.Do_Cancel, + AnsiString('FDTable.Cancel() -> None') ); + AddMethod(AnsiString('Delete'), @TPyDBTable.Do_Delete, + AnsiString('FDTable.Delete() -> None') ); + AddMethod(AnsiString('SetRangeStart'), @TPyDBTable.Do_SetRangeStart, + AnsiString('FDTable.SetRangeStart() -> None') ); + AddMethod(AnsiString('EditRangeStart'), @TPyDBTable.Do_EditRangeStart, + AnsiString('FDTable.EditRangeStart() -> None') ); + AddMethod(AnsiString('SetRangeEnd'), @TPyDBTable.Do_SetRangeEnd, + AnsiString('FDTable.SetRangeEnd() -> None') ); + AddMethod(AnsiString('EditRangeEnd'), @TPyDBTable.Do_EditRangeEnd, + AnsiString('FDTable.EditRangeEnd() -> None') ); + AddMethod(AnsiString('ApplyRange'), @TPyDBTable.Do_ApplyRange, + AnsiString('FDTable.ApplyRange() -> None') ); + AddMethod(AnsiString('SetRange'), @TPyDBTable.Do_SetRange, + AnsiString('FDTable.SetRange( sequence of RangeStart values, sequence of RangeEnd values ) -> None') ); + AddMethod(AnsiString('CancelRange'), @TPyDBTable.Do_CancelRange, + AnsiString('FDTable.CancelRange() -> None') ); + AddMethod(AnsiString('GetIndexNames'), @TPyDBTable.Do_GetIndexNames, + AnsiString('FDTable.GetIndexNames() -> list of Index Names') ); + end; +end; + +class procedure TPyDBTable.RegisterMembers( PythonType : TPythonType ); +begin + inherited; + //-- PythonType.AddMember( 'Active', mtInt, NativeInt(@TPyDBTable(nil).x), mfDefault, 'Active'); +end; + +class procedure TPyDBTable.RegisterGetSets( PythonType : TPythonType ); +begin + inherited; + //-- PythonType.AddGetSet(PAnsiChar('Active'), @TPyDBTable.Get_Active, @TPyDBTable.Set_Active, + //-- PAnsiChar('Returns/Sets the Active'), nil); +end; + +function TPyDBTable.CheckActiveDBTable(aMustOpen: Boolean): Boolean; +begin + Result := True; + if GetDelphiObject.Active then begin + if not aMustOpen then begin + Result := False; + with GetPythonEngine do + PyErr_SetString (PyExc_RuntimeError^, PAnsiChar('DBTable is open!') ); + end; + end + else begin + if aMustOpen then begin + Result := False; + with GetPythonEngine do + PyErr_SetString (PyExc_RuntimeError^, PAnsiChar('DBTable is not open!') ); + end; + end; +end; + +function TPyDBTable.GetAttr(key : PAnsiChar) : PPyObject; +var + l_sUpperKey: String; + l_sConnectionDefName, l_sDatabaseName: String; + l_oConn: TFDCustomConnection; + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + l_oConn := Nil; + try + l_oTable := DelphiObject; + l_sUpperKey := UpperCase(String(key)); + if CompareText(l_sUpperKey, 'CONNECTIONDEFNAME' ) = 0 then begin + l_oConn := DelphiObject.Connection; + l_sConnectionDefName := DelphiObject.ConnectionName; + if Assigned(l_oConn) then + l_sConnectionDefName := l_oConn.ConnectionName; + Result := VariantAsPyObject( l_sConnectionDefName ) + end + else if CompareText(UpperCase(String(key)), 'DATABASENAME' ) = 0 then begin + l_oConn := DelphiObject.Connection; + if Assigned(l_oConn) then + l_sDatabaseName := l_oConn.Params.Database + else + l_sDatabaseName := ''; + Result := VariantAsPyObject( l_sDatabaseName ) + end + else if CompareText(l_sUpperKey, 'TABLENAME' ) = 0 then + Result := VariantAsPyObject( l_oTable.TableName ) + else if CompareText(l_sUpperKey, 'ACTIVE' ) = 0 then + Result := VariantAsPyObject( l_oTable.Active ) + else if CompareText(l_sUpperKey, 'FILTER' ) = 0 then + Result := VariantAsPyObject( l_oTable.Filter ) + else if CompareText(l_sUpperKey, 'FILTERED' ) = 0 then + Result := VariantAsPyObject( l_oTable.Filtered ) + else if CompareText(l_sUpperKey, 'STATE' ) = 0 then + Result := VariantAsPyObject( Integer(l_oTable.State) ) + else if CompareText(l_sUpperKey, 'MODIFIED' ) = 0 then + Result := VariantAsPyObject( l_oTable.Modified ) + else if CompareText(l_sUpperKey, 'ISRANGED' ) = 0 then + // Ermöglicht das Ermitteln des aktuellen Bereichsfilterungsmodus. + Result := VariantAsPyObject( l_oTable.IsRanged ) + else if CompareText(l_sUpperKey, 'KEYEXCLUSIVE' ) = 0 then + // Ermittelt oder setzt die Einbeziehung der niedrigsten und höchsten Werte in einen gefilterten Bereich. + Result := VariantAsPyObject( l_oTable.KeyExclusive ) + else if CompareText(l_sUpperKey, 'KEYFIELDCOUNT' ) = 0 then + // Ermittelt oder setzt die Anzahl der in der Bereichsfilterung zu verwendenden Indexfelder + Result := VariantAsPyObject( l_oTable.KeyFieldCount ) + else if CompareText(l_sUpperKey, 'INDEXNAME' ) = 0 then + Result := VariantAsPyObject( l_oTable.IndexName ) + else + Result := inherited GetAttr(key); + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBTable.SetAttr(key : PAnsiChar; value : PPyObject) : Integer; +var + i: Integer; + l_sUpperKey: String; + l_sName, l_sConnectionDefName, l_sDatabaseName: String; + l_oConn: TFDCustomConnection; + l_oTable: TFDTable; +begin + Result := -1; + with GetPythonEngine do begin + l_oConn := Nil; + try + l_oTable := DelphiObject; + l_sUpperKey := UpperCase(String(key)); + if CompareText(l_sUpperKey, 'CONNECTIONDEFNAME' ) = 0 then begin + if CheckActiveDBTable(False) then begin + l_sConnectionDefName := UpperCase(PyObjectAsVariant(value)); + for i := 0 to FDManager.ConnectionCount-1 do begin + l_sName := UpperCase(FDManager.Connections[i].ConnectionDefName); + if l_sName = l_sConnectionDefName then begin + l_oConn := FDManager.Connections[i]; + break; + end; + end; + if Assigned(l_oConn) then begin + if l_oTable.Active then + l_oTable.Active := False; + l_oTable.Connection := l_oConn; + end; + Result := 0; + end; + end + else if CompareText(l_sUpperKey, 'DATABASENAME' ) = 0 then begin + if CheckActiveDBTable(False) then begin + l_sDatabaseName := PyObjectAsVariant( value ); + l_oConn := DelphiObject.Connection; + if Assigned(l_oConn) then begin + l_oConn.Params.Database := l_sDatabaseName; + end; + Result := 0; + end; + end + else if CompareText(l_sUpperKey, 'TABLENAME' ) = 0 then begin + if CheckActiveDBTable(False) then begin + l_oTable.TableName := PyObjectAsVariant( value ); + Result := 0; + end; + end + else if CompareText(l_sUpperKey, 'ACTIVE' ) = 0 then begin + l_oTable.Active := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'FILTER' ) = 0 then begin + l_oTable.Filter := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'FILTERED' ) = 0 then begin + l_oTable.Filtered := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'STATE' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'MODIFIED' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'ISRANGED' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'KEYEXCLUSIVE' ) = 0 then begin + // Ermittelt oder setzt die Einbeziehung der niedrigsten und höchsten Werte in einen gefilterten Bereich. + l_oTable.KeyExclusive := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'KEYFIELDCOUNT' ) = 0 then begin + // Ermittelt oder setzt die Anzahl der in der Bereichsfilterung zu verwendenden Indexfelder + l_oTable.KeyFieldCount := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'INDEXNAME' ) = 0 then begin + // Ermittelt oder setzt die Anzahl der in der Bereichsfilterung zu verwendenden Indexfelder + l_oTable.IndexName := PyObjectAsVariant( value ); + Result := 0; + end + else + Result := inherited SetAttr(key, value); + except + on E : Exception do begin + RaiseDBError( E ); + Result := -1; + end; + end; + end; +end; + +function TPyDBTable.Do_Open( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); // <- Adjust the transmitted self argument + l_oTable := DelphiObject; + try + l_oTable.Open; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_Close( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + l_oTable.Close; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_Edit( args : PPyObject ): PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.Edit; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_Insert( args : PPyObject ): PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.Insert; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_Append( args : PPyObject ): PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.Append; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_Post( args : PPyObject ): PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.Post; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_Cancel( args : PPyObject ): PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.Cancel; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_Delete( args : PPyObject ): PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.Delete; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_SetRangeStart( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.SetRangeStart; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_EditRangeStart( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.EditRangeStart; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_SetRangeEnd( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.EditRangeEnd; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_EditRangeEnd( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.EditRangeEnd; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_ApplyRange( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.ApplyRange; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_SetRange( args : PPyObject ) : PPyObject; +var + i: Integer; + l_oTable: TFDTable; + l_oPyStartValues, l_oPyEndValues : PPyObject; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active and + (PyArg_ParseTuple( args, 'OO:FDTable.SetRange',@l_oPyStartValues, @l_oPyEndValues ) <> 0) then begin + if PySequence_Check(l_oPyStartValues) = 0 then begin + PyErr_SetString (PyExc_AttributeError^, 'First argument of SetRange must be a sequence.'); + end + else if PySequence_Check(l_oPyEndValues) = 0 then begin + PyErr_SetString (PyExc_AttributeError^, 'Second argument of SetRange must be a sequence.'); + end + else begin + l_oTable.SetRangeStart; + for i := 0 to PySequence_Length(l_oPyStartValues)-1 do + l_oTable.IndexFields[i].Value := PyObjectAsVariant(PySequence_GetItem(l_oPyStartValues, i)); + l_oTable.SetRangeEnd; + for i := 0 to PySequence_Length(l_oPyEndValues)-1 do + l_oTable.IndexFields[i].Value := PyObjectAsVariant(PySequence_GetItem(l_oPyEndValues, i)); + l_oTable.ApplyRange; + end; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_CancelRange( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + try + if l_oTable.Active then begin + l_oTable.CancelRange; + Result := ReturnNone; + end; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBTable.Do_GetIndexNames( args : PPyObject ) : PPyObject; +var + l_oTable: TFDTable; + L : TStringList; +begin + Result := nil; + L := Nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oTable := DelphiObject; + L := TStringList.Create; + try + l_oTable.GetIndexNames( L ); + Result := GetPythonEngine.StringsToPyList( L ); + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; + if Assigned(L) then + L.Free; +end; + +// --------------------- TPyDBQuery -------------------------------------------- + +constructor TPyDBQuery.Create( aPythonType : TPythonType ); +begin + if not Assigned(DelphiObject) then begin + DelphiObject := TFDQuery.Create(Nil); + self.Owned := True; + end; + inherited; +end; + +constructor TPyDBQuery.CreateWith( aPythonType : TPythonType; args : PPyObject ); +begin + if not Assigned(DelphiObject) then begin + DelphiObject := TFDQuery.Create(Nil); + self.Owned := True; + end; + inherited; +end; + +destructor TPyDBQuery.Destroy; +var + l_oQry: TFDQuery; +begin + l_oQry := DelphiObject; + if Assigned(l_oQry) then begin + if l_oQry.Active then + l_oQry.Close(); + DelphiObject := Nil; // <- implizit Free!!! + end; + inherited; +end; + +function TPyDBQuery.GetDelphiObject: TFDQuery; +begin + Result := TFDQuery(inherited DelphiObject); +end; + +procedure TPyDBQuery.SetDelphiObject(const Value: TFDQuery); +begin + inherited DelphiObject := Value; +end; + +class function TPyDBQuery.DelphiObjectClass : TClass; +begin + Result := TFDQuery; +end; + +class procedure TPyDBQuery.RegisterMethods( PythonType : TPythonType ); +begin + inherited; + with PythonType do begin + AddMethod(AnsiString('Open'), @TPyDBQuery.Do_Open, + AnsiString('FDQuery.Open() -> None') ); + AddMethod(AnsiString('Close'), @TPyDBQuery.Do_Close, + AnsiString('FDQuery.Close() -> None') ); + AddMethod(AnsiString('Prepare'), @TPyDBQuery.Do_Prepare, + AnsiString('FDQuery.Prepare() -> None') ); + AddMethod(AnsiString('Unprepare'), @TPyDBQuery.Do_Unprepare, + AnsiString('FDQuery.Unprepare() -> None') ); + AddMethod(AnsiString('ExecSQL'), @TPyDBQuery.Do_ExecSQL, + AnsiString('FDQuery.ExecSQL() -> None') ); + end; +end; + +class procedure TPyDBQuery.RegisterMembers( PythonType : TPythonType ); +begin + inherited; + //-- PythonType.AddMember( 'Active', mtInt, NativeInt(@TPyDBTable(nil).x), mfDefault, 'Active'); +end; + +class procedure TPyDBQuery.RegisterGetSets( PythonType : TPythonType ); +begin + inherited; + //-- PythonType.AddGetSet(PAnsiChar('Active'), @TPyDBTable.Get_Active, @TPyDBTable.Set_Active, + //-- PAnsiChar('Returns/Sets the Active'), nil); +end; + +function TPyDBQuery.CheckActiveDBQuery(aMustOpen: Boolean): Boolean; +begin + Result := True; + if GetDelphiObject.Active then begin + if not aMustOpen then begin + Result := False; + with GetPythonEngine do + PyErr_SetString (PyExc_RuntimeError^, PAnsiChar('DBQuery is open!') ); + end; + end + else begin + if aMustOpen then begin + Result := False; + with GetPythonEngine do + PyErr_SetString (PyExc_RuntimeError^, PAnsiChar('DBQuery is not open!') ); + end; + end; +end; + +function TPyDBQuery.GetAttr(key : PAnsiChar) : PPyObject; +var + i: Integer; + l_sUpperKey, l_sStr: String; + l_sConnectionDefName, l_sDatabaseName: String; + l_pAnsiChar: PAnsiChar; + l_oConn: TFDCustomConnection; + l_oQuery: TFDQuery; +begin + Result := nil; + with GetPythonEngine do begin + l_oConn := Nil; + try + l_oQuery := DelphiObject; + l_sUpperKey := UpperCase(String(key)); + if CompareText(l_sUpperKey, 'CONNECTIONDEFNAME' ) = 0 then begin + l_oConn := DelphiObject.Connection; + l_sConnectionDefName := DelphiObject.ConnectionName; + if Assigned(l_oConn) then + l_sConnectionDefName := l_oConn.ConnectionName; + Result := VariantAsPyObject( l_sConnectionDefName ) + end + else if CompareText(UpperCase(String(key)), 'DATABASENAME' ) = 0 then begin + l_oConn := DelphiObject.Connection; + if Assigned(l_oConn) then + l_sDatabaseName := l_oConn.Params.Database + else + l_sDatabaseName := ''; + Result := VariantAsPyObject( l_sDatabaseName ) + end + else if CompareText(l_sUpperKey, 'PARAMCOUNT' ) = 0 then + Result := VariantAsPyObject( l_oQuery.ParamCount ) + else if CompareText(l_sUpperKey, 'ACTIVE' ) = 0 then + Result := VariantAsPyObject( l_oQuery.Active ) + else if CompareText(l_sUpperKey, 'PREPARED' ) = 0 then + Result := VariantAsPyObject( l_oQuery.Prepared ) + else if CompareText(l_sUpperKey, 'SQL' ) = 0 then begin + Result := PyTuple_New(l_oQuery.SQL.Count); + SetLength(m_arAnsiTextBuf,l_oQuery.SQL.Count); + for i := 0 to l_oQuery.SQL.Count - 1 do begin + l_sStr := l_oQuery.SQL[i]; + l_pAnsiChar := _PAnsiChar(l_sStr, m_arAnsiTextBuf[i]); + PyTuple_SetItem( Result, i, PyString_FromString( l_pAnsiChar ) ); + end; + end + else + Result := inherited GetAttr(key); + except + on E : Exception do begin + RaiseDBError( E ); + Result := nil; + end; + end; + end; +end; + +function TPyDBQuery.SetAttr(key : PAnsiChar; value : PPyObject) : Integer; +var + i, j: Integer; + l_sUpperKey, l_sText, l_sStr, l_sSql: String; + l_sName, l_sConnectionDefName, l_sDatabaseName: String; + l_oConn: TFDCustomConnection; + l_oQuery: TFDQuery; + l_pPyObj: PPyObject; +begin + Result := -1; + with GetPythonEngine do begin + l_oConn := Nil; + try + l_oQuery := DelphiObject; + l_sUpperKey := UpperCase(String(key)); + if CompareText(l_sUpperKey, 'CONNECTIONDEFNAME' ) = 0 then begin + if CheckActiveDBQuery(False) then begin + l_sConnectionDefName := UpperCase(PyObjectAsVariant(value)); + for i := 0 to FDManager.ConnectionCount-1 do begin + l_sName := UpperCase(FDManager.Connections[i].ConnectionDefName); + if l_sName = l_sConnectionDefName then begin + l_oConn := FDManager.Connections[i]; + break; + end; + end; + if Assigned(l_oConn) then begin + if l_oQuery.Active then + l_oQuery.Active := False; + l_oQuery.Connection := l_oConn; + end; + Result := 0; + end; + end + else if CompareText(l_sUpperKey, 'DATABASENAME' ) = 0 then begin + if CheckActiveDBQuery(False) then begin + l_sDatabaseName := PyObjectAsVariant( value ); + l_oConn := DelphiObject.Connection; + if Assigned(l_oConn) then begin + l_oConn.Params.Database := l_sDatabaseName; + end; + Result := 0; + end; + end + else if CompareText(l_sUpperKey, 'PARAMCOUNT' ) = 0 then begin + Result := 0; + end + else if CompareText(l_sUpperKey, 'ACTIVE' ) = 0 then begin + l_oQuery.Active := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'PREPARED' ) = 0 then begin + l_oQuery.Prepared := PyObjectAsVariant( value ); + Result := 0; + end + else if CompareText(l_sUpperKey, 'SQL' ) = 0 then begin + if not PyList_Check(value) then + raise EPythonError.Create('the python object is not a list'); + l_sSql := ''; + for i := 0 to PyList_Size( value ) - 1 do begin + l_pPyObj := PyList_GetItem( value, i ); + l_sStr := PyObjectAsString( l_pPyObj ); + for j := 1 to Length(l_sStr) do begin + if (l_sStr[j] > #0) and (l_sStr[j] <= #13) then + l_sStr[j] := ' '; + end; + if (Length(l_sSql) > 0) and (l_sSql[Length(l_sSql)] <> ' ') then + l_sSql := l_sSql + ' '; + l_sSql := l_sSql + l_sStr; + end; + l_oQuery.SQL.Clear; + l_oQuery.SQL.Add(l_sSql); + l_sText := l_oQuery.SQL.Text; + Result := 0; + end + else + Result := inherited SetAttr(key, value); + except + on E : Exception do begin + RaiseDBError( E ); + Result := -1; + end; + end; + end; +end; + +function TPyDBQuery.Do_Open( args : PPyObject ) : PPyObject; +var + l_oQuery: TFDQuery; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); // <- Adjust the transmitted self argument + l_oQuery := DelphiObject; + try + l_oQuery.Open; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBQuery.Do_Close( args : PPyObject ) : PPyObject; +var + l_oQuery: TFDQuery; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oQuery := DelphiObject; + try + l_oQuery.Close; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBQuery.Do_Prepare( args : PPyObject ) : PPyObject; +var + l_oQuery: TFDQuery; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oQuery := DelphiObject; + try + l_oQuery.Prepare; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBQuery.Do_Unprepare( args : PPyObject ) : PPyObject; +var + l_oQuery: TFDQuery; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oQuery := DelphiObject; + try + l_oQuery.Unprepare; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +function TPyDBQuery.Do_ExecSQL( args : PPyObject ) : PPyObject; +var + l_oQuery: TFDQuery; +begin + Result := nil; + with GetPythonEngine do begin + Adjust(@Self); + l_oQuery := DelphiObject; + try + l_oQuery.ExecSQL; + Result := ReturnNone; + except + on E : Exception do begin + RaiseDBError( E ); + end; + end; + end; +end; + +// ----------------------------------------------------------------------------- + +initialization +begin + //-- RegisteredUnits.Add( TPyDSRowsRegistration.Create ); + //-- Classes.RegisterClasses([TPyDBTable]); +end; + +finalization +begin + { + if Assigned(g_oDBFieldType) then begin + g_oDBFieldType.Free; + g_oDBFieldType := Nil; + end; + if Assigned(g_oDBVarArgType) then begin + g_oDBVarArgType.Free; + g_oDBVarArgType := Nil; + end; + if Assigned(g_oDBTableType) then begin + g_oDBTableType.Free; + g_oDBTableType := Nil; + end; + if Assigned(g_oDBQueryType) then begin + g_oDBQueryType.Free; + g_oDBQueryType := Nil; + end; + if Assigned(g_oDBModule) then begin + g_oDBModule.Free; + g_oDBModule := Nil; + end; + } +end; + +end. diff --git a/PythonForDelphi/Demos/Demo01/Project1.conf b/PythonForDelphi/Demos/Demo01/Project1.conf deleted file mode 100644 index 84e6d103..00000000 --- a/PythonForDelphi/Demos/Demo01/Project1.conf +++ /dev/null @@ -1,32 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --H+ --W+ --M --$M16384,1048576 --K$00400000 diff --git a/PythonForDelphi/Demos/Demo01/Project1.dof b/PythonForDelphi/Demos/Demo01/Project1.dof deleted file mode 100644 index 4a7631b0..00000000 --- a/PythonForDelphi/Demos/Demo01/Project1.dof +++ /dev/null @@ -1,136 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55;VMREPORTBUILDER -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= diff --git a/PythonForDelphi/Demos/Demo01/Project1.dpr b/PythonForDelphi/Demos/Demo01/Project1.dpr index 34e6006c..66f3bb8a 100644 --- a/PythonForDelphi/Demos/Demo01/Project1.dpr +++ b/PythonForDelphi/Demos/Demo01/Project1.dpr @@ -1,7 +1,5 @@ program Project1; -{$I Definition.Inc} - uses {$IFDEF MSWINDOWS} Forms, diff --git a/PythonForDelphi/Demos/Demo01/Project1.dproj b/PythonForDelphi/Demos/Demo01/Project1.dproj index 359c290a..4b8f8ef6 100644 --- a/PythonForDelphi/Demos/Demo01/Project1.dproj +++ b/PythonForDelphi/Demos/Demo01/Project1.dproj @@ -4,11 +4,11 @@ Project1.dpr Debug DCC32 - 16.1 + 18.3 VCL True Win64 - 3 + 2 Application @@ -34,6 +34,12 @@ Base true + + true + Cfg_2 + true + true + true Cfg_2 @@ -48,6 +54,8 @@ Project1.exe 00400000 x86 + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + .\$(Platform)\$(Config) true @@ -55,12 +63,18 @@ System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) 1033 $(BDS)\bin\default_app.manifest + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png true $(BDS)\bin\default_app.manifest System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png false @@ -71,9 +85,14 @@ DEBUG;$(DCC_Define) + + Debug + $(BDS)\bin\delphi_PROJECTICON.ico true + Debug + true @@ -136,12 +155,14 @@ - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) - True + False True diff --git a/PythonForDelphi/Demos/Demo01/Project1.kof b/PythonForDelphi/Demos/Demo01/Project1.kof deleted file mode 100644 index 6ad26fc6..00000000 --- a/PythonForDelphi/Demos/Demo01/Project1.kof +++ /dev/null @@ -1,61 +0,0 @@ -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases= - -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -DynamicLoader=/lib/ld-linux.so.2 - -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages= -Conditionals= -DebugSourceDirs= -UsePackages=0 - -[Parameters] -RunParams= -HostApplication= -Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% -UseLauncher=0 -DebugCWD= - diff --git a/PythonForDelphi/Demos/Demo01/Project1.res b/PythonForDelphi/Demos/Demo01/Project1.res index 3f7606cf..bdc8ee3e 100644 Binary files a/PythonForDelphi/Demos/Demo01/Project1.res and b/PythonForDelphi/Demos/Demo01/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo01/Project1_Icon.ico b/PythonForDelphi/Demos/Demo01/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo01/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo01/Unit1.dfm b/PythonForDelphi/Demos/Demo01/Unit1.dfm index dd29a578..1d5d0950 100644 Binary files a/PythonForDelphi/Demos/Demo01/Unit1.dfm and b/PythonForDelphi/Demos/Demo01/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo01/Unit1.pas b/PythonForDelphi/Demos/Demo01/Unit1.pas index d4a0d70b..f8c3c795 100644 --- a/PythonForDelphi/Demos/Demo01/Unit1.pas +++ b/PythonForDelphi/Demos/Demo01/Unit1.pas @@ -1,7 +1,5 @@ unit Unit1; -{$I Definition.Inc} - interface uses diff --git a/PythonForDelphi/Demos/Demo01/Unit1.xfm b/PythonForDelphi/Demos/Demo01/Unit1.xfm deleted file mode 100644 index 215ff8d1..00000000 Binary files a/PythonForDelphi/Demos/Demo01/Unit1.xfm and /dev/null differ diff --git a/PythonForDelphi/Demos/Demo02/Project1.conf b/PythonForDelphi/Demos/Demo02/Project1.conf deleted file mode 100644 index 84e6d103..00000000 --- a/PythonForDelphi/Demos/Demo02/Project1.conf +++ /dev/null @@ -1,32 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --H+ --W+ --M --$M16384,1048576 --K$00400000 diff --git a/PythonForDelphi/Demos/Demo02/Project1.dof b/PythonForDelphi/Demos/Demo02/Project1.dof deleted file mode 100644 index 9cccf462..00000000 --- a/PythonForDelphi/Demos/Demo02/Project1.dof +++ /dev/null @@ -1,87 +0,0 @@ -[Compiler] -A=1 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55;VMREPORTBUILDER -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -D:\projects\Source\ThirdParty\ReportBuilder\dclRBC51.bpl=ReportBuilder TeeChart 4.0 Components -$(DELPHI)\Bin\dcldss50.bpl=Borland Decision Cube Components -$(DELPHI)\Bin\dcltee50.bpl=TeeChart Components -$(DELPHI)\Bin\dcltqr50.bpl=TeeChart for QuickReport Components diff --git a/PythonForDelphi/Demos/Demo02/Project1.dpr b/PythonForDelphi/Demos/Demo02/Project1.dpr index 37535427..a318c129 100644 --- a/PythonForDelphi/Demos/Demo02/Project1.dpr +++ b/PythonForDelphi/Demos/Demo02/Project1.dpr @@ -3,8 +3,6 @@ // JCL_DEBUG_EXPERT_DELETEMAPFILE OFF program Project1; -{$I Definition.Inc} - uses {$IFDEF MSWINDOWS} Forms, diff --git a/PythonForDelphi/Demos/Demo02/Project1.dproj b/PythonForDelphi/Demos/Demo02/Project1.dproj index 85ff6b4c..a5e82dec 100644 --- a/PythonForDelphi/Demos/Demo02/Project1.dproj +++ b/PythonForDelphi/Demos/Demo02/Project1.dproj @@ -1,101 +1,207 @@ - - - {C2FA2A8D-7DA4-4631-B05E-4C16A0FC8F3B} - Project1.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - Project1.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {C2FA2A8D-7DA4-4631-B05E-4C16A0FC8F3B} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Project1.exe + 00400000 + x86 + Project1 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo02/Project1.kof b/PythonForDelphi/Demos/Demo02/Project1.kof deleted file mode 100644 index 6ad26fc6..00000000 --- a/PythonForDelphi/Demos/Demo02/Project1.kof +++ /dev/null @@ -1,61 +0,0 @@ -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases= - -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -DynamicLoader=/lib/ld-linux.so.2 - -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages= -Conditionals= -DebugSourceDirs= -UsePackages=0 - -[Parameters] -RunParams= -HostApplication= -Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% -UseLauncher=0 -DebugCWD= - diff --git a/PythonForDelphi/Demos/Demo02/Project1.res b/PythonForDelphi/Demos/Demo02/Project1.res index 55f87420..8bbe6f05 100644 Binary files a/PythonForDelphi/Demos/Demo02/Project1.res and b/PythonForDelphi/Demos/Demo02/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo02/Project1_Icon.ico b/PythonForDelphi/Demos/Demo02/Project1_Icon.ico new file mode 100644 index 00000000..1998c2db Binary files /dev/null and b/PythonForDelphi/Demos/Demo02/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo02/Unit1.dfm b/PythonForDelphi/Demos/Demo02/Unit1.dfm index 7ce3a158..eab5c7c9 100644 Binary files a/PythonForDelphi/Demos/Demo02/Unit1.dfm and b/PythonForDelphi/Demos/Demo02/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo02/Unit1.pas b/PythonForDelphi/Demos/Demo02/Unit1.pas index a9097ae2..1e219833 100644 --- a/PythonForDelphi/Demos/Demo02/Unit1.pas +++ b/PythonForDelphi/Demos/Demo02/Unit1.pas @@ -1,7 +1,5 @@ unit Unit1; -{$I Definition.Inc} - interface uses diff --git a/PythonForDelphi/Demos/Demo02/Unit1.xfm b/PythonForDelphi/Demos/Demo02/Unit1.xfm deleted file mode 100644 index 52433e88..00000000 Binary files a/PythonForDelphi/Demos/Demo02/Unit1.xfm and /dev/null differ diff --git a/PythonForDelphi/Demos/Demo03/Project1.conf b/PythonForDelphi/Demos/Demo03/Project1.conf deleted file mode 100644 index 84e6d103..00000000 --- a/PythonForDelphi/Demos/Demo03/Project1.conf +++ /dev/null @@ -1,32 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --H+ --W+ --M --$M16384,1048576 --K$00400000 diff --git a/PythonForDelphi/Demos/Demo03/Project1.dof b/PythonForDelphi/Demos/Demo03/Project1.dof deleted file mode 100644 index 9cccf462..00000000 --- a/PythonForDelphi/Demos/Demo03/Project1.dof +++ /dev/null @@ -1,87 +0,0 @@ -[Compiler] -A=1 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55;VMREPORTBUILDER -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -D:\projects\Source\ThirdParty\ReportBuilder\dclRBC51.bpl=ReportBuilder TeeChart 4.0 Components -$(DELPHI)\Bin\dcldss50.bpl=Borland Decision Cube Components -$(DELPHI)\Bin\dcltee50.bpl=TeeChart Components -$(DELPHI)\Bin\dcltqr50.bpl=TeeChart for QuickReport Components diff --git a/PythonForDelphi/Demos/Demo03/Project1.dproj b/PythonForDelphi/Demos/Demo03/Project1.dproj index 5db58a3c..d8f14812 100644 --- a/PythonForDelphi/Demos/Demo03/Project1.dproj +++ b/PythonForDelphi/Demos/Demo03/Project1.dproj @@ -1,101 +1,207 @@ - - - {BA2F2117-1B8F-44C7-8610-DAB4F55DB2EC} - Project1.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - Project1.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {BA2F2117-1B8F-44C7-8610-DAB4F55DB2EC} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Project1.exe + 00400000 + x86 + Project1 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo03/Project1.kof b/PythonForDelphi/Demos/Demo03/Project1.kof deleted file mode 100644 index 6ad26fc6..00000000 --- a/PythonForDelphi/Demos/Demo03/Project1.kof +++ /dev/null @@ -1,61 +0,0 @@ -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases= - -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -DynamicLoader=/lib/ld-linux.so.2 - -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages= -Conditionals= -DebugSourceDirs= -UsePackages=0 - -[Parameters] -RunParams= -HostApplication= -Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% -UseLauncher=0 -DebugCWD= - diff --git a/PythonForDelphi/Demos/Demo03/Project1.res b/PythonForDelphi/Demos/Demo03/Project1.res index 6008d582..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo03/Project1.res and b/PythonForDelphi/Demos/Demo03/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo03/Project1_Icon.ico b/PythonForDelphi/Demos/Demo03/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo03/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo03/Unit1.dfm b/PythonForDelphi/Demos/Demo03/Unit1.dfm index a6bb8e62..4d7cd9b3 100644 Binary files a/PythonForDelphi/Demos/Demo03/Unit1.dfm and b/PythonForDelphi/Demos/Demo03/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo04/Project1.dof b/PythonForDelphi/Demos/Demo04/Project1.dof deleted file mode 100644 index e3281697..00000000 --- a/PythonForDelphi/Demos/Demo04/Project1.dof +++ /dev/null @@ -1,92 +0,0 @@ -[FileVersion] -Version=6.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55;VMREPORTBUILDER -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -D:\projects\Source\ThirdParty\ReportBuilder\dclRBC51.bpl=ReportBuilder TeeChart 4.0 Components -d:\program files\borland\delphi6\Bin\dcldss50.bpl=Borland Decision Cube Components -d:\program files\borland\delphi6\Bin\dcltee50.bpl=TeeChart Components -d:\program files\borland\delphi6\Bin\dcltqr50.bpl=TeeChart for QuickReport Components diff --git a/PythonForDelphi/Demos/Demo04/Project1.dpr b/PythonForDelphi/Demos/Demo04/Project1.dpr index 34e6006c..66f3bb8a 100644 --- a/PythonForDelphi/Demos/Demo04/Project1.dpr +++ b/PythonForDelphi/Demos/Demo04/Project1.dpr @@ -1,7 +1,5 @@ program Project1; -{$I Definition.Inc} - uses {$IFDEF MSWINDOWS} Forms, diff --git a/PythonForDelphi/Demos/Demo04/Project1.dproj b/PythonForDelphi/Demos/Demo04/Project1.dproj index 7f4466f1..8decde26 100644 --- a/PythonForDelphi/Demos/Demo04/Project1.dproj +++ b/PythonForDelphi/Demos/Demo04/Project1.dproj @@ -1,101 +1,209 @@ - - - {6F45452F-882D-4BBD-8AEA-872276E8B856} - Project1.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - Project1.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {6F45452F-882D-4BBD-8AEA-872276E8B856} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Project1.exe + 00400000 + x86 + Project1 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo04/Project1.res b/PythonForDelphi/Demos/Demo04/Project1.res index fdf1db32..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo04/Project1.res and b/PythonForDelphi/Demos/Demo04/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo04/Project1_Icon.ico b/PythonForDelphi/Demos/Demo04/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo04/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo04/Unit1.dfm b/PythonForDelphi/Demos/Demo04/Unit1.dfm index 9dfab95b..70575837 100644 Binary files a/PythonForDelphi/Demos/Demo04/Unit1.dfm and b/PythonForDelphi/Demos/Demo04/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo04/Unit1.pas b/PythonForDelphi/Demos/Demo04/Unit1.pas index 291ed953..4ba12ae3 100644 --- a/PythonForDelphi/Demos/Demo04/Unit1.pas +++ b/PythonForDelphi/Demos/Demo04/Unit1.pas @@ -1,7 +1,5 @@ unit Unit1; -{$I Definition.Inc} - interface uses diff --git a/PythonForDelphi/Demos/Demo05/Project1.dof b/PythonForDelphi/Demos/Demo05/Project1.dof deleted file mode 100644 index e3281697..00000000 --- a/PythonForDelphi/Demos/Demo05/Project1.dof +++ /dev/null @@ -1,92 +0,0 @@ -[FileVersion] -Version=6.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55;VMREPORTBUILDER -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -D:\projects\Source\ThirdParty\ReportBuilder\dclRBC51.bpl=ReportBuilder TeeChart 4.0 Components -d:\program files\borland\delphi6\Bin\dcldss50.bpl=Borland Decision Cube Components -d:\program files\borland\delphi6\Bin\dcltee50.bpl=TeeChart Components -d:\program files\borland\delphi6\Bin\dcltqr50.bpl=TeeChart for QuickReport Components diff --git a/PythonForDelphi/Demos/Demo05/Project1.dproj b/PythonForDelphi/Demos/Demo05/Project1.dproj index f12deaa7..cd961939 100644 --- a/PythonForDelphi/Demos/Demo05/Project1.dproj +++ b/PythonForDelphi/Demos/Demo05/Project1.dproj @@ -1,101 +1,209 @@ - - - {38ABBD9D-A0AD-422F-959B-062CAB828F37} - Project1.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - Project1.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {38ABBD9D-A0AD-422F-959B-062CAB828F37} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Project1.exe + 00400000 + x86 + Project1 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo05/Project1.res b/PythonForDelphi/Demos/Demo05/Project1.res index 6008d582..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo05/Project1.res and b/PythonForDelphi/Demos/Demo05/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo05/Project1_Icon.ico b/PythonForDelphi/Demos/Demo05/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo05/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo05/Unit1.dfm b/PythonForDelphi/Demos/Demo05/Unit1.dfm index 07c01b88..6ab246ac 100644 Binary files a/PythonForDelphi/Demos/Demo05/Unit1.dfm and b/PythonForDelphi/Demos/Demo05/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo06/Project1.dof b/PythonForDelphi/Demos/Demo06/Project1.dof deleted file mode 100644 index 911b28c0..00000000 --- a/PythonForDelphi/Demos/Demo06/Project1.dof +++ /dev/null @@ -1,136 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=dxBarD6;dxcomnd6;rtl;dxBarDBNavD6;dbrtl;dxBarExtItemsD6;dxBarExtDBItemsD6;dxsbD6;dxdbtrD6;dxtrmdD6;dxmdsd6;dxInsD6;dxDBEdD6;dxEdtrD6;dxObjInsD6;vcldb;dxorgcD6;dxdborD6;vcl;vclx;fc3000v6;EQTLD6;ECQDBCD6;EQDBTLD6;EQGridD6;dxGrEdD6;dxExELD6;dxELibD6;dxPSCoreD6;dxPsPrVwAdvD6;dxPSLnksD6;dxPSTLLnkD6;dxPSdxDBTLLnkD6;dxPSdxDBCtrlLnkD6;dxPSdxDBGrLnkD6;dxPSdxDBTVLnkD6;dxPSdxInsLnkD6;dxPSdxOCLnkD6;dxPSdxDBOCLnkD6;rbTDBC61;rbRCL66;rbCIDE66;rbIDE66;rbBDE66;rbRIDE66;rbRAP66;rbDBDE66;rbDAD66;rbDIDE66;rbUSER66;rbDB66;rbADO66;adortl;rbDBE66;dbxcds;dbexpress;rbIBE66;ibxpress;dxMasterViewD6;RxCtl6;VclSmp;RxDB6;RxBDE6 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir=D:\Program Files\Borland\Delphi6\Bin\ -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= diff --git a/PythonForDelphi/Demos/Demo06/Project1.dproj b/PythonForDelphi/Demos/Demo06/Project1.dproj index 78fba70d..79cb07ae 100644 --- a/PythonForDelphi/Demos/Demo06/Project1.dproj +++ b/PythonForDelphi/Demos/Demo06/Project1.dproj @@ -1,134 +1,183 @@ - - - {2E88E1AD-C1A3-403E-8AEE-28895B68FBF7} - Project1.dpr - Debug - DCC32 - 13.4 - VCL - True - Win32 - 1 - Application - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - Project1.exe - 00400000 - x86 - - - Project1_Icon.ico - - - true - Project1_Icon.ico - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - 1033 - $(BDS)\bin\default_app.manifest - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - False - True - - - 12 - - -
+ + + {2E88E1AD-C1A3-403E-8AEE-28895B68FBF7} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + 1033 + Project1.exe + 00400000 + x86 + Project1 + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + true + Project1_Icon.ico + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + 1033 + $(BDS)\bin\default_app.manifest + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo06/Project1.res b/PythonForDelphi/Demos/Demo06/Project1.res index 3f7606cf..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo06/Project1.res and b/PythonForDelphi/Demos/Demo06/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo06/Project1_Icon.ico b/PythonForDelphi/Demos/Demo06/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo06/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo06/Unit1.dfm b/PythonForDelphi/Demos/Demo06/Unit1.dfm index 832fdbdc..67e4c229 100644 Binary files a/PythonForDelphi/Demos/Demo06/Unit1.dfm and b/PythonForDelphi/Demos/Demo06/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo06/Unit1.pas b/PythonForDelphi/Demos/Demo06/Unit1.pas index f8df4802..ec37e5da 100644 --- a/PythonForDelphi/Demos/Demo06/Unit1.pas +++ b/PythonForDelphi/Demos/Demo06/Unit1.pas @@ -158,6 +158,8 @@ procedure PyPoint_dealloc(obj : PPyObject); cdecl; // object.value // object.method(args) function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl; +var + PyKey : PPyObject; begin with GetPythonEngine, PPyPoint(obj)^ do begin @@ -170,11 +172,17 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl; else begin // Else check for a method - Result := Py_FindMethod( MethodsByName('PythonType1'), obj, key); - // or we could write, because it's quicker: - // Result := Py_FindMethod( Form1.PythonType1.MethodsData, obj, key); - if not Assigned(Result) then - PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format('Unknown attribute "%s"',[key]))); + if IsPython3000 then begin + PyKey := PyString_FromString(key); + Result := PyObject_GenericGetAttr(obj, PyKey); + end + else begin + Result := Py_FindMethod( MethodsByName('PythonType1'), obj, key); + // or we could write, because it's quicker: + // Result := Py_FindMethod( Form1.PythonType1.MethodsData, obj, key); + if not Assigned(Result) then + PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format('Unknown attribute "%s"',[key]))); + end; end; end; end; diff --git a/PythonForDelphi/Demos/Demo07/Project1.conf b/PythonForDelphi/Demos/Demo07/Project1.conf deleted file mode 100644 index 84e6d103..00000000 --- a/PythonForDelphi/Demos/Demo07/Project1.conf +++ /dev/null @@ -1,32 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --H+ --W+ --M --$M16384,1048576 --K$00400000 diff --git a/PythonForDelphi/Demos/Demo07/Project1.dof b/PythonForDelphi/Demos/Demo07/Project1.dof deleted file mode 100644 index 9cccf462..00000000 --- a/PythonForDelphi/Demos/Demo07/Project1.dof +++ /dev/null @@ -1,87 +0,0 @@ -[Compiler] -A=1 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55;VMREPORTBUILDER -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -D:\projects\Source\ThirdParty\ReportBuilder\dclRBC51.bpl=ReportBuilder TeeChart 4.0 Components -$(DELPHI)\Bin\dcldss50.bpl=Borland Decision Cube Components -$(DELPHI)\Bin\dcltee50.bpl=TeeChart Components -$(DELPHI)\Bin\dcltqr50.bpl=TeeChart for QuickReport Components diff --git a/PythonForDelphi/Demos/Demo07/Project1.dproj b/PythonForDelphi/Demos/Demo07/Project1.dproj index d6438414..31b2deb8 100644 --- a/PythonForDelphi/Demos/Demo07/Project1.dproj +++ b/PythonForDelphi/Demos/Demo07/Project1.dproj @@ -1,134 +1,185 @@ - - - {241C5DB1-E30A-4305-9F0A-4B7DD00FAD59} - Project1.dpr - Debug - DCC32 - 13.4 - VCL - True - Win32 - 1 - Application - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - Project1.exe - 00400000 - x86 - - - Project1_Icon1.ico - - - true - Project1_Icon1.ico - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - 1033 - $(BDS)\bin\default_app.manifest - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - False - True - - - 12 - - -
+ + + {241C5DB1-E30A-4305-9F0A-4B7DD00FAD59} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + 1033 + Project1.exe + 00400000 + x86 + Project1 + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + true + Project1_Icon1.ico + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + 1033 + $(BDS)\bin\default_app.manifest + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon1.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + true + true + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo07/Project1.kof b/PythonForDelphi/Demos/Demo07/Project1.kof deleted file mode 100644 index 6ad26fc6..00000000 --- a/PythonForDelphi/Demos/Demo07/Project1.kof +++ /dev/null @@ -1,61 +0,0 @@ -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases= - -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -DynamicLoader=/lib/ld-linux.so.2 - -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages= -Conditionals= -DebugSourceDirs= -UsePackages=0 - -[Parameters] -RunParams= -HostApplication= -Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% -UseLauncher=0 -DebugCWD= - diff --git a/PythonForDelphi/Demos/Demo07/Project1.res b/PythonForDelphi/Demos/Demo07/Project1.res index 3f7606cf..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo07/Project1.res and b/PythonForDelphi/Demos/Demo07/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo07/Project1_Icon.ico b/PythonForDelphi/Demos/Demo07/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo07/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo07/Project1_Icon1.ico b/PythonForDelphi/Demos/Demo07/Project1_Icon1.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo07/Project1_Icon1.ico differ diff --git a/PythonForDelphi/Demos/Demo07/Unit1.dfm b/PythonForDelphi/Demos/Demo07/Unit1.dfm index e4d92573..52c0d59a 100644 Binary files a/PythonForDelphi/Demos/Demo07/Unit1.dfm and b/PythonForDelphi/Demos/Demo07/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo07/Unit1.pas b/PythonForDelphi/Demos/Demo07/Unit1.pas index ff769141..98e507d2 100644 --- a/PythonForDelphi/Demos/Demo07/Unit1.pas +++ b/PythonForDelphi/Demos/Demo07/Unit1.pas @@ -196,6 +196,8 @@ procedure PyPoint_dealloc(obj : PPyObject); cdecl; // object.value // object.method(args) function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl; +var + PyKey : PPyObject; begin with GetPythonEngine, PPyPoint(obj)^ do begin @@ -207,12 +209,18 @@ function PyPoint_getattr(obj : PPyObject; key : PAnsiChar) : PPyObject; cdecl; Result := PyInt_FromLong( po_y ) else begin - // Else check for a method - Result := Py_FindMethod( MethodsByName('PythonType1'), obj, key); - // or we could write, because it's quicker: - // Result := Py_FindMethod( Form1.PythonType1.MethodsData, obj, key); - if not Assigned(Result) then - PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format('Unknown attribute "%s"',[key]))); + if IsPython3000 then begin + PyKey := PyString_FromString(key); + Result := PyObject_GenericGetAttr(obj, PyKey); + end + else begin + // Else check for a method + Result := Py_FindMethod( MethodsByName('PythonType1'), obj, key); + // or we could write, because it's quicker: + // Result := Py_FindMethod( Form1.PythonType1.MethodsData, obj, key); + if not Assigned(Result) then + PyErr_SetString (PyExc_AttributeError^, PAnsiChar(Format('Unknown attribute "%s"',[key]))); + end; end; end; end; diff --git a/PythonForDelphi/Demos/Demo08/Project1.conf b/PythonForDelphi/Demos/Demo08/Project1.conf deleted file mode 100644 index 84e6d103..00000000 --- a/PythonForDelphi/Demos/Demo08/Project1.conf +++ /dev/null @@ -1,32 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --H+ --W+ --M --$M16384,1048576 --K$00400000 diff --git a/PythonForDelphi/Demos/Demo08/Project1.dof b/PythonForDelphi/Demos/Demo08/Project1.dof deleted file mode 100644 index 2f62fbdb..00000000 --- a/PythonForDelphi/Demos/Demo08/Project1.dof +++ /dev/null @@ -1,88 +0,0 @@ -[FileVersion] -Version=6.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=0 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath=$(DELPHI)\Lib\Debug -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;TeeUI50;TeeDB50;Tee50;Dss50;TeeQR50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Excluded Packages] -c:\program files\borland\delphi6\RBuilder\Lib\dclRBC61.bpl=ReportBuilder TeeChart 5.0 Components -c:\program files\borland\delphi6\RBuilder\Lib\dclRBE66.bpl=ReportBuilder Enterprise -c:\program files\borland\delphi6\RBuilder\Lib\dclRAP66.bpl=ReportBuilder RAP Language -c:\program files\borland\delphi6\RBuilder\Lib\dclDAD66.bpl=ReportBuilder Data Access Environment -c:\program files\borland\delphi6\RBuilder\Lib\dclRBU66.bpl=ReportBuilder Sample Components -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxDBTVLnkD6.bpl=ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxInsLnkD6.bpl=ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxMVLnkD6.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxOCLnkD6.bpl=ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxDBOCLnkD6.bpl=ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxFCLnkD6.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc. diff --git a/PythonForDelphi/Demos/Demo08/Project1.dproj b/PythonForDelphi/Demos/Demo08/Project1.dproj index a69d5b3d..d82f7a85 100644 --- a/PythonForDelphi/Demos/Demo08/Project1.dproj +++ b/PythonForDelphi/Demos/Demo08/Project1.dproj @@ -1,134 +1,185 @@ - - - {237903A4-03D0-4047-A134-AAF207C6AC42} - Project1.dpr - Debug - DCC32 - 13.4 - VCL - True - Win32 - 1 - Application - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - 1033 - Project1.exe - 00400000 - x86 - - - Project1_Icon.ico - - - true - Project1_Icon.ico - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - 1033 - $(BDS)\bin\default_app.manifest - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Cfg_2 - Base - - - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - False - True - - - 12 - - -
+ + + {237903A4-03D0-4047-A134-AAF207C6AC42} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + 1033 + Project1.exe + 00400000 + x86 + Project1 + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + true + Project1_Icon.ico + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + 1033 + $(BDS)\bin\default_app.manifest + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + true + true + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo08/Project1.kof b/PythonForDelphi/Demos/Demo08/Project1.kof deleted file mode 100644 index 6ad26fc6..00000000 --- a/PythonForDelphi/Demos/Demo08/Project1.kof +++ /dev/null @@ -1,61 +0,0 @@ -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases= - -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -DynamicLoader=/lib/ld-linux.so.2 - -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages= -Conditionals= -DebugSourceDirs= -UsePackages=0 - -[Parameters] -RunParams= -HostApplication= -Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% -UseLauncher=0 -DebugCWD= - diff --git a/PythonForDelphi/Demos/Demo08/Project1.res b/PythonForDelphi/Demos/Demo08/Project1.res index 3f7606cf..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo08/Project1.res and b/PythonForDelphi/Demos/Demo08/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo08/Project1_Icon.ico b/PythonForDelphi/Demos/Demo08/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo08/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo08/Unit1.dfm b/PythonForDelphi/Demos/Demo08/Unit1.dfm index 22aef1fa..563d285d 100644 Binary files a/PythonForDelphi/Demos/Demo08/Unit1.dfm and b/PythonForDelphi/Demos/Demo08/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo09/Project1.conf b/PythonForDelphi/Demos/Demo09/Project1.conf deleted file mode 100644 index 84e6d103..00000000 --- a/PythonForDelphi/Demos/Demo09/Project1.conf +++ /dev/null @@ -1,32 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --H+ --W+ --M --$M16384,1048576 --K$00400000 diff --git a/PythonForDelphi/Demos/Demo09/Project1.dof b/PythonForDelphi/Demos/Demo09/Project1.dof deleted file mode 100644 index c24dad24..00000000 --- a/PythonForDelphi/Demos/Demo09/Project1.dof +++ /dev/null @@ -1,150 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=0 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55;VMREPORTBUILDER -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBGrLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBTVLnkD7.bpl=ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxInsLnkD7.bpl=ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxOILnkD7.bpl=ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxMVLnkD7.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxOCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBOCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxFCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxLCLnkD7.bpl=ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPscxTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPScxPCProdD7.bpl=ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc. diff --git a/PythonForDelphi/Demos/Demo09/Project1.dproj b/PythonForDelphi/Demos/Demo09/Project1.dproj index 0a37d802..be2df094 100644 --- a/PythonForDelphi/Demos/Demo09/Project1.dproj +++ b/PythonForDelphi/Demos/Demo09/Project1.dproj @@ -1,100 +1,207 @@ - - - {A9EE3C80-927A-458F-83F8-5388BD57BAF3} - Project1.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - Project1.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {A9EE3C80-927A-458F-83F8-5388BD57BAF3} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Project1.exe + 00400000 + x86 + Project1 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo09/Project1.kof b/PythonForDelphi/Demos/Demo09/Project1.kof deleted file mode 100644 index 6ad26fc6..00000000 --- a/PythonForDelphi/Demos/Demo09/Project1.kof +++ /dev/null @@ -1,61 +0,0 @@ -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases= - -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -DynamicLoader=/lib/ld-linux.so.2 - -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages= -Conditionals= -DebugSourceDirs= -UsePackages=0 - -[Parameters] -RunParams= -HostApplication= -Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% -UseLauncher=0 -DebugCWD= - diff --git a/PythonForDelphi/Demos/Demo09/Project1.res b/PythonForDelphi/Demos/Demo09/Project1.res index f928fd9e..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo09/Project1.res and b/PythonForDelphi/Demos/Demo09/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo09/Project1_Icon.ico b/PythonForDelphi/Demos/Demo09/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo09/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo09/ProjectGroup1.groupproj b/PythonForDelphi/Demos/Demo09/ProjectGroup1.groupproj new file mode 100644 index 00000000..29ccb633 --- /dev/null +++ b/PythonForDelphi/Demos/Demo09/ProjectGroup1.groupproj @@ -0,0 +1,48 @@ + + + {DE1835E8-3F23-495E-987E-5FADD5840B51} + + + + + + + + + + + Default.Personality.12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PythonForDelphi/Demos/Demo09/Unit1.dfm b/PythonForDelphi/Demos/Demo09/Unit1.dfm index adbe6a3f..6ea24339 100644 --- a/PythonForDelphi/Demos/Demo09/Unit1.dfm +++ b/PythonForDelphi/Demos/Demo09/Unit1.dfm @@ -29,7 +29,7 @@ object Form1: TForm1 Left = 0 Top = 132 Width = 528 - Height = 164 + Height = 163 Align = alClient Lines.Strings = ( 'import sys' @@ -41,7 +41,7 @@ object Form1: TForm1 end object Panel1: TPanel Left = 0 - Top = 296 + Top = 295 Width = 528 Height = 41 Align = alBottom @@ -69,19 +69,19 @@ object Form1: TForm1 TabOrder = 2 end object PythonEngine1: TPythonEngine - DllName = 'python32.dll' + DllName = 'python36.dll' APIVersion = 1013 RegVersion = '3.2' UseLastKnownVersion = False IO = PythonGUIInputOutput1 - Left = 16 + Left = 56 Top = 16 end object PythonGUIInputOutput1: TPythonGUIInputOutput UnicodeIO = True RawOutput = False Output = Memo2 - Left = 56 + Left = 184 Top = 16 end end diff --git a/PythonForDelphi/Demos/Demo09/demodll.conf b/PythonForDelphi/Demos/Demo09/demodll.conf deleted file mode 100644 index bb7b1251..00000000 --- a/PythonForDelphi/Demos/Demo09/demodll.conf +++ /dev/null @@ -1,34 +0,0 @@ --$A8 --$B- --$C+ --$D+ --$E- --$F- --$G+ --$H+ --$I+ --$J- --$K- --$L+ --$M- --$N+ --$O+ --$P+ --$Q- --$R- --$S- --$T- --$U- --$V+ --$W- --$X+ --$YD --$Z1 --cg --vn --vr --H+ --W+ --M --$M16384,1048576 --K$00400000 diff --git a/PythonForDelphi/Demos/Demo09/demodll.dof b/PythonForDelphi/Demos/Demo09/demodll.dof deleted file mode 100644 index 555135df..00000000 --- a/PythonForDelphi/Demos/Demo09/demodll.dof +++ /dev/null @@ -1,150 +0,0 @@ -[FileVersion] -Version=7.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=1 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -NamespacePrefix= -SymbolDeprecated=1 -SymbolLibrary=1 -SymbolPlatform=1 -UnitLibrary=1 -UnitPlatform=1 -UnitDeprecated=1 -HResultCompat=1 -HidingMember=1 -HiddenVirtual=1 -Garbage=1 -BoundsError=1 -ZeroNilCompat=1 -StringConstTruncated=1 -ForLoopVarVarPar=1 -TypedConstVarPar=1 -AsgToTypedConst=1 -CaseLabelRange=1 -ForVariable=1 -ConstructingAbstract=1 -ComparisonFalse=1 -ComparisonTrue=1 -ComparingSignedUnsigned=1 -CombiningSignedUnsigned=1 -UnsupportedConstruct=1 -FileOpen=1 -FileOpenUnitSrc=1 -BadGlobalSymbol=1 -DuplicateConstructorDestructor=1 -InvalidDirective=1 -PackageNoLink=1 -PackageThreadVar=1 -ImplicitImport=1 -HPPEMITIgnored=1 -NoRetVal=1 -UseBeforeDef=1 -ForLoopVarUndef=1 -UnitNameMismatch=1 -NoCFGFileFound=1 -MessageDirective=1 -ImplicitVariants=1 -UnicodeToLocale=1 -LocaleToUnicode=1 -ImagebaseMultiple=1 -SuspiciousTypecast=1 -PrivatePropAccessor=1 -UnsafeType=0 -UnsafeCode=0 -UnsafeCast=0 -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=Vcl50;Vclx50;VclSmp50;Vcldb50;vclado50;ibevnt50;Vclbde50;vcldbx50;Qrpt50;VCLIB50;Vclmid50;vclie50;Inetdb50;Inet50;NMFast50;webmid50;dclocx50;dclaxserver50;Indy50;VM;rbCIDE55;rbIDE55;rbRCL55;rbBDE55;rbDBDE55;rbDAD55;rbDIDE55;rbUSER55;rbDB55;rbADO55;rbIBE55;VMREPORTBUILDER -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang=$00000409 -RootDir= -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumTreeList by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumDBTreeList by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBGrLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumGrid by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBTVLnkD7.bpl=ExpressPrinting System ReportLink for ExpressDBTree by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxInsLnkD7.bpl=ExpressPrinting System ReportLink for ExpressInspector by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxOILnkD7.bpl=ExpressPrinting System ReportLink for ExpressRTTIInspector by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxMVLnkD7.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxOCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressOrgChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxDBOCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressDBOrgChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxFCLnkD7.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPSdxLCLnkD7.bpl=ExpressPrinting System ReportLink for ExpressLayoutControl by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPscxTLLnkD7.bpl=ExpressPrinting System ReportLink for ExpressQuantumTreeList 4 by Developer Express Inc. -C:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 7\Lib\dxPScxPCProdD7.bpl=ExpressPrinting System ContainerProducer for ExpressPageControl 2 by Developer Express Inc. diff --git a/PythonForDelphi/Demos/Demo09/demodll.dproj b/PythonForDelphi/Demos/Demo09/demodll.dproj index fdcbb23a..e7163f8a 100644 --- a/PythonForDelphi/Demos/Demo09/demodll.dproj +++ b/PythonForDelphi/Demos/Demo09/demodll.dproj @@ -1,101 +1,169 @@ - - - {FFF278A4-CBAE-4C3F-B542-8C88A2EFDA53} - demodll.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - demodll.pyd - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - true - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - - - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - - - - - Delphi.Personality.12 - VCLApplication - - - - demodll.dpr - - - False - True - False - C:\Delphi\progs32\Python\P4D\PythonForDelphi\Demos\Demo09\Project1.exe - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - - + + + {FFF278A4-CBAE-4C3F-B542-8C88A2EFDA53} + demodll.dpr + Debug + DCC32 + 18.3 + None + True + Win64 + 2 + Library + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + demodll.pyd + true + 00400000 + x86 + demodll + 1033 + .\$(Platform)\$(Config) + System;Xml;Data;Datasnap;Web;Soap;$(DCC_Namespace) + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + C:\Delphi\progs32\Python\P4D\PythonForDelphi\Demos\Demo09\Project1.exe + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + DEBUG;$(DCC_Define) + + + Debug + + + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + (Ohne) + + + + MainSource + + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + + + + + Delphi.Personality.12 + VCLApplication + + + + demodll.dpr + + + False + True + False + C:\Delphi\progs32\Python\P4D\PythonForDelphi\Demos\Demo09\Project1.exe + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + False + True + + + 12 + + + diff --git a/PythonForDelphi/Demos/Demo09/demodll.kof b/PythonForDelphi/Demos/Demo09/demodll.kof deleted file mode 100644 index 44affd6b..00000000 --- a/PythonForDelphi/Demos/Demo09/demodll.kof +++ /dev/null @@ -1,61 +0,0 @@ -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases= - -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=1 -RemoteSymbols=1 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -DynamicLoader=/lib/ld-linux.so.2 - -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=baseclx:visualclx:visualdbclx:dataclx:netdataclx:netclx:indy:Python_kylix -Conditionals= -DebugSourceDirs= -UsePackages=0 - -[Parameters] -RunParams= -HostApplication= -Launcher=/usr/X11R6/bin/xterm -T KylixDebuggerOutput -e bash -i -c %debuggee% -UseLauncher=0 -DebugCWD= - diff --git a/PythonForDelphi/Demos/Demo09/demodll.res b/PythonForDelphi/Demos/Demo09/demodll.res new file mode 100644 index 00000000..98b43987 Binary files /dev/null and b/PythonForDelphi/Demos/Demo09/demodll.res differ diff --git a/PythonForDelphi/Demos/Demo09/module.pas b/PythonForDelphi/Demos/Demo09/module.pas index e2545071..65c3798d 100644 --- a/PythonForDelphi/Demos/Demo09/module.pas +++ b/PythonForDelphi/Demos/Demo09/module.pas @@ -53,7 +53,7 @@ function PyInit_demodll : PPyObject; gEngine.UseLastKnownVersion := False; gEngine.RegVersion := '3.2'; //<-- Use the same version as the python 3.x your main program uses gEngine.APIVersion := 1013; - gEngine.DllName := 'python32.dll'; + gEngine.DllName := 'python36.dll'; gEngine.LoadDll; gModule := TPythonModule.Create(nil); gModule.Engine := gEngine; diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Demo.ini b/PythonForDelphi/Demos/Demo10_FireDAC/Demo.ini new file mode 100644 index 00000000..c39632ab --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/Demo.ini @@ -0,0 +1,26 @@ +[MSSQL_DB] +BaseDriverID=MSSQL +DriverID=MSSQL_2008 +ODBCDriver=SQL Server Native Client 11.0 +Server=XXX\YYY +Database=XXX +OSAuthent=No +User_Name=XXX +Password=XXX +MetaDefCatalog=XX +MetaDefSchema=XXX +ExtendedMetadata=True +VariantFormat=Binary +Encrypt=No +MARS=Yes + +[Ora_DB] +DriverID=OraXE +Database=localhost:1521/XE +User_Name=XXX +Password=YYY +CharacterSet=UTF8 + +[SQLite_DB] +DriverID=SQLite +Database=Demo.s3db diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Demo.s3db b/PythonForDelphi/Demos/Demo10_FireDAC/Demo.s3db new file mode 100644 index 00000000..d9a34aad Binary files /dev/null and b/PythonForDelphi/Demos/Demo10_FireDAC/Demo.s3db differ diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.dpr b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.dpr new file mode 100644 index 00000000..7997b7cd --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.dpr @@ -0,0 +1,17 @@ +program Demo10; + +uses + Forms, + fmMain in 'fmMain.pas' {Main}, + PythonEngine in '..\..\Components\Sources\Core\PythonEngine.pas', + WrapDelphiClasses in '..\..\Components\Sources\Core\WrapDelphiClasses.pas', + pyDBFireDac in '..\..\Components\Sources\FireDAC\pyDBFireDac.pas', + WrapDelphi in '..\..\Components\Sources\Core\WrapDelphi.pas'; + +{$R *.res} + +begin + Application.Initialize; + Application.CreateForm(TMain, Main); + Application.Run; +end. diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.dproj b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.dproj new file mode 100644 index 00000000..f1fff730 --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.dproj @@ -0,0 +1,583 @@ + + + {1D701B96-D47C-4AD0-BE2E-830C95586BC9} + Demo10.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Demo10.exe + 00400000 + x86 + Demo10 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1032 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Demo10_Icon1.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Demo10_Icon1.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + 1033 + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;USE_FASTMM4_LEAK_MONITOR;FullDebugMode;LogMemoryLeakDetailToFile;$(DCC_Define) + + + Debug + + + true + true + true + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + + + true + true + true + 1033 + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + false + + + + MainSource + + +
Main
+
+ + + + + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Demo10.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1032 + 1253 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + + + Demo10.exe + true + + + + + 1 + + + Contents\MacOS + 0 + + + + + classes + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + + + res\values + 1 + + + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + + + 1 + + + 1 + + + 0 + + + + + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + 1 + + + 1 + + + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + 12 + + + +
diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.res b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.res new file mode 100644 index 00000000..b51b21ff Binary files /dev/null and b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10.res differ diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Demo10_Icon.ico b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Demo10_Icon1.ico b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10_Icon1.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo10_FireDAC/Demo10_Icon1.ico differ diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Example1.py b/PythonForDelphi/Demos/Demo10_FireDAC/Example1.py new file mode 100644 index 00000000..0c47eb89 --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/Example1.py @@ -0,0 +1,65 @@ +import DBFireDac + +# Create and open the table +T = DBFireDac.CreateFDTable() +T.ConnectionDefName = "SQLite_DB" +T.TableName = "Customer" +T.Active = True #or use T.Open() + +# Display columns +print ("Columns: ", T.FieldNamesAsTuple()) + +LastInvoiceDate = T.FieldByName("LastInvoiceDate") + +# For each record of the table +T.First() +while not T.EOF: + # Get all the fields in a list + A = [] + for i in range( 0, T.FieldCount ): + A.append( T.Fields(i).Value ) + # Print the current record number and the list + print ("Rec.", T.RecNo, ":", A) + # Edit record + T.Edit() + T.FieldByName("TaxRate").Value = 2.5 + # Increments date by one day + D = LastInvoiceDate.Value + if D[2] < 28: + D2 = D[:2]+(D[2]+1,)+D[3:] # this is tuple arithmetic ! + else: + D2 = D[:2]+(1,)+D[3:] # this is tuple arithmetic ! + LastInvoiceDate.Value = D2 + T.Post() + # Get next record + T.Next() + +# Print some fields by their names +F = T.FieldByName("Company") +print (F, F.FieldName, "=", F.Value) + +# Use the TFields and print the list of companies +T.First() +while not T.EOF: + print (F.AsString) + T.Next() + +# Print the fields as a dictionary +D = T.FieldsAsDict() +print (D) +print ("COMPANY:", D["COMPANY"]) # <- case-sensitive + +T.Close() + +T.TableName = "Dummy" +try: + T.Open() +except DBFireDac.DBError: + print ("could not open table ", T.TableName) + +#delete fields +del F +del LastInvoiceDate + +# delete the table +del T diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Example2.py b/PythonForDelphi/Demos/Demo10_FireDAC/Example2.py new file mode 100644 index 00000000..3b6ef1e1 --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/Example2.py @@ -0,0 +1,76 @@ +import DBFireDac + +# Get the TTable object associated to +# the delphi table displayed on right +# It is done when you click on Execute +T = DBFireDac.T + +# Display TableName +print ("TableName: ", T.TableName) + +# Display columns +print ("Columns: ") +for i in T.FieldNamesAsTuple(): + print (" ", i) + +T.CancelRange() +# For each record of the table +for i in T: # <- required ContainerAccess !!! + print ("Rec.", T.RecNo, ":", i) + +# Print some fields by their names +print ("Rec.", T.RecNo, ": ", "Company: ", T.FieldByName("Company").Value) + +# check state +if not T.State in [DBFireDac.dsEdit, DBFireDac.dsInsert]: + print ("Table is not edited") + +# access the table like an array +print ("Index 10; Row 11: ", T[10]) # Row 11 <- required ContainerAccess !!! +print ("Index 10; Row 11 - First field: ", T[10][1]) # second field of row 11 <- required ContainerAccess !!! + +# locate a record +if T.Locate( "City;State", ["Largo","FL"], [] ): + print ("Found RecNo:", T.RecNo, " for Locate(Key: 'City;State', Value: [Largo,FL])") +if T.Locate( "Company", "BLUE SPORTS", [DBFireDac.loCaseInsensitive] ): + print ("Found RecNo:", T.RecNo, " for Locate(Key: 'Company', Value: [BLUE SPORTS])") +if T.Locate( "Company", "ISLAND", [DBFireDac.loCaseInsensitive, DBFireDac.loPartialKey] ): + print ("Found RecNo:", T.RecNo, " for Locate(Key: 'Company', Value: [ISLAND])") + +# lookup a record +print ("Lookup 'CustNo;Company' for Key: 'City;State', Value: [Largo,FL] -> ", T.Lookup( "City;State", ["Largo","FL"], "CustNo;Company" )) + +# define a range +print ("-----------------------------------------------------------") +print ("Names of Indexes:", T.GetIndexNames()) +T.IndexName = "SK1_CUSTOMER" +T.SetRange( ["Unisco"], ["Unisco"] ) +for i in T: + print ("Rec.", T.RecNo, ":", i) +T.CancelRange() + +print ("-----------------------------------------------------------") +# Find a record +if T.FindKey( ['Unisco'] ): + print ("Unisco found !") +else: + print ("Could not find Unisco !") + +# Find the nearest record +T.FindNearest( ['Ocean'] ) +print ("Find nearest Ocean :", T.FieldsAsTuple()) + +# Print all doc strings of an instance's methods +def PrintDocOf( inst ): + print ("--------------------- Type ", type(inst).__name__, "---------------------") + if type(inst).__doc__: + print (type(inst).__doc__) +print ("-----------------------------------------------------------") +print ("Documentation:") +print +print ("Module DBFireDac:") +print (DBFireDac.__doc__) +PrintDocOf(T) +print ("-----------------------------------------------------------") + + diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Example3.py b/PythonForDelphi/Demos/Demo10_FireDAC/Example3.py new file mode 100644 index 00000000..419f64d4 --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/Example3.py @@ -0,0 +1,54 @@ +import DBFireDac +from datetime import datetime + +# Get the TTable object associated to +# the delphi table displayed on right +# It is done when you click on Execute +T = DBFireDac.T + +# Display columns +print ("Columns: ") +for i in T.FieldNamesAsTuple(): + print (" ", i) + +# For each record of the table +print ("Company name for each record of table : ") +T.First() +while not T.EOF: + # Print the current record number and the Company + print ("Rec.", T.RecNo, "; Company: ", T.FieldByName("Company").Value) + # Get next record + T.Next() + +# check state +if not T.State in [DBFireDac.dsEdit, DBFireDac.dsInsert]: + print ("Table is not edited") + +# Find and edit a record +T.IndexName = "SK1_CUSTOMER" +if T.FindKey( ['Unisco'] ): + print ("Unisco found !") + T.Edit() + T.FieldByName('ADDR2').AsString = 'Egal' + T.FieldByName('LASTINVOICEDATE').AsDateTime = datetime.today() + T.Post() + print ("New values for ADDR2='", T.FieldByName('ADDR2').AsString, "'and LASTINVOICEDATE=", T.FieldByName('LASTINVOICEDATE').AsString) +else: + print ("Could not find Unisco !") + +# New Company: Append or Delete +if T.FindKey( ['Test-Company'] ): + # Delete record + T.Delete() + print ("New Company 'Test-Company' deleted !") +else: + # New record + T.Append() + T.FieldByName('COMPANY').AsString = 'Test-Company' + T.FieldByName('ADDR1').AsString = 'Marktplatz 1' + T.FieldByName('CITY').AsString = 'Köln' + T.FieldByName('LASTINVOICEDATE').AsDateTime = datetime.today() + T.Post() + print ("New Company 'Test-Company' created !") + + diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/Example4.py b/PythonForDelphi/Demos/Demo10_FireDAC/Example4.py new file mode 100644 index 00000000..25a1183b --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/Example4.py @@ -0,0 +1,30 @@ +import DBFireDac + +# Create and open the Query +Q = DBFireDac.CreateFDQuery() +Q.ConnectionDefName = "SQLite_DB" +Q.SQL = [ +"select *", +" from ORDERS" ] + +Q.Open() # or Q.Active = True + +# Display columns +print ("Columns: ", Q.FieldNamesAsTuple()) +# For each record of the table +Q.First() +while not Q.EOF: + # Get all the fields in a list + A = [] + for i in range( 0, Q.FieldCount ): + A.append( Q.Fields(i).AsString ) + # Print the current record number and the list + print ("Rec.", Q.RecNo, ":", A) + # Get next record + Q.Next() +# +Q.Close() + +# delete the Query +del Q + diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/FDDrivers.ini b/PythonForDelphi/Demos/Demo10_FireDAC/FDDrivers.ini new file mode 100644 index 00000000..6711ca60 --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/FDDrivers.ini @@ -0,0 +1,19 @@ +[ADDrivers.ini] +Encoding=UTF8 + +[OraXE] +BaseDriverID=Ora +VendorHome=XE + +[MSSQL_2005] +BaseDriverID=MSSQL +ODBCDriver=SQL SERVER + +[MSSQL_2008] +BaseDriverID=MSSQL +ODBCDriver=SQL Server Native Client 11.0 + +[MSSQL_2012] +BaseDriverID=MSSQL +ODBCDriver=SQL Server Native Client 11.0 + diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/fmMain.dfm b/PythonForDelphi/Demos/Demo10_FireDAC/fmMain.dfm new file mode 100644 index 00000000..fb6fd36f Binary files /dev/null and b/PythonForDelphi/Demos/Demo10_FireDAC/fmMain.dfm differ diff --git a/PythonForDelphi/Demos/Demo10_FireDAC/fmMain.pas b/PythonForDelphi/Demos/Demo10_FireDAC/fmMain.pas new file mode 100644 index 00000000..d270b632 --- /dev/null +++ b/PythonForDelphi/Demos/Demo10_FireDAC/fmMain.pas @@ -0,0 +1,488 @@ +unit fmMain; + +interface + +uses + Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, + System.Types, System.UITypes, + ComCtrls, ExtCtrls, StdCtrls, PythonEngine, PythonGUIInputOutput, Db, + Grids, DBGrids, Datasnap.DBClient, FireDAC.Stan.Intf, FireDAC.Stan.Option, + FireDAC.Stan.Error, FireDAC.UI.Intf, FireDAC.Phys.Intf, FireDAC.Stan.Def, + FireDAC.Stan.Pool, FireDAC.Stan.Async, FireDAC.Phys, FireDAC.FMXUI.Wait, + FireDAC.Stan.Param, FireDAC.DatS, FireDAC.DApt.Intf, FireDAC.DApt, + FireDAC.Comp.Client, FireDAC.Comp.DataSet, FireDAC.Comp.UI, + FireDAC.Phys.SQLite, FireDAC.Phys.SQLiteDef, FireDAC.Stan.ExprFuncs, + WrapDelphi, pyDBFireDac, SynEditHighlighter, SynHighlighterPython, SynEdit; + +type + TMain = class(TForm) + RichEdit1: TRichEdit; + Splitter1: TSplitter; + PythonGUIInputOutput: TPythonGUIInputOutput; + typeFDTable: TPythonType; + modDBFireDac: TPythonModule; + dsrcCustomer: TDataSource; + typeFDQuery: TPythonType; + DataSource2: TDataSource; + typeDBField: TPythonType; + typeDBVarArg: TPythonType; + Panel6: TPanel; + btnSQLTest: TButton; + cobxConnSQLServer: TComboBox; + Label5: TLabel; + Connection: TFDConnection; + FDGUIxWaitCursor: TFDGUIxWaitCursor; + mqSrcTables: TFDMetaInfoQuery; + SynPythonSyn: TSynPythonSyn; + PythonEngine: TPythonEngine; + tblCustomer: TFDTable; + PageControl: TPageControl; + TabSheet1: TTabSheet; + Splitter7: TSplitter; + SynEditScript1: TSynEdit; + Panel7: TPanel; + Label1: TLabel; + Label2: TLabel; + btnExecuteExample1: TButton; + TabSheet2: TTabSheet; + Splitter3: TSplitter; + Panel1: TPanel; + btnExecuteExample2: TButton; + DBGrid1: TDBGrid; + SynEditScript2: TSynEdit; + TabSheet4: TTabSheet; + Splitter4: TSplitter; + Panel3: TPanel; + btnExecuteExample3: TButton; + DBGrid2: TDBGrid; + SynEditScript3: TSynEdit; + TabSheet5: TTabSheet; + Splitter2: TSplitter; + Panel2: TPanel; + btnExecuteExample4: TButton; + SynEditScript4: TSynEdit; + procedure btnExecuteExample1Click(Sender: TObject); + procedure typeFDTableInitialization(Sender: TObject); + procedure btnExecuteExample2Click(Sender: TObject); + procedure Table1CalcFields(DataSet: TDataSet); + procedure typeFDQueryInitialization(Sender: TObject); + procedure btnExecuteExample4Click(Sender: TObject); + procedure btnExecuteExample3Click(Sender: TObject); + procedure typeDBFieldInitialization(Sender: TObject); + procedure modDBFireDacAfterInitialization(Sender: TObject); + procedure modDBFireDacInitialization(Sender: TObject); + procedure typeDBVarArgInitialization(Sender: TObject); + procedure FormShow(Sender: TObject); + procedure btnSQLTestClick(Sender: TObject); + procedure modDBFireDacFinalization(Sender: TObject); + procedure typeFDTableFinalization(Sender: TObject); + procedure FormDestroy(Sender: TObject); + procedure typeFDQueryFinalization(Sender: TObject); + procedure typeDBFieldFinalization(Sender: TObject); + procedure PageControlChange(Sender: TObject); + private + function DBConnectionClosedCheck(aConnectionDefName: String): Boolean; + public + end; + +var + Main: TMain; + + +implementation + + +{$R *.DFM} + + +procedure TMain.FormShow(Sender: TObject); +var + i: Integer; + l_sStr: String; +begin + SynEditScript1.Lines.LoadFromFile( 'Example1.py' ); + SynEditScript2.Lines.LoadFromFile( 'Example2.py' ); + SynEditScript3.Lines.LoadFromFile( 'Example3.py' ); + SynEditScript4.Lines.LoadFromFile( 'Example4.py' ); + // + PageControl.ActivePage := TabSheet1; + // + RichEdit1.Lines.Clear; + cobxConnSQLServer.ItemIndex := -1; + if FileExists('FDDrivers.ini') then begin + FDManager.DriverDefFileName := 'FDDrivers.ini'; + FDManager.DriverDefFileAutoLoad := True; + end + else begin + l_sStr := 'Die Ini-Datei "FDDrivers.ini" existiert nicht!'; + RichEdit1.Lines.Add(l_sStr); + MessageDlg(l_sStr, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0); + Close; + end; + if FileExists('Demo.ini') then begin + FDManager.ConnectionDefFileName := 'Demo.ini'; + try + FDManager.LoadConnectionDefFile; + FDManager.GetConnectionNames(cobxConnSQLServer.Items); + for i := 0 to cobxConnSQLServer.Items.Count-1 do begin + l_sStr := UpperCase(cobxConnSQLServer.Items[i]); + if (Pos('SQLITE',l_sStr) > 0) and (cobxConnSQLServer.ItemIndex < 0) then begin + cobxConnSQLServer.ItemIndex := i; + break; + end; + end; + except + on E: Exception do begin + l_sStr := 'Exception: ' + E.Message; + RichEdit1.Lines.Add(l_sStr); + MessageDlg(l_sStr, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0); + end; + end; + end + else begin + l_sStr := 'Die Ini-Datei "Demo.ini" existiert nicht!'; + RichEdit1.Lines.Add(l_sStr); + MessageDlg(l_sStr, TMsgDlgType.mtError, [TMsgDlgBtn.mbOK], 0); + Close; + end; +end; + +procedure TMain.FormDestroy(Sender: TObject); +begin + if Connection.Connected then + Connection.Close; + typeFDTableFinalization(TPyDBTable.PyDBTableType); + typeFDQueryFinalization(TPyDBQuery.PyDBQueryType); + typeDBFieldFinalization(TPyDBField.PyDBFieldType); + modDBFireDacFinalization(pyDBFireDac.g_oDBModule); +end; + +procedure TMain.btnSQLTestClick(Sender: TObject); +var + l_sStr, l_sConnName: String; +begin + RichEdit1.Lines.Clear; + l_sConnName := cobxConnSQLServer.Items[cobxConnSQLServer.ItemIndex]; + l_sStr := UpperCase(l_sConnName); + if Pos('ORA',l_sStr) > 0 then begin + RichEdit1.Lines.Add('Oracle Parameter:'); + end + else if Pos('MSSQL',l_sStr) > 0 then begin + RichEdit1.Lines.Add('MS SQL Server Parameter:'); + end + else if Pos('SQLITE',l_sStr) > 0 then begin + RichEdit1.Lines.Add('SQLite Parameter:'); + end + else begin + RichEdit1.Lines.Add('Unkown database type!'); + exit; + end; + if self.DBConnectionClosedCheck(l_sConnName) then + RichEdit1.Lines.Add('Database was connected!') + else + RichEdit1.Lines.Add('Database was not connected!'); +end; + +function TMain.DBConnectionClosedCheck(aConnectionDefName: String): Boolean; +var + l_sStr: String; + l_oDef: IFDStanConnectionDef; +begin + Result := True; + if Connection.Connected then + Connection.Close; + if Connection.ConnectionDefName <> aConnectionDefName then begin + l_oDef := FDManager.ConnectionDefs.ConnectionDefByName(aConnectionDefName); + Connection.Params.Clear; + Connection.Params.AddStrings(l_oDef.Params); + Connection.ConnectionDefName := aConnectionDefName; + // + try + Connection.Connected := True; + if Connection.Connected then begin + Result := True; + Connection.Close; + end; + except + on E: Exception do begin + Result := False; + l_sStr := 'Exception: ' + E.Message; + RichEdit1.Lines.Add(l_sStr); + end; + end; + end; +end; + +procedure TMain.typeFDTableInitialization(Sender: TObject); +var + l_oPythonType: TPythonType; +begin + if Sender is TPythonType then begin + l_oPythonType := TPythonType(Sender); + l_oPythonType.PyObjectClass := TPyDBTable; + if not Assigned(typeFDTable) then + typeFDTable := l_oPythonType; + TPyDBTable.PyDBTableType := l_oPythonType; + end; +end; + +procedure TMain.typeFDTableFinalization(Sender: TObject); +var + l_oPythonType: TPythonType; +begin + if Sender is TPythonType then begin + l_oPythonType := TPythonType(Sender); + //-- l_oPythonType.ClearMethods; + end; +end; + +procedure TMain.typeFDQueryInitialization(Sender: TObject); +var + l_oPythonType: TPythonType; +begin + if Sender is TPythonType then begin + l_oPythonType := TPythonType(Sender); + l_oPythonType.PyObjectClass := TPyDBQuery; + if not Assigned(typeFDQuery) then + typeFDQuery := l_oPythonType; + TPyDBQuery.PyDBQueryType := l_oPythonType; + end; +end; + +procedure TMain.typeFDQueryFinalization(Sender: TObject); +var + l_oPythonType: TPythonType; +begin + if Sender is TPythonType then begin + l_oPythonType := TPythonType(Sender); + //-- l_oPythonType.ClearMethods; + end; +end; + +procedure TMain.typeDBFieldInitialization(Sender: TObject); +var + l_oPythonType: TPythonType; +begin + if Sender is TPythonType then begin + l_oPythonType := TPythonType(Sender); + l_oPythonType.PyObjectClass := TPyDBField; + if not Assigned(typeDBField) then + typeDBField := l_oPythonType; + TPyDBField.PyDBFieldType := l_oPythonType; + end; +end; + +procedure TMain.typeDBFieldFinalization(Sender: TObject); +var + l_oPythonType: TPythonType; +begin + if Sender is TPythonType then begin + l_oPythonType := TPythonType(Sender); + //-- l_oPythonType.ClearMethods; + end; +end; + +procedure TMain.typeDBVarArgInitialization(Sender: TObject); +var + l_oPythonType: TPythonType; +begin + if Sender is TPythonType then begin + l_oPythonType := TPythonType(Sender); + l_oPythonType.PyObjectClass := TPyDBVarArg; + if not Assigned(typeDBVarArg) then + typeDBVarArg := l_oPythonType; + TPyDBVarArg.PyDBVarArgType := l_oPythonType; + end; +end; + +procedure TMain.Table1CalcFields(DataSet: TDataSet); +begin + Dataset.FieldByName('Demo').AsString := Dataset.FieldByName('State').AsString + ' - ' + + Dataset.FieldByName('Zip').AsString; +end; + +procedure TMain.modDBFireDacAfterInitialization(Sender: TObject); +begin + with Sender as TPythonModule do begin + // Values for type TDatasetState + SetVarFromVariant( AnsiString('dsInactive'), 0 ); + SetVarFromVariant( AnsiString('dsBrowse'), 1 ); + SetVarFromVariant( AnsiString('dsEdit'), 2 ); + SetVarFromVariant( AnsiString('dsInsert'), 3 ); + SetVarFromVariant( AnsiString('dsSetKey'), 4 ); + SetVarFromVariant( AnsiString('dsCalcFields'), 5 ); + SetVarFromVariant( AnsiString('dsFilter'), 6 ); + SetVarFromVariant( AnsiString('dsNewValue'), 7 ); + SetVarFromVariant( AnsiString('dsOldValue'), 8 ); + SetVarFromVariant( AnsiString('dsCurValue'), 9 ); + // Values for type TFieldType + SetVarFromVariant( AnsiString('ftUnknown'), 0 ); + SetVarFromVariant( AnsiString('ftString'), 1 ); + SetVarFromVariant( AnsiString('ftSmallint'), 2 ); + SetVarFromVariant( AnsiString('ftInteger'), 3 ); + SetVarFromVariant( AnsiString('ftWord'), 4 ); + SetVarFromVariant( AnsiString('ftBoolean'), 5 ); + SetVarFromVariant( AnsiString('ftFloat'), 6 ); + SetVarFromVariant( AnsiString('ftCurrency'), 7 ); + SetVarFromVariant( AnsiString('ftBCD'), 8 ); + SetVarFromVariant( AnsiString('ftDate'), 9 ); + SetVarFromVariant( AnsiString('ftTime'), 10 ); + SetVarFromVariant( AnsiString('ftDateTime'), 11 ); + SetVarFromVariant( AnsiString('ftBytes'), 12 ); + SetVarFromVariant( AnsiString('ftVarBytes'), 13 ); + SetVarFromVariant( AnsiString('ftAutoInc'), 14 ); + SetVarFromVariant( AnsiString('ftBlob'), 15 ); + SetVarFromVariant( AnsiString('ftMemo'), 16 ); + SetVarFromVariant( AnsiString('ftGraphic'), 17 ); + SetVarFromVariant( AnsiString('ftFmtMemo'), 18 ); + SetVarFromVariant( AnsiString('ftParadoxOle'), 19 ); + SetVarFromVariant( AnsiString('ftDBaseOle'), 20 ); + SetVarFromVariant( AnsiString('ftTypedBinary'), 21 ); + SetVarFromVariant( AnsiString('ftCursor'), 22 ); + // Values for type TFieldKind + SetVarFromVariant( AnsiString('fkData'), 0 ); + SetVarFromVariant( AnsiString('fkCalculated'), 1 ); + SetVarFromVariant( AnsiString('fkLookup'), 2 ); + SetVarFromVariant( AnsiString('fkInternalCalc'), 3 ); + // Values for type TLocateOption + SetVarFromVariant( AnsiString('loCaseInsensitive'), 0 ); + SetVarFromVariant( AnsiString('loPartialKey'), 1 ); + // Values for type TLockType + SetVarFromVariant( AnsiString('ltReadLock'), 0 ); + SetVarFromVariant( AnsiString('ltWriteLock'), 1 ); + // Values for type TIndexOptions + SetVarFromVariant( AnsiString('ixPrimary'), 0 ); + SetVarFromVariant( AnsiString('ixUnique'), 1 ); + SetVarFromVariant( AnsiString('ixDescending'), 2 ); + SetVarFromVariant( AnsiString('ixCaseInsensitive'), 3 ); + SetVarFromVariant( AnsiString('ixExpression'), 4 ); + // Values for type TDataAction + SetVarFromVariant( AnsiString('daFail'), 0 ); + SetVarFromVariant( AnsiString('daAbort'), 1 ); + SetVarFromVariant( AnsiString('daRetry'), 2 ); + // Values for type TUpdateKind + SetVarFromVariant( AnsiString('ukModify'), 0 ); + SetVarFromVariant( AnsiString('ukInsert'), 1 ); + SetVarFromVariant( AnsiString('ukDelete'), 2 ); + // Values for type TUpdateAction + SetVarFromVariant( AnsiString('uaFail'), 0 ); + SetVarFromVariant( AnsiString('uaAbort'), 1 ); + SetVarFromVariant( AnsiString('uaSkip'), 2 ); + SetVarFromVariant( AnsiString('uaRetry'), 3 ); + SetVarFromVariant( AnsiString('uaApplied'), 4 ); + end; +end; + +procedure TMain.modDBFireDacInitialization(Sender: TObject); +begin + pyDBFireDac.g_oDBModule := Sender as TPythonModule; + with Sender as TPythonModule do begin + with DocString do begin + Add( 'This module contains several Object Types that' ); + Add( 'will let you work with FireDAC and access' ); + Add( 'a database.' ); + Add( '' ); + Add( 'CreateDBTable() -> creates a TFDTable instance' ); + Add( 'CreateDBQuery() -> creates a TFDQuery instance' ); + end; + with Errors.Add do begin + Name := 'DBError'; + ErrorType := etClass; // <- !!! Must ... + end; + end; +end; + +procedure TMain.modDBFireDacFinalization(Sender: TObject); +begin + if Sender is TPythonModule then begin + with Sender as TPythonModule do begin + ClearVars; + end; + end; +end; + +procedure TMain.PageControlChange(Sender: TObject); +begin + if PageControl.TabIndex = 1 then begin + // Example2 + if not tblCustomer.Active then + tblCustomer.Active := True; + end + else begin + if tblCustomer.Active then + tblCustomer.Active := False; + end; +end; + +procedure TMain.btnExecuteExample1Click(Sender: TObject); +var + l_sConnName: String; +begin + l_sConnName := cobxConnSQLServer.Items[cobxConnSQLServer.ItemIndex]; + if self.DBConnectionClosedCheck(l_sConnName) then begin + with GetPythonEngine do begin + ExecStrings( SynEditScript1.Lines ); + end; + end; +end; + +procedure TMain.btnExecuteExample2Click(Sender: TObject); +var + pyTbl : TPyDBTable; + pyObj : PPyObject; +begin + // Instantiate a new Python object TPyTable + pyObj := typeFDTable.CreateInstance; + pyTbl := PythonToDelphi(pyObj) as TPyDBTable; + // Attach our Delphi table to the Python object + pyTbl.DelphiObject := tblCustomer; + pyTbl.Owned := False; + with GetPythonEngine do begin + // Define a new variable "T" in the DB module + modDBFireDac.SetVar( 'T', pyObj ); + Py_XDecRef(pyObj); + // Excecute the script + ExecStrings( SynEditScript2.Lines ); + end; + pyTbl.Free; +end; + +procedure TMain.btnExecuteExample3Click(Sender: TObject); +var + pyTbl : TPyDBTable; + pyObj : PPyObject; + l_oTable: TFDTable; +begin + // Instantiate a new Python object TPyTable + pyObj := typeFDTable.CreateInstance; + pyTbl := PythonToDelphi(pyObj) as TPyDBTable; + // connect the Datasource2 to the Python Table + l_oTable := pyTbl.GetDelphiObject; + l_oTable.TableName := 'Customer'; + l_oTable.Connection := Connection; + Datasource2.Dataset := l_oTable; + l_oTable.Open(); + // Datasource2.Dataset. + with GetPythonEngine do begin + // Define a new variable "T" in the DB module + modDBFireDac.SetVar( 'T', pyObj ); + Py_XDecRef(pyObj); + // Excecute the script + ExecStrings( SynEditScript3.Lines ); + end; + pyTbl.Free; +end; + +procedure TMain.btnExecuteExample4Click(Sender: TObject); +var + l_sConnName: String; +begin + l_sConnName := cobxConnSQLServer.Items[cobxConnSQLServer.ItemIndex]; + if self.DBConnectionClosedCheck(l_sConnName) then begin + with PythonEngine do + ExecStrings( SynEditScript4.Lines ); + end; +end; + +end. + diff --git a/PythonForDelphi/Demos/Demo11/ThSort.dfm b/PythonForDelphi/Demos/Demo11/ThSort.dfm index 19bcd533..529ed183 100644 Binary files a/PythonForDelphi/Demos/Demo11/ThSort.dfm and b/PythonForDelphi/Demos/Demo11/ThSort.dfm differ diff --git a/PythonForDelphi/Demos/Demo11/ThrdDemo.dof b/PythonForDelphi/Demos/Demo11/ThrdDemo.dof deleted file mode 100644 index a3bc2aa7..00000000 --- a/PythonForDelphi/Demos/Demo11/ThrdDemo.dof +++ /dev/null @@ -1,93 +0,0 @@ -[FileVersion] -Version=6.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=dxBarD6;dxcomnd6;rtl;dxBarDBNavD6;dbrtl;dxBarExtItemsD6;dxBarExtDBItemsD6;dxsbD6;dxdbtrD6;dxtrmdD6;dxmdsd6;dxInsD6;dxDBEdD6;dxEdtrD6;dxObjInsD6;vcldb;dxorgcD6;dxdborD6;vcl;vclx;fc3000v6;EQTLD6;ECQDBCD6;EQDBTLD6;EQGridD6;dxGrEdD6;dxExELD6;dxELibD6;dxPSCoreD6;dxPsPrVwAdvD6;dxPSLnksD6;dxPSTLLnkD6;dxPSdxDBTLLnkD6;dxPSdxDBCtrlLnkD6;dxPSdxDBGrLnkD6;dxPSdxDBTVLnkD6;dxPSdxInsLnkD6;dxPSdxOCLnkD6;dxPSdxDBOCLnkD6;rbTDBC61;rbRCL66;rbCIDE66;rbIDE66;rbBDE66;rbRIDE66;rbRAP66;rbDBDE66;rbDAD66;rbDIDE66;rbUSER66;rbDB66;rbADO66;adortl;rbDBE66;dbxcds;dbexpress;rbIBE66;ibxpress;dxMasterViewD6;RxCtl6;VclSmp;RxDB6;RxBDE6 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir=D:\Program Files\Borland\Delphi6\Bin\ -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -d:\Program Files\Developer Express Inc\ExpressInspector\Delphi 6\Lib\dcldxExRwD6.bpl=ExpressInspector Extended Rows -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSTeeChartD6.bpl=ExpressPrinting System ReportLink for TeeChart by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSDBTeeChartD6.bpl=ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxMVLnkD6.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxFCLnkD6.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc. diff --git a/PythonForDelphi/Demos/Demo11/ThrdDemo.dproj b/PythonForDelphi/Demos/Demo11/ThrdDemo.dproj index 214459aa..8d6fd12f 100644 --- a/PythonForDelphi/Demos/Demo11/ThrdDemo.dproj +++ b/PythonForDelphi/Demos/Demo11/ThrdDemo.dproj @@ -1,102 +1,208 @@ - - - {FA5D85B3-B6D3-47F9-A4F9-482E5482F142} - ThrdDemo.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - ThrdDemo.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
ThreadSortForm
-
- - - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - ThrdDemo.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {FA5D85B3-B6D3-47F9-A4F9-482E5482F142} + ThrdDemo.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + ThrdDemo.exe + 00400000 + x86 + ThrdDemo + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + ThrdDemo_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + ThrdDemo_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;USE_FASTMM4_LEAK_MONITOR;FullDebugMode;LogMemoryLeakDetailToFile;$(DCC_Define) + + + Debug + + + true + true + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
ThreadSortForm
+
+ + + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + ThrdDemo.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo11/ThrdDemo.res b/PythonForDelphi/Demos/Demo11/ThrdDemo.res index 8d706e28..13c8ea14 100644 Binary files a/PythonForDelphi/Demos/Demo11/ThrdDemo.res and b/PythonForDelphi/Demos/Demo11/ThrdDemo.res differ diff --git a/PythonForDelphi/Demos/Demo11/ThrdDemo_Icon.ico b/PythonForDelphi/Demos/Demo11/ThrdDemo_Icon.ico new file mode 100644 index 00000000..61bf674f Binary files /dev/null and b/PythonForDelphi/Demos/Demo11/ThrdDemo_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo16/Example1/Project1.dof b/PythonForDelphi/Demos/Demo16/Example1/Project1.dof deleted file mode 100644 index a3bc2aa7..00000000 --- a/PythonForDelphi/Demos/Demo16/Example1/Project1.dof +++ /dev/null @@ -1,93 +0,0 @@ -[FileVersion] -Version=6.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=dxBarD6;dxcomnd6;rtl;dxBarDBNavD6;dbrtl;dxBarExtItemsD6;dxBarExtDBItemsD6;dxsbD6;dxdbtrD6;dxtrmdD6;dxmdsd6;dxInsD6;dxDBEdD6;dxEdtrD6;dxObjInsD6;vcldb;dxorgcD6;dxdborD6;vcl;vclx;fc3000v6;EQTLD6;ECQDBCD6;EQDBTLD6;EQGridD6;dxGrEdD6;dxExELD6;dxELibD6;dxPSCoreD6;dxPsPrVwAdvD6;dxPSLnksD6;dxPSTLLnkD6;dxPSdxDBTLLnkD6;dxPSdxDBCtrlLnkD6;dxPSdxDBGrLnkD6;dxPSdxDBTVLnkD6;dxPSdxInsLnkD6;dxPSdxOCLnkD6;dxPSdxDBOCLnkD6;rbTDBC61;rbRCL66;rbCIDE66;rbIDE66;rbBDE66;rbRIDE66;rbRAP66;rbDBDE66;rbDAD66;rbDIDE66;rbUSER66;rbDB66;rbADO66;adortl;rbDBE66;dbxcds;dbexpress;rbIBE66;ibxpress;dxMasterViewD6;RxCtl6;VclSmp;RxDB6;RxBDE6 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir=D:\Program Files\Borland\Delphi6\Bin\ -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -d:\Program Files\Developer Express Inc\ExpressInspector\Delphi 6\Lib\dcldxExRwD6.bpl=ExpressInspector Extended Rows -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSTeeChartD6.bpl=ExpressPrinting System ReportLink for TeeChart by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSDBTeeChartD6.bpl=ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxMVLnkD6.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxFCLnkD6.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc. diff --git a/PythonForDelphi/Demos/Demo16/Example1/Project1.dpr b/PythonForDelphi/Demos/Demo16/Example1/Project1.dpr index 34e6006c..66f3bb8a 100644 --- a/PythonForDelphi/Demos/Demo16/Example1/Project1.dpr +++ b/PythonForDelphi/Demos/Demo16/Example1/Project1.dpr @@ -1,7 +1,5 @@ program Project1; -{$I Definition.Inc} - uses {$IFDEF MSWINDOWS} Forms, diff --git a/PythonForDelphi/Demos/Demo16/Example1/Project1.dproj b/PythonForDelphi/Demos/Demo16/Example1/Project1.dproj index dd79616b..a56f46f7 100644 --- a/PythonForDelphi/Demos/Demo16/Example1/Project1.dproj +++ b/PythonForDelphi/Demos/Demo16/Example1/Project1.dproj @@ -1,101 +1,209 @@ - - - {FEB76A6C-3FF0-423D-AA7F-BA28CE5A6B63} - Project1.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - Project1.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {FEB76A6C-3FF0-423D-AA7F-BA28CE5A6B63} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Project1.exe + 00400000 + x86 + Project1 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + ..\..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + .\$(Platform)\$(Config) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo16/Example1/Project1.res b/PythonForDelphi/Demos/Demo16/Example1/Project1.res index d1f138df..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo16/Example1/Project1.res and b/PythonForDelphi/Demos/Demo16/Example1/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo16/Example1/Project1_Icon.ico b/PythonForDelphi/Demos/Demo16/Example1/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo16/Example1/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo16/Example1/Unit1.dfm b/PythonForDelphi/Demos/Demo16/Example1/Unit1.dfm index 04f92eda..a46de688 100644 Binary files a/PythonForDelphi/Demos/Demo16/Example1/Unit1.dfm and b/PythonForDelphi/Demos/Demo16/Example1/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo16/Example1/Unit1.pas b/PythonForDelphi/Demos/Demo16/Example1/Unit1.pas index 16ae03b3..c1fd0aa9 100644 --- a/PythonForDelphi/Demos/Demo16/Example1/Unit1.pas +++ b/PythonForDelphi/Demos/Demo16/Example1/Unit1.pas @@ -1,7 +1,5 @@ unit Unit1; -{$I Definition.Inc} - interface uses diff --git a/PythonForDelphi/Demos/Demo16/Example2/Project1.dproj b/PythonForDelphi/Demos/Demo16/Example2/Project1.dproj index 421fe16d..48575243 100644 --- a/PythonForDelphi/Demos/Demo16/Example2/Project1.dproj +++ b/PythonForDelphi/Demos/Demo16/Example2/Project1.dproj @@ -1,101 +1,207 @@ - - - {3B870EA7-EAEB-434F-8C0D-2800B09DC00C} - Project1.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - Project1.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {3B870EA7-EAEB-434F-8C0D-2800B09DC00C} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Project1.exe + 00400000 + x86 + Project1 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo16/Example2/Project1.res b/PythonForDelphi/Demos/Demo16/Example2/Project1.res index d1f138df..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo16/Example2/Project1.res and b/PythonForDelphi/Demos/Demo16/Example2/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo16/Example2/Project1_Icon.ico b/PythonForDelphi/Demos/Demo16/Example2/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo16/Example2/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo16/Example2/Unit1.dfm b/PythonForDelphi/Demos/Demo16/Example2/Unit1.dfm index 76671a7d..9b4edb33 100644 Binary files a/PythonForDelphi/Demos/Demo16/Example2/Unit1.dfm and b/PythonForDelphi/Demos/Demo16/Example2/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/Demo17/Project1.dof b/PythonForDelphi/Demos/Demo17/Project1.dof deleted file mode 100644 index a3bc2aa7..00000000 --- a/PythonForDelphi/Demos/Demo17/Project1.dof +++ /dev/null @@ -1,93 +0,0 @@ -[FileVersion] -Version=6.0 -[Compiler] -A=8 -B=0 -C=1 -D=1 -E=0 -F=0 -G=1 -H=1 -I=1 -J=0 -K=0 -L=1 -M=0 -N=1 -O=1 -P=1 -Q=0 -R=0 -S=0 -T=0 -U=0 -V=1 -W=0 -X=1 -Y=1 -Z=1 -ShowHints=1 -ShowWarnings=1 -UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; -[Linker] -MapFile=0 -OutputObjs=0 -ConsoleApp=1 -DebugInfo=0 -RemoteSymbols=0 -MinStackSize=16384 -MaxStackSize=1048576 -ImageBase=4194304 -ExeDescription= -[Directories] -OutputDir= -UnitOutputDir= -PackageDLLOutputDir= -PackageDCPOutputDir= -SearchPath= -Packages=dxBarD6;dxcomnd6;rtl;dxBarDBNavD6;dbrtl;dxBarExtItemsD6;dxBarExtDBItemsD6;dxsbD6;dxdbtrD6;dxtrmdD6;dxmdsd6;dxInsD6;dxDBEdD6;dxEdtrD6;dxObjInsD6;vcldb;dxorgcD6;dxdborD6;vcl;vclx;fc3000v6;EQTLD6;ECQDBCD6;EQDBTLD6;EQGridD6;dxGrEdD6;dxExELD6;dxELibD6;dxPSCoreD6;dxPsPrVwAdvD6;dxPSLnksD6;dxPSTLLnkD6;dxPSdxDBTLLnkD6;dxPSdxDBCtrlLnkD6;dxPSdxDBGrLnkD6;dxPSdxDBTVLnkD6;dxPSdxInsLnkD6;dxPSdxOCLnkD6;dxPSdxDBOCLnkD6;rbTDBC61;rbRCL66;rbCIDE66;rbIDE66;rbBDE66;rbRIDE66;rbRAP66;rbDBDE66;rbDAD66;rbDIDE66;rbUSER66;rbDB66;rbADO66;adortl;rbDBE66;dbxcds;dbexpress;rbIBE66;ibxpress;dxMasterViewD6;RxCtl6;VclSmp;RxDB6;RxBDE6 -Conditionals= -DebugSourceDirs= -UsePackages=0 -[Parameters] -RunParams= -HostApplication= -Launcher= -UseLauncher=0 -DebugCWD= -[Language] -ActiveLang= -ProjectLang= -RootDir=D:\Program Files\Borland\Delphi6\Bin\ -[Version Info] -IncludeVerInfo=0 -AutoIncBuild=0 -MajorVer=1 -MinorVer=0 -Release=0 -Build=0 -Debug=0 -PreRelease=0 -Special=0 -Private=0 -DLL=0 -Locale=1033 -CodePage=1252 -[Version Info Keys] -CompanyName= -FileDescription= -FileVersion=1.0.0.0 -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion=1.0.0.0 -Comments= -[Excluded Packages] -d:\Program Files\Developer Express Inc\ExpressInspector\Delphi 6\Lib\dcldxExRwD6.bpl=ExpressInspector Extended Rows -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSTeeChartD6.bpl=ExpressPrinting System ReportLink for TeeChart by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSDBTeeChartD6.bpl=ExpressPrinting System ReportLink for DBTeeChart by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxMVLnkD6.bpl=ExpressPrinting System ReportLink for ExpressMasterView by Developer Express Inc. -d:\Program Files\Developer Express Inc\ExpressPrinting System\Delphi 6\Lib\dxPSdxFCLnkD6.bpl=ExpressPrinting System ReportLinks for ExpressFlowChart by Developer Express Inc. diff --git a/PythonForDelphi/Demos/Demo17/Project1.dproj b/PythonForDelphi/Demos/Demo17/Project1.dproj index 588f2d7b..0297371a 100644 --- a/PythonForDelphi/Demos/Demo17/Project1.dproj +++ b/PythonForDelphi/Demos/Demo17/Project1.dproj @@ -1,101 +1,207 @@ - - - {45B70068-605E-4FFB-B78E-2045071FD5FA} - Project1.dpr - Debug - DCC32 - 12.0 - - - true - - - true - Base - true - - - true - Base - true - - - WinTypes=Windows;WinProcs=Windows;$(DCC_UnitAlias) - Project1.exe - 00400000 - x86 - - - false - RELEASE;$(DCC_Define) - 0 - false - - - DEBUG;$(DCC_Define) - - - - MainSource - - -
Form1
-
- - Base - - - Cfg_2 - Base - - - Cfg_1 - Base - -
- - - Delphi.Personality.12 - VCLApplication - - - - Project1.dpr - - - False - True - False - - - False - False - 1 - 0 - 0 - 0 - False - False - False - False - False - 1033 - 1252 - - - - - 1.0.0.0 - - - - - - 1.0.0.0 - - - - - 12 - -
+ + + {45B70068-605E-4FFB-B78E-2045071FD5FA} + Project1.dpr + Debug + DCC32 + 18.3 + VCL + True + Win64 + 2 + Application + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + Project1.exe + 00400000 + x86 + Project1 + Vcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Data;Datasnap;Web;Soap;Winapi;$(DCC_Namespace) + 1033 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments= + .\$(Platform)\$(Config) + ..\..\Components\Sources\Core;$(DCC_UnitSearchPath) + + + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + $(BDS)\bin\default_app.manifest + Project1_Icon.ico + true + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + + + Project1_Icon.ico + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png + $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png + System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + $(BDS)\bin\default_app.manifest + + + false + RELEASE;$(DCC_Define) + 0 + 0 + + + true + true + + + true + true + + + DEBUG;$(DCC_Define) + + + Debug + + + true + true + + + true + true + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments= + + + + MainSource + + +
Form1
+
+ + Cfg_2 + Base + + + Base + + + Cfg_1 + Base + +
+ + + Delphi.Personality.12 + VCLApplication + + + + Project1.dpr + + + False + True + False + + + False + False + 1 + 0 + 0 + 0 + False + False + False + False + False + 1033 + 1252 + + + + + 1.0.0.0 + + + + + + 1.0.0.0 + + + + Embarcadero Bibliothekskomponenten (Entwurf) + Microsoft Office 2000 Beispiele für gekapselte Komponenten für Automatisierungsserver + Microsoft Office XP Beispiele für gekapselte Komponenten für Automation Server + Security Manager for Microsoft Outlook, VCL Edition (Delphi 10.2 Tokyo) + + + + False + False + False + True + + + 12 + + +
diff --git a/PythonForDelphi/Demos/Demo17/Project1.res b/PythonForDelphi/Demos/Demo17/Project1.res index cfdbb79b..9c86860d 100644 Binary files a/PythonForDelphi/Demos/Demo17/Project1.res and b/PythonForDelphi/Demos/Demo17/Project1.res differ diff --git a/PythonForDelphi/Demos/Demo17/Project1_Icon.ico b/PythonForDelphi/Demos/Demo17/Project1_Icon.ico new file mode 100644 index 00000000..9d0e1f36 Binary files /dev/null and b/PythonForDelphi/Demos/Demo17/Project1_Icon.ico differ diff --git a/PythonForDelphi/Demos/Demo17/Unit1.dfm b/PythonForDelphi/Demos/Demo17/Unit1.dfm index 7426472f..63b5c258 100644 Binary files a/PythonForDelphi/Demos/Demo17/Unit1.dfm and b/PythonForDelphi/Demos/Demo17/Unit1.dfm differ diff --git a/PythonForDelphi/Demos/readme.txt b/PythonForDelphi/Demos/readme.txt index 8f7c3681..69cb47c5 100644 --- a/PythonForDelphi/Demos/readme.txt +++ b/PythonForDelphi/Demos/readme.txt @@ -7,12 +7,13 @@ Demo06 Defining a new Type Demo07 Using Delphi methods as Python functions Demo08 Using Delphi classes for new Python types Demo09 Making a Python module as a Dll -Demo10 Mapping Delphi VCL components inside Python +Demo10 Mapping Delphi VCL components inside Python using TPythonDatabase (BDE - not changed) +Demo10_FireDAC Database demo using FireDAC Demo11 Using Threads inside Python -Demo12 Using PythonAtom. (Deprecated since Delphi 6, See VarPyth instead) -Demo13 Using TPythonDatabase. -Demo14 Making a Dll with TPythonDatabase -Demo15 Using a TDataset descendant with Python, except TTable and TQuery. +Demo12 Using PythonAtom. -> Deprecated since Delphi 6, See VarPyth instead +Demo13 Using TPythonDatabase. (BDE - not changed) +Demo14 Making a Dll with TPythonDatabase (BDE - not changed) +Demo15 Using a TDataset descendant with Python, except TTable and TQuery. (BDE - not changed) Demo16 Using a TDelphiVar or Module methods ? (Kylix ready) Demo17 Using variant arrays of 2 dimensions (Kylix ready) Demo18 C++ Builder: using the Python Dll in a console application @@ -30,3 +31,4 @@ Demo29 Using Python Imaging Library (PAL) Demo30 Using Named Parameters (Kylix ready) Demo31 Using WrapDelphi to access Delphi Form attributes (Requires Delphi5 or later) Demo32 Demo08 revisited using WrapDelphi (Requires Delphi7 or later) +Demo33 Using Threads inside Python diff --git a/README.md b/README.md index c2cb10eb..a12f51cc 100644 --- a/README.md +++ b/README.md @@ -6,3 +6,7 @@ Python for Delphi (P4D) is a set of free components that wrap up the Python dll * **Wrapping of Delphi objects for use in python scripts using RTTI (WrapDelphi.pas)** P4D makes it very easy to use python as a scripting language for Delphi applications. It comes with an extensive range of demos and tutorials. + +This forked-version includes customizations to Python 3.x, 64bit and FireDAC. +The GetIt-package "SynEdit" is required. +All changed demos have been compiled and tested to 64-bit-Windows. diff --git a/clean.bat b/clean.bat new file mode 100644 index 00000000..731f4e52 --- /dev/null +++ b/clean.bat @@ -0,0 +1,145 @@ +rd /s /q PythonForDelphi\Components\__history +rd /s /q PythonForDelphi\Components\bpl +rd /s /q PythonForDelphi\Components\dcp +rd /s /q PythonForDelphi\Components\dcu + +rd /s /q PythonForDelphi\Components\Sources\Core\__history +rd /s /q PythonForDelphi\Components\Sources\Core\__recovery + +rd /s /q PythonForDelphi\Components\Sources\FireDAC\__history +rd /s /q PythonForDelphi\Components\Sources\FireDAC\__recovery + +rd /s /q PythonForDelphi\Demos\Demo01\__history +rd /s /q PythonForDelphi\Demos\Demo01\__recovery +rd /s /q PythonForDelphi\Demos\Demo01\Win64 +del /q PythonForDelphi\Demos\Demo01\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo01\Project1.identcache +del /q PythonForDelphi\Demos\Demo01\Project1.stat +del /q PythonForDelphi\Demos\Demo01\Project1.exe +del /q PythonForDelphi\Demos\Demo01\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo02\__history +rd /s /q PythonForDelphi\Demos\Demo02\__recovery +rd /s /q PythonForDelphi\Demos\Demo02\Win64 +del /q PythonForDelphi\Demos\Demo02\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo02\Project1.identcache +del /q PythonForDelphi\Demos\Demo02\Project1.stat +del /q PythonForDelphi\Demos\Demo02\Project1.exe +del /q PythonForDelphi\Demos\Demo02\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo03\__history +rd /s /q PythonForDelphi\Demos\Demo03\__recovery +rd /s /q PythonForDelphi\Demos\Demo03\Win64 +del /q PythonForDelphi\Demos\Demo03\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo03\Project1.identcache +del /q PythonForDelphi\Demos\Demo03\Project1.stat +del /q PythonForDelphi\Demos\Demo03\Project1.exe +del /q PythonForDelphi\Demos\Demo03\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo04\__history +rd /s /q PythonForDelphi\Demos\Demo04\__recovery +rd /s /q PythonForDelphi\Demos\Demo04\Win64 +del /q PythonForDelphi\Demos\Demo04\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo04\Project1.identcache +del /q PythonForDelphi\Demos\Demo04\Project1.stat +del /q PythonForDelphi\Demos\Demo04\Project1.exe +del /q PythonForDelphi\Demos\Demo04\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo05\__history +rd /s /q PythonForDelphi\Demos\Demo05\__recovery +rd /s /q PythonForDelphi\Demos\Demo05\Win64 +del /q PythonForDelphi\Demos\Demo05\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo05\Project1.identcache +del /q PythonForDelphi\Demos\Demo05\Project1.stat +del /q PythonForDelphi\Demos\Demo05\Project1.exe +del /q PythonForDelphi\Demos\Demo05\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo06\__history +rd /s /q PythonForDelphi\Demos\Demo06\__recovery +rd /s /q PythonForDelphi\Demos\Demo06\Win64 +del /q PythonForDelphi\Demos\Demo06\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo06\Project1.identcache +del /q PythonForDelphi\Demos\Demo06\Project1.stat +del /q PythonForDelphi\Demos\Demo06\Project1.exe +del /q PythonForDelphi\Demos\Demo06\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo07\__history +rd /s /q PythonForDelphi\Demos\Demo07\__recovery +rd /s /q PythonForDelphi\Demos\Demo07\Win64 +del /q PythonForDelphi\Demos\Demo07\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo07\Project1.identcache +del /q PythonForDelphi\Demos\Demo07\Project1.stat +del /q PythonForDelphi\Demos\Demo07\Project1.exe +del /q PythonForDelphi\Demos\Demo07\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo08\__history +rd /s /q PythonForDelphi\Demos\Demo08\__recovery +rd /s /q PythonForDelphi\Demos\Demo08\Win64 +del /q PythonForDelphi\Demos\Demo08\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo08\Project1.identcache +del /q PythonForDelphi\Demos\Demo08\Project1.stat +del /q PythonForDelphi\Demos\Demo08\Project1.exe +del /q PythonForDelphi\Demos\Demo08\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo09\__history +rd /s /q PythonForDelphi\Demos\Demo09\__recovery +rd /s /q PythonForDelphi\Demos\Demo09\Win64 +del /q PythonForDelphi\Demos\Demo09\ProjectGroup1.groupproj.local +del /q PythonForDelphi\Demos\Demo09\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo09\Project1.identcache +del /q PythonForDelphi\Demos\Demo09\Project1.stat +del /q PythonForDelphi\Demos\Demo09\Project1.exe +del /q PythonForDelphi\Demos\Demo09\Project1.rsm +del /q PythonForDelphi\Demos\Demo09\demodll.dproj.local +del /q PythonForDelphi\Demos\Demo09\demodll.identcache +del /q PythonForDelphi\Demos\Demo09\demodll.stat +del /q PythonForDelphi\Demos\Demo09\demodll.pyd +del /q PythonForDelphi\Demos\Demo09\demodll.rsm + +rd /s /q PythonForDelphi\Demos\Demo10_FireDAC\__history +rd /s /q PythonForDelphi\Demos\Demo10_FireDAC\__recovery +rd /s /q PythonForDelphi\Demos\Demo10_FireDAC\Win64 +del /q PythonForDelphi\Demos\Demo10_FireDAC\Demo10.dproj.local +del /q PythonForDelphi\Demos\Demo10_FireDAC\Demo10.identcache +del /q PythonForDelphi\Demos\Demo10_FireDAC\Demo10.stat +del /q PythonForDelphi\Demos\Demo10_FireDAC\Demo10.exe +del /q PythonForDelphi\Demos\Demo10_FireDAC\Demo10.rsm +del /q PythonForDelphi\Demos\Demo10_FireDAC\Demo10_MemoryManager_EventLog.txt + +rd /s /q PythonForDelphi\Demos\Demo11\__history +rd /s /q PythonForDelphi\Demos\Demo11\__recovery +rd /s /q PythonForDelphi\Demos\Demo11\Win64 +del /q PythonForDelphi\Demos\Demo11\ThrdDemo.dproj.local +del /q PythonForDelphi\Demos\Demo11\ThrdDemo.identcache +del /q PythonForDelphi\Demos\Demo11\ThrdDemo.stat +del /q PythonForDelphi\Demos\Demo11\ThrdDemo.exe +del /q PythonForDelphi\Demos\Demo11\ThrdDemo.rsm + +rd /s /q PythonForDelphi\Demos\Demo16\Example1\__history +rd /s /q PythonForDelphi\Demos\Demo16\Example1\__recovery +rd /s /q PythonForDelphi\Demos\Demo16\Example1\Win64 +del /q PythonForDelphi\Demos\Demo16\Example1\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo16\Example1\Project1.identcache +del /q PythonForDelphi\Demos\Demo16\Example1\Project1.stat +del /q PythonForDelphi\Demos\Demo16\Example1\Project1.exe +del /q PythonForDelphi\Demos\Demo16\Example1\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo16\Example2\__history +rd /s /q PythonForDelphi\Demos\Demo16\Example2\__recovery +rd /s /q PythonForDelphi\Demos\Demo16\Example2\Win64 +del /q PythonForDelphi\Demos\Demo16\Example2\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo16\Example2\Project1.identcache +del /q PythonForDelphi\Demos\Demo16\Example2\Project1.stat +del /q PythonForDelphi\Demos\Demo16\Example2\Project1.exe +del /q PythonForDelphi\Demos\Demo16\Example2\Project1.rsm + +rd /s /q PythonForDelphi\Demos\Demo17\__history +rd /s /q PythonForDelphi\Demos\Demo17\__recovery +rd /s /q PythonForDelphi\Demos\Demo17\Win64 +del /q PythonForDelphi\Demos\Demo17\Project1.dproj.local +del /q PythonForDelphi\Demos\Demo17\Project1.identcache +del /q PythonForDelphi\Demos\Demo17\Project1.stat +del /q PythonForDelphi\Demos\Demo17\Project1.exe +del /q PythonForDelphi\Demos\Demo17\Project1.rsm + +Pause \ No newline at end of file pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy