From: Stricted Date: Sun, 4 Nov 2018 08:19:35 +0000 (+0100) Subject: Python 3.5.3 compatibility X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d1c31789d503db4c5c421e088fec3be735f6b924;p=GitLab%2Fstricted-build%2Flineage_builder.git Python 3.5.3 compatibility Change-Id: I37336a68f51a6ce94ac213307291638f0e8e66fb --- diff --git a/ui/gitlab/api.py b/ui/gitlab/api.py index 463e132..f789796 100644 --- a/ui/gitlab/api.py +++ b/ui/gitlab/api.py @@ -5,7 +5,7 @@ import os GITLAB_BASE = "https://gitlab.com/api/v4/" def create_pipeline(project, trigger, data): - resp = requests.post(f"{GITLAB_BASE}projects/{project}/trigger/pipeline?token={token}", data=data) + resp = requests.post("{}projects/{}/trigger/pipeline?token={}".format(GITLAB_BASE, project, token), data=data) if resp.status_code != 201: raise Exception("ERROR", req.status_code, req.json()) return resp.json() diff --git a/ui/models.py b/ui/models.py index 31f3d82..81a3c7a 100644 --- a/ui/models.py +++ b/ui/models.py @@ -15,7 +15,7 @@ class Build(db.Model): build_runner = db.relationship('Runner', backref=db.backref('builds', lazy=True)) def __repr__(self): - return f"{self.build_id} {self.build_device} {self.build_version} {self.build_type} {self.build_runner_id}" + return "{} {} {} {} {}".format(self.build_id, self.build_device, self.build_version, self.build_type, self.build_runner_id) def as_dict(self): return { diff --git a/ui/slack/webhook.py b/ui/slack/webhook.py index 8403a61..f7f8b5c 100644 --- a/ui/slack/webhook.py +++ b/ui/slack/webhook.py @@ -13,7 +13,7 @@ def post_build(status, device, version, btype, id_): else: return version = version.split("-")[1] - text = f"LineageOS {version} {state} {device} ({btype})" + text = "LineageOS {} {} {} ({})".format(version, state, device, btype) data = { "channel": "#releases", "attachments": [ @@ -21,7 +21,7 @@ def post_build(status, device, version, btype, id_): "fallback": text, "author_name": "buildbot", "title": text, - "text": f"https://gitlab.com/lineageos/builder/android/pipelines/{id_}", + "text": "https://gitlab.com/lineageos/builder/android/pipelines/{}".format(id_), "color": "danger" if status == "failed" else "#020202" } ]