Thread: [Modeling-users] problem with qualifier parser?
Status: Abandoned
Brought to you by:
sbigaret
From: John L. <jo...@vi...> - 2004-04-15 21:19:35
|
Sender: John Lenton <jo...@ma...> Hi there, long time no see :) First, sorry for my delay with the cimarron example. I've had to stop working on cimarron for a while... Now I'm working with Modeling in zope, and I seem to have come across a bug... and I'm hoping there's an easy fix (or that it's already fixed and I've just not seen it on sourceforge :p). $ python Python 2.3.3 (#2, Feb 24 2004, 09:29:20)=20 [GCC 3.3.3 (Debian)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from Modeling.EditingContext import EditingContext >>> ec=3DEditingContext() >>> ec.fetch('foo', 'orbit > 3') Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.3/site-packages/Modeling/EditingContext.py", l= ine 1413, in fetch qualifier=3DqualifierWithQualifierFormat(qualifier) File "/usr/lib/python2.3/site-packages/Modeling/Qualifier.py", line 1= 29, in qualifierWithQualifierFormat return QualifierParser.qualifierWithQualifierFormat(expression) File "/usr/lib/python2.3/site-packages/Modeling/QualifierParser.py", = line 550, in qualifierWithQualifierFormat _parse=3Dparse(sc) File "/usr/lib/python2.3/site-packages/Modeling/QualifierParser.py", = line 417, in parse return parser.parse(tokens) File "/usr/lib/python2.3/site-packages/spark.py", line 204, in parse self.error(tokens[i-1]) File "/usr/lib/python2.3/site-packages/Modeling/QualifierParser.py", = line 261, in error raise ValueError, "Syntax error near token: `%s'" % token ValueError: Syntax error near token: `<Token OR>' actually there's the same problem with any token: OR, AND, IN, or NOT. Is this a known problem in spark? is my spark version wrong? spark is 0.6.1, Modeling is 0.9-pre-16-patch892454. --=20 John Lenton (jo...@vi...) -- Random fortune: Teme a la vejez, pues nunca viene sola. -- Plat=F3n. (427-347 a.C.) Fil=F3sofo griego.=20 |
From: Sebastien B. <sbi...@us...> - 2004-04-16 12:23:05
|
Hi John, John Lenton <jo...@vi...> writes: > Hi there, long time no see :) >=20 > First, sorry for my delay with the cimarron example. I've had to stop > working on cimarron for a while... Not a problem, 'having a hard time here as well :) > Now I'm working with Modeling in zope, and I seem to have come across > a bug... and I'm hoping there's an easy fix (or that it's already > fixed and I've just not seen it on sourceforge :p). >=20 > $ python > Python 2.3.3 (#2, Feb 24 2004, 09:29:20) > [GCC 3.3.3 (Debian)] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> from Modeling.EditingContext import EditingContext > >>> ec=3DEditingContext() > >>> ec.fetch('foo', 'orbit > 3') > Traceback (most recent call last): > File "<stdin>", line 1, in ? [...] > raise ValueError, "Syntax error near token: `%s'" % token > ValueError: Syntax error near token: `<Token OR>' >=20 > actually there's the same problem with any token: OR, AND, IN, or > NOT. Is this a known problem in spark? is my spark version wrong? > spark is 0.6.1, Modeling is 0.9-pre-16-patch892454. This is a bug, unfortunately not fixed on sf yet :/ I'll have a look at it tonite. In the meantime you can build the same qualifier by hand: >>> from Modeling.Qualifier import * >>> q=3DKeyValueQualifier('foo', QualifierOperatorGreaterThan, 3) >>> print q (foo>3) >>> ec.fetch('foo', q) You can have a look at test_Qualifier.py for other examples. HTH, -- S=E9bastien. |
From: Sebastien B. <sbi...@us...> - 2004-04-19 19:27:56
|
Hi John and all, You'll find a patch solving the problem along w/ the corresponding unittests at sf.net, bug #938096: https://sourceforge.net/tracker/index.php?func=3Ddetail&aid=3D938096&group_= id=3D58935&atid=3D489335 Thanks for reporting! -- S=E9bastien. PS for Yannick: I still did not find the time to investigate any further about GNU Arch, but I will, this looks interesting (not to say about the new name for the framework...!-). Any comparison w/ subversion, BTW? > John Lenton <jo...@vi...> writes: > > $ python > > Python 2.3.3 (#2, Feb 24 2004, 09:29:20) > > [GCC 3.3.3 (Debian)] on linux2 > > Type "help", "copyright", "credits" or "license" for more informati= on. > > >>> from Modeling.EditingContext import EditingContext > > >>> ec=3DEditingContext() > > >>> ec.fetch('foo', 'orbit > 3') > > Traceback (most recent call last): > > File "<stdin>", line 1, in ? > [...] > > raise ValueError, "Syntax error near token: `%s'" % token > > ValueError: Syntax error near token: `<Token OR>' > >=20 > > actually there's the same problem with any token: OR, AND, IN, or > > NOT. Is this a known problem in spark? is my spark version wrong? > > spark is 0.6.1, Modeling is 0.9-pre-16-patch892454. >=20 >=20 > This is a bug, unfortunately not fixed on sf yet :/ I'll have a look at = it > tonite. In the meantime you can build the same qualifier by hand: >=20 > >>> from Modeling.Qualifier import * > >>> q=3DKeyValueQualifier('foo', QualifierOperatorGreaterThan, 3) > >>> print q > (foo>3) > >>> ec.fetch('foo', q) >=20 > You can have a look at test_Qualifier.py for other examples. |