aboutsummaryrefslogtreecommitdiffstats
path: root/database.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2022-08-11 18:12:29 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2022-08-11 18:12:29 +0000
commit4ea267bdedc9736456f1ec0f8b0c76ed3a6254e8 (patch)
tree2aa1ab54235fb60975bdc076fa87bc83e844a67a /database.py
parent5a3378bb7d8ee2e6ba8f44ac29f34b658915b0c5 (diff)
downloadyaoi-communism-4ea267bdedc9736456f1ec0f8b0c76ed3a6254e8.tar.gz
yaoi-communism-4ea267bdedc9736456f1ec0f8b0c76ed3a6254e8.zip
Updated dockerfile
Diffstat (limited to 'database.py')
-rwxr-xr-xdatabase.py15
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