Add black code formatter

This commit is contained in:
Sascha Ißbrücker
2024-01-27 11:29:16 +01:00
parent 6775633be5
commit 98b9a9c1a0
128 changed files with 7181 additions and 4264 deletions

View File

@@ -8,19 +8,19 @@ class Command(BaseCommand):
help = "Creates a backup of the linkding database"
def add_arguments(self, parser):
parser.add_argument('destination', type=str, help='Backup file destination')
parser.add_argument("destination", type=str, help="Backup file destination")
def handle(self, *args, **options):
destination = options['destination']
destination = options["destination"]
def progress(status, remaining, total):
self.stdout.write(f'Copied {total-remaining} of {total} pages...')
self.stdout.write(f"Copied {total-remaining} of {total} pages...")
source_db = sqlite3.connect(os.path.join('data', 'db.sqlite3'))
source_db = sqlite3.connect(os.path.join("data", "db.sqlite3"))
backup_db = sqlite3.connect(destination)
with backup_db:
source_db.backup(backup_db, pages=50, progress=progress)
backup_db.close()
source_db.close()
self.stdout.write(self.style.SUCCESS(f'Backup created at {destination}'))
self.stdout.write(self.style.SUCCESS(f"Backup created at {destination}"))