mirror of
				https://github.com/Ahp06/SUMO_Emissions.git
				synced 2025-11-03 19:49:19 +00:00 
			
		
		
		
	Check whether logdir exists before creating it
This commit is contained in:
		@@ -30,6 +30,7 @@ def generate_scenario(out_path, name):
 | 
				
			|||||||
    shutil.copyfile(os.path.join(STATICDIR, 'simul.sumocfg'), os.path.join(out_path, f'{name}.sumocfg'))
 | 
					    shutil.copyfile(os.path.join(STATICDIR, 'simul.sumocfg'), os.path.join(out_path, f'{name}.sumocfg'))
 | 
				
			||||||
    # Move log files
 | 
					    # Move log files
 | 
				
			||||||
    logdir = os.path.join(out_path, 'log')
 | 
					    logdir = os.path.join(out_path, 'log')
 | 
				
			||||||
 | 
					    if not os.path.exists(logdir):
 | 
				
			||||||
        os.mkdir(logdir)
 | 
					        os.mkdir(logdir)
 | 
				
			||||||
    for f in os.listdir(STATICDIR):
 | 
					    for f in os.listdir(STATICDIR):
 | 
				
			||||||
        if f.endswith('.log'):
 | 
					        if f.endswith('.log'):
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user