lots of typing fixes
This commit is contained in:
parent
51f580a304
commit
3665c34961
43 changed files with 260 additions and 178 deletions
|
@ -1,4 +1,5 @@
|
|||
from datetime import datetime
|
||||
from typing import List
|
||||
|
||||
from app import db
|
||||
from app.models import AbstractConfiguration
|
||||
|
@ -15,7 +16,7 @@ class Group(AbstractConfiguration):
|
|||
alarms = db.relationship("Alarm", back_populates="group")
|
||||
|
||||
@classmethod
|
||||
def csv_header(cls):
|
||||
def csv_header(cls) -> List[str]:
|
||||
return super().csv_header() + [
|
||||
"group_name", "eotk"
|
||||
]
|
||||
|
@ -43,21 +44,21 @@ class MirrorList(AbstractConfiguration):
|
|||
"bridgelines": "Tor Bridge Lines"
|
||||
}
|
||||
|
||||
def destroy(self):
|
||||
def destroy(self) -> None:
|
||||
self.destroyed = datetime.utcnow()
|
||||
self.updated = datetime.utcnow()
|
||||
db.session.commit()
|
||||
|
||||
def url(self):
|
||||
def url(self) -> str:
|
||||
if self.provider == "gitlab":
|
||||
return f"https://gitlab.com/{self.container}/-/raw/{self.branch}/{self.filename}"
|
||||
if self.provider == "github":
|
||||
return f"https://raw.githubusercontent.com/{self.container}/{self.branch}/{self.filename}"
|
||||
if self.provider == "s3":
|
||||
return f"s3://{self.container}/{self.filename}"
|
||||
return "Unknown provider"
|
||||
|
||||
@classmethod
|
||||
def csv_header(cls):
|
||||
def csv_header(cls) -> List[str]:
|
||||
return super().csv_header() + [
|
||||
"provider", "format", "container", "branch", "filename"
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue