mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 17:00:05 +00:00 
			
		
		
		
	Added warning message about breaking tests
This commit is contained in:
		
							parent
							
								
									d8472a33f8
								
							
						
					
					
						commit
						b7213ddc5c
					
				
					 1 changed files with 8 additions and 1 deletions
				
			
		|  | @ -4,6 +4,8 @@ import json | ||||||
| import argparse | import argparse | ||||||
| 
 | 
 | ||||||
| NOAA_BASE = "https://www.ncdc.noaa.gov/homr/services/station" | NOAA_BASE = "https://www.ncdc.noaa.gov/homr/services/station" | ||||||
|  | WARNING = "\033[93mWARNING: Updating radar sites may break tests in \ | ||||||
|  | 'test/source/scwx/qt/config/radar_sites.test.cpp'\033[39m" | ||||||
| 
 | 
 | ||||||
| # Get the noaa station data. | # Get the noaa station data. | ||||||
| # platform is what platform should be searched for | # platform is what platform should be searched for | ||||||
|  | @ -183,7 +185,7 @@ def make_coords(stations, file): | ||||||
| def main(): | def main(): | ||||||
|     parser = argparse.ArgumentParser( |     parser = argparse.ArgumentParser( | ||||||
|             description="""Update supercell-wx's location data for towers form NOAA's HOMR database.\n |             description="""Update supercell-wx's location data for towers form NOAA's HOMR database.\n | ||||||
|             Recommended Arguments: -u ../res/config/radar_sites.json -t""") |             Recommended Arguments: -u ../res/config/radar_sites.json -t -w""") | ||||||
|     parser.add_argument("--current_file", "-u", type = str, default = None, required = False, |     parser.add_argument("--current_file", "-u", type = str, default = None, required = False, | ||||||
|                         help = "The 'radar_sites.json' file to update. Without this option, this will generate a new file") |                         help = "The 'radar_sites.json' file to update. Without this option, this will generate a new file") | ||||||
|     parser.add_argument("--test_updated", "-t", default = False, action = "store_true", |     parser.add_argument("--test_updated", "-t", default = False, action = "store_true", | ||||||
|  | @ -202,6 +204,8 @@ def main(): | ||||||
|                         help = "Get AWOS and UPPERAIR stations as well. Should NOT be used.") |                         help = "Get AWOS and UPPERAIR stations as well. Should NOT be used.") | ||||||
|     parser.add_argument("--current_only", "-C", default = False, action = "store_true", |     parser.add_argument("--current_only", "-C", default = False, action = "store_true", | ||||||
|                         help = "Get only currently active stations. Does not seem to change anything.") |                         help = "Get only currently active stations. Does not seem to change anything.") | ||||||
|  |     parser.add_argument("--warn", "-w", default = False, action = "store_true", | ||||||
|  |                         help = "Display a warning about breaking a test by updating the radar sites.") | ||||||
| 
 | 
 | ||||||
|     args = parser.parse_args() |     args = parser.parse_args() | ||||||
|     # default to updating the same file as input |     # default to updating the same file as input | ||||||
|  | @ -275,6 +279,9 @@ def main(): | ||||||
|             if failed: |             if failed: | ||||||
|                 exit(4) |                 exit(4) | ||||||
| 
 | 
 | ||||||
|  |     if args.warn: | ||||||
|  |         print(WARNING) | ||||||
|  | 
 | ||||||
| if __name__ == "__main__": | if __name__ == "__main__": | ||||||
|     main() |     main() | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 AdenKoperczak
						AdenKoperczak