From e0145de08665408b8468a0de586d9480bd6f33ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Gru=CC=88ndger?= Date: Wed, 4 Nov 2015 08:16:49 +0100 Subject: [PATCH] Small bugs --- ogn/model/flarm.py | 7 +++---- ogn/ognproceed.py | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ogn/model/flarm.py b/ogn/model/flarm.py index 3b44fd2..021ad75 100644 --- a/ogn/model/flarm.py +++ b/ogn/model/flarm.py @@ -6,9 +6,6 @@ from .address_origin import AddressOrigin from .base import Base -FLARMNET_LINE_LENGTH = 173 - - class Flarm(Base): __tablename__ = 'flarm' @@ -26,6 +23,8 @@ class Flarm(Base): address_origin = Column(SmallInteger) + FLARMNET_LINE_LENGTH = 173 + def parse_ogn(self, line): PATTERN = "\'([FIO])\',\'(.{6})\',\'([^\']+)?\',\'([^\']+)?\',\'([^\']+)?\',\'([YN])\',\'([YN])\'" ogn_re = re.compile(PATTERN) @@ -84,7 +83,7 @@ if __name__ == '__main__': response = urllib.request.urlopen("http://flarmnet.org/files/data.fln") lines = response.readlines() for line in lines: - if (len(line) != FLARMNET_LINE_LENGTH): + if (len(line) != Flarm.FLARMNET_LINE_LENGTH): continue flarm = Flarm() diff --git a/ogn/ognproceed.py b/ogn/ognproceed.py index cd47bea..7daed1a 100644 --- a/ogn/ognproceed.py +++ b/ogn/ognproceed.py @@ -4,7 +4,7 @@ from time import time from ogn import db_utils from ogn import settings from ogn.aprs_parser import parse_aprs -from .model import Position, Receiver +from ogn.model import Position, Receiver def proceed():