added backup system!
This commit is contained in:
@@ -77,7 +77,6 @@ class Search:
|
||||
|
||||
payload = []
|
||||
for row in rows:
|
||||
print(row)
|
||||
city = City(Database.connection)._set_row_values(row)
|
||||
payload.append(city)
|
||||
|
||||
|
@@ -1,7 +1,21 @@
|
||||
|
||||
import os
|
||||
|
||||
from models.database import Database
|
||||
|
||||
class Utils:
|
||||
@staticmethod
|
||||
def clear_screen():
|
||||
os.system('cls' if os.name == 'nt' else 'clear')
|
||||
os.system('cls' if os.name == 'nt' else 'clear')
|
||||
|
||||
@staticmethod
|
||||
def export_db(file):
|
||||
with open(f"./{file}", 'w') as f:
|
||||
for line in Database.connection.iterdump():
|
||||
f.write('%s\n' % line)
|
||||
|
||||
@staticmethod
|
||||
def import_db(file):
|
||||
with open(f"./{file}", 'r') as f:
|
||||
str = f.read()
|
||||
Database.connection.executescript(str)
|
Reference in New Issue
Block a user