Exemple #1
0
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()
Exemple #2
0
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()
Exemple #3
0
 def testInterface(self):
     from zope.app.size.interfaces import ISized
     self.failUnless(ISized.implementedBy(Sized))
     self.failUnless(verifyClass(ISized, Sized))
Exemple #4
0
 def size(self):
     a = ISized(self.context, None)
     if a is None:
         raise AttributeError('size')
     return a.sizeForDisplay()
Exemple #5
0
 def testImplementsISized(self):
     from zope.app.container.size import ContainerSized
     sized = ContainerSized(DummyContainer(23))
     self.assert_(ISized.providedBy(sized))
Exemple #6
0
 def testImplementsISized(self):
     from zope.app.size import DefaultSized
     sized = DefaultSized(object())
     self.assert_(ISized.providedBy(sized))
Exemple #7
0
 def size(self):
     sized = ISized(self.context)
     return sized.sizeForDisplay()