def get_size(self): size = ISized(self, None) if size is not None: unit, amount = size.sizeForSorting() if unit == 'byte': return amount method = getattr(self, '__five_original_get_size', None) if method is not None: return self.__five_original_get_size()
def testInterface(self): from zope.app.size.interfaces import ISized self.failUnless(ISized.implementedBy(Sized)) self.failUnless(verifyClass(ISized, Sized))
def size(self): a = ISized(self.context, None) if a is None: raise AttributeError('size') return a.sizeForDisplay()
def testImplementsISized(self): from zope.app.container.size import ContainerSized sized = ContainerSized(DummyContainer(23)) self.assert_(ISized.providedBy(sized))
def testImplementsISized(self): from zope.app.size import DefaultSized sized = DefaultSized(object()) self.assert_(ISized.providedBy(sized))
def size(self): sized = ISized(self.context) return sized.sizeForDisplay()