Making work with threading
This commit is contained in:
parent
c13c101ac5
commit
470fe21ad1
@ -138,7 +138,7 @@ def writeOutputFile(filename, data):
|
||||
os.system('sync')
|
||||
os.system('rm %s'%(tmpfile))
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main():
|
||||
global cfg
|
||||
cfg = configparser.ConfigParser()
|
||||
cfg.read('config.cfg')
|
||||
@ -158,5 +158,30 @@ if __name__ == "__main__":
|
||||
writeOutputFile(arguments.outputfilename, data)
|
||||
logger.info('Complete')
|
||||
|
||||
def threadingCSV(csv):
|
||||
global cfg
|
||||
cfg = configparser.ConfigParser()
|
||||
cfg.read('config.cfg')
|
||||
|
||||
arguments = argParser()
|
||||
arguments.csvfile = csv[0]
|
||||
arguments.outputfilename = csv[1]
|
||||
global logger
|
||||
logging.config.fileConfig('logging.cfg')
|
||||
logger = logging.getLogger(__name__)
|
||||
logger.info('Starting ADSB Encoder')
|
||||
logger.debug('The arguments: %s' % (arguments))
|
||||
data = None
|
||||
if arguments.csvfile == '':
|
||||
data = singlePlane(arguments)
|
||||
else:
|
||||
data = manyPlanes(arguments)
|
||||
writeOutputFile(arguments.outputfilename, data)
|
||||
logger.info('Complete')
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user