~launchpad-pqm/launchpad/devel

8687.15.22 by Karl Fogel
Add the copyright header block to the remaining .py files.
1
# Copyright 2009 Canonical Ltd.  This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
8447.1.2 by Jonathan Lange
Fix up lots of lint, including removing code that's been disabled forever.
4
# pylint: disable-msg=E0211,E0213
8028.3.2 by Jonathan Lange
Move the puller interface off branchset and into a new utility interface
5
6
"""The public interface to the model of the branch puller."""
7
8
__metaclass__ = type
9
__all__ = [
10
    'IBranchPuller',
11
    ]
12
13
11403.1.4 by Henning Eggers
Reformatted imports using format-imports script r32.
14
from zope.interface import (
15
    Attribute,
16
    Interface,
17
    )
8028.3.2 by Jonathan Lange
Move the puller interface off branchset and into a new utility interface
18
19
20
class IBranchPuller(Interface):
21
    """The interface to the database for the branch puller."""
22
23
    MAXIMUM_MIRROR_FAILURES = Attribute(
24
        "The maximum number of failures before we disable mirroring.")
25
26
    MIRROR_TIME_INCREMENT = Attribute(
27
        "How frequently we mirror branches.")
28
10379.2.3 by Michael Hudson
acquireBranchToPull changes
29
    def acquireBranchToPull(*branch_types):
8312.3.10 by Michael Hudson
docstring fixes pointed out in review
30
        """Return a Branch to pull and mark it as mirror-started.
8312.3.5 by Michael Hudson
mostly copy and pasted tests for the xml-rpc endpoint
31
10379.2.3 by Michael Hudson
acquireBranchToPull changes
32
        :param branch_types: Only return branches of these types.  Passing no
33
            types means consider all types (apart from REMOTE).
8312.3.5 by Michael Hudson
mostly copy and pasted tests for the xml-rpc endpoint
34
        :return: The branch object to pull next, or ``None`` if there is no
35
            branch to pull.
36
        """