Python 3.5.3 compatibility
authorStricted <info@stricted.net>
Sun, 4 Nov 2018 08:19:35 +0000 (09:19 +0100)
committerJan Altensen <info@stricted.net>
Tue, 20 Aug 2019 19:06:30 +0000 (21:06 +0200)
Change-Id: I37336a68f51a6ce94ac213307291638f0e8e66fb

ui/gitlab/api.py
ui/models.py
ui/slack/webhook.py

index 463e132077a206395b70502956bd017785ab6f98..f789796aeb14fb4304a2c7008a2d4f4717176973 100644 (file)
@@ -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()
index 31f3d82e8ab03290eb2b7cb336ea6dc18e4c5b02..81a3c7a0140b7bfc9e16f9f77cd0573a0e954ba9 100644 (file)
@@ -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 {
index 8403a616b0d7d43ea503edebf42ec0ff2f9788a7..f7f8b5ce32e3a3fc4c128bc0a29eecd614ecca47 100644 (file)
@@ -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"
             }
         ]