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

zopefoundation / ZODB / 6920335661

10 Oct 2023 06:43AM UTC coverage: 83.729% (+0.005%) from 83.724%
6920335661

push

github

web-flow
scripts/space.py: fix sorting dict items (#392)

Co-authored-by: Jens Vagelpohl <jens@plyp.com>
Co-authored-by: Michael Howitz <icemac@gmx.net>

2877 of 4048 branches covered (0.0%)

0 of 2 new or added lines in 1 file covered. (0.0%)

13323 of 15912 relevant lines covered (83.73%)

0.84 hits per line

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

0.0
/src/ZODB/FileStorage/interfaces.py
1
##############################################################################
2
#
3
# Copyright (c) Zope Corporation 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
import zope.interface
×
15

16

17
class IFileStoragePacker(zope.interface.Interface):
×
18

19
    def __call__(storage, referencesf, stop, gc):
×
20
        r"""Pack the file storage into a new file
21

22
        :param FileStorage storage: The storage object to be packed
23
        :param callable referencesf: A function that extracts object
24
            references from a pickle bytes string.  This is usually
25
            ``ZODB.serialize.referencesf``.
26
        :param bytes stop: A transaction id representing the time at
27
            which to stop packing.
28
        :param bool gc: A flag indicating whether garbage collection
29
            should be performed.
30

31
        The new file will have the same name as the old file with
32
        ``.pack`` appended. (The packer can get the old file name via
33
        storage._file.name.) If blobs are supported, if the storages
34
        blob_dir attribute is not None or empty, then a .removed file
35
        must be created in the blob directory. This file contains records of
36
        the form::
37

38
           (oid+serial).encode('hex')+'\n'
39

40
        or, of the form::
41

42
           oid.encode('hex')+'\n'
43

44
        If packing is unnecessary, or would not change the file, then
45
        no pack or removed files are created None is returned,
46
        otherwise a tuple is returned with:
47

48
        - the size of the packed file, and
49

50
        - the packed index
51

52
        If and only if packing was necessary (non-None) and there was
53
        no error, then the commit lock must be acquired.  In addition,
54
        it is up to FileStorage to:
55

56
        - Rename the .pack file, and
57

58
        - process the blob_dir/.removed file by removing the blobs
59
          corresponding to the file records.
60
        """
61

62

63
class IFileStorage(zope.interface.Interface):
×
64

65
    packer = zope.interface.Attribute(
×
66
        "The IFileStoragePacker to be used for packing."
67
    )
68

69
    _file = zope.interface.Attribute(
×
70
        "The file object used to access the underlying data."
71
    )
72

73
    _lock = zope.interface.Attribute(
×
74
        "The storage lock."
75
    )
76

77
    _commit_lock = zope.interface.Attribute(
×
78
        "The storage commit lock."
79
    )
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