-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextensions.py
52 lines (46 loc) · 1.41 KB
/
extensions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class Checker:
def is_text(self, filename: str):
return filename.lower().endswith(
(
'.txt', '.doc', '.docx',
)
)
def is_audio(self, filename: str):
return filename.lower().endswith(
(
'.mp3', '.flac', '.mid',
'.wav', '.aif', '.m3u8',
'.aa3', '.flm', '.ec3',
'.mtm', '.flp', '.weba',
'.wproj', '.wow','.vlc',
)
)
def is_image(self, filename: str) -> bool:
return filename.lower().endswith (
(
'.jpeg', '.jpg', '.png',
'.webp', '.gif', '.tiff',
'.psd', '.raw', '.ai',
'.indd', '.eps'
)
)
def is_video(self, filename: str):
return filename.lower().endswith (
(
'.mp4', '.mpg', '.mov',
'.wmv', '.rm', '.mkv',
'.webm', '.aep', '.kine',
'.prproj', '.veg', '.drp',
'.kdenlive', '.cpvc'
)
)
def is_archive(self, filename: str):
return filename.lower().endswith(
(
'.zip', '.rar', '.gz',
'.tar', '.7z', '.jar',
'.djvu', '.zipx', '.tar.gz',
'.odb', '.bz', '.bz2', '.gzip',
'.tgz', '.z'
)
)