From 120d5daf6b78f84c9a89053ab399cd7fc8c47c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Gru=CC=88ndger?= Date: Sun, 15 Nov 2015 12:10:20 +0100 Subject: [PATCH] Cleanup --- ogn/__init__.py | 1 - ogn/commands/database.py | 2 +- ogn/commands/showreceiver.py | 2 +- ogn/gateway/__init__.py | 2 +- ogn/gateway/manage.py | 1 + tests/__init__.py | 1 - tests/model/__init__.py | 1 - tests/model/test_aircraft_beacon.py | 3 +-- tests/model/test_beacon.py | 2 +- tests/model/test_receiver_beacon.py | 2 +- 10 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ogn/__init__.py b/ogn/__init__.py index 8b13789..e69de29 100644 --- a/ogn/__init__.py +++ b/ogn/__init__.py @@ -1 +0,0 @@ - diff --git a/ogn/commands/database.py b/ogn/commands/database.py index c8d1140..f18b9f4 100755 --- a/ogn/commands/database.py +++ b/ogn/commands/database.py @@ -19,4 +19,4 @@ def updateddb(): print("Updating ddb data...") result = update_ddb_data.delay() counter = result.get() - print("Imported %i devieces."%counter) + print("Imported %i devices." % counter) diff --git a/ogn/commands/showreceiver.py b/ogn/commands/showreceiver.py index 8b78e53..8940e6b 100755 --- a/ogn/commands/showreceiver.py +++ b/ogn/commands/showreceiver.py @@ -16,7 +16,7 @@ manager = Manager() @manager.command -def list(): +def list_all(): """Show a list of all receivers.""" sq = session.query(distinct(ReceiverBeacon.name).label('name'), func.max(ReceiverBeacon.timestamp).label('lastseen'), func.count(ReceiverBeacon.name).label('messages_count')).\ filter(ReceiverBeacon.timestamp > back_24h).\ diff --git a/ogn/gateway/__init__.py b/ogn/gateway/__init__.py index 91747c3..31a5eff 100644 --- a/ogn/gateway/__init__.py +++ b/ogn/gateway/__init__.py @@ -11,6 +11,7 @@ from ogn.model import Base MODULE_VERSION = "0.1" + class ognGateway: def __init__(self): pass @@ -30,7 +31,6 @@ class ognGateway: self.sock.send(login.encode()) self.sock_file = self.sock.makefile('rw') - def run(self): keepalive_time = time() while True: diff --git a/ogn/gateway/manage.py b/ogn/gateway/manage.py index d3b8337..3f6bab8 100644 --- a/ogn/gateway/manage.py +++ b/ogn/gateway/manage.py @@ -5,6 +5,7 @@ DB_URI = 'sqlite:///beacons.db' from manager import Manager manager = Manager() + @manager.command def run(aprs_user="anon-dev"): """Run the aprs client.""" diff --git a/tests/__init__.py b/tests/__init__.py index 8b13789..e69de29 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1 +0,0 @@ - diff --git a/tests/model/__init__.py b/tests/model/__init__.py index 8b13789..e69de29 100644 --- a/tests/model/__init__.py +++ b/tests/model/__init__.py @@ -1 +0,0 @@ - diff --git a/tests/model/test_aircraft_beacon.py b/tests/model/test_aircraft_beacon.py index eaee0fa..b210234 100644 --- a/tests/model/test_aircraft_beacon.py +++ b/tests/model/test_aircraft_beacon.py @@ -1,8 +1,7 @@ import unittest from ogn.aprs_utils import ms2fpm -from ogn.model.beacon import Beacon -from ogn.model.aircraft_beacon import AircraftBeacon +from ogn.model import Beacon, AircraftBeacon class TestStringMethods(unittest.TestCase): diff --git a/tests/model/test_beacon.py b/tests/model/test_beacon.py index 0918471..51c873b 100644 --- a/tests/model/test_beacon.py +++ b/tests/model/test_beacon.py @@ -1,7 +1,7 @@ import unittest from ogn.aprs_utils import dmsToDeg, kts2kmh, m2feet -from ogn.model.beacon import Beacon +from ogn.model import Beacon class TestStringMethods(unittest.TestCase): diff --git a/tests/model/test_receiver_beacon.py b/tests/model/test_receiver_beacon.py index c687779..5630cb0 100644 --- a/tests/model/test_receiver_beacon.py +++ b/tests/model/test_receiver_beacon.py @@ -1,6 +1,6 @@ import unittest -from ogn.model.receiver_beacon import ReceiverBeacon +from ogn.model import ReceiverBeacon class TestStringMethods(unittest.TestCase):