aboutsummaryrefslogtreecommitdiffstats
path: root/database.py
blob: 82c019bb96ecfd0da3a2fe25bcfb0c30d4f16148 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pymysql
import get_images

class Database:
    def __enter__(self):
        self.__connection = pymysql.connect(
            **CONFIG["mysql"]
        )
        return self

    def __exit__(self, type, value, traceback):
        self.__connection.commit()
        self.__connection.close()

    def append_black