You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ITD_track/delete_123123_parking.py

30 lines
954 B
Python

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# -*- coding: utf-8 -*-
"""Еднократно изтриване на записи с код 123123, които имат само паркинг (само пост 1)."""
import sys
import os
# работи от директорията на проекта
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
import itd_db as db
def main():
conn = db.get_connection()
try:
deleted_regs, deleted_closes = db.delete_parking_only_cycles_for_card(conn, "123123")
print(f"Готово. Изтрити регистрации (само паркинг): {deleted_regs}")
print(f"Изтрити служебни затваряния за тези цикли: {deleted_closes}")
except Exception as e:
print(f"Грешка: {e}")
return 1
finally:
try:
conn.close()
except Exception:
pass
return 0
if __name__ == "__main__":
sys.exit(main())