Commit 1c1fe070 authored by Mustafa Gezen's avatar Mustafa Gezen 🏗
Browse files

Remove python3.8 incompatible calls

parent a7b70d4f
......@@ -42,14 +42,14 @@ class Lookaside:
def __init__(self, url: str):
if url.startswith("file://"):
self.backend = LookasideBackend.FILE
self.dir = url.removeprefix("file://")
self.dir = url[len("file://"):]
elif url.startswith("s3://"):
self.backend = LookasideBackend.S3
self.s3 = boto3.client("s3")
self.bucket = url.removeprefix("s3://")
self.bucket = url[len("s3://"):]
elif url.startswith("gs://"):
self.backend = LookasideBackend.GCS
self.gcs = storage.Client().bucket(url.removeprefix("gs://"))
self.gcs = storage.Client().bucket(url[len("gs://"):])
def upload(self, f: BinaryIO, name: str):
if self.backend == LookasideBackend.FILE:
......
......@@ -45,7 +45,7 @@ async def do(package: Package, package_import: Import):
package.last_import = datetime.datetime.now()
mode = "modules" if package_import.module else "rpms"
project = gl.projects.get(f"{settings.repo_prefix.removeprefix('/')}/{mode}/{gitlabify(package.name)}")
project = gl.projects.get(f"{settings.repo_prefix[1:]}/{mode}/{gitlabify(package.name)}")
project.visibility = "public"
project.save()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment