kopia lustrzana https://github.com/glidernet/ogn-python
Added logbook to manage.py
rodzic
e5b771fc19
commit
ceca97b47c
|
@ -9,7 +9,7 @@ from celery.signals import worker_init, worker_shutdown
|
|||
app = Celery('ogn.collect',
|
||||
broker='redis://localhost:6379/0',
|
||||
backend='redis://localhost:6379/0',
|
||||
include=["ogn.collect.fetchddb"])
|
||||
include=["ogn.collect.fetchddb", "ogn.collect.logbook"])
|
||||
|
||||
DB_URI = 'sqlite:///beacons.db'
|
||||
|
||||
|
|
|
@ -9,11 +9,19 @@ from sqlalchemy.sql.expression import true, false, label
|
|||
from ogn.model import Device, TakeoffLanding
|
||||
|
||||
from ogn.commands.dbutils import session
|
||||
from ogn.collect.logbook import compute_takeoff_and_landing
|
||||
|
||||
from manager import Manager
|
||||
manager = Manager()
|
||||
|
||||
|
||||
@manager.command
|
||||
def compute():
|
||||
"""Compute takeoffs and landings."""
|
||||
print("Compute takeoffs and landings...")
|
||||
compute_takeoff_and_landing.delay()
|
||||
|
||||
|
||||
@manager.command
|
||||
def show(airport_name, latitude, longitude, altitude):
|
||||
"""Show a logbook for <airport_name> located at given position."""
|
||||
|
|
Ładowanie…
Reference in New Issue