diff options
Diffstat (limited to 'ick2lib/project.py')
-rw-r--r-- | ick2lib/project.py | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/ick2lib/project.py b/ick2lib/project.py deleted file mode 100644 index ae9a124..0000000 --- a/ick2lib/project.py +++ /dev/null @@ -1,69 +0,0 @@ -# Copyright 2017 Lars Wirzenius -# -# 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, either version 3 of the License, or -# (at your option) any later version. -# -# 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, see <http://www.gnu.org/licenses/>. -# -# =*= License: GPL-3+ =*= - - -class Project(object): - - def __init__(self, name): - self.name = name - self.git = None - self.current_log = '' - self.previous_log = '' - self.build_steps = [] - self.current_build_step = None - self.current_worker = None - - def set_git(self, url): - self.git = url - - def get_current_log(self): - return self.current_log - - def get_previous_log(self): - return self.previous_log - - def append_to_current_log(self, text): - self.current_log += text - - def finish_current_log(self): - self.previous_log = self.current_log - self.current_log = '' - - def get_build_steps(self): - return self.build_steps - - def add_build_step(self, shell_text): - self.build_steps.append(shell_text) - - def get_current_build_step(self, worker_name): - if self.current_build_step is None: - return None - if self.current_worker is None: - self.current_worker = worker_name - elif self.current_worker != worker_name: - return None - return self.build_steps[self.current_build_step] - - def finish_current_build_step(self): - assert self.current_build_step is not None - self.current_build_step += 1 - if self.current_build_step >= len(self.build_steps): - self.current_build_step = None - - def trigger_build(self): - if self.current_build_step is None: - self.current_build_step = 0 |