diff options
Diffstat (limited to 'database.py')
-rwxr-xr-x | database.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/database.py b/database.py new file mode 100755 index 0000000..82c019b --- /dev/null +++ b/database.py @@ -0,0 +1,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
\ No newline at end of file |