kopia lustrzana https://github.com/glidernet/ogn-python
Small bugs
rodzic
30599c4c35
commit
e0145de086
|
@ -6,9 +6,6 @@ from .address_origin import AddressOrigin
|
||||||
from .base import Base
|
from .base import Base
|
||||||
|
|
||||||
|
|
||||||
FLARMNET_LINE_LENGTH = 173
|
|
||||||
|
|
||||||
|
|
||||||
class Flarm(Base):
|
class Flarm(Base):
|
||||||
__tablename__ = 'flarm'
|
__tablename__ = 'flarm'
|
||||||
|
|
||||||
|
@ -26,6 +23,8 @@ class Flarm(Base):
|
||||||
|
|
||||||
address_origin = Column(SmallInteger)
|
address_origin = Column(SmallInteger)
|
||||||
|
|
||||||
|
FLARMNET_LINE_LENGTH = 173
|
||||||
|
|
||||||
def parse_ogn(self, line):
|
def parse_ogn(self, line):
|
||||||
PATTERN = "\'([FIO])\',\'(.{6})\',\'([^\']+)?\',\'([^\']+)?\',\'([^\']+)?\',\'([YN])\',\'([YN])\'"
|
PATTERN = "\'([FIO])\',\'(.{6})\',\'([^\']+)?\',\'([^\']+)?\',\'([^\']+)?\',\'([YN])\',\'([YN])\'"
|
||||||
ogn_re = re.compile(PATTERN)
|
ogn_re = re.compile(PATTERN)
|
||||||
|
@ -84,7 +83,7 @@ if __name__ == '__main__':
|
||||||
response = urllib.request.urlopen("http://flarmnet.org/files/data.fln")
|
response = urllib.request.urlopen("http://flarmnet.org/files/data.fln")
|
||||||
lines = response.readlines()
|
lines = response.readlines()
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if (len(line) != FLARMNET_LINE_LENGTH):
|
if (len(line) != Flarm.FLARMNET_LINE_LENGTH):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
flarm = Flarm()
|
flarm = Flarm()
|
||||||
|
|
|
@ -4,7 +4,7 @@ from time import time
|
||||||
from ogn import db_utils
|
from ogn import db_utils
|
||||||
from ogn import settings
|
from ogn import settings
|
||||||
from ogn.aprs_parser import parse_aprs
|
from ogn.aprs_parser import parse_aprs
|
||||||
from .model import Position, Receiver
|
from ogn.model import Position, Receiver
|
||||||
|
|
||||||
|
|
||||||
def proceed():
|
def proceed():
|
||||||
|
|
Ładowanie…
Reference in New Issue