Rename module ogn.exceptions to ogn.parser.exceptions

pull/43/head
Fabian P. Schmidt 2016-02-18 16:01:06 +01:00
rodzic 756ac0e337
commit 2012310ad2
11 zmienionych plików z 14 dodań i 15 usunięć

Wyświetl plik

@ -1,7 +1,7 @@
from datetime import datetime from datetime import datetime
from .model import Beacon, AircraftBeacon, ReceiverBeacon from .model import Beacon, AircraftBeacon, ReceiverBeacon
from ogn.exceptions import AprsParseError from ogn.parser.exceptions import AprsParseError
def parse_aprs(packet, reference_date=None): def parse_aprs(packet, reference_date=None):

Wyświetl plik

@ -4,7 +4,7 @@ from time import time
from ogn.gateway import settings from ogn.gateway import settings
from ogn.aprs_parser import parse_aprs from ogn.aprs_parser import parse_aprs
from ogn.exceptions import AprsParseError, OgnParseError, AmbigousTimeError from ogn.parser.exceptions import AprsParseError, OgnParseError, AmbigousTimeError
def create_aprs_login(user_name, pass_code, app_name, app_version, aprs_filter=None): def create_aprs_login(user_name, pass_code, app_name, app_version, aprs_filter=None):

Wyświetl plik

@ -4,7 +4,7 @@ from sqlalchemy import Column, String, Integer, Float, Boolean, SmallInteger
from ogn.parser.utils import fpm2ms from ogn.parser.utils import fpm2ms
from .beacon import Beacon from .beacon import Beacon
from ogn.exceptions import OgnParseError from ogn.parser.exceptions import OgnParseError
class AircraftBeacon(Beacon): class AircraftBeacon(Beacon):

Wyświetl plik

@ -5,7 +5,7 @@ from sqlalchemy import Column, String, Integer, Float, DateTime
from sqlalchemy.ext.declarative import AbstractConcreteBase from sqlalchemy.ext.declarative import AbstractConcreteBase
from ogn.parser.utils import createTimestamp, dmsToDeg, kts2kmh, feet2m from ogn.parser.utils import createTimestamp, dmsToDeg, kts2kmh, feet2m
from ogn.exceptions import AprsParseError from ogn.parser.exceptions import AprsParseError
from .base import Base from .base import Base

Wyświetl plik

@ -3,7 +3,7 @@ import re
from sqlalchemy import Column, Float, String from sqlalchemy import Column, Float, String
from .beacon import Beacon from .beacon import Beacon
from ogn.exceptions import OgnParseError from ogn.parser.exceptions import OgnParseError
class ReceiverBeacon(Beacon): class ReceiverBeacon(Beacon):

Wyświetl plik

Wyświetl plik

@ -9,17 +9,16 @@ class AprsParseError(Exception):
def __init__(self, aprs_string): def __init__(self, aprs_string):
self.aprs_string = aprs_string self.aprs_string = aprs_string
self.message = "This is not a valid APRS string: {}".format(aprs_string) self.message = "This is not a valid APRS packet: {}".format(aprs_string)
super(AprsParseError, self).__init__(self.message) super(AprsParseError, self).__init__(self.message)
class OgnParseError(Exception): class OgnParseError(Exception):
"""Parse error while parsing an aprs packet substring.""" """Parse error while parsing an ogn message from aprs comment."""
def __init__(self, substring, expected_type): def __init__(self, aprs_comment):
self.substring = substring self.aprs_comment = aprs_comment
self.expected_type = expected_type
self.message = "For type {} this is not a valid token: {}".format(expected_type, substring) self.message = "This is not a valid OGN message: {}".format(aprs_comment)
super(OgnParseError, self).__init__(self.message) super(OgnParseError, self).__init__(self.message)

Wyświetl plik

@ -4,7 +4,7 @@ from datetime import datetime
from ogn.parser.utils import ms2fpm from ogn.parser.utils import ms2fpm
from ogn.model import Beacon, AircraftBeacon from ogn.model import Beacon, AircraftBeacon
from ogn.exceptions import OgnParseError from ogn.parser.exceptions import OgnParseError
class TestStringMethods(unittest.TestCase): class TestStringMethods(unittest.TestCase):

Wyświetl plik

@ -4,7 +4,7 @@ from datetime import datetime
from ogn.parser.utils import dmsToDeg, kts2kmh, m2feet from ogn.parser.utils import dmsToDeg, kts2kmh, m2feet
from ogn.model import Beacon from ogn.model import Beacon
from ogn.exceptions import AprsParseError from ogn.parser.exceptions import AprsParseError
class TestStringMethods(unittest.TestCase): class TestStringMethods(unittest.TestCase):

Wyświetl plik

@ -1,7 +1,7 @@
import unittest import unittest
from ogn.model import ReceiverBeacon from ogn.model import ReceiverBeacon
from ogn.exceptions import OgnParseError from ogn.parser.exceptions import OgnParseError
class TestStringMethods(unittest.TestCase): class TestStringMethods(unittest.TestCase):

Wyświetl plik

@ -5,7 +5,7 @@ from datetime import datetime
from time import sleep from time import sleep
from ogn.aprs_parser import parse_aprs from ogn.aprs_parser import parse_aprs
from ogn.exceptions import AprsParseError, OgnParseError from ogn.parser.exceptions import AprsParseError, OgnParseError
class TestStringMethods(unittest.TestCase): class TestStringMethods(unittest.TestCase):