forked from maxkleiner/python4delphi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuPSI_PythonEngine.pas
More file actions
6403 lines (5361 loc) · 359 KB
/
uPSI_PythonEngine.pas
File metadata and controls
6403 lines (5361 loc) · 359 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
unit uPSI_PythonEngine;
{
This file has been generated by UnitParser v0.7, written by M. Knight
and updated by NP. v/d Spek and George Birbilis.
Source Code from Carlo Kok has been used to implement various sections of
UnitParser. Components of ROPS are used in the construction of UnitParser,
code implementing the class wrapper is taken from Carlo Kok's conv utility
}
interface
uses
SysUtils
,Classes
,uPSComponent
,uPSRuntime
,uPSCompiler
;
type
(*----------------------------------------------------------------------------*)
TPSImport_PythonEngine = class(TPSPlugin)
public
procedure CompileImport1(CompExec: TPSScript); override;
procedure ExecImport1(CompExec: TPSScript; const ri: TPSRuntimeClassImporter); override;
end;
{ compile-time registration functions }
procedure SIRegister_TPythonThread(CL: TPSPascalCompiler);
procedure SIRegister_TPyVar(CL: TPSPascalCompiler);
procedure SIRegister_TPythonDelphiVar(CL: TPSPascalCompiler);
procedure SIRegister_TPythonType(CL: TPSPascalCompiler);
procedure SIRegister_TTypeServices(CL: TPSPascalCompiler);
procedure SIRegister_TPyObject(CL: TPSPascalCompiler);
procedure SIRegister_TPythonModule(CL: TPSPascalCompiler);
procedure SIRegister_TErrors(CL: TPSPascalCompiler);
procedure SIRegister_TError(CL: TPSPascalCompiler);
procedure SIRegister_TParentClassError(CL: TPSPascalCompiler);
procedure SIRegister_TGetSetContainer(CL: TPSPascalCompiler);
procedure SIRegister_TMembersContainer(CL: TPSPascalCompiler);
procedure SIRegister_TMethodsContainer(CL: TPSPascalCompiler);
procedure SIRegister_TEventDefs(CL: TPSPascalCompiler);
procedure SIRegister_TEventDef(CL: TPSPascalCompiler);
procedure SIRegister_TEngineClient(CL: TPSPascalCompiler);
procedure SIRegister_TPythonEngine(CL: TPSPascalCompiler);
procedure SIRegister_TPythonTraceback(CL: TPSPascalCompiler);
procedure SIRegister_TTracebackItem(CL: TPSPascalCompiler);
procedure SIRegister_TPythonInterface(CL: TPSPascalCompiler);
procedure SIRegister_TDynamicDll(CL: TPSPascalCompiler);
procedure SIRegister_TPythonInputOutput(CL: TPSPascalCompiler);
procedure SIRegister_EPySyntaxError(CL: TPSPascalCompiler);
procedure SIRegister_EPythonError(CL: TPSPascalCompiler);
procedure SIRegister_EDLLImportError(CL: TPSPascalCompiler);
procedure SIRegister_PythonEngine(CL: TPSPascalCompiler);
{ run-time registration functions }
procedure RIRegister_PythonEngine_Routines(S: TPSExec);
procedure RIRegister_TPythonThread(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPyVar(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPythonDelphiVar(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPythonType(CL: TPSRuntimeClassImporter);
procedure RIRegister_TTypeServices(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPyObject(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPythonModule(CL: TPSRuntimeClassImporter);
procedure RIRegister_TErrors(CL: TPSRuntimeClassImporter);
procedure RIRegister_TError(CL: TPSRuntimeClassImporter);
procedure RIRegister_TParentClassError(CL: TPSRuntimeClassImporter);
procedure RIRegister_TGetSetContainer(CL: TPSRuntimeClassImporter);
procedure RIRegister_TMembersContainer(CL: TPSRuntimeClassImporter);
procedure RIRegister_TMethodsContainer(CL: TPSRuntimeClassImporter);
procedure RIRegister_TEventDefs(CL: TPSRuntimeClassImporter);
procedure RIRegister_TEventDef(CL: TPSRuntimeClassImporter);
procedure RIRegister_TEngineClient(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPythonEngine(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPythonTraceback(CL: TPSRuntimeClassImporter);
procedure RIRegister_TTracebackItem(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPythonInterface(CL: TPSRuntimeClassImporter);
procedure RIRegister_TDynamicDll(CL: TPSRuntimeClassImporter);
procedure RIRegister_TPythonInputOutput(CL: TPSRuntimeClassImporter);
procedure RIRegister_EPySyntaxError(CL: TPSRuntimeClassImporter);
procedure RIRegister_EPythonError(CL: TPSRuntimeClassImporter);
procedure RIRegister_EDLLImportError(CL: TPSRuntimeClassImporter);
procedure RIRegister_PythonEngine(CL: TPSRuntimeClassImporter);
procedure Register;
implementation
uses
Types
,Windows
,Dl
,DynLibs
,SyncObjs
,Variants
,MethodCallBack
,PythonEngine
;
procedure Register;
begin
RegisterComponents('Pascal Script', [TPSImport_PythonEngine]);
end;
(* === compile-time registration functions === *)
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPythonThread(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TThread', 'TPythonThread') do
with CL.AddClassN(CL.FindClass('TThread'),'TPythonThread') do
begin
RegisterMethod('Procedure Py_Begin_Allow_Threads');
RegisterMethod('Procedure Py_End_Allow_Threads');
RegisterMethod('Procedure Py_Begin_Block_Threads');
RegisterMethod('Procedure Py_Begin_Unblock_Threads');
RegisterProperty('ThreadState', 'PPyThreadState', iptr);
RegisterProperty('ThreadExecMode', 'TThreadExecMode', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPyVar(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TPyObject', 'TPyVar') do
with CL.AddClassN(CL.FindClass('TPyObject'),'TPyVar') do
begin
RegisterProperty('dv_var', 'Variant', iptrw);
RegisterProperty('dv_component', 'TPythonDelphiVar', iptrw);
RegisterProperty('dv_object', 'PPyObject', iptrw);
RegisterMethod('Function GetValue : PPyObject');
RegisterMethod('Function GetValueAsVariant : Variant');
RegisterMethod('Procedure SetValue( value : PPyObject)');
RegisterMethod('Procedure SetValueFromVariant( const value : Variant)');
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPythonDelphiVar(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TEngineClient', 'TPythonDelphiVar') do
with CL.AddClassN(CL.FindClass('TEngineClient'),'TPythonDelphiVar') do
begin
RegisterMethod('Function IsVariantOk( const v : Variant) : Boolean');
RegisterProperty('Value', 'Variant', iptrw);
RegisterProperty('ValueObject', 'PPyObject', iptrw);
RegisterProperty('ValueAsString', 'string', iptr);
RegisterProperty('VarObject', 'PPyObject', iptrw);
RegisterProperty('Module', 'AnsiString', iptrw);
RegisterProperty('VarName', 'AnsiString', iptrw);
RegisterProperty('OnGetData', 'TGetDataEvent', iptrw);
RegisterProperty('OnSetData', 'TSetDataEvent', iptrw);
RegisterProperty('OnExtGetData', 'TExtGetDataEvent', iptrw);
RegisterProperty('OnExtSetData', 'TExtSetDataEvent', iptrw);
RegisterProperty('OnChange', 'TNotifyEvent', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPythonType(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TGetSetContainer', 'TPythonType') do
with CL.AddClassN(CL.FindClass('TGetSetContainer'),'TPythonType') do
begin
RegisterMethod('Function CreateInstance : PPyObject');
RegisterMethod('Function CreateInstanceWith( args : PPyObject) : PPyObject');
RegisterMethod('Procedure AddTypeVar');
RegisterProperty('TheType', 'PyTypeObject', iptrw);
RegisterProperty('TheTypePtr', 'PPyTypeObject', iptr);
RegisterProperty('PyObjectClass', 'TPyObjectClass', iptrw);
RegisterProperty('InstanceCount', 'Integer', iptr);
RegisterProperty('CreateHits', 'Integer', iptr);
RegisterProperty('DeleteHits', 'Integer', iptr);
RegisterProperty('DocString', 'TStringList', iptrw);
RegisterProperty('TypeName', 'AnsiString', iptrw);
RegisterProperty('TypeFlags', 'TPFlags', iptrw);
RegisterProperty('Prefix', 'AnsiString', iptrw);
RegisterProperty('Module', 'TPythonModule', iptrw);
RegisterProperty('Services', 'TTypeServices', iptrw);
RegisterProperty('GenerateCreateFunction', 'Boolean', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TTypeServices(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TPersistent', 'TTypeServices') do
with CL.AddClassN(CL.FindClass('TPersistent'),'TTypeServices') do
begin
RegisterMethod('Constructor Create');
RegisterProperty('Basic', 'TBasicServices', iptrw);
RegisterProperty('InplaceNumber', 'TInplaceNumberServices', iptrw);
RegisterProperty('Number', 'TNumberServices', iptrw);
RegisterProperty('Sequence', 'TSequenceServices', iptrw);
RegisterProperty('Mapping', 'TMappingServices', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPyObject(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TOBJECT', 'TPyObject') do
with CL.AddClassN(CL.FindClass('TOBJECT'),'TPyObject') do
begin
RegisterProperty('PythonType', 'TPythonType', iptrw);
RegisterProperty('IsSubtype', 'Boolean', iptrw);
RegisterProperty('PythonAlloc', 'Boolean', iptrw);
RegisterMethod('Constructor Create( APythonType : TPythonType)');
RegisterMethod('Constructor CreateWith( APythonType : TPythonType; args : PPyObject)');
RegisterMethod('Function GetSelf : PPyObject');
RegisterMethod('Procedure IncRef');
RegisterMethod('Procedure Adjust( PyPointer : Pointer)');
RegisterMethod('Function GetModule : TPythonModule');
RegisterProperty('ob_refcnt', 'NativeInt', iptrw);
RegisterProperty('ob_type', 'PPyTypeObject', iptrw);
RegisterMethod('Function Print( var f : file; i : integer) : Integer');
RegisterMethod('Function GetAttr( key : PAnsiChar) : PPyObject');
RegisterMethod('Function SetAttr( key : PAnsiChar; value : PPyObject) : Integer');
RegisterMethod('Function Repr : PPyObject');
RegisterMethod('Function Compare( obj : PPyObject) : Integer');
RegisterMethod('Function Hash : NativeInt');
RegisterMethod('Function Str : PPyObject');
RegisterMethod('Function GetAttrO( key : PPyObject) : PPyObject');
RegisterMethod('Function SetAttrO( key, value : PPyObject) : Integer');
RegisterMethod('Function Call( ob1, ob2 : PPyObject) : PPyObject');
RegisterMethod('Function Traverse( proc : visitproc; ptr : Pointer) : integer');
RegisterMethod('Function Clear : integer');
RegisterMethod('Function RichCompare( obj : PPyObject; Op : TRichComparisonOpcode) : PPyObject');
RegisterMethod('Function Iter : PPyObject');
RegisterMethod('Function IterNext : PPyObject');
RegisterMethod('Function Init( args, kwds : PPyObject) : Integer');
RegisterMethod('Function NbAdd( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbSubtract( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbMultiply( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbFloorDivide( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbTrueDivide( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbMatrixMultiply( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbRemainder( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbDivmod( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbPower( ob1, ob2 : PPyObject) : PPyObject');
RegisterMethod('Function NbNegative : PPyObject');
RegisterMethod('Function NbPositive : PPyObject');
RegisterMethod('Function NbAbsolute : PPyObject');
RegisterMethod('Function NbBool : Integer');
RegisterMethod('Function NbInvert : PPyObject');
RegisterMethod('Function NbLShift( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbRShift( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbAnd( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbXor( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbOr( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInt : PPyObject');
RegisterMethod('Function NbFloat : PPyObject');
RegisterMethod('Function NbInplaceAdd( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceSubtract( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceMultiply( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceDivide( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceFloorDivide( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceTrueDivide( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceRemainder( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplacePower( ob1, ob2 : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceLshift( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceRshift( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceAnd( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceXor( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceOr( obj : PPyObject) : PPyObject');
RegisterMethod('Function NbInplaceMatrixMultiply( obj : PPyObject) : PPyObject');
RegisterMethod('Function SqLength : NativeInt');
RegisterMethod('Function SqConcat( obj : PPyObject) : PPyObject');
RegisterMethod('Function SqRepeat( val : NativeInt) : PPyObject');
RegisterMethod('Function SqItem( idx : NativeInt) : PPyObject');
RegisterMethod('Function SqAssItem( idx : NativeInt; obj : PPyObject) : Integer');
RegisterMethod('Function SqContains( obj : PPyObject) : integer');
RegisterMethod('Function SqInplaceConcat( obj : PPyObject) : PPyObject');
RegisterMethod('Function SqInplaceRepeat( i : NativeInt) : PPyObject');
RegisterMethod('Function MpLength : NativeInt');
RegisterMethod('Function MpSubscript( obj : PPyObject) : PPyObject');
RegisterMethod('Function MpAssSubscript( obj1, obj2 : PPyObject) : Integer');
RegisterMethod('Procedure RegisterMethods( APythonType : TPythonType)');
RegisterMethod('Procedure RegisterMembers( APythonType : TPythonType)');
RegisterMethod('Procedure RegisterGetSets( APythonType : TPythonType)');
RegisterMethod('Procedure SetupType( APythonType : TPythonType)');
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPythonModule(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TMethodsContainer', 'TPythonModule') do
with CL.AddClassN(CL.FindClass('TMethodsContainer'),'TPythonModule') do
begin
RegisterMethod('Constructor Create( AOwner : TComponent)');
RegisterMethod('Procedure MakeModule');
RegisterMethod('Procedure DefineDocString');
RegisterMethod('Procedure Initialize');
RegisterMethod('Procedure InitializeForNewInterpreter');
RegisterMethod('Procedure AddClient( client : TEngineClient)');
RegisterMethod('Function ErrorByName( const AName : AnsiString) : TError');
RegisterMethod('Procedure RaiseError( const error, msg : AnsiString)');
RegisterMethod('Procedure RaiseErrorFmt( const error, format : AnsiString; const Args : array of const)');
RegisterMethod('Procedure RaiseErrorObj( const error, msg : AnsiString; obj : PPyObject)');
RegisterMethod('Procedure BuildErrors');
RegisterMethod('Procedure SetVar( const varName : AnsiString; value : PPyObject)');
RegisterMethod('Function GetVar( const varName : AnsiString) : PPyObject');
RegisterMethod('Procedure DeleteVar( const varName : AnsiString)');
RegisterMethod('Procedure ClearVars');
RegisterMethod('Procedure SetVarFromVariant( const varName : AnsiString; const value : Variant)');
RegisterMethod('Function GetVarAsVariant( const varName : AnsiString) : Variant');
RegisterProperty('Module', 'PPyObject', iptr);
RegisterProperty('Clients', 'TEngineClient Integer', iptr);
RegisterProperty('ClientCount', 'Integer', iptr);
RegisterProperty('DocString', 'TStringList', iptrw);
RegisterProperty('ModuleName', 'AnsiString', iptrw);
RegisterProperty('Errors', 'TErrors', iptrw);
RegisterProperty('OnAfterInitialization', 'TNotifyEvent', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TErrors(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCollection', 'TErrors') do
with CL.AddClassN(CL.FindClass('TCollection'),'TErrors') do
begin
RegisterMethod('Constructor Create( Module : TPythonModule)');
RegisterMethod('Function Add : TError');
RegisterMethod('Function Owner : TPythonModule');
RegisterProperty('Items', 'TError Integer', iptrw);
SetDefaultPropery('Items');
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TError(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCollectionItem', 'TError') do
with CL.AddClassN(CL.FindClass('TCollectionItem'),'TError') do
begin
RegisterMethod('Constructor Create( ACollection : TCollection)');
RegisterMethod('Procedure Assign( Source : TPersistent)');
RegisterMethod('Procedure BuildError( const ModuleName : AnsiString)');
RegisterMethod('Procedure RaiseError( const msg : AnsiString)');
RegisterMethod('Procedure RaiseErrorObj( const msg : AnsiString; obj : PPyObject)');
RegisterMethod('Function Owner : TErrors');
RegisterProperty('Error', 'PPyObject', iptrw);
RegisterProperty('Name', 'AnsiString', iptrw);
RegisterProperty('Text', 'AnsiString', iptrw);
RegisterProperty('ErrorType', 'TErrorType', iptrw);
RegisterProperty('ParentClass', 'TParentClassError', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TParentClassError(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TPersistent', 'TParentClassError') do
with CL.AddClassN(CL.FindClass('TPersistent'),'TParentClassError') do
begin
RegisterMethod('Procedure AssignTo( Dest : TPersistent)');
RegisterProperty('Module', 'AnsiString', iptrw);
RegisterProperty('Name', 'AnsiString', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TGetSetContainer(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TMembersContainer', 'TGetSetContainer') do
with CL.AddClassN(CL.FindClass('TMembersContainer'),'TGetSetContainer') do
begin
RegisterMethod('Constructor Create( AOwner : TComponent)');
RegisterMethod('Procedure AddGetSet( AName : PAnsiChar; AGet : getter; ASet : setter; ADoc : PAnsiChar; AClosure : Pointer)');
RegisterMethod('Procedure ClearGetSets');
RegisterProperty('GetSetCount', 'Integer', iptr);
RegisterProperty('GetSet', 'PPyGetSetDef Integer', iptr);
RegisterProperty('GetSetData', 'PPyGetSetDef', iptr);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TMembersContainer(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TMethodsContainer', 'TMembersContainer') do
with CL.AddClassN(CL.FindClass('TMethodsContainer'),'TMembersContainer') do
begin
RegisterMethod('Constructor Create( AOwner : TComponent)');
RegisterMethod('Procedure AddMember( MemberName : PAnsiChar; MemberType : TPyMemberType; MemberOffset : NativeInt; MemberFlags : TPyMemberFlag; MemberDoc : PAnsiChar)');
RegisterMethod('Procedure ClearMembers');
RegisterProperty('MemberCount', 'Integer', iptr);
RegisterProperty('Members', 'PPyMemberDef Integer', iptr);
RegisterProperty('MembersData', 'PPyMemberDef', iptr);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TMethodsContainer(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TEngineClient', 'TMethodsContainer') do
with CL.AddClassN(CL.FindClass('TEngineClient'),'TMethodsContainer') do
begin
RegisterMethod('Constructor Create( AOwner : TComponent)');
RegisterMethod('Procedure Initialize');
RegisterMethod('Procedure Finalize');
RegisterMethod('Function AddMethod( AMethodName : PAnsiChar; AMethod : PyCFunction; ADocString : PAnsiChar) : PPyMethodDef');
RegisterMethod('Function AddMethodWithKeywords( AMethodName : PAnsiChar; AMethod : PyCFunctionWithKW; ADocString : PAnsiChar) : PPyMethodDef');
RegisterMethod('Function AddDelphiMethod( AMethodName : PAnsiChar; ADelphiMethod : TDelphiMethod; ADocString : PAnsiChar) : PPyMethodDef');
RegisterMethod('Function AddDelphiMethodWithKeywords( AMethodName : PAnsiChar; ADelphiMethod : TDelphiMethodWithKW; ADocString : PAnsiChar) : PPyMethodDef');
RegisterMethod('Procedure ClearMethods');
RegisterProperty('MethodCount', 'Integer', iptr);
RegisterProperty('Methods', 'PPyMethodDef Integer', iptr);
RegisterProperty('MethodsData', 'PPyMethodDef', iptr);
RegisterProperty('ModuleDef', 'PyModuleDef', iptr);
RegisterProperty('Events', 'TEventDefs', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TEventDefs(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCollection', 'TEventDefs') do
with CL.AddClassN(CL.FindClass('TCollection'),'TEventDefs') do
begin
RegisterMethod('Constructor Create( AMethodsContainer : TMethodsContainer)');
RegisterMethod('Function Add : TEventDef');
RegisterMethod('Procedure RegisterEvents');
RegisterProperty('Items', 'TEventDef Integer', iptr);
RegisterProperty('Container', 'TMethodsContainer', iptr);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TEventDef(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TCollectionItem', 'TEventDef') do
with CL.AddClassN(CL.FindClass('TCollectionItem'),'TEventDef') do
begin
RegisterMethod('Constructor Create( ACollection : TCollection)');
RegisterMethod('Function GetDocString : AnsiString');
RegisterMethod('Function PythonEvent( pself, args : PPyObject) : PPyObject');
RegisterMethod('Function Owner : TEventDefs');
RegisterProperty('Name', 'string', iptrw);
RegisterProperty('OnExecute', 'TPythonEvent', iptrw);
RegisterProperty('DocString', 'TStringList', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TEngineClient(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TComponent', 'TEngineClient') do
with CL.AddClassN(CL.FindClass('TComponent'),'TEngineClient') do
begin
RegisterMethod('Constructor Create( AOwner : TComponent)');
RegisterMethod('Procedure Initialize');
RegisterMethod('Procedure Finalize');
RegisterMethod('Procedure ClearEngine');
RegisterMethod('Procedure CheckEngine');
RegisterProperty('Initialized', 'Boolean', iptr);
RegisterProperty('Engine', 'TPythonEngine', iptrw);
RegisterProperty('OnCreate', 'TNotifyEvent', iptrw);
RegisterProperty('OnDestroy', 'TNotifyEvent', iptrw);
RegisterProperty('OnFinalization', 'TNotifyEvent', iptrw);
RegisterProperty('OnInitialization', 'TNotifyEvent', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPythonEngine(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TPythonInterface', 'TPythonEngine') do
with CL.AddClassN(CL.FindClass('TPythonInterface'),'TPythonEngine') do
begin
RegisterMethod('Constructor Create( AOwner : TComponent)');
RegisterMethod('Procedure SetPythonHome( const PythonHome : UnicodeString)');
RegisterMethod('Procedure SetProgramName( const ProgramName : UnicodeString)');
RegisterMethod('Function IsType( ob : PPyObject; obt : PPyTypeObject) : Boolean');
RegisterMethod('Function Run_CommandAsString( const command : AnsiString; mode : Integer) : string');
RegisterMethod('Function Run_CommandAsObject( const command : AnsiString; mode : Integer) : PPyObject');
RegisterMethod('Function Run_CommandAsObjectWithDict( const command : AnsiString; mode : Integer; locals, globals : PPyObject) : PPyObject');
RegisterMethod('Function EncodeString01( const str : UnicodeString) : AnsiString;;');
RegisterMethod('Function EncodeString2( const str : AnsiString) : AnsiString;');
RegisterMethod('Function EncodeWindowsFilePath( const str : string) : AnsiString');
RegisterMethod('Procedure ExecString3( const command : AnsiString);');
RegisterMethod('Procedure ExecStrings4( strings : TStrings);');
RegisterMethod('Function EvalString5( const command : AnsiString) : PPyObject;');
RegisterMethod('Function EvalStringAsStr( const command : AnsiString) : string');
RegisterMethod('Function EvalStrings6( strings : TStrings) : PPyObject;');
RegisterMethod('Procedure ExecString7( const command : AnsiString; locals, globals : PPyObject);');
RegisterMethod('Procedure ExecStrings8( strings : TStrings; locals, globals : PPyObject);');
RegisterMethod('Function EvalString9( const command : AnsiString; locals, globals : PPyObject) : PPyObject;');
RegisterMethod('Function EvalStrings10( strings : TStrings; locals, globals : PPyObject) : PPyObject;');
RegisterMethod('Function EvalStringsAsStr( strings : TStrings) : string');
RegisterMethod('Function EvalPyFunction( pyfunc, pyargs : PPyObject) : Variant');
RegisterMethod('Function EvalFunction( pyfunc : PPyObject; const args : array of const) : Variant');
RegisterMethod('Function EvalFunctionNoArgs( pyfunc : PPyObject) : Variant');
RegisterMethod('Function CheckEvalSyntax( const str : AnsiString) : Boolean');
RegisterMethod('Function CheckExecSyntax( const str : AnsiString) : Boolean');
RegisterMethod('Function CheckSyntax( const str : AnsiString; mode : Integer) : Boolean');
RegisterMethod('Procedure RaiseError');
RegisterMethod('Function PyObjectAsString( obj : PPyObject) : string');
RegisterMethod('Procedure DoRedirectIO');
RegisterMethod('Procedure AddClient( client : TEngineClient)');
RegisterMethod('Procedure RemoveClient( client : TEngineClient)');
RegisterMethod('Function FindClient( const aName : string) : TEngineClient');
RegisterMethod('Function TypeByName( const aTypeName : AnsiString) : PPyTypeObject');
RegisterMethod('Function ModuleByName( const aModuleName : AnsiString) : PPyObject');
RegisterMethod('Function MethodsByName( const aMethodsContainer : string) : PPyMethodDef');
RegisterMethod('Function VariantAsPyObject( const V : Variant) : PPyObject');
RegisterMethod('Function PyObjectAsVariant( obj : PPyObject) : Variant');
RegisterMethod('Function VarRecAsPyObject( const v : TVarRec) : PPyObject');
RegisterMethod('Function MakePyTuple( const objects : array of PPyObject) : PPyObject');
RegisterMethod('Function MakePyList( const objects : array of PPyObject) : PPyObject');
RegisterMethod('Function ArrayToPyTuple( const items : array of const) : PPyObject');
RegisterMethod('Function ArrayToPyList( const items : array of const) : PPyObject');
RegisterMethod('Function ArrayToPyDict( const items : array of const) : PPyObject');
RegisterMethod('Function StringsToPyList( strings : TStrings) : PPyObject');
RegisterMethod('Function StringsToPyTuple( strings : TStrings) : PPyObject');
RegisterMethod('Procedure PyListToStrings( list : PPyObject; strings : TStrings)');
RegisterMethod('Procedure PyTupleToStrings( tuple : PPyObject; strings : TStrings)');
RegisterMethod('Function ReturnNone : PPyObject');
RegisterMethod('Function ReturnTrue : PPyObject');
RegisterMethod('Function ReturnFalse : PPyObject');
RegisterMethod('Function FindModule( const ModuleName : AnsiString) : PPyObject');
RegisterMethod('Function FindFunction( const ModuleName, FuncName : AnsiString) : PPyObject');
RegisterMethod('Function SetToList( data : Pointer; size : Integer) : PPyObject');
RegisterMethod('Procedure ListToSet( List : PPyObject; data : Pointer; size : Integer)');
RegisterMethod('Procedure CheckError( ACatchStopEx : Boolean)');
RegisterMethod('Function GetMainModule : PPyObject');
RegisterMethod('Function PyTimeStruct_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyDate_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyDate_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyDateTime_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyDateTime_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyTime_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyTime_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyDelta_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyDelta_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyTZInfo_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyTZInfo_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyUnicodeFromString11( const AString : UnicodeString) : PPyObject;');
RegisterMethod('Function PyUnicodeFromString12( const AString : AnsiString) : PPyObject;');
RegisterMethod('Function PyUnicodeAsString( obj : PPyObject) : UnicodeString');
RegisterMethod('Function PyUnicodeAsUTF8String( obj : PPyObject) : RawByteString');
RegisterMethod('Function PyBytesAsAnsiString( obj : PPyObject) : AnsiString');
RegisterProperty('ClientCount', 'Integer', iptr);
RegisterProperty('Clients', 'TEngineClient Integer', iptr);
RegisterProperty('ExecModule', 'AnsiString', iptrw);
RegisterProperty('ThreadState', 'PPyThreadState', iptr);
RegisterProperty('Traceback', 'TPythonTraceback', iptr);
RegisterProperty('LocalVars', 'PPyObject', iptrw);
RegisterProperty('GlobalVars', 'PPyObject', iptrw);
RegisterProperty('IOPythonModule', 'TObject', iptr);
RegisterProperty('PythonHome', 'UnicodeString', iptrw);
RegisterProperty('ProgramName', 'UnicodeString', iptrw);
RegisterProperty('AutoFinalize', 'Boolean', iptrw);
RegisterProperty('VenvPythonExe', 'string', iptrw);
RegisterProperty('DatetimeConversionMode', 'TDatetimeConversionMode', iptrw);
RegisterProperty('InitScript', 'TStrings', iptrw);
RegisterProperty('InitThreads', 'Boolean', iptrw);
RegisterProperty('IO', 'TPythonInputOutput', iptrw);
RegisterProperty('PyFlags', 'TPythonFlags', iptrw);
RegisterProperty('RedirectIO', 'Boolean', iptrw);
RegisterProperty('UseWindowsConsole', 'Boolean', iptrw);
RegisterProperty('OnAfterInit', 'TNotifyEvent', iptrw);
RegisterProperty('OnPathInitialization', 'TPathInitializationEvent', iptrw);
RegisterProperty('OnSysPathInit', 'TSysPathInitEvent', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPythonTraceback(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TOBJECT', 'TPythonTraceback') do
with CL.AddClassN(CL.FindClass('TOBJECT'),'TPythonTraceback') do
begin
RegisterMethod('Constructor Create');
RegisterMethod('Procedure Clear');
RegisterMethod('Procedure Refresh( pytraceback : PPyObject)');
RegisterMethod('Procedure AddItem( const Context, FileName : string; LineNo : Integer)');
RegisterProperty('ItemCount', 'Integer', iptr);
RegisterProperty('Items', 'TTracebackItem Integer', iptr);
RegisterProperty('Limit', 'Integer', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TTracebackItem(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TOBJECT', 'TTracebackItem') do
with CL.AddClassN(CL.FindClass('TOBJECT'),'TTracebackItem') do
begin
RegisterProperty('FileName', 'string', iptrw);
RegisterProperty('LineNo', 'Integer', iptrw);
RegisterProperty('Context', 'string', iptrw);
end;
end;
(*----------------------------------------------------------------------------*)
procedure SIRegister_TPythonInterface(CL: TPSPascalCompiler);
begin
//with RegClassS(CL,'TDynamicDll', 'TPythonInterface') do
with CL.AddClassN(CL.FindClass('TDynamicDll'),'TPythonInterface') do
begin
RegisterProperty('Py_DebugFlag', 'PInteger', iptrw);
RegisterProperty('Py_VerboseFlag', 'PInteger', iptrw);
RegisterProperty('Py_InteractiveFlag', 'PInteger', iptrw);
RegisterProperty('Py_OptimizeFlag', 'PInteger', iptrw);
RegisterProperty('Py_NoSiteFlag', 'PInteger', iptrw);
RegisterProperty('Py_FrozenFlag', 'PInteger', iptrw);
RegisterProperty('Py_IgnoreEnvironmentFlag', 'PInteger', iptrw);
RegisterProperty('PyImport_FrozenModules', 'PP_frozen', iptrw);
RegisterProperty('Py_None', 'PPyObject', iptrw);
RegisterProperty('Py_Ellipsis', 'PPyObject', iptrw);
RegisterProperty('Py_False', 'PPyObject', iptrw);
RegisterProperty('Py_True', 'PPyObject', iptrw);
RegisterProperty('Py_NotImplemented', 'PPyObject', iptrw);
RegisterProperty('PyExc_AttributeError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_EOFError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_IOError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_ImportError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_IndexError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_KeyError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_KeyboardInterrupt', 'PPPyObject', iptrw);
RegisterProperty('PyExc_MemoryError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_NameError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_OverflowError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_RuntimeError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_SyntaxError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_SystemError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_SystemExit', 'PPPyObject', iptrw);
RegisterProperty('PyExc_TypeError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_ValueError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_ZeroDivisionError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_ArithmeticError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_Exception', 'PPPyObject', iptrw);
RegisterProperty('PyExc_FloatingPointError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_LookupError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_AssertionError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_EnvironmentError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_IndentationError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_NotImplementedError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_OSError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_TabError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_UnboundLocalError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_UnicodeError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_WindowsError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_Warning', 'PPPyObject', iptrw);
RegisterProperty('PyExc_DeprecationWarning', 'PPPyObject', iptrw);
RegisterProperty('PyExc_RuntimeWarning', 'PPPyObject', iptrw);
RegisterProperty('PyExc_SyntaxWarning', 'PPPyObject', iptrw);
RegisterProperty('PyExc_UserWarning', 'PPPyObject', iptrw);
RegisterProperty('PyExc_ReferenceError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_StopIteration', 'PPPyObject', iptrw);
RegisterProperty('PyExc_FutureWarning', 'PPPyObject', iptrw);
RegisterProperty('PyExc_PendingDeprecationWarning', 'PPPyObject', iptrw);
RegisterProperty('PyExc_UnicodeDecodeError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_UnicodeEncodeError', 'PPPyObject', iptrw);
RegisterProperty('PyExc_UnicodeTranslateError', 'PPPyObject', iptrw);
RegisterProperty('PyCode_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyType_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyCFunction_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyComplex_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyDict_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyFloat_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyFrame_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyFunction_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyList_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyLong_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyMethod_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyModule_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyObject_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyRange_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PySlice_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyBytes_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyTuple_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyBaseObject_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyCallIter_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyCell_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyClassMethod_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyProperty_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PySeqIter_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyStaticMethod_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PySuper_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyTraceBack_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyUnicode_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyWrapperDescr_Type', 'PPyTypeObject', iptrw);
RegisterProperty('_PyWeakref_RefType', 'PPyTypeObject', iptrw);
RegisterProperty('_PyWeakref_ProxyType', 'PPyTypeObject', iptrw);
RegisterProperty('_PyWeakref_CallableProxyType', 'PPyTypeObject', iptrw);
RegisterProperty('PyBool_Type', 'PPyTypeObject', iptrw);
RegisterProperty('PyEnum_Type', 'PPyTypeObject', iptrw);
RegisterProperty('Py_GetBuildInfo', '', iptrw);
RegisterProperty('PyImport_ExecCodeModule', '', iptrw);
RegisterProperty('PyComplex_FromCComplex', '', iptrw);
RegisterProperty('PyComplex_FromDoubles', '', iptrw);
RegisterProperty('PyComplex_RealAsDouble', '', iptrw);
RegisterProperty('PyComplex_ImagAsDouble', '', iptrw);
RegisterProperty('PyComplex_AsCComplex', '', iptrw);
RegisterProperty('PyCFunction_GetFunction', '', iptrw);
RegisterProperty('PyCFunction_GetSelf', '', iptrw);
RegisterProperty('PyCallable_Check', '', iptrw);
RegisterProperty('PyModule_Create2', '', iptrw);
RegisterProperty('PyErr_BadArgument', '', iptrw);
RegisterProperty('PyErr_BadInternalCall', '', iptrw);
RegisterProperty('PyErr_CheckSignals', '', iptrw);
RegisterProperty('PyErr_Clear', '', iptrw);
RegisterProperty('PyErr_Fetch', '', iptrw);
RegisterProperty('PyErr_NoMemory', '', iptrw);
RegisterProperty('PyErr_Occurred', '', iptrw);
RegisterProperty('PyErr_Print', '', iptrw);
RegisterProperty('PyErr_Restore', '', iptrw);
RegisterProperty('PyErr_SetFromErrno', '', iptrw);
RegisterProperty('PyErr_SetNone', '', iptrw);
RegisterProperty('PyErr_SetObject', '', iptrw);
RegisterProperty('PyErr_SetString', '', iptrw);
RegisterProperty('PyErr_WarnEx', '', iptrw);
RegisterProperty('PyErr_WarnExplicit', '', iptrw);
RegisterProperty('PyImport_GetModuleDict', '', iptrw);
RegisterProperty('PyArg_Parse', 'TPyArg_Parse', iptrw);
RegisterProperty('PyArg_ParseTuple', 'TPyArg_Parse', iptrw);
RegisterProperty('PyArg_ParseTupleAndKeywords', 'TPyArg_ParseTupleAndKeywords', iptrw);
RegisterProperty('Py_BuildValue', 'TPy_BuildValue', iptrw);
RegisterProperty('Py_Initialize', '', iptrw);
RegisterProperty('Py_Exit', '', iptrw);
RegisterProperty('PyEval_GetBuiltins', '', iptrw);
RegisterProperty('PyDict_Copy', '', iptrw);
RegisterProperty('PyDict_GetItem', '', iptrw);
RegisterProperty('PyDict_SetItem', '', iptrw);
RegisterProperty('PyDict_DelItem', '', iptrw);
RegisterProperty('PyDict_Clear', '', iptrw);
RegisterProperty('PyDict_Next', '', iptrw);
RegisterProperty('PyDict_Keys', '', iptrw);
RegisterProperty('PyDict_Values', '', iptrw);
RegisterProperty('PyDict_Items', '', iptrw);
RegisterProperty('PyDict_Size', '', iptrw);
RegisterProperty('PyDict_Update', '', iptrw);
RegisterProperty('PyDict_DelItemString', '', iptrw);
RegisterProperty('PyDict_New', '', iptrw);
RegisterProperty('PyDict_GetItemString', '', iptrw);
RegisterProperty('PyDict_SetItemString', '', iptrw);
RegisterProperty('PyDictProxy_New', '', iptrw);
RegisterProperty('PyModule_GetDict', '', iptrw);
RegisterProperty('PyObject_Str', '', iptrw);
RegisterProperty('PyRun_String', '', iptrw);
RegisterProperty('PyRun_SimpleString', '', iptrw);
RegisterProperty('PyBytes_AsString', '', iptrw);
RegisterProperty('PyBytes_AsStringAndSize', '', iptrw);
RegisterProperty('PySys_SetArgv', '', iptrw);
RegisterProperty('PyCFunction_NewEx', '', iptrw);
RegisterProperty('PyEval_CallObjectWithKeywords', '', iptrw);
RegisterProperty('PyEval_GetFrame', '', iptrw);
RegisterProperty('PyEval_GetGlobals', '', iptrw);
RegisterProperty('PyEval_GetLocals', '', iptrw);
RegisterProperty('PyEval_InitThreads', '', iptrw);
RegisterProperty('PyEval_RestoreThread', '', iptrw);
RegisterProperty('PyEval_SaveThread', '', iptrw);
RegisterProperty('PyFile_GetLine', '', iptrw);
RegisterProperty('PyFile_WriteObject', '', iptrw);
RegisterProperty('PyFile_WriteString', '', iptrw);
RegisterProperty('PyFloat_AsDouble', '', iptrw);
RegisterProperty('PyFloat_FromDouble', '', iptrw);
RegisterProperty('PyFloat_FromString', '', iptrw);
RegisterProperty('PyFunction_GetCode', '', iptrw);
RegisterProperty('PyFunction_GetGlobals', '', iptrw);
RegisterProperty('PyFunction_New', '', iptrw);
RegisterProperty('PyImport_AddModule', '', iptrw);
RegisterProperty('PyImport_GetMagicNumber', '', iptrw);
RegisterProperty('PyImport_ImportFrozenModule', '', iptrw);
RegisterProperty('PyImport_ImportModule', '', iptrw);
RegisterProperty('PyImport_Import', '', iptrw);
RegisterProperty('PyImport_ReloadModule', '', iptrw);
RegisterProperty('PyList_Append', '', iptrw);
RegisterProperty('PyList_AsTuple', '', iptrw);
RegisterProperty('PyList_GetItem', '', iptrw);
RegisterProperty('PyList_GetSlice', '', iptrw);
RegisterProperty('PyList_Insert', '', iptrw);
RegisterProperty('PyList_New', '', iptrw);
RegisterProperty('PyList_Reverse', '', iptrw);
RegisterProperty('PyList_SetItem', '', iptrw);
RegisterProperty('PyList_SetSlice', '', iptrw);
RegisterProperty('PyList_Size', '', iptrw);
RegisterProperty('PyList_Sort', '', iptrw);
RegisterProperty('PyLong_AsDouble', '', iptrw);
RegisterProperty('PyLong_AsLong', '', iptrw);
RegisterProperty('PyLong_FromDouble', '', iptrw);
RegisterProperty('PyLong_FromLong', '', iptrw);
RegisterProperty('PyLong_FromString', '', iptrw);
RegisterProperty('PyLong_FromUnsignedLong', '', iptrw);
RegisterProperty('PyLong_AsUnsignedLong', '', iptrw);
RegisterProperty('PyLong_FromUnicodeObject', '', iptrw);
RegisterProperty('PyLong_FromLongLong', '', iptrw);
RegisterProperty('PyLong_FromUnsignedLongLong', '', iptrw);
RegisterProperty('PyLong_AsLongLong', '', iptrw);
RegisterProperty('PyLong_FromVoidPtr', '', iptrw);
RegisterProperty('PyMapping_Check', '', iptrw);
RegisterProperty('PyMapping_GetItemString', '', iptrw);
RegisterProperty('PyMapping_HasKey', '', iptrw);
RegisterProperty('PyMapping_HasKeyString', '', iptrw);
RegisterProperty('PyMapping_Length', '', iptrw);
RegisterProperty('PyMapping_SetItemString', '', iptrw);
RegisterProperty('PyMethod_Function', '', iptrw);
RegisterProperty('PyMethod_New', '', iptrw);
RegisterProperty('PyMethod_Self', '', iptrw);
RegisterProperty('PyModule_GetName', '', iptrw);
RegisterProperty('PyModule_New', '', iptrw);
RegisterProperty('PyNumber_Absolute', '', iptrw);
RegisterProperty('PyNumber_Add', '', iptrw);
RegisterProperty('PyNumber_And', '', iptrw);
RegisterProperty('PyNumber_Check', '', iptrw);
RegisterProperty('PyNumber_FloorDivide', '', iptrw);
RegisterProperty('PyNumber_TrueDivide', '', iptrw);
RegisterProperty('PyNumber_Divmod', '', iptrw);
RegisterProperty('PyNumber_Float', '', iptrw);
RegisterProperty('PyNumber_Invert', '', iptrw);
RegisterProperty('PyNumber_Long', '', iptrw);
RegisterProperty('PyNumber_Lshift', '', iptrw);
RegisterProperty('PyNumber_Multiply', '', iptrw);
RegisterProperty('PyNumber_Negative', '', iptrw);
RegisterProperty('PyNumber_Or', '', iptrw);
RegisterProperty('PyNumber_Positive', '', iptrw);
RegisterProperty('PyNumber_Power', '', iptrw);
RegisterProperty('PyNumber_Remainder', '', iptrw);
RegisterProperty('PyNumber_Rshift', '', iptrw);
RegisterProperty('PyNumber_Subtract', '', iptrw);
RegisterProperty('PyNumber_Xor', '', iptrw);
RegisterProperty('PyOS_InterruptOccurred', '', iptrw);
RegisterProperty('PyObject_CallObject', '', iptrw);
RegisterProperty('PyObject_RichCompare', '', iptrw);
RegisterProperty('PyObject_RichCompareBool', '', iptrw);
RegisterProperty('PyObject_GetAttr', '', iptrw);
RegisterProperty('PyObject_GetAttrString', '', iptrw);
RegisterProperty('PyObject_GetItem', '', iptrw);
RegisterProperty('PyObject_DelItem', '', iptrw);
RegisterProperty('PyObject_HasAttrString', '', iptrw);
RegisterProperty('PyObject_Hash', '', iptrw);
RegisterProperty('PyObject_IsTrue', '', iptrw);
RegisterProperty('PyObject_Length', '', iptrw);
RegisterProperty('PyObject_Repr', '', iptrw);
RegisterProperty('PyObject_SetAttr', '', iptrw);
RegisterProperty('PyObject_SetAttrString', '', iptrw);
RegisterProperty('PyObject_SetItem', '', iptrw);
RegisterProperty('PyObject_Init', '', iptrw);
RegisterProperty('PyObject_InitVar', '', iptrw);
RegisterProperty('PyObject_New', '', iptrw);
RegisterProperty('PyObject_NewVar', '', iptrw);
RegisterProperty('PyObject_Free', '', iptrw);
RegisterProperty('PyObject_GetIter', '', iptrw);
RegisterProperty('PyIter_Next', '', iptrw);
RegisterProperty('PyObject_IsInstance', '', iptrw);
RegisterProperty('PyObject_IsSubclass', '', iptrw);
RegisterProperty('PyObject_Call', '', iptrw);
RegisterProperty('PyObject_GenericGetAttr', '', iptrw);
RegisterProperty('PyObject_GenericSetAttr', '', iptrw);
RegisterProperty('PyObject_GC_Malloc', '', iptrw);
RegisterProperty('PyObject_GC_New', '', iptrw);
RegisterProperty('PyObject_GC_NewVar', '', iptrw);
RegisterProperty('PyObject_GC_Resize', '', iptrw);
RegisterProperty('PyObject_GC_Del', '', iptrw);
RegisterProperty('PyObject_GC_Track', '', iptrw);
RegisterProperty('PyObject_GC_UnTrack', '', iptrw);
RegisterProperty('PySequence_Check', '', iptrw);
RegisterProperty('PySequence_Concat', '', iptrw);
RegisterProperty('PySequence_Count', '', iptrw);
RegisterProperty('PySequence_GetItem', '', iptrw);
RegisterProperty('PySequence_GetSlice', '', iptrw);
RegisterProperty('PySequence_In', '', iptrw);
RegisterProperty('PySequence_Index', '', iptrw);
RegisterProperty('PySequence_Length', '', iptrw);
RegisterProperty('PySequence_Repeat', '', iptrw);
RegisterProperty('PySequence_SetItem', '', iptrw);
RegisterProperty('PySequence_SetSlice', '', iptrw);
RegisterProperty('PySequence_DelSlice', '', iptrw);
RegisterProperty('PySequence_Tuple', '', iptrw);
RegisterProperty('PySequence_Contains', '', iptrw);
RegisterProperty('PySequence_List', '', iptrw);
RegisterProperty('PySeqIter_New', '', iptrw);
RegisterProperty('PySlice_GetIndices', '', iptrw);
RegisterProperty('PySlice_GetIndicesEx', '', iptrw);
RegisterProperty('PySlice_New', '', iptrw);
RegisterProperty('PyBytes_Concat', '', iptrw);
RegisterProperty('PyBytes_ConcatAndDel', '', iptrw);
RegisterProperty('PyBytes_FromString', '', iptrw);
RegisterProperty('PyBytes_FromStringAndSize', '', iptrw);
RegisterProperty('PyBytes_Size', '', iptrw);
RegisterProperty('PyBytes_DecodeEscape', '', iptrw);
RegisterProperty('PyBytes_Repr', '', iptrw);
RegisterProperty('PySys_GetObject', '', iptrw);
RegisterProperty('PySys_SetObject', '', iptrw);
RegisterProperty('PySys_SetPath', '', iptrw);
RegisterProperty('PyTraceBack_Here', '', iptrw);
RegisterProperty('PyTraceBack_Print', '', iptrw);
RegisterProperty('PyTuple_GetItem', '', iptrw);
RegisterProperty('PyTuple_GetSlice', '', iptrw);
RegisterProperty('PyTuple_New', '', iptrw);
RegisterProperty('PyTuple_SetItem', '', iptrw);
RegisterProperty('PyTuple_Size', '', iptrw);
RegisterProperty('PyType_IsSubtype', '', iptrw);
RegisterProperty('PyType_GenericAlloc', '', iptrw);
RegisterProperty('PyType_GenericNew', '', iptrw);
RegisterProperty('PyType_Ready', '', iptrw);
RegisterProperty('PyUnicode_FromWideChar', '', iptrw);
RegisterProperty('PyUnicode_FromString', '', iptrw);
RegisterProperty('PyUnicode_FromStringAndSize', '', iptrw);
RegisterProperty('PyUnicode_FromKindAndData', '', iptrw);
RegisterProperty('PyUnicode_AsWideChar', '', iptrw);
RegisterProperty('PyUnicode_AsUTF8', '', iptrw);
RegisterProperty('PyUnicode_AsUTF8AndSize', '', iptrw);
RegisterProperty('PyUnicode_Decode', '', iptrw);
RegisterProperty('PyUnicode_DecodeUTF16', '', iptrw);
RegisterProperty('PyUnicode_AsEncodedString', '', iptrw);
RegisterProperty('PyUnicode_FromOrdinal', '', iptrw);
RegisterProperty('PyUnicode_GetSize', '', iptrw);
RegisterProperty('PyWeakref_GetObject', '', iptrw);
RegisterProperty('PyWeakref_NewProxy', '', iptrw);
RegisterProperty('PyWeakref_NewRef', '', iptrw);
RegisterProperty('PyWrapper_New', '', iptrw);
RegisterProperty('PyBool_FromLong', '', iptrw);
RegisterProperty('PyThreadState_SetAsyncExc', '', iptrw);
RegisterProperty('Py_AtExit', '', iptrw);
RegisterProperty('Py_CompileStringExFlags', '', iptrw);
RegisterProperty('Py_FatalError', '', iptrw);
RegisterProperty('_PyObject_New', '', iptrw);
RegisterProperty('_PyBytes_Resize', '', iptrw);
RegisterProperty('Py_Finalize', '', iptrw);
RegisterProperty('PyErr_ExceptionMatches', '', iptrw);
RegisterProperty('PyErr_GivenExceptionMatches', '', iptrw);
RegisterProperty('PyEval_EvalCode', '', iptrw);
RegisterProperty('Py_GetVersion', '', iptrw);
RegisterProperty('Py_GetCopyright', '', iptrw);
RegisterProperty('Py_GetExecPrefix', '', iptrw);
RegisterProperty('Py_GetPath', '', iptrw);
RegisterProperty('Py_SetPythonHome', '', iptrw);
RegisterProperty('Py_GetPythonHome', '', iptrw);
RegisterProperty('Py_GetPrefix', '', iptrw);
RegisterProperty('Py_GetProgramName', '', iptrw);
RegisterProperty('PyParser_SimpleParseStringFlags', '', iptrw);
RegisterProperty('PyNode_Free', '', iptrw);
RegisterProperty('PyErr_NewException', '', iptrw);
RegisterProperty('PyMem_Malloc', '', iptrw);
RegisterProperty('Py_SetProgramName', '', iptrw);
RegisterProperty('Py_IsInitialized', '', iptrw);
RegisterProperty('Py_GetProgramFullPath', '', iptrw);
RegisterProperty('Py_NewInterpreter', '', iptrw);
RegisterProperty('Py_EndInterpreter', '', iptrw);
RegisterProperty('PyEval_AcquireLock', '', iptrw);
RegisterProperty('PyEval_ReleaseLock', '', iptrw);
RegisterProperty('PyEval_AcquireThread', '', iptrw);
RegisterProperty('PyEval_ReleaseThread', '', iptrw);
RegisterProperty('PyInterpreterState_New', '', iptrw);
RegisterProperty('PyInterpreterState_Clear', '', iptrw);
RegisterProperty('PyInterpreterState_Delete', '', iptrw);
RegisterProperty('PyThreadState_New', '', iptrw);
RegisterProperty('PyThreadState_Clear', '', iptrw);
RegisterProperty('PyThreadState_Delete', '', iptrw);
RegisterProperty('PyThreadState_Get', '', iptrw);
RegisterProperty('PyThreadState_Swap', '', iptrw);
RegisterProperty('PyErr_SetInterrupt', '', iptrw);
RegisterProperty('PyGILState_Ensure', '', iptrw);
RegisterProperty('PyGILState_Release', '', iptrw);
RegisterMethod('Function PyParser_SimpleParseString( str : PAnsiChar; start : Integer) : PNode');
RegisterMethod('Function Py_CompileString( str, filename : PAnsiChar; start : integer) : PPyObject');
RegisterMethod('Procedure Py_INCREF( op : PPyObject)');
RegisterMethod('Procedure Py_DECREF( op : PPyObject)');
RegisterMethod('Procedure Py_XINCREF( op : PPyObject)');
RegisterMethod('Procedure Py_XDECREF( op : PPyObject)');
RegisterMethod('Procedure Py_CLEAR( var op : PPyObject)');
RegisterMethod('Function PyBytes_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyBytes_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyFloat_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyFloat_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyLong_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyLong_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyTuple_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyTuple_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyClass_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyType_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyMethod_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyList_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyList_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyDict_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyDict_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyModule_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyModule_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PySlice_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyFunction_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyIter_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyUnicode_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyUnicode_CheckExact( obj : PPyObject) : Boolean');
RegisterMethod('Function PyType_IS_GC( t : PPyTypeObject) : Boolean');
RegisterMethod('Function PyObject_IS_GC( obj : PPyObject) : Boolean');
RegisterMethod('Function PyWeakref_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyWeakref_CheckRef( obj : PPyObject) : Boolean');
RegisterMethod('Function PyWeakref_CheckProxy( obj : PPyObject) : Boolean');
RegisterMethod('Function PyBool_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyEnum_Check( obj : PPyObject) : Boolean');
RegisterMethod('Function PyObject_TypeCheck( obj : PPyObject; t : PPyTypeObject) : Boolean');
RegisterMethod('Function Py_InitModule( const md : PyModuleDef) : PPyObject');