mirror of
https://github.com/Code-For-Groningen/temmies.git
synced 2025-03-15 07:10:15 +01:00
Replaced | syntax with Optional (Python types <3)
This commit is contained in:
parent
96488ac69c
commit
5ba67e3b51
@ -4,6 +4,7 @@
|
|||||||
File to define the Submission class
|
File to define the Submission class
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from typing import Optional
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
class Submission:
|
class Submission:
|
||||||
@ -48,7 +49,7 @@ class Submission:
|
|||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def get_info(self) -> dict[str, str] | None:
|
def get_info(self) -> Optional[dict[str, str]]:
|
||||||
"""Submission information (in details)"""
|
"""Submission information (in details)"""
|
||||||
if self.__info:
|
if self.__info:
|
||||||
return self.__info
|
return self.__info
|
||||||
@ -74,7 +75,7 @@ class Submission:
|
|||||||
return self.__info
|
return self.__info
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def get_files(self) -> list[str] | None:
|
def get_files(self) -> Optional[list[str]]:
|
||||||
"""Get a list of uploaded files in the format [(name, url)]"""
|
"""Get a list of uploaded files in the format [(name, url)]"""
|
||||||
if not self.__info:
|
if not self.__info:
|
||||||
self.__info = self.get_info()
|
self.__info = self.get_info()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user