File size: 425 Bytes
a8e9b84
 
 
 
 
 
677cbbf
 
 
 
 
 
 
 
a8e9b84
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import os

from ..logging import LOGGER


def dirr():
    if not os.path.isdir("/tmp/downloads"):
        os.makedirs("/tmp/downloads")
    if not os.path.isdir("/tmp/cache"):
        os.makedirs("/tmp/cache")
    
    for file in os.listdir("/tmp/downloads"):
        if file.endswith((".jpg", ".jpeg", ".png")):
            os.remove(os.path.join("/tmp/downloads", file))

    LOGGER(__name__).info("Directories Updated.")