• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zopefoundation / zope.size / 16248883852

14 Feb 2025 09:00AM UTC coverage: 100.0%. Remained the same
16248883852

push

github

icemac
Back to development: 5.2

8 of 8 branches covered (100.0%)

Branch coverage included in aggregate %.

102 of 102 relevant lines covered (100.0%)

1.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/zope/size/interfaces.py
1
##############################################################################
2
#
3
# Copyright (c) 2002 Zope Foundation and Contributors.
4
# All Rights Reserved.
5
#
6
# This software is subject to the provisions of the Zope Public License,
7
# Version 2.1 (ZPL).  A copy of the ZPL should accompany this distribution.
8
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
9
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
10
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
11
# FOR A PARTICULAR PURPOSE.
12
#
13
##############################################################################
14
"""Interfaces that give the size of an object.
15
"""
16

17
from zope.interface import Interface
1✔
18

19

20
class ISized(Interface):
1✔
21
    """
22
    An object that is sized in some unit.
23

24
    Basic units:
25

26
    - 'byte'
27

28
    - 'item'  for example, number of subobjects for a folder
29

30
    - None    for unsized things
31

32
    - 'line'  for source-code like things
33

34
    """
35

36
    def sizeForSorting():
1✔
37
        """Returns a tuple (basic_unit, amount)
38

39
        Used for sorting among different kinds of sized objects.
40
        'amount' need only be sortable among things that share the
41
        same basic unit."""
42

43
    def sizeForDisplay():
1✔
44
        """Returns a string giving the size. The output string may be a
45
        zope.i18nmessageid.message.Message with an embedded mapping, so
46
        it should be translated with zope.i18n.translate()
47
        """
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc