summaryrefslogtreecommitdiff
path: root/lorrycontroller/__init__.py
blob: ef9c9777d089cfe2d0ef1e1513d4d748c331bfb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# Copyright (C) 2014-2020  Codethink Limited
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


from .statedb import (
    StateDB,
    LorryNotFoundError,
    WrongNumberLorriesRunningJob,
    HostNotFoundError)
from .route import LorryControllerRoute
from .readconf import ReadConfiguration
from .status import Status, StatusHTML, StatusRenderer, FailuresHTML
from .listqueue import ListQueue
from .showlorry import ShowLorry, ShowLorryHTML
from .startstopqueue import StartQueue, StopQueue
from .givemejob import GiveMeJob
from .jobupdate import JobUpdate
from .listrunningjobs import ListRunningJobs
from .movetopbottom import MoveToTop, MoveToBottom
from .stopjob import StopJob
from .listjobs import ListAllJobs, ListAllJobsHTML
from .showjob import ShowJob, ShowJobHTML, JobShower
from .removeghostjobs import RemoveGhostJobs
from .removejob import RemoveJob
from .lsupstreams import LsUpstreams, ForceLsUpstream
from .pretendtime import PretendTime
from .maxjobs import GetMaxJobs, SetMaxJobs
from .static import StaticFile
from .proxy import setup_proxy
from . import gerrit
from . import gitano
from . import gitea
from . import gitlab
from . import local


downstream_types = {
    'gerrit': gerrit.GerritDownstream,
    'gitano': gitano.GitanoDownstream,
    'gitea':  gitea.GiteaDownstream,
    'gitlab': gitlab.GitlabDownstream,
    'local':  local.LocalDownstream,
}


upstream_types = {
    'gitlab': gitlab.GitlabUpstream,
    'trove':  gitano.TroveUpstream,
}


def get_upstream_host(host_info):
    return upstream_types[host_info['type']](host_info)


__all__ = [
    'StateDB',
    'LorryNotFoundError', 'WrongNumberLorriesRunningJob', 'HostNotFoundError',
    'LorryControllerRoute',
    'ReadConfiguration',
    'Status', 'StatusHTML', 'StatusRenderer', 'FailuresHTML',
    'ListQueue',
    'ShowLorry', 'ShowLorryHTML',
    'StartQueue', 'StopQueue',
    'GiveMeJob',
    'JobUpdate',
    'ListRunningJobs',
    'MoveToTop', 'MoveToBottom',
    'StopJob',
    'ListAllJobs', 'ListAllJobsHTML',
    'ShowJob', 'ShowJobHTML', 'JobShower',
    'RemoveGhostJobs',
    'RemoveJob',
    'LsUpstreams', 'ForceLsUpstream',
    'PretendTime',
    'GetMaxJobs', 'SetMaxJobs',
    'StaticFile',
    'setup_proxy',
    'gerrit',
    'gitano',
    'gitea',
    'gitlab',
    'local',
    'downstream_types',
    'upstream_types',
    'get_upstream_host',
]