Re: Writing tags "the hard way" in 2.2...
Iwan Vosloo <[email protected]> Thu, 08 Mar 2007 16:43:35 +0200
| Newsgroups | gmane.comp.python.spyce.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, we have the scenario where we have a tag that displays only when a certain exception happens. It would then display stuff about the exception. But if the exception did not happen the tag's insides break since the "exception == None" in that case, and the insides of the tag is not meant to be rendered in that case... So its not about side effects... Still not a big deal, just an irritation which would be nice to be able to fix. -i On Thu, 2007-03-08 at 06:09 -0800, Jonathan Ellis wrote: > That's true, but it's not a big deal unless you're using [[= ]] with > expressions that have side effects besides their output, which is a Bad > Idea anyway. > > On Thu, 08 Mar 2007 14:03:47 +0200, "Iwan Vosloo" <[email protected]> said: > > Hi Jonathan, > > > > mmm, thanks, that sortof works - only problem is that if you have a tag > > such as: > > > > <mytag> [[= some python expression ]] </mytag> > > > > The python expression will always be evaluated, whether the tag should > > be displayed or not... Any ideas how one can stop that from happening? > > > > (The problem is that the expression may break in the cases when mytag > > should not be displayed.) > > > > -i > > > > On Wed, 2007-03-07 at 07:03 -0800, Jonathan Ellis wrote: > > > yes, this was removed. > > > > > > you can easily do the same thing with an instance var yourself, though. > > > > > > def body(self): > > > if not self.conditional: return > > > ... > > > > > > On Wed, 07 Mar 2007 16:00:20 +0200, "Iwan Vosloo" <[email protected]> said: > > > > Hi, > > > > > > > > we suspect another change in 2.2: > > > > > > > > We used to be able to write a tag (something inheriting from > > > > spyceTagPlus), and set conditional=True on it. If I understand > > > > correctly, if you then return None from your begin(), its body will NOT > > > > be output. > > > > > > > > It seems this does not work the same in 2.2? > > > > > > > > Thanks > > > > -i > > > > > > > > > > > > ------------------------------------------------------------------------- > > > > Take Surveys. Earn Cash. Influence the Future of IT > > > > Join SourceForge.net's Techsay panel and you'll get the chance to share > > > > your > > > > opinions on IT & business topics through brief surveys-and earn cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > > _______________________________________________ > > > > Spyce-users mailing list > > > > [email protected] > > > > https://lists.sourceforge.net/lists/listinfo/spyce-users > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Spyce-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/spyce-users ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV