From 37d7afd15eb01eb09fd2ff0d157bdcada84aa329 Mon Sep 17 00:00:00 2001 From: "Fabian P. Schmidt" Date: Sun, 15 Nov 2015 10:31:35 +0100 Subject: [PATCH] Fix module imports; Readd aprs settings. --- ogn/commands/database.py | 2 +- ogn/commands/logbook.py | 2 +- ogn/commands/showreceiver.py | 2 +- ogn/gateway/__init__.py | 2 +- ogn/gateway/settings.py | 6 ++++++ tests/test_ognutils.py | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 ogn/gateway/settings.py diff --git a/ogn/commands/database.py b/ogn/commands/database.py index cd2f6a3..c8d1140 100755 --- a/ogn/commands/database.py +++ b/ogn/commands/database.py @@ -8,7 +8,7 @@ from ogn.collect.fetchddb import update_ddb_data @manager.command def init(): """Initialize the database.""" - from dbutils import engine + from ogn.commands.dbutils import engine Base.metadata.create_all(engine) print("Done.") diff --git a/ogn/commands/logbook.py b/ogn/commands/logbook.py index 13559bf..8d84341 100755 --- a/ogn/commands/logbook.py +++ b/ogn/commands/logbook.py @@ -8,7 +8,7 @@ from sqlalchemy.sql.expression import case, true, false, label from ogn.model import Flarm, AircraftBeacon, TakeoffLanding -from dbutils import session +from ogn.commands.dbutils import session from manager import Manager manager = Manager() diff --git a/ogn/commands/showreceiver.py b/ogn/commands/showreceiver.py index e295936..2094d9f 100755 --- a/ogn/commands/showreceiver.py +++ b/ogn/commands/showreceiver.py @@ -5,7 +5,7 @@ from sqlalchemy import distinct, and_ from ogn.model import ReceiverBeacon -from dbutils import session +from ogn.commands.dbutils import session back_24h = datetime.utcnow() - timedelta(days=1) receiver_messages_per_24h = 24*60 / 5 diff --git a/ogn/gateway/__init__.py b/ogn/gateway/__init__.py index a5d3897..91747c3 100644 --- a/ogn/gateway/__init__.py +++ b/ogn/gateway/__init__.py @@ -1,7 +1,7 @@ import socket from time import time -from ogn import settings +from ogn.gateway import settings from ogn.commands.dbutils import session from ogn.aprs_parser import parse_aprs diff --git a/ogn/gateway/settings.py b/ogn/gateway/settings.py new file mode 100644 index 0000000..3ccad01 --- /dev/null +++ b/ogn/gateway/settings.py @@ -0,0 +1,6 @@ +APRS_SERVER_HOST = 'aprs.glidernet.org' +APRS_SERVER_PORT = 14580 +APRS_USER = 'PyGrabber' +APRS_PASSCODE = -1 # Read only + +APRS_FILTER = "filter r/+50.0000/+10.0000/5000" diff --git a/tests/test_ognutils.py b/tests/test_ognutils.py index 9810a19..764807e 100644 --- a/tests/test_ognutils.py +++ b/tests/test_ognutils.py @@ -1,5 +1,5 @@ import unittest -from ogn.ognutils import get_ddb, get_country_code +from ogn.utils import get_ddb, get_country_code from ogn.model.address_origin import AddressOrigin