[Modeling-cvs] ProjectModeling/Modeling PyModel.py,1.4,1.5
Status: Abandoned
Brought to you by:
sbigaret
From: <sbi...@us...> - 2003-08-26 19:40:42
|
Update of /cvsroot/modeling/ProjectModeling/Modeling In directory sc8-pr-cvs1:/tmp/cvs-serv17140/Modeling Modified Files: PyModel.py Log Message: PyModel.Model: - Fixed bug #795561: __init__() did not recognize 'version' as a parameter - Now raises PyModel.IncompatibleVersionError when a model has an incompatible version (was: ValueError) Index: PyModel.py =================================================================== RCS file: /cvsroot/modeling/ProjectModeling/Modeling/PyModel.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyModel.py 3 Aug 2003 12:54:48 -0000 1.4 --- PyModel.py 26 Aug 2003 19:40:24 -0000 1.5 *************** *** 58,62 **** from utils import isListOrTuple ! identity=lambda x: x def debug(msg): --- 58,67 ---- from utils import isListOrTuple ! class IncompatibleVersionError(RuntimeError): ! pass ! ! def identity(x): ! "Returns x, unchanged" ! return x def debug(msg): *************** *** 71,75 **** self.method=method self.param=args ! class BaseDescription: ''' Base description class (should not be exported to client code) ''' --- 76,82 ---- self.method=method self.param=args ! def __repr__(self): ! return '%s%s'%(self.method, self.param) ! class BaseDescription: ''' Base description class (should not be exported to client code) ''' *************** *** 123,130 **** self.name=self.requiredField(name) self.entities=list(kw.get('entities', [])) from Model import Model as MModel self.component=MModel(name) updateComponent(self, kw, Model.defaults, name, ! ignore=('entities','associations')) def entityNamed(self, name): --- 130,139 ---- self.name=self.requiredField(name) self.entities=list(kw.get('entities', [])) + self.entities=list(kw.get('associations', [])) from Model import Model as MModel self.component=MModel(name) updateComponent(self, kw, Model.defaults, name, ! ignore=('entities','associations','version')) ! self.version=kw.get('version', None) def entityNamed(self, name): *************** *** 177,181 **** # Check version if getattr(self, 'version', None)!=BaseDescription.VERSION: ! raise ValueError, 'Incompatible versions' # --- 186,190 ---- # Check version if getattr(self, 'version', None)!=BaseDescription.VERSION: ! raise IncompatibleVersionError, 'Incompatible versions --please check MIGRATION' # |