Fix the issue where was only the one split file in the CSV generator stuff

This commit is contained in:
nzkarit 2018-05-06 19:04:15 +12:00
parent 510e9da267
commit c9cae9130a
3 changed files with 9 additions and 11 deletions

View File

@ -168,15 +168,14 @@ def threadingCSV(csv):
global cfg
cfg = configparser.ConfigParser()
cfg.read('config.cfg')
arguments = argParser()
arguments.csvfile = csv[0]
arguments.outputfilename = csv[1]
arguments.csvfile = csv['csv']
arguments.outputfilename = csv['out']
global logger
logging.config.fileConfig('logging.cfg')
logger = logging.getLogger(__name__)
logger.info('Starting ADSB Encoder threadingCSV entry point')
logger.debug('Being called with the following CSV file: %s' % (csv[0]))
logger.debug('Being called with the following CSV file: %s' % (arguments.csvfile))
logger.debug('The arguments: %s' % (arguments))
data = None
if arguments.csvfile == '':

View File

@ -12,7 +12,7 @@ def writeFile(directory, filename, filenameExtension, data, count):
for row in data:
output.writerow([row])
csvfile.close()
return "['%s', '%s-%s.iq8s'],"%(csvFilename, filename, count)
return "{'csv':'%s', 'out':'%s-%s.iq8s'},"%(csvFilename, filename, count)
def main():
directory = 'generated'
@ -23,8 +23,7 @@ def main():
minICAO = 0x0
maxICAO = 0x3E8
# If the number of planes is less than the split it doesn't work
splitNumber = 100
splitNumber = 1000
try:
os.stat(directory)
@ -63,7 +62,7 @@ def main():
k += 1
j = 0
files = files[:-1]
script.write('files = (%s)\n' % (files))
script.write('files = [%s]\n' % (files))
script.write('for file in files:\n')
script.write(' t = threading.Thread(target=threadingCSV, args=(file,))\n')
script.write(' t.start()\n')

View File

@ -12,7 +12,7 @@ def writeFile(directory, filename, filenameExtension, data, count):
for row in data:
output.writerow([row])
csvfile.close()
return "['%s', '%s-%s.iq8s'],"%(csvFilename, filename, count)
return "{'csv':'%s', 'out':'%s-%s.iq8s'},"%(csvFilename, filename, count)
def main():
directory = 'generated'
@ -24,7 +24,7 @@ def main():
minLat = -90
maxLat = 90
# If the number of lat is less than the split it doesn't work
splitNumber = 100
splitNumber = 1000
step = 0.1
try:
@ -64,7 +64,7 @@ def main():
k += 1
j = 0
files = files[:-1]
script.write('files = (%s)\n' % (files))
script.write('files = [%s]\n' % (files))
script.write('for file in files:\n')
script.write(' t = threading.Thread(target=threadingCSV, args=(file,))\n')
script.write(' t.start()\n')