modeling-cvs Mailing List for Object-Relational Bridge for python (Page 2)
Status: Abandoned
Brought to you by:
sbigaret
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
(54) |
Apr
(29) |
May
(94) |
Jun
(47) |
Jul
(156) |
Aug
(132) |
Sep
(40) |
Oct
(6) |
Nov
(18) |
Dec
(24) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(18) |
Feb
(59) |
Mar
(7) |
Apr
|
May
(8) |
Jun
(2) |
Jul
(12) |
Aug
(15) |
Sep
(12) |
Oct
(6) |
Nov
(25) |
Dec
(1) |
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
(27) |
Mar
|
Apr
(16) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sbi...@us...> - 2006-02-26 17:50:24
|
Revision: 978 Author: sbigaret Date: 2006-02-26 09:50:15 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=978&view=rev Log Message: ----------- removed iso-8859-1 chars causing epydoc failure Modified Paths: -------------- trunk/ProjectModeling/Modeling/interfaces/Relationship.py Modified: trunk/ProjectModeling/Modeling/interfaces/Relationship.py =================================================================== --- trunk/ProjectModeling/Modeling/interfaces/Relationship.py 2006-02-26 17:48:56 UTC (rev 977) +++ trunk/ProjectModeling/Modeling/interfaces/Relationship.py 2006-02-26 17:50:15 UTC (rev 978) @@ -15,7 +15,7 @@ """ ClassDescription API - Dire + notez les champs suivants:: + Decrire + notez les champs suivants:: # Join semantic: for later use INNER_JOIN = 0 @@ -68,7 +68,7 @@ - cardinality of the relationship - [Tableau suivant fier avec le Modeler]:: + [Tableau suivant erifier avec le Modeler]:: SimpleRel. FlattenedRel. definition get y:None Y This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-26 17:49:08
|
Revision: 977 Author: sbigaret Date: 2006-02-26 09:48:56 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=977&view=rev Log Message: ----------- Updated documentation Modified Paths: -------------- trunk/ProjectModeling/Modeling/doc/HomePage/features.tex trunk/ProjectModeling/Modeling/doc/HomePage/main.tex trunk/ProjectModeling/Modeling/doc/HomePage/status.tex trunk/ProjectModeling/Modeling/doc/README.dynamic.txt trunk/ProjectModeling/Modeling/doc/UserGuide.tex trunk/ProjectModeling/Modeling/doc/www/menu-inline-begin.tex Modified: trunk/ProjectModeling/Modeling/doc/HomePage/features.tex =================================================================== --- trunk/ProjectModeling/Modeling/doc/HomePage/features.tex 2006-02-26 17:44:38 UTC (rev 976) +++ trunk/ProjectModeling/Modeling/doc/HomePage/features.tex 2006-02-26 17:48:56 UTC (rev 977) @@ -87,14 +87,14 @@ \item Support for nested graphs/sets of objects. -\item Works with python 2.1, 2.2 and 2.3. +\item Works with python 2.1, 2.2, 2.3 and 2.4 \end{itemize} \paragraph*{Supported RDBMS} \begin{description} \item[\begin{rawhtml}<a href="http://www.mysql.com/">MySQL</a>\end{rawhtml}] -tested with v3.23.52 and v4.0.13 +tested with v3.x and v4.0.24 Supported python adaptor: \begin{rawhtml} @@ -125,7 +125,8 @@ <a href="http://pypgsql.sourceforge.net">PyPgSQL</a> \end{rawhtml} -\item[\begin{rawhtml}<a href="http://www.sqlite.org/">SQLite</a>\end{rawhtml}] tested with v2.8.15. +\item[\begin{rawhtml}<a href="http://www.sqlite.org/">SQLite</a>\end{rawhtml}] + tested with v2.8.17 and v3.3. Supported python adaptor: \begin{rawhtml} Modified: trunk/ProjectModeling/Modeling/doc/HomePage/main.tex =================================================================== --- trunk/ProjectModeling/Modeling/doc/HomePage/main.tex 2006-02-26 17:44:38 UTC (rev 976) +++ trunk/ProjectModeling/Modeling/doc/HomePage/main.tex 2006-02-26 17:48:56 UTC (rev 977) @@ -12,7 +12,7 @@ % snail-mail address if you like. \author{S\'ebastien Bigaret} \email{sbi...@us...} -\date{Feb 22, 2004} +\date{Feb 26, 2006} %\date{\today} \begin{document} Modified: trunk/ProjectModeling/Modeling/doc/HomePage/status.tex =================================================================== --- trunk/ProjectModeling/Modeling/doc/HomePage/status.tex 2006-02-26 17:44:38 UTC (rev 976) +++ trunk/ProjectModeling/Modeling/doc/HomePage/status.tex 2006-02-26 17:48:56 UTC (rev 977) @@ -11,8 +11,7 @@ \begin{description} \item[Example of projects using the framework] -The framework is still considered to be in beta stage (see below), even if -some applications have been in production for some time now, e.g. two +Some applications have been in production for some time now, e.g. two applications by the author that have been in production since november 2002: \begin{enumerate} @@ -42,17 +41,13 @@ We'd be happy to hear about your own projects and deployment experience. -\item[Development status: Beta] +\item[Development status: Production/Stable] -While the framework is stable and used in production, we maintain it in -``beta'' status because of the following reasons. +While the framework is stable and used in production, there is still some +features that miss before v1.0: \begin{itemize} -\item To our knowledge, some particular features have not been used extensively - (apart in the unittests). This concerns: EditingContext.autoInsertion(); - ``manual'' management of many-to-many relationships. - \item There is a lack of functionalities for the sessioning mechanisms , see the following sections in the User's Guide for details: \begin{itemize} @@ -82,15 +77,6 @@ \end{itemize} -\item[Notes on the pre-0.9 series] - -It's been some time since we're stuck in the pre-0.9 series. The reason is -that we once thought that the steps required to reach v0.9 would be easily -passed. But this was too much optimistic; in particular, we still need to -complete the \code{PyModel} dev. branch (where models can be expressed in -pure python rather than xml) and find a better name for the framework before -we reach 0.9. Until then, the pre-0.9 series continues. - \end{description} %% end \input{www/menu-inline-end} Modified: trunk/ProjectModeling/Modeling/doc/README.dynamic.txt =================================================================== --- trunk/ProjectModeling/Modeling/doc/README.dynamic.txt 2006-02-26 17:44:38 UTC (rev 976) +++ trunk/ProjectModeling/Modeling/doc/README.dynamic.txt 2006-02-26 17:48:56 UTC (rev 977) @@ -14,7 +14,7 @@ * method build(model): dynamically build the package derived from the model. The generated package and its modules have the very same functionality as the ones generated by the script - mdl_generate_python_code.py (in "base" mode, option ``-B``). + mdl_generate_python_code.py (in "compact" mode, option ``-C``). * metaclass ``CustomObjectMeta``: automatically adds all the necessary methods to a class for integration with the modeling framework. It Modified: trunk/ProjectModeling/Modeling/doc/UserGuide.tex =================================================================== --- trunk/ProjectModeling/Modeling/doc/UserGuide.tex 2006-02-26 17:44:38 UTC (rev 976) +++ trunk/ProjectModeling/Modeling/doc/UserGuide.tex 2006-02-26 17:48:56 UTC (rev 977) @@ -21,8 +21,8 @@ % Please at least include a long-lived email address; % the rest is at your discretion. \authoraddress{Email: \email{sbi...@us...}} -\date{Feb 22, 2004} -%\date{\today} +%\date{Feb 22, 2004} +\date{\today} \release{0.9-pre-17.1} %\setreleaseinfo{pre-8} \setshortversion{0.9} Modified: trunk/ProjectModeling/Modeling/doc/www/menu-inline-begin.tex =================================================================== --- trunk/ProjectModeling/Modeling/doc/www/menu-inline-begin.tex 2006-02-26 17:44:38 UTC (rev 976) +++ trunk/ProjectModeling/Modeling/doc/www/menu-inline-begin.tex 2006-02-26 17:48:56 UTC (rev 977) @@ -33,8 +33,10 @@ <a href="http://lists.sourceforge.net/lists/listinfo/modeling-users">Mailing list</a><br> <a href="https://sourceforge.net/news/?group_id=58935">News</a><br> <a href="https://sourceforge.net/tracker/?group_id=58935&atid=489335">Bugs</a><br> +<!-- <font color="FF0000">!!! </font><a href="bugs/bug861048.html" target="_new">Bug #861048</a><br> - <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/modeling/">Web CVS</a><br> +--> + <a href="http://svn.sourceforge.net/viewcvs.cgi/modeling/trunk/ProjectModeling/">Web SVN</a><br> <br> <a href="licence.html">Licence</a><br> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-26 17:45:11
|
Revision: 976 Author: sbigaret Date: 2006-02-26 09:44:38 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=976&view=rev Log Message: ----------- Updated license Modified Paths: -------------- trunk/ProjectModeling/LICENSE trunk/ProjectModeling/Modeling/DatabaseAdaptors/LICENSE trunk/ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer/LICENSE trunk/ProjectModeling/Modeling/DatabaseAdaptors/OracleAdaptorLayer/LICENSE trunk/ProjectModeling/Modeling/DatabaseAdaptors/PostgresqlAdaptorLayer/LICENSE trunk/ProjectModeling/Modeling/DatabaseAdaptors/SQLiteAdaptorLayer/LICENSE trunk/ProjectModeling/Modeling/LICENSE trunk/ProjectModeling/Modeling/doc/HomePage/licence.tex trunk/ProjectModeling/Modeling/tests/LICENSE Modified: trunk/ProjectModeling/LICENSE =================================================================== --- trunk/ProjectModeling/LICENSE 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/LICENSE 2006-02-26 17:44:38 UTC (rev 976) @@ -1,6 +1,6 @@ Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/ProjectModeling/Modeling/DatabaseAdaptors/LICENSE =================================================================== --- trunk/ProjectModeling/Modeling/DatabaseAdaptors/LICENSE 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/Modeling/DatabaseAdaptors/LICENSE 2006-02-26 17:44:38 UTC (rev 976) @@ -1,6 +1,6 @@ Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer/LICENSE =================================================================== --- trunk/ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer/LICENSE 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/Modeling/DatabaseAdaptors/MySQLAdaptorLayer/LICENSE 2006-02-26 17:44:38 UTC (rev 976) @@ -1,6 +1,6 @@ Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/ProjectModeling/Modeling/DatabaseAdaptors/OracleAdaptorLayer/LICENSE =================================================================== --- trunk/ProjectModeling/Modeling/DatabaseAdaptors/OracleAdaptorLayer/LICENSE 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/Modeling/DatabaseAdaptors/OracleAdaptorLayer/LICENSE 2006-02-26 17:44:38 UTC (rev 976) @@ -1,6 +1,6 @@ Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/ProjectModeling/Modeling/DatabaseAdaptors/PostgresqlAdaptorLayer/LICENSE =================================================================== --- trunk/ProjectModeling/Modeling/DatabaseAdaptors/PostgresqlAdaptorLayer/LICENSE 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/Modeling/DatabaseAdaptors/PostgresqlAdaptorLayer/LICENSE 2006-02-26 17:44:38 UTC (rev 976) @@ -1,6 +1,6 @@ Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/ProjectModeling/Modeling/DatabaseAdaptors/SQLiteAdaptorLayer/LICENSE =================================================================== --- trunk/ProjectModeling/Modeling/DatabaseAdaptors/SQLiteAdaptorLayer/LICENSE 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/Modeling/DatabaseAdaptors/SQLiteAdaptorLayer/LICENSE 2006-02-26 17:44:38 UTC (rev 976) @@ -1,6 +1,6 @@ Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/ProjectModeling/Modeling/LICENSE =================================================================== --- trunk/ProjectModeling/Modeling/LICENSE 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/Modeling/LICENSE 2006-02-26 17:44:38 UTC (rev 976) @@ -1,6 +1,6 @@ Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/ProjectModeling/Modeling/doc/HomePage/licence.tex =================================================================== --- trunk/ProjectModeling/Modeling/doc/HomePage/licence.tex 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/Modeling/doc/HomePage/licence.tex 2006-02-26 17:44:38 UTC (rev 976) @@ -11,16 +11,17 @@ \begin{rawhtml}<hr noshade>\end{rawhtml} {\sc \bf Important~:} License has changed. All versions released prior to 0.7a5-1 (including 0.7a5-1) were under a BSD-like licence. From 0.8 -(inclusive), the Modeling Framework is released under the GNU General -Public License. +(inclusive) to 0.9-pre-17, the Modeling Framework was released under the GNU +General Public License. From version 0.9, it is distributed under the 3-clause +BSD licence. \begin{rawhtml}<hr noshade>\end{rawhtml} -\section{Versions 0.9pre18 and higher} +\section{Versions 0.9 and higher} \begin{centering} \begin{verbatim} Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without Modified: trunk/ProjectModeling/Modeling/tests/LICENSE =================================================================== --- trunk/ProjectModeling/Modeling/tests/LICENSE 2006-02-26 14:39:05 UTC (rev 975) +++ trunk/ProjectModeling/Modeling/tests/LICENSE 2006-02-26 17:44:38 UTC (rev 976) @@ -1,6 +1,6 @@ Modeling Framework: an Object-Relational Bridge for python -Copyright (c) 2001 - 2004 Sstien Bigaret <sbi...@us...> +Copyright (c) 2001 - 2006 Sstien Bigaret <sbi...@us...> All rights reserved. Redistribution and use in source and binary forms, with or without This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-26 14:39:17
|
Revision: 975 Author: sbigaret Date: 2006-02-26 06:39:05 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=975&view=rev Log Message: ----------- Updated; in particular, new versions of Cheetah are not comptaible w/ py2.1 and py2.2 Modified Paths: -------------- trunk/ProjectModeling/INSTALL Modified: trunk/ProjectModeling/INSTALL =================================================================== --- trunk/ProjectModeling/INSTALL 2006-02-26 14:06:07 UTC (rev 974) +++ trunk/ProjectModeling/INSTALL 2006-02-26 14:39:05 UTC (rev 975) @@ -1,6 +1,6 @@ -------------------------- +========================= Installation Instructions -------------------------- +========================= :Authors: Sstien Bigaret <sbi...@us...> @@ -8,23 +8,22 @@ :Version: $Revision$ ------------- Introduction ------------- +============ The framework depends on four other python packages, plus one or more python adaptors to connect to your database server. Additionally you'll need to have -a running database server (either postgresql, mysql or sqlite) --we do not -cover here the installation of a database server, please refer to their -respective documentation for installation details. +a running database server (either postgresql, mysql or oracle; sqlite does not +need any server) --we do not cover here the installation of a database server, +please refer to their respective documentation for installation details. Unless explicitely stated, all installation can be made by unpacking their source distribution, cd-ing to the unpacked directory and then use the standard python package ``distutils`` with command-line like:: - python2.2 ./setup.py install [--prefix=$HOME] + python ./setup.py install [--prefix=$HOME] You can specify ``--prefix`` if you want to install the packages in an other -location than the standard one (like ``/usr/lib/python2.1/site-packages/``) +location than the standard one. This is what we will call *Installation: standard distutils* in the rest of this document. @@ -37,9 +36,8 @@ python database adaptors, and you'll choose which one(s) you'll install depending on the database server you want to connect to. -------------------- Needed dependencies -------------------- +=================== Modeling Framework ------------------ @@ -54,8 +52,16 @@ => Using the already compiled templates Press ENTER to continue, CTRL-C to abort -Ignore the warning and press ENTER, installation will continue. +- if you're running python 2.1 or python2.2, you **must** install the + appropriate version of Cheetah before continuing; the pre-compiled versions + shipped with the framework are not compatible with cheetah versions running on + py2.1/2.2. + +- otherwise, you can safely ignore the warning and press ENTER, installation + will continue. + + NotificationFramework v0.6 -------------------------- The NotificationFramework can be downloaded from @@ -66,12 +72,16 @@ Cheetah Templates ----------------- +- If you're running python v2.1 or 2.2, you **must** use Cheetah v0.9.15 + +- Otherwise, get the latest cheetah package (v2.0rc6 at the time I write this) + Get it here: http://www.cheetahtemplate.org/ Installation: standard distutils. -eGenix.com mx Extensions for Python v2.0.5 +eGenix.com mx Extensions for Python v2.0.6 ------------------------------------------ Download this from: @@ -98,15 +108,14 @@ ``$HOME/lib/python2.x/site-packages/``). -PyXML v0.8.3 +PyXML v0.8.4 ------------ Obtain your copy of PyXML at http://pyxml.sourceforge.net/ Installation: standard distutils. ------------------- Database specifics ------------------- +================== The rest of the document addresses installation of specific python adaptors. You do not have to install all of them: simply choose at least one @@ -116,7 +125,7 @@ MySQL ----- -The only supported python db-adaptor is MySQL-python v0.9.2. +The only supported python db-adaptor is MySQL-python, currently v1.2.1 You'll find it at: http://sourceforge.net/projects/mysql-python @@ -138,7 +147,7 @@ Three python db-adaptors are supported, Either: -* psycopg v1.1.8, at http://initd.org/software/psycopg +* psycopg, at http://initd.org/software/psycopg Installation: psycopg uses the standard scheme ``./configure && make``. However, depending on your installation, you may need to This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-26 14:06:18
|
Revision: 974 Author: sbigaret Date: 2006-02-26 06:06:07 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=974&view=rev Log Message: ----------- missing encoding Modified Paths: -------------- trunk/ProjectModeling/Modeling/ModelMasons/CMFModelMason.py trunk/ProjectModeling/Modeling/ModelMasons/ModelMason.py trunk/ProjectModeling/Modeling/ModelMasons/PyModelMason.py trunk/ProjectModeling/Modeling/ModelMasons/__init__.py Modified: trunk/ProjectModeling/Modeling/ModelMasons/CMFModelMason.py =================================================================== --- trunk/ProjectModeling/Modeling/ModelMasons/CMFModelMason.py 2006-02-26 13:02:29 UTC (rev 973) +++ trunk/ProjectModeling/Modeling/ModelMasons/CMFModelMason.py 2006-02-26 14:06:07 UTC (rev 974) @@ -1,3 +1,4 @@ +# -*- coding: iso-8859-1 -*- #----------------------------------------------------------------------------- # Modeling Framework: an Object-Relational Bridge for python # Modified: trunk/ProjectModeling/Modeling/ModelMasons/ModelMason.py =================================================================== --- trunk/ProjectModeling/Modeling/ModelMasons/ModelMason.py 2006-02-26 13:02:29 UTC (rev 973) +++ trunk/ProjectModeling/Modeling/ModelMasons/ModelMason.py 2006-02-26 14:06:07 UTC (rev 974) @@ -1,3 +1,4 @@ +# -*- coding: iso-8859-1 -*- #----------------------------------------------------------------------------- # Modeling Framework: an Object-Relational Bridge for python # Modified: trunk/ProjectModeling/Modeling/ModelMasons/PyModelMason.py =================================================================== --- trunk/ProjectModeling/Modeling/ModelMasons/PyModelMason.py 2006-02-26 13:02:29 UTC (rev 973) +++ trunk/ProjectModeling/Modeling/ModelMasons/PyModelMason.py 2006-02-26 14:06:07 UTC (rev 974) @@ -1,3 +1,4 @@ +# -*- coding: iso-8859-1 -*- #----------------------------------------------------------------------------- # Modeling Framework: an Object-Relational Bridge for python # Modified: trunk/ProjectModeling/Modeling/ModelMasons/__init__.py =================================================================== --- trunk/ProjectModeling/Modeling/ModelMasons/__init__.py 2006-02-26 13:02:29 UTC (rev 973) +++ trunk/ProjectModeling/Modeling/ModelMasons/__init__.py 2006-02-26 14:06:07 UTC (rev 974) @@ -1,3 +1,4 @@ +# -*- coding: iso-8859-1 -*- #----------------------------------------------------------------------------- # Modeling Framework: an Object-Relational Bridge for python # This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-26 13:02:41
|
Revision: 973 Author: sbigaret Date: 2006-02-26 05:02:29 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=973&view=rev Log Message: ----------- Updated + ticket #1041371 Modified Paths: -------------- trunk/ProjectModeling/Modeling/tests/README Modified: trunk/ProjectModeling/Modeling/tests/README =================================================================== --- trunk/ProjectModeling/Modeling/tests/README 2006-02-26 01:27:05 UTC (rev 972) +++ trunk/ProjectModeling/Modeling/tests/README 2006-02-26 13:02:29 UTC (rev 973) @@ -8,40 +8,41 @@ ============================================= Pre-conditions: -- a PostgreSQL or MySQL or SQLite database server must be running somewhere -- you modify either ./Postgresql.cfg or MySQL.cfg SQLite.cfg to reflect your - own database installation +- a PostgreSQL or MySQL or Oracle database server must be running somewhere + (SQLite needs no server) +- you modify either ./Postgresql.cfg, MySQL.cfg, SQLite.cfg or Oracle.cfg to + reflect your own database installation - two different[3] databases (may be empty) with names: "AUTHOR_BOOKS" & "STORE_EMPLOYEES" + Note that these test-DBs should use a Latin1 encoding. ============================================= -To run the tests: +To run the tests:: -cd <unpacked Modeling package>/Modeling/tests + cd <unpacked Modeling package>/Modeling/tests + + python ./run.py # preliminary test (no db needed), -h for usage + + # NOTE: the following three test_EditingContext_*.py testsuites + # accept a '-d' option to specify the database: + # '-d Postgresql' (default) (configuration: Postgresql.cfg) + # '-d MySQL', (configuration: MySQL.cfg) + # '-d SQLite'. + + python ./test_EditingContext_Global.py -r # init test db [1][2] (./testPackages/AuthorBooks) + python ./test_EditingContext_Global.py + python ./test_EditingContext.py + + python ./test_EditingContext_Global_Inheritance.py -r # init test db (./testPackages/StoreEmployees) + python ./test_EditingContext_Global_Inheritance.py + + python ./test_EditingContext_ParentChild.py + + python ./test_AdaptorLayer.py # requires 'test_EditingContext_Global.py -r', above + + sh ./test_generate_python_code.sh # tests script mdl_generate_python_code.py -python ./run.py # preliminary test (no db needed), -h for usage - -# NOTE: the following three test_EditingContext_*.py testsuites -# accept a '-d' option to specify the database: -# '-d Postgresql' (default) (configuration: Postgresql.cfg) -# '-d MySQL', (configuration: MySQL.cfg) -# '-d SQLite'. - -python ./test_EditingContext_Global.py -r # init test db [1][2] (./testPackages/AuthorBooks) -python ./test_EditingContext_Global.py -python ./test_EditingContext.py - -python ./test_EditingContext_Global_Inheritance.py -r # init test db (./testPackages/StoreEmployees) -python ./test_EditingContext_Global_Inheritance.py - -python ./test_EditingContext_ParentChild.py - -python ./test_AdaptorLayer.py # requires 'test_EditingContext_Global.py -r', above - -sh ./test_generate_python_code.sh # tests script mdl_generate_python_code.py - ============================================= -============================================= Notes: [1] Note that, the first time this script is run on an empty database, it is @@ -58,8 +59,11 @@ [3] Quick hint: Postgresql: % psql template1 - template1=# CREATE DATABASE "AUTHOR_BOOKS"; + template1=# CREATE DATABASE "AUTHOR_BOOKS" ENCODING 'LATIN1'; MySQL: % mysqladmin create "AUTHOR_BOOKS" + and, if your mysql supports it: + % mysql -u root -D AUTHOR_BOOKS \ + -e 'ALTER DATABASE AUTHOR_BOOKS DEFAULT CHARACTER SET latin1' ============================================= \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-26 01:27:21
|
Revision: 972 Author: sbigaret Date: 2006-02-25 17:27:05 -0800 (Sat, 25 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=972&view=rev Log Message: ----------- Fixed bug #918115: tests were failing under py2.1 w/ ZODB was installed, plus: relationships equality was not behaving as expected under py2.1 and 2.2, because these versions of python use __cmp__ rather than __eq__ Modified Paths: -------------- trunk/ProjectModeling/CHANGES trunk/ProjectModeling/Modeling/ChangeLog trunk/ProjectModeling/Modeling/Relationship.py trunk/ProjectModeling/Modeling/tests/test_Relationship.py Modified: trunk/ProjectModeling/CHANGES =================================================================== --- trunk/ProjectModeling/CHANGES 2006-02-25 23:49:51 UTC (rev 971) +++ trunk/ProjectModeling/CHANGES 2006-02-26 01:27:05 UTC (rev 972) @@ -9,6 +9,10 @@ * Now distributed under a 3-clause BSD-style license, see LICENSE for details + * Fixed bug #918115: tests were failing under py2.1 w/ ZODB was installed, + plus: relationships equality was not behaving as expected under py2.1 and + 2.2, because these versions of python use __cmp__ rather than __eq__ + * Fixed: Attribute.convertStringToAttributeType() failed when python db-adapters, such as mysqldb, already return values under the a date type Modified: trunk/ProjectModeling/Modeling/ChangeLog =================================================================== --- trunk/ProjectModeling/Modeling/ChangeLog 2006-02-25 23:49:51 UTC (rev 971) +++ trunk/ProjectModeling/Modeling/ChangeLog 2006-02-26 01:27:05 UTC (rev 972) @@ -1,3 +1,10 @@ +2006-02-26 Sebastien Bigaret <Seb...@en...> + + * Relationship.py (Relationship.__cmp__): added for py2.1 and 2.2, + or equality is not correcty handled (bug #918115) + * utils.py (cache_simple_methods): disabled under py2.1 when ZODB + is installed (bug #918115) + 2006-02-25 Sebastien Bigaret <Seb...@en...> * Attribute.py (date_types): added python date and datetime types Modified: trunk/ProjectModeling/Modeling/Relationship.py =================================================================== --- trunk/ProjectModeling/Modeling/Relationship.py 2006-02-25 23:49:51 UTC (rev 971) +++ trunk/ProjectModeling/Modeling/Relationship.py 2006-02-26 01:27:05 UTC (rev 972) @@ -227,6 +227,12 @@ def __ne__(self, aRelationship): # See test_Relationship.test_00_equality_n_inequality() for details return not self.__eq__(aRelationship) + + import sys + if sys.version_info < (2,3): + def __cmp__(self, r): + return not self.__eq__(r) + # XMLCapabilityInterface def initWithXMLDOMNode(self, aNode, encoding='iso-8859-1'): Modified: trunk/ProjectModeling/Modeling/tests/test_Relationship.py =================================================================== --- trunk/ProjectModeling/Modeling/tests/test_Relationship.py 2006-02-25 23:49:51 UTC (rev 971) +++ trunk/ProjectModeling/Modeling/tests/test_Relationship.py 2006-02-26 01:27:05 UTC (rev 972) @@ -16,13 +16,13 @@ from __future__ import nested_scopes -import unittest +import unittest, sys if __name__ == "__main__": - import utils, sys + import utils utils.disable_model_cache() utils.fixpath() -from Modeling import ModelSet +from Modeling import ModelSet, Relationship import StoreEmployees # load the model @@ -46,11 +46,22 @@ # v2.2 both of which were defaulting to identity comparison for '!=' # when __ne__ was undefined (despite the fact that __eq__ was defined). # python2.3 operator '!=' takes '__eq__' into account and that revealed - # both the bug and the fact that py2.1 and 2.2 + # both the bug and the fact that py2.1 and 2.2 rely on __cmp__ instead of + # __eq__ rel_ab=model.entityNamed('A').relationshipNamed('toB') rel_ac=model.entityNamed('A').relationshipNamed('toCs') + import copy - rel_abb=copy.copy(rel_ab) # same, different id() + if sys.version_info < (2,3): + # simulates copy, because it fails if ZODB is installed (because of + # extension class) + rel_abb=Relationship.SimpleRelationship('toB') + for k in rel_ab.__dict__.keys(): + setattr(rel_abb, k, getattr(rel_ab, k)) + else: + rel_abb = copy.copy(rel_ab) + + self.assertNotEqual(id(rel_ab), id(rel_abb)) self.failUnless(rel_ab==rel_ab, "rel==rel fails") self.failUnless(rel_ab==rel_abb, "rel==copy(rel) fails") self.failUnless(not rel_ab!=rel_ab, "rel!=rel fails") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-25 23:50:04
|
Revision: 971 Author: sbigaret Date: 2006-02-25 15:49:51 -0800 (Sat, 25 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=971&view=rev Log Message: ----------- Few comments added Modified Paths: -------------- trunk/ProjectModeling/Modeling/tests/tests.sh Modified: trunk/ProjectModeling/Modeling/tests/tests.sh =================================================================== --- trunk/ProjectModeling/Modeling/tests/tests.sh 2006-02-25 23:47:54 UTC (rev 970) +++ trunk/ProjectModeling/Modeling/tests/tests.sh 2006-02-25 23:49:51 UTC (rev 971) @@ -1,4 +1,11 @@ #! /bin/bash +# +# This scripts runs all available tests on python 2.1, 2.2, 2.3 and 2.4, +# testing all possible database backends: +# MySQL, Oracle (8i and 9i), Postgresql and SQLite. +# +# Adapt to your needs! +# PYTHON21=python2.1 PYTHON21PATH="/home/big/lib/python2.1:/home/big/lib/python2.1/site-packages:/usr/lib/python2.1:/usr/lib/python2.1/site-packages" @@ -9,12 +16,13 @@ PYTHON24=python2.4 PYTHON24PATH="/home/big/lib/python2.4:/home/big/lib/python2.4/site-packages" -PYTHON=$PYTHON21 function execute() { echo $* $PYTHON -W 'ignore::RuntimeWarning::' $* #2>/dev/null } +# DCOracle2 is compiled for oracle 8i AND 9i w/ every versions of python, +# and the corresponding py/c extension dco2.so is stored as dco2.9i.so or dco2.9i.so function oracle8i() { ORACLE_HOME=/home/u01/app/oracle/product/8.1.7; export ORACLE_HOME cp ~/lib/python2.1/site-packages/dco2.8i.so ~/lib/python2.1/site-packages/dco2.so @@ -79,6 +87,7 @@ echo "------------------------------------------------------------------------" echo "Python2.1" +PYTHON=$PYTHON21 unset PYTHONPATH; declare -x PYTHONPATH=$PYTHON21PATH run_tests This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-25 23:48:06
|
Revision: 970 Author: sbigaret Date: 2006-02-25 15:47:54 -0800 (Sat, 25 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=970&view=rev Log Message: ----------- Added Added Paths: ----------- trunk/ProjectModeling/Modeling/tests/tests.sh Added: trunk/ProjectModeling/Modeling/tests/tests.sh =================================================================== --- trunk/ProjectModeling/Modeling/tests/tests.sh (rev 0) +++ trunk/ProjectModeling/Modeling/tests/tests.sh 2006-02-25 23:47:54 UTC (rev 970) @@ -0,0 +1,112 @@ +#! /bin/bash + +PYTHON21=python2.1 +PYTHON21PATH="/home/big/lib/python2.1:/home/big/lib/python2.1/site-packages:/usr/lib/python2.1:/usr/lib/python2.1/site-packages" +PYTHON22=python2.2 +PYTHON22PATH="/home/big/lib/python2.2:/home/big/lib/python2.2/site-packages" +PYTHON23=python2.3 +PYTHON23PATH="/home/big/lib/python2.3:/home/big/lib/python2.3/site-packages" +PYTHON24=python2.4 +PYTHON24PATH="/home/big/lib/python2.4:/home/big/lib/python2.4/site-packages" + +PYTHON=$PYTHON21 +function execute() { + echo $* + $PYTHON -W 'ignore::RuntimeWarning::' $* #2>/dev/null +} + +function oracle8i() { + ORACLE_HOME=/home/u01/app/oracle/product/8.1.7; export ORACLE_HOME + cp ~/lib/python2.1/site-packages/dco2.8i.so ~/lib/python2.1/site-packages/dco2.so + cp ~/lib/python2.2/site-packages/dco2.8i.so ~/lib/python2.2/site-packages/dco2.so + cp ~/lib/python2.3/site-packages/dco2.8i.so ~/lib/python2.3/site-packages/dco2.so + cp ~/lib/python2.4/site-packages/dco2.8i.so ~/lib/python2.4/site-packages/dco2.so + \rm Oracle.cfg + ln -s Oracle8i.cfg Oracle.cfg + export MDL_ORACLE_SERVER_VERSION="8i" +} + +function oracle9i() { + export ORACLE_BASE=/home/oracle + export ORACLE_HOME=$ORACLE_BASE/OraHome + cp ~/lib/python2.1/site-packages/dco2.9i.so ~/lib/python2.1/site-packages/dco2.so + cp ~/lib/python2.2/site-packages/dco2.9i.so ~/lib/python2.2/site-packages/dco2.so + cp ~/lib/python2.3/site-packages/dco2.9i.so ~/lib/python2.3/site-packages/dco2.so + cp ~/lib/python2.4/site-packages/dco2.9i.so ~/lib/python2.4/site-packages/dco2.so + \rm Oracle.cfg + ln -s Oracle9i.cfg Oracle.cfg + export MDL_ORACLE_SERVER_VERSION="9i" +} + +function run_tests() { + execute ./run.py + + # Regenerate test DBs + execute ./test_EditingContext_Global.py -d Postgresql -r + execute ./test_EditingContext_Global.py -d MySQL -r + oracle8i ; execute ./test_EditingContext_Global.py -d Oracle -r + oracle9i ; execute ./test_EditingContext_Global.py -d Oracle -r + execute ./test_EditingContext_Global.py -d SQLite -r + + execute ./test_EditingContext_Global_Inheritance.py -d Postgresql -r + execute ./test_EditingContext_Global_Inheritance.py -d MySQL -r + oracle8i ; execute ./test_EditingContext_Global_Inheritance.py -d Oracle -r + oracle9i ; execute ./test_EditingContext_Global_Inheritance.py -d Oracle -r + execute ./test_EditingContext_Global_Inheritance.py -d SQLite -r + + # EC global + execute ./test_EditingContext_Global.py -d Postgresql + execute ./test_EditingContext_Global.py -d MySQL + oracle8i ; execute ./test_EditingContext_Global.py -d Oracle + oracle9i ; execute ./test_EditingContext_Global.py -d Oracle + execute ./test_EditingContext_Global.py -d SQLite + + # EC global inheritance + execute ./test_EditingContext_Global_Inheritance.py -d Postgresql + execute ./test_EditingContext_Global_Inheritance.py -d MySQL + oracle8i ; execute ./test_EditingContext_Global_Inheritance.py -d Oracle + oracle9i ; execute ./test_EditingContext_Global_Inheritance.py -d Oracle + execute ./test_EditingContext_Global_Inheritance.py -d SQLite + + # Nested EC + execute ./test_EditingContext_ParentChild.py -d Postgresql + execute ./test_EditingContext_ParentChild.py -d MySQL + oracle8i ; execute ./test_EditingContext_ParentChild.py -d Oracle + oracle9i ; execute ./test_EditingContext_ParentChild.py -d Oracle + execute ./test_EditingContext_ParentChild.py -d SQLite +} + + +echo "------------------------------------------------------------------------" +echo "Python2.1" +unset PYTHONPATH; declare -x PYTHONPATH=$PYTHON21PATH + +run_tests + +# ------------------------------------------------------------------------ + +echo "------------------------------------------------------------------------" +echo "Python2.2" +PYTHON=$PYTHON22 +unset PYTHONPATH; declare -x PYTHONPATH=$PYTHON22PATH + +run_tests + +# ------------------------------------------------------------------------ +echo "------------------------------------------------------------------------" +echo "Python2.3" +PYTHON=$PYTHON23 +unset PYTHONPATH; declare -x PYTHONPATH=$PYTHON23PATH + +run_tests + + +# ------------------------------------------------------------------------ +echo "------------------------------------------------------------------------" +echo "Python2.4" +PYTHON=$PYTHON24 +unset PYTHONPATH; declare -x PYTHONPATH=$PYTHON24PATH + +run_tests + + Property changes on: trunk/ProjectModeling/Modeling/tests/tests.sh ___________________________________________________________________ Name: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sbi...@us...> - 2006-02-25 23:15:16
|
Revision: 969 Author: sbigaret Date: 2006-02-25 15:15:05 -0800 (Sat, 25 Feb 2006) ViewCVS: http://svn.sourceforge.net/modeling/?rev=969&view=rev Log Message: ----------- True & False do not exist in py2.1 Modified Paths: -------------- trunk/ProjectModeling/Modeling/DatabaseChannel.py Modified: trunk/ProjectModeling/Modeling/DatabaseChannel.py =================================================================== --- trunk/ProjectModeling/Modeling/DatabaseChannel.py 2006-02-25 15:46:25 UTC (rev 968) +++ trunk/ProjectModeling/Modeling/DatabaseChannel.py 2006-02-25 23:15:05 UTC (rev 969) @@ -188,7 +188,7 @@ # DBContext.initializeObject() raises KeyError on the corresp. GlobalID # since the corresponding snapshot has been thrown away. # - snapshot_refcount_incremented = False + snapshot_refcount_incremented = 0 database.lock() try: # Handle snapshot @@ -262,7 +262,7 @@ database.incrementSnapshotCountForGlobalID(globalID) - snapshot_refcount_incremented = True + snapshot_refcount_incremented = 1 finally: database.unlock() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Sebastien B. <sbi...@us...> - 2006-02-25 15:46:31
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15451/Modeling Modified Files: ChangeLog Attribute.py Log Message: Fixed: Attribute.convertStringToAttributeType() failed when python db-adapters, such as mysqldb, already return values under the a date type Index: Attribute.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/Attribute.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Attribute.py 20 Jul 2004 06:21:36 -0000 1.23 --- Attribute.py 25 Feb 2006 15:46:25 -0000 1.24 *************** *** 72,75 **** --- 72,82 ---- except ImportError: pass + try: + from time import localtime + from datetime import date, datetime + avail_types.append( type(datetime(*localtime(0)[:3])) ) + avail_types.append( type(date(*localtime(0)[:3])) ) + except ImportError: + pass return avail_types *************** *** 363,370 **** # if type(_tmp)!=types.TupleType: raise ValueError # return _tmp ! if self.type()=='DateTime': return DateFrom(aValue) ! except ValueError, TypeError: raise ModelError, \ ! "Invalid default value ('%s') for attribute '%s' type '%s' "%(aValue, self._name,self.type()) def setScale(self, scale): --- 370,382 ---- # if type(_tmp)!=types.TupleType: raise ValueError # return _tmp ! if self.type()=='DateTime': ! if type(aValue) not in date_types(): ! # Some python db-adapters, such as MySQLdb, already return the ! # appropriate type ! return DateFrom(aValue) ! return aValue ! except (ValueError, TypeError): raise ModelError, \ ! "Invalid value ('%s') for attribute '%s' type '%s' "%(aValue, self._name,self.type()) def setScale(self, scale): *************** *** 536,540 **** return _entity.name()+'.'+self.name() else: ! return None ## XML --- 548,552 ---- return _entity.name()+'.'+self.name() else: ! return "" ## XML Index: ChangeLog =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ChangeLog,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ChangeLog 25 Feb 2006 13:26:05 -0000 1.9 --- ChangeLog 25 Feb 2006 15:46:25 -0000 1.10 *************** *** 1,4 **** --- 1,10 ---- 2006-02-25 Sebastien Bigaret <Seb...@en...> + * Attribute.py (date_types): added python date and datetime types + when available + (Attribute.convertStringToAttributeType): failed when python + db-adapters, such as mysqldb, already return values under a date + type + * DatabaseContext (DatabaseContext methods: availableChannel, hasBusyChannels, performChanges, prepareForSaveWithCoordinator, |
From: Sebastien B. <sbi...@us...> - 2006-02-25 15:46:29
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15451/Modeling/tests Modified Files: test_EditingContext_Global_Inheritance.py Log Message: Fixed: Attribute.convertStringToAttributeType() failed when python db-adapters, such as mysqldb, already return values under the a date type Index: test_EditingContext_Global_Inheritance.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/tests/test_EditingContext_Global_Inheritance.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** test_EditingContext_Global_Inheritance.py 20 Jul 2004 06:21:57 -0000 1.25 --- test_EditingContext_Global_Inheritance.py 25 Feb 2006 15:46:25 -0000 1.26 *************** *** 621,626 **** self.assertEqual(len(emp2.getHolidays()), 1) h2b=emp2.getHolidays()[0] ! self.assertEqual(sd2, h2b.getStartDate()) ! self.assertEqual(ed2, h2b.getEndDate()) #print db.snapshotForGlobalID(h_gid) --- 621,635 ---- self.assertEqual(len(emp2.getHolidays()), 1) h2b=emp2.getHolidays()[0] ! ! # the fetched value may be of a different type (python's datetime), ! # if returned as such by the python db-adapter (mysqldb e.g.) ! if getattr(h2b.getStartDate(),'isoformat',None): ! self.assertEqual(sd2.Format('%Y-%m-%dT%H:%M:%S'), ! h2b.getStartDate().isoformat()) ! self.assertEqual(ed2.Format('%Y-%m-%dT%H:%M:%S'), ! h2b.getEndDate().isoformat()) ! else: ! self.assertEqual(sd2, h2b.getStartDate()) ! self.assertEqual(ed2, h2b.getEndDate()) #print db.snapshotForGlobalID(h_gid) |
From: Sebastien B. <sbi...@us...> - 2006-02-25 15:46:28
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15451 Modified Files: CHANGES Log Message: Fixed: Attribute.convertStringToAttributeType() failed when python db-adapters, such as mysqldb, already return values under the a date type Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** CHANGES 25 Feb 2006 13:26:04 -0000 1.67 --- CHANGES 25 Feb 2006 15:46:25 -0000 1.68 *************** *** 10,13 **** --- 10,16 ---- * Now distributed under a 3-clause BSD-style license, see LICENSE for details + * Fixed: Attribute.convertStringToAttributeType() failed when python + db-adapters, such as mysqldb, already return values under the a date type + * Fixed a serious problem occuring in multi-threaded environment: unexpected failures happened when an EC was fetching objects while another |
From: Sebastien B. <sbi...@us...> - 2006-02-25 13:26:20
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18800/Modeling Modified Files: DatabaseContext.py ChangeLog Log Message: * Fixed a serious problem occuring in multi-threaded environment: unexpected failures happened when an EC was fetching objects while another had a faulted object which was concurrently fetching its own values. Index: DatabaseContext.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseContext.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** DatabaseContext.py 20 Jul 2004 06:21:36 -0000 1.22 --- DatabaseContext.py 25 Feb 2006 13:26:05 -0000 1.23 *************** *** 234,238 **** # the userInfo dictionary for this notification is assumed to hold only # one row ! entity_name=aNotification.userInfo().values()[0].entityName() from ModelSet import defaultModelSet model=defaultModelSet().modelForEntityNamed(entity_name) --- 234,240 ---- # the userInfo dictionary for this notification is assumed to hold only # one row ! entity_name=aNotification.userInfo().get('entityName') \ ! or aNotification.userInfo().values()[0].entityName() ! # TBD: fix docstring and doc. itself from ModelSet import defaultModelSet model=defaultModelSet().modelForEntityNamed(entity_name) *************** *** 321,335 **** DatabaseChannel.isFetchInProgress() """ ! for channel in self._channels: ! if not channel.isFetchInProgress(): ! return channel ! NC.postNotification(DatabaseChannelNeededNotification, self) ! for channel in self._channels: ! if not channel.isFetchInProgress(): ! return channel ! # None registered, let's create one ! channel=DatabaseChannel(self) ! self.registerChannel(channel) ! return channel def batchFetchRelationship(self, aRelationship, objects, anEditingContext): --- 323,341 ---- DatabaseChannel.isFetchInProgress() """ ! self.lock() ! try: ! for channel in self._channels: ! if not channel.isFetchInProgress(): ! return channel ! NC.postNotification(DatabaseChannelNeededNotification, self) ! for channel in self._channels: ! if not channel.isFetchInProgress(): ! return channel ! # None registered, let's create one ! channel=DatabaseChannel(self) ! self.registerChannel(channel) ! return channel ! finally: ! self.unlock() def batchFetchRelationship(self, aRelationship, objects, anEditingContext): *************** *** 477,485 **** See also: DatabaseChannel.isFetchInProgress() """ ! for channel in self._channels: ! if channel.isFetchInProgress(): ! return 1 ! return 0 ! def localSnapshotForGlobalID(self, aGlobalID): """ --- 483,495 ---- See also: DatabaseChannel.isFetchInProgress() """ ! self.lock() ! try: ! for channel in self._channels: ! if channel.isFetchInProgress(): ! return 1 ! return 0 ! finally: ! self.unlock() ! def localSnapshotForGlobalID(self, aGlobalID): """ *************** *** 859,862 **** --- 869,886 ---- return 0 + def ownsEntityName(self, entityName): + """ + Tells whether the DatabaseContext is responsible for the objects of the + supplied entity. Namely: if the entity is registered in the entities set + managed by the dbContext.database() + """ + try: + # will fail if aGlobalID has no method entityName (TemporaryGlobalID) + if self._database.entityNamed(entityName): + return 1 + except: + pass + return 0 + def ownsGlobalID(self, aGlobalID): """ *************** *** 907,948 **** raise RuntimeError, "Invalid state: DatabaseContext isn't saving changes" ! self.__channel=self.availableChannel().adaptorChannel() ! if self.__channel is None: ! raise RuntimeError, 'Unable to find an available AdaptorChannel' ! self.__channel.adaptorContext().beginTransaction() ! ! _adaptorOperations=[] ! trace('performChanges: dbOps: %s'%self._dbOperations) ! #import pprint ! #pprint.pprint(self._dbOperations) ! ! for dbOp in self._dbOperations: ! # Simple: No locking, just operations ! _adOps = self.__databaseOperationToAdaptorOperations(dbOp) ! if not _adOps: ! pass ! # Note: the following statement was initially coded: ! #self.forgetSnapshotForGlobalID(dbOp.globalID()) ! # meaning: if the object was marked as updated but, in fact, no changes ! # needs to be forwarded to the database, then we simply discard the ! # update and forget the snapshots. Seems Ok... ! # BUT: this leads to a buggy behaviour when an object has been marked ! # as updated because at least one of its toMany-relationships-related ! # objects as been removed (and possibly deleted): sure, since the ! # information about that dropped relationship is stored in the ! # destination object (in the FK), there is no changes to forward to ! # the database as far as the source object (=self) is concerned. ! # However, if we forget the snapshots about that object, the ! # Database's snapshotForSourceGlobalID() will not be updated and will ! # be out of sync. ! # cf. test_EditingContext_Global.test_16_toManySnapshotsUpdated() ! else: ! _adaptorOperations += _adOps ! # order dbOperations NB: __TBD delegate ! _adaptorOperations.sort() ! trace("adaptorOperations: %s"%str(_adaptorOperations)) ! #import pdb ; pdb.set_trace() ! self.__channel.performAdaptorOperations(_adaptorOperations) ! def __databaseOperationToAdaptorOperations(self, databaseOperation): """ --- 931,976 ---- raise RuntimeError, "Invalid state: DatabaseContext isn't saving changes" ! self.lock() ! try: ! self.__channel=self.availableChannel().adaptorChannel() ! if self.__channel is None: ! raise RuntimeError, 'Unable to find an available AdaptorChannel' ! self.__channel.adaptorContext().beginTransaction() ! ! _adaptorOperations=[] ! trace('performChanges: dbOps: %s'%self._dbOperations) ! #import pprint ! #pprint.pprint(self._dbOperations) ! ! for dbOp in self._dbOperations: ! # Simple: No locking, just operations ! _adOps = self.__databaseOperationToAdaptorOperations(dbOp) ! if not _adOps: ! pass ! # Note: the following statement was initially coded: ! #self.forgetSnapshotForGlobalID(dbOp.globalID()) ! # meaning: if the object was marked as updated but, in fact, no changes ! # needs to be forwarded to the database, then we simply discard the ! # update and forget the snapshots. Seems Ok... ! # BUT: this leads to a buggy behaviour when an object has been marked ! # as updated because at least one of its toMany-relationships-related ! # objects as been removed (and possibly deleted): sure, since the ! # information about that dropped relationship is stored in the ! # destination object (in the FK), there is no changes to forward to ! # the database as far as the source object (=self) is concerned. ! # However, if we forget the snapshots about that object, the ! # Database's snapshotForSourceGlobalID() will not be updated and will ! # be out of sync. ! # cf. test_EditingContext_Global.test_16_toManySnapshotsUpdated() ! else: ! _adaptorOperations += _adOps ! # order dbOperations NB: __TBD delegate ! _adaptorOperations.sort() ! trace("adaptorOperations: %s"%str(_adaptorOperations)) ! #import pdb ; pdb.set_trace() ! self.__channel.performAdaptorOperations(_adaptorOperations) ! finally: ! self.unlock() ! def __databaseOperationToAdaptorOperations(self, databaseOperation): """ *************** *** 1041,1053 **** # this could be made more efficient if PKs were asked within a single # round-trip to the DB ! channel=self.availableChannel().adaptorChannel() ! for gID in self._inserted_gIDs: ! entity=ec.objectForGlobalID(gID).classDescription().entity() ! pk=channel.primaryKeysForNewRowsWithEntity(1, entity) ! self._pks_for_inserted_gIDs[gID]=pk[0] ! ! newGid=KeyGlobalID(entity.name(), self._pks_for_inserted_gIDs[gID]) ! self.__temporaryGID_to_KeyGlobalID[gID]=newGid ! def _recordChangesInEditingContext(self, gID, obj, dbOperator): """ --- 1069,1085 ---- # this could be made more efficient if PKs were asked within a single # round-trip to the DB ! self.lock() ! try: ! channel=self.availableChannel().adaptorChannel() ! for gID in self._inserted_gIDs: ! entity=ec.objectForGlobalID(gID).classDescription().entity() ! pk=channel.primaryKeysForNewRowsWithEntity(1, entity) ! self._pks_for_inserted_gIDs[gID]=pk[0] ! ! newGid=KeyGlobalID(entity.name(), self._pks_for_inserted_gIDs[gID]) ! self.__temporaryGID_to_KeyGlobalID[gID]=newGid ! finally: ! self.unlock() ! def _recordChangesInEditingContext(self, gID, obj, dbOperator): """ *************** *** 1741,1745 **** See also: DatabaseChannel.selectCountObjectsWithFetchSpecification() """ - channel=self.availableChannel() entitiesNames=[aFetchSpec.entityName()] if aFetchSpec.isDeep(): --- 1773,1776 ---- *************** *** 1750,1760 **** objects=[] ! count=0 for entityName in entitiesNames: aFetchSpec.setEntityName(entityName) - c=channel.selectCountObjectsWithFetchSpecification(aFetchSpec, - anEditingContext) - count+=int(c) # SQLite return count --- 1781,1797 ---- objects=[] ! count=c=0 for entityName in entitiesNames: aFetchSpec.setEntityName(entityName) + self.lock() + try: + channel=self.availableChannel() + c=channel.selectCountObjectsWithFetchSpecification(aFetchSpec, + anEditingContext) + finally: + self.unlock() + count+=int(c) # SQLite + return count *************** *** 1789,1793 **** """ - channel=self.availableChannel() entitiesNames=[aFetchSpec.entityName()] if aFetchSpec.isDeep(): --- 1826,1829 ---- *************** *** 1802,1807 **** for entityName in entitiesNames: aFetchSpec.setEntityName(entityName) ! channel.selectObjectsWithFetchSpecification(aFetchSpec, ! anEditingContext) object=channel.fetchObject() while object: --- 1838,1850 ---- for entityName in entitiesNames: aFetchSpec.setEntityName(entityName) ! ! self.lock() ! try: ! channel=self.availableChannel() ! channel.selectObjectsWithFetchSpecification(aFetchSpec, ! anEditingContext) ! finally: ! self.unlock() ! object=channel.fetchObject() while object: *************** *** 1812,1816 **** aFetchSpec.setEntityName(original_entity_name) return objects ! def refaultObject(self, aDatabaseObject, aGlobalID, anEditingContext): """ --- 1855,1859 ---- aFetchSpec.setEntityName(original_entity_name) return objects ! def refaultObject(self, aDatabaseObject, aGlobalID, anEditingContext): """ Index: ChangeLog =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ChangeLog,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ChangeLog 25 Feb 2006 13:08:08 -0000 1.8 --- ChangeLog 25 Feb 2006 13:26:05 -0000 1.9 *************** *** 1,4 **** --- 1,12 ---- 2006-02-25 Sebastien Bigaret <Seb...@en...> + * DatabaseContext (DatabaseContext methods: availableChannel, + hasBusyChannels, performChanges, prepareForSaveWithCoordinator, + objectsCountWithFetchSpecification, + objectsWithFetchSpecification): + modified to fix "random" failures when EC.fetch() and clearing + fault were concurrently fetching values (MT environment only) + + * DatabaseContext.py (DatabaseContext.ownsEntityName): added * ObjectStoreCoordinator.py (ObjectStoreCoordinator.objectStoreForEntityName): added |
From: Sebastien B. <sbi...@us...> - 2006-02-25 13:26:16
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18800 Modified Files: CHANGES Log Message: * Fixed a serious problem occuring in multi-threaded environment: unexpected failures happened when an EC was fetching objects while another had a faulted object which was concurrently fetching its own values. Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** CHANGES 25 Feb 2006 13:04:11 -0000 1.66 --- CHANGES 25 Feb 2006 13:26:04 -0000 1.67 *************** *** 10,13 **** --- 10,17 ---- * Now distributed under a 3-clause BSD-style license, see LICENSE for details + * Fixed a serious problem occuring in multi-threaded environment: + unexpected failures happened when an EC was fetching objects while another + had a faulted object which was concurrently fetching its own values. + * Fixed: DatabaseChannel.fetchObject(): it was possible for a snapshot to be cleared from the cache while initializeObject() was in progress (this |
From: Sebastien B. <sbi...@us...> - 2006-02-25 13:08:20
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10624 Modified Files: ChangeLog ObjectStoreCoordinator.py Log Message: ObjectStoreCoordinator.objectStoreForEntityName(): added Index: ObjectStoreCoordinator.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ObjectStoreCoordinator.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ObjectStoreCoordinator.py 20 Jul 2004 06:21:37 -0000 1.14 --- ObjectStoreCoordinator.py 25 Feb 2006 13:08:08 -0000 1.15 *************** *** 243,246 **** --- 243,283 ---- self.unlock() + def _objectStoreForEntityName(self, entityName): + """ + Private method returning the 1st cooperating store answering positively + to message `ownsEntityName`. Called by `objectStoreForEntityName`. + + Note: This method does not lock self. Do not call this by hand in a + multi-threaded env. + + """ + for store in self._cooperatingObjectStores: + if store.ownsEntityName(entityName): + return store + return None + + def objectStoreForEntityName(self, entityName): + """ + Iterates on objectStores and returns the first one who answers positively + to message 'ownsEntityName' + + Posts 'CooperatingObjectStoreNeeded' in case no store can be found at + first glance, so that listeners get a chance to register an adequate + 'CooperatingObjectStore' ; then the requested 'ObjectStore' is returned, + or 'None' if it still cannot be found. + """ + self.lock() + try: + store=self._objectStoreForEntityName(entityName) + if store is not None: + return store + # We need one, let the observers have a chance to register it + NC.postNotification(CooperatingObjectStoreNeededNotification, + self, + {'entityName': entityName}) + return self._objectStoreForEntityName(entityName) + finally: + self.unlock() + def _objectStoreForGlobalID(self, aGlobalID): """ Index: ChangeLog =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ChangeLog,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ChangeLog 3 May 2005 15:12:05 -0000 1.7 --- ChangeLog 25 Feb 2006 13:08:08 -0000 1.8 *************** *** 1,2 **** --- 1,7 ---- + 2006-02-25 Sebastien Bigaret <Seb...@en...> + + * ObjectStoreCoordinator.py + (ObjectStoreCoordinator.objectStoreForEntityName): added + 2005-05-03 Sebastien Bigaret <sbi...@us...> |
From: Sebastien B. <sbi...@us...> - 2006-02-25 13:04:14
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8450 Modified Files: CHANGES Log Message: Updated Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** CHANGES 25 Feb 2006 12:32:32 -0000 1.65 --- CHANGES 25 Feb 2006 13:04:11 -0000 1.66 *************** *** 10,13 **** --- 10,21 ---- * Now distributed under a 3-clause BSD-style license, see LICENSE for details + * Fixed: DatabaseChannel.fetchObject(): it was possible for a snapshot to + be cleared from the cache while initializeObject() was in progress (this + could happen when another EC was garbage-collected in another thread e.g.) + This happened because at this point, the database's lock is released. To + prevent the problem, the snapshot's count is incremented before releasing + the database's lock, and decremented only after initialzeObject() has + returned. + * Documentation: added full documentation concerning: |
From: Sebastien B. <sbi...@us...> - 2006-02-25 12:32:50
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26330/Modeling Modified Files: DatabaseChannel.py Log Message: * Fixed: DatabaseChannel.fetchObject(): it was possible for a snapshot to be cleared from the cache while initializeObject() was in progress (this could happen when another EC was garbage-collected in another thread e.g.) This happened because at this point, the database's lock is released. To prevent the problem, the snapshot's count is incremented before releasing the database's lock, and decremented only after initialzeObject() has returned. Index: DatabaseChannel.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/DatabaseChannel.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** DatabaseChannel.py 20 Jul 2004 06:21:36 -0000 1.18 --- DatabaseChannel.py 25 Feb 2006 12:32:33 -0000 1.19 *************** *** 133,143 **** import time currentTimestamp=time.time() # for snapshots ! dict=self._adaptorChannel.fetchRow() ! if dict is None: self.cancelFetch() # No more objects return None ! globalID=self._currentEntity.globalIDForRow(dict) if self.fetchesRawRows(): --- 133,143 ---- import time currentTimestamp=time.time() # for snapshots ! raw_row=self._adaptorChannel.fetchRow() ! if raw_row is None: self.cancelFetch() # No more objects return None ! globalID=self._currentEntity.globalIDForRow(raw_row) if self.fetchesRawRows(): *************** *** 153,163 **** return registeredSnapshot else: ! return dict else: ! return dict # Get snapshot ! #snapshot=self._currentEntity.snapshotForRow(dict) ! snapshot=dict database=self.databaseContext().database() --- 153,163 ---- return registeredSnapshot else: ! return raw_row else: ! return raw_row # Get snapshot ! #snapshot=self._currentEntity.snapshotForRow(raw_row) ! snapshot=raw_row database=self.databaseContext().database() *************** *** 189,192 **** --- 189,193 ---- # since the corresponding snapshot has been thrown away. # + snapshot_refcount_incremented = False database.lock() try: *************** *** 260,272 **** ec.recordObject(object, globalID) ! # Initialize the new object or the cleared fault ! try: ! object.clearFault() ! except: ! pass ! ec.initializeObject(object, globalID, ec) finally: database.unlock() return object --- 261,282 ---- ec.recordObject(object, globalID) ! ! database.incrementSnapshotCountForGlobalID(globalID) ! snapshot_refcount_incremented = True finally: database.unlock() + # Initialize the new object or the cleared fault + try: + object.clearFault() + except: + pass + + try: + ec.initializeObject(object, globalID, ec) + finally: + if snapshot_refcount_incremented: + database.decrementSnapshotCountForGlobalID(globalID) + return object |
From: Sebastien B. <sbi...@us...> - 2006-02-25 12:32:43
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26330 Modified Files: CHANGES Log Message: * Fixed: DatabaseChannel.fetchObject(): it was possible for a snapshot to be cleared from the cache while initializeObject() was in progress (this could happen when another EC was garbage-collected in another thread e.g.) This happened because at this point, the database's lock is released. To prevent the problem, the snapshot's count is incremented before releasing the database's lock, and decremented only after initialzeObject() has returned. Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** CHANGES 30 Nov 2004 17:14:25 -0000 1.64 --- CHANGES 25 Feb 2006 12:32:32 -0000 1.65 *************** *** 38,42 **** negative value in hex(). Thanks to Lorenzo Gil Sanchez for reporting. ! * Applied <<trivial>> patch #1040045 submitted by John R. Lenton --typo corrections in the documentation --- 38,42 ---- negative value in hex(). Thanks to Lorenzo Gil Sanchez for reporting. ! * Applied patch #1040045 submitted by John R. Lenton --typo corrections in the documentation |
From: Sebastien B. <sbi...@us...> - 2005-05-03 15:12:20
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27955/Modeling Modified Files: ChangeLog ModelSet.py Log Message: ModelSet.py (ModelSet.addModelFromXML): Fixed: loadXMLModel() belongs to the module 'Model', not the class Index: ChangeLog =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ChangeLog,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ChangeLog 30 Nov 2004 17:24:23 -0000 1.6 --- ChangeLog 3 May 2005 15:12:05 -0000 1.7 *************** *** 1,2 **** --- 1,7 ---- + 2005-05-03 Sebastien Bigaret <sbi...@us...> + + * ModelSet.py (ModelSet.addModelFromXML): Fixed: loadXMLModel + belongs to the module 'Model', not the class. + 2004-11-30 Sebastien Bigaret <sbi...@us...> Index: ModelSet.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ModelSet.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** ModelSet.py 30 Nov 2004 17:07:37 -0000 1.14 --- ModelSet.py 3 May 2005 15:12:06 -0000 1.15 *************** *** 38,42 **** from Modeling.utils import isaValidName, base_persistent_object ! from Modeling.Model import ModelError, Model from Modeling.ClassDescription import ClassDescriptionNeededForEntityNameNotification from NotificationFramework import NotificationCenter --- 38,42 ---- from Modeling.utils import isaValidName, base_persistent_object ! from Modeling.Model import ModelError, Model, loadXMLModel from Modeling.ClassDescription import ClassDescriptionNeededForEntityNameNotification from NotificationFramework import NotificationCenter *************** *** 166,170 **** raise AttributeError, "xmlSource parameter has no key 'string' or 'file'" ! model=Model.loadXMLModel(xml_content) self.addModel(model) return model --- 166,170 ---- raise AttributeError, "xmlSource parameter has no key 'string' or 'file'" ! model=loadXMLModel(xml_content) self.addModel(model) return model |
From: Sebastien B. <sbi...@us...> - 2004-12-14 09:33:56
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17278/Modeling/tests Removed Files: __init__.py Log Message: tests/ does not need to be a package --- __init__.py DELETED --- |
From: Sebastien B. <sbi...@us...> - 2004-11-30 17:25:58
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9342/Modeling/scripts Modified Files: mdl_generate_python_code.py Log Message: Fixed: main() uses Model._loadModel() but forgot to call Model.updateModelWithCFG() afterwards Index: mdl_generate_python_code.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/scripts/mdl_generate_python_code.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mdl_generate_python_code.py 30 Nov 2004 17:14:25 -0000 1.10 --- mdl_generate_python_code.py 30 Nov 2004 17:25:35 -0000 1.11 *************** *** 169,172 **** --- 169,173 ---- if not model: raise RuntimeError, "Abnormal: got no exception but Model is None" + Model.updateModelWithCFG(model) except Exception, exc: if verbose: log(tracebackInfoFromStack(exc)) |
From: Sebastien B. <sbi...@us...> - 2004-11-30 17:24:32
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9065/Modeling Modified Files: ChangeLog Log Message: Updated Index: ChangeLog =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/ChangeLog,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ChangeLog 30 Nov 2004 17:11:45 -0000 1.5 --- ChangeLog 30 Nov 2004 17:24:23 -0000 1.6 *************** *** 1,8 **** 2004-11-30 Sebastien Bigaret <sbi...@us...> ! * ModelMasons/PyModelMason.py (PyModelMason.build): added ! parameter 'pymodel_path', that should be equal to the full path of ! the file containing the PyModel from which 'model' was built, or ! None otherwise. If supplied, the method copies the original pymodel into the generated package, otherwise it generates the xml files from the 'model' as usual. --- 1,13 ---- 2004-11-30 Sebastien Bigaret <sbi...@us...> ! * scripts/mdl_generate_python_code.py (main,build_python_code): ! (v1.9) now detects whether it is called with a pymodel or an ! xmlmodel, and supplied the information to PyModelMason.__init__() ! ! * ModelMasons/PyModelMason.py ! (PyModelMason.__init__,PyModelMason.build): added parameter ! 'pymodel_path', that should be equal to the full path of the file ! containing the PyModel from which 'model' was built, or None ! otherwise. If supplied, the method build() copies the original pymodel into the generated package, otherwise it generates the xml files from the 'model' as usual. |
From: Sebastien B. <sbi...@us...> - 2004-11-30 17:14:34
|
Update of /cvsroot/modeling/ProjectModeling In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2174 Modified Files: CHANGES Log Message: Script mdl_generate_python_code.py now detects whether it is called with an xml- or a py-model and, in case it is called w/ a pymodel, it copies it into the generated module (it was previously only generating the files for the xml-model, no matter how it was called) Index: CHANGES =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/CHANGES,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** CHANGES 29 Nov 2004 17:08:42 -0000 1.63 --- CHANGES 30 Nov 2004 17:14:25 -0000 1.64 *************** *** 17,22 **** 2. the requirements the framework imposes on python modules and classes. ! * Script mdl_generate_python_code.py does not create the empty files ! TODO.txt, README.txt, VERSION.txt, INSTALL.txt, DEPEDENCIES.txt anymore * Fixed bug #1032577: undetected syntax errors in qualifier strings. Thanks --- 17,29 ---- 2. the requirements the framework imposes on python modules and classes. ! * Script mdl_generate_python_code.py ! ! - does not create the empty files TODO.txt, README.txt, VERSION.txt, ! INSTALL.txt, DEPEDENCIES.txt anymore ! ! - now detects whether it is called with an xml- or a py-model and, in case ! it is called w/ a pymodel, it copies it into the generated module ! (it was previously only generating the files for the xml-model, no ! matter how it was called) * Fixed bug #1032577: undetected syntax errors in qualifier strings. Thanks |
From: Sebastien B. <sbi...@us...> - 2004-11-30 17:14:34
|
Update of /cvsroot/modeling/ProjectModeling/Modeling/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2174/Modeling/scripts Modified Files: mdl_generate_python_code.py Log Message: Script mdl_generate_python_code.py now detects whether it is called with an xml- or a py-model and, in case it is called w/ a pymodel, it copies it into the generated module (it was previously only generating the files for the xml-model, no matter how it was called) Index: mdl_generate_python_code.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/scripts/mdl_generate_python_code.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** mdl_generate_python_code.py 22 Sep 2004 18:56:31 -0000 1.9 --- mdl_generate_python_code.py 30 Nov 2004 17:14:25 -0000 1.10 *************** *** 44,68 **** del tb ! def build_python_code(model, generation_scheme, rootPath=None, typeOfCode='python', verbose_mode=0, fake_mode=0): """ Builds the python-code templates for the supplied model ! Parameters ! ! model -- an instance of Modeling.Model ! ! generation_scheme -- ! ! rootPath -- where the files should be dropped ! ! typeOfCode -- (do not use) only 'python' is available for the moment ; ! future dev. will probably include generation of zope products. ! ! verbose_mode -- if set to true, the building process logs some informational message onto sys.stderr while building the files. Default is false. ! ! fake_mode -- if true, do not create or change any file, just report what would be done --- 44,63 ---- del tb ! def build_python_code(model, pymodel_path, generation_scheme, rootPath=None, typeOfCode='python', verbose_mode=0, fake_mode=0): """ Builds the python-code templates for the supplied model ! :Parameters: ! - `model`: an instance of Modeling.Model ! - `pymodel_path`: the detected type, as returned by `Model._loadModel()` ! - `generation_scheme`: ! - `rootPath`: where the files should be dropped ! - `typeOfCode`: (do not use) only 'python' is available for the moment ; ! future dev. will probably include generation of zope products. ! - `verbose_mode`: if set to true, the building process logs some informational message onto sys.stderr while building the files. Default is false. ! - `fake_mode`: if true, do not create or change any file, just report what would be done *************** *** 76,80 **** if typeOfCode=='python': from Modeling.ModelMasons.PyModelMason import PyModelMason ! mason = PyModelMason(model, rootPath, verbose_mode=verbose_mode, generation_scheme=generation_scheme, fake_mode=fake_mode) --- 71,76 ---- if typeOfCode=='python': from Modeling.ModelMasons.PyModelMason import PyModelMason ! mason = PyModelMason(model, pymodel_path, rootPath, ! verbose_mode=verbose_mode, generation_scheme=generation_scheme, fake_mode=fake_mode) *************** *** 161,164 **** --- 157,161 ---- model_file=args[0] rootPath=len(args)==2 and args[1] or './' + pymodel_path=None # load the model *************** *** 166,170 **** try: from Modeling import Model ! model=Model.loadModel(model_file) if not model: raise RuntimeError, "Abnormal: got no exception but Model is None" --- 163,170 ---- try: from Modeling import Model ! model,model_type=Model._loadModel(model_file) ! if model_type=="pymodel": ! import os ! pymodel_path=os.path.abspath(model_file) if not model: raise RuntimeError, "Abnormal: got no exception but Model is None" *************** *** 189,194 **** try: ! build_python_code(model, generation_scheme, rootPath, verbose_mode=verbose, ! fake_mode=fake_mode) except TargetDirectoryAlreadyExists, exc: sys.stderr.write(str(sys.exc_info()[1])+'\n') --- 189,194 ---- try: ! build_python_code(model, pymodel_path, generation_scheme, rootPath, ! verbose_mode=verbose, fake_mode=fake_mode) except TargetDirectoryAlreadyExists, exc: sys.stderr.write(str(sys.exc_info()[1])+'\n') |