Fixed some indenting so outputs are only called when there's something to output. Hopefully also fixed that pesky NoneType error.

This commit is contained in:
Nick Foster
2010-10-23 16:51:09 -07:00
parent 839596a4b2
commit 0d4194ef84
4 changed files with 13 additions and 11 deletions

View File

@@ -149,7 +149,7 @@ if __name__ == '__main__':
updates = [] #registry of plugin update functions
if options.kml is not None:
sqlport = modes_output_sql() #create a SQL parser to push stuff into SQLite
sqlport = modes_output_sql('adsb.db') #create a SQL parser to push stuff into SQLite
outputs.append(sqlport.insert)
#also we spawn a thread to run every 30 seconds (or whatever) to generate KML
kmlgen = modes_kml('adsb.db', options.kml) #create a KML generating thread which reads the database
@@ -178,8 +178,8 @@ if __name__ == '__main__':
while queue.empty_p() == 0 :
msg = queue.delete_head() #blocking read
for out in outputs:
out(msg.to_string())
for out in outputs:
out(msg.to_string())
elif runner.done:
raise KeyboardInterrupt