kopia lustrzana https://github.com/glidernet/ogn-python
import_logfile: Add reference_date argument
rodzic
ac03cc2ab6
commit
2b69ef5cac
|
@ -43,8 +43,8 @@ def run(aprs_user='anon-dev', logfile='main.log', loglevel='INFO'):
|
||||||
|
|
||||||
|
|
||||||
@manager.command
|
@manager.command
|
||||||
def import_logfile(ogn_logfile, logfile='main.log', loglevel='INFO'):
|
def import_logfile(ogn_logfile, reference_date, logfile='main.log', loglevel='INFO'):
|
||||||
"""Import OGN-data from ogn-log-files <arg: ogn-logfile>."""
|
"""Import OGN-data from ogn-log-files <arg: ogn-logfile, reference_date>. Reference date must be given in YYYY-MM-DD."""
|
||||||
|
|
||||||
# Check if filename exists
|
# Check if filename exists
|
||||||
try:
|
try:
|
||||||
|
@ -61,7 +61,7 @@ def import_logfile(ogn_logfile, logfile='main.log', loglevel='INFO'):
|
||||||
|
|
||||||
print('Start importing ogn-logfile')
|
print('Start importing ogn-logfile')
|
||||||
for line in f:
|
for line in f:
|
||||||
process_beacon(line)
|
process_beacon(line, reference_date)
|
||||||
|
|
||||||
f.close()
|
f.close()
|
||||||
logging.shutdown()
|
logging.shutdown()
|
||||||
|
|
Ładowanie…
Reference in New Issue