language moved to dataclass

This commit is contained in:
Egor Matveev
2021-11-06 12:35:57 +03:00
parent c2490b564e
commit 5fd4823740
9 changed files with 82 additions and 26 deletions

37
SprintLib/language.py Normal file
View File

@@ -0,0 +1,37 @@
from dataclasses import dataclass
@dataclass
class Language:
id: int
name: str
work_name: str
file_type: str
logo_url: str
image: str
highlight: str
def __str__(self):
return self.name
languages = [
Language(
id=0,
name="Python3",
work_name="Python3",
file_type="py",
logo_url="https://entredatos.es/wp-content/uploads/2021/05/1200px-Python-logo-notext.svg.png",
image="python:3.6",
highlight="python",
),
Language(
id=1,
name="Kotlin",
work_name="Kotlin",
file_type="kt",
logo_url="https://upload.wikimedia.org/wikipedia/commons/0/06/Kotlin_Icon.svg",
image="zenika/kotlin",
highlight="kotlin",
),
]