wss445566 / python4delphi

Automatically exported from code.google.com/p/python4delphi
0 stars 1 forks source link

Delphi 2009 Compatibility #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Need Delphi 2009 Compatibility

Original issue reported on code.google.com by halukcet...@gmail.com on 21 May 2009 at 7:28

GoogleCodeExporter commented 9 years ago

Original comment by pyscripter on 6 Dec 2009 at 12:16

GoogleCodeExporter commented 9 years ago
Here's my patch versus 3.32 to add support for Python 2.6, Delphi 2009/2010. 
Only 
VarPyth, the core and the likes have been ported, I haven't looked at the atom 
stuff.
A full archive with the patch and the patched files can be found attached as 
well, 
might be easier to use.

Original comment by koenvand...@gmail.com on 7 Jan 2010 at 2:58

Attachments:

GoogleCodeExporter commented 9 years ago
KOen, thank you for doing the D2009/2010 port.

I have also fixed (hopefully) all the issues with the pydb.pas module so that it
compiles and works correctly in D2010.

Richard

Original comment by rjkin...@gmail.com on 25 Mar 2010 at 11:14

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
rjking - should not there be changes to pyDBTables.pas too?  to change from 
PChar to 
PAnsiChar in getAttr and setAttr?
I am using Python 2.6 and Delphi 2010

Original comment by mmhamz...@gmail.com on 6 Jun 2010 at 12:47

GoogleCodeExporter commented 9 years ago
Another thing in PythonEngine.pas
If DELPHI2010:  TheType is avoided entirely thus 'killing' demos 6 and 7 that 
use 
TheType structure.
The thing is that with Delphi 2010 WITH can not be used with a property name 
anymore.  The with keyword can no longer be used to provide write-access to 
record fields, through the read-only property name. use the field name 
instead to provide writeable record properties.
So with Delphi 2010, we can use the provided field name FType instead of 
TheType.
I attached PythonEngine.pas with the changes.  Search file for mmh.
Removed DEF from TheType property declaration.
Then later if DELPHI2010 use: with FType do
ELSE use: with TheType do

In demos 6 and 7 use the with keyword appropriately.  With Delphi 2010 use:
var FType : PyTypeobject
then use:
with FType do

where with TheType appears.

In demos 6 and 7 - they run partially now then I get an exception that I need 
to 
look at.

Original comment by mmhamz...@gmail.com on 6 Jun 2010 at 10:55

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Furthermore (not included in PythonEngine.pas I attached before).
In PythonEngine,pas I moved:
FType : PyTypeObject;
from the Protected section of TPythonType = class(TGetSetContainer)
to the Public section.
This allows TheType to be accessed via FType in Demos 6 and 7.  These work now 
with no exceptions.  Of course declaring FType in demos 6 and 7 is not 
necessary and WRONG!
Anyone reads thiese comments anyway?  Anyone working on this project?

Original comment by mmhamz...@gmail.com on 12 Jun 2010 at 4:56

GoogleCodeExporter commented 9 years ago
Fixed in version control.
Updated and tested everything (including demos) except from stuff in 
C:\Delphi\progs32PythonForDelphi\Components\Sources\VCL (database stuff) which 
I do not use.
Included package for Delphi 2010.

If someone comes along with an update for these 4 units I will update the SVN.

Original comment by pyscripter on 25 Aug 2010 at 10:32

GoogleCodeExporter commented 9 years ago
I have updated the database stuff for Unicode as well.  However there are 
various issues when running the related demos.  I checked with Delphi 2006 and 
the issues existed there as well.  If someone is interested in maintaining the 
database units in PythonForDelphi\Components\Sources\VCL then I would be happy 
to update them.  Otherwise you should consider them as deprecated and possibly 
unstable.  I am not planning to do any work on them.

In any case a better way to wrap the database stuff would be to use the 
WrapDelphi appproach.

Original comment by pyscripter on 26 Aug 2010 at 1:01

GoogleCodeExporter commented 9 years ago
I have applied a fix by Lee Shaver to the database components and they now seem 
to work well with Delphi 2010 and 2006.

Original comment by pyscripter on 1 Sep 2010 at 6:21