From d1c31789d503db4c5c421e088fec3be735f6b924 Mon Sep 17 00:00:00 2001 From: Stricted Date: Sun, 4 Nov 2018 09:19:35 +0100 Subject: [PATCH] Python 3.5.3 compatibility Change-Id: I37336a68f51a6ce94ac213307291638f0e8e66fb --- ui/gitlab/api.py | 2 +- ui/models.py | 2 +- ui/slack/webhook.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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" } ] -- 2.20.1