from unitls.settings import DBServer , flightDB4
from .flightDB import flightDB
from .sortFlighttime import sortFlighttime
from .sortFlighttime2 import sortFlighttime2

host, port, user1, password,online_host, online_port, online_user,online_password = DBServer()
databaseflightDB4=flightDB4()

def deleteFlight(fdb:flightDB,flightid,time):
    fdb.deleteTable("TaskFlightinfo%s"%time,"航班编号='%s'"%flightid)
    res={"返回值":"ok"}
    sortFlighttime(flightDB(host=host,
                    port=port,
                    user=user1,
                    password=password,
                    database=databaseflightDB4
                   ))
    sortFlighttime2(flightDB(host=host,
                    port=port,
                    user=user1,
                    password=password,
                    database=databaseflightDB4
                   ))
    return res
