[reportlab-users] Canvas.pageHasData

Robin Becker reportlab-users@reportlab.com
Mon, 06 Sep 2004 10:00:51 +0100


amaury.forgeotdarc@ubitrade.com wrote:
> Hello,
> I've just seen this code in the current Subversion tree:
> 
> canvas.py:
> 
>>   def pageHasData(self):
>>       "Info function - app can call it after showPage to see if it needs
> 
> a save"
> 
>>       return len(self._code) == 0
> 
> 
> I may be wrong, but I feel that the test should be reversed:
> data is stored in the _code member,
> and pageHasData should tell whether _code is not empty...
> 
> --
> Amaury Forgeot d'Arc
..... looks that way to me too, but I don't think I wrote it, I would probably 
just have used
	def pageHasData(self):
		return self._code

so that the truth or otherwise of self._code could be revealed directly. More 
importantly I can't find anywhere in our code corpus where it has been used.
-- 
Robin Becker