Untitled
Anonymous
python
03/20/2023 1:58 PM
484 B
13
Indexable
# Tutaj utrzymujesz listę wspieranych kombinacji
class FileType(Enum):
JAVA = ['.java']
C = ['.c', '.h']
# można po tym iterować:
for e in FileType:
if file.extension in e.value:
file.filetype = e
# lub
file.filetype = e.name
# Można używać do wymieniania
supported_filetypes = [
FileType.JAVA
]
Editor is loading...