this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

update generator

alice 57e56da6 226d2e44

+11 -5
+11 -5
scripts/generate_airport_tz_list.py
··· 333 333 f.write(f"// Year-specific DST data for {year}\n\n") 334 334 f.write("#include <stdint.h>\n\n") 335 335 # Code pool 336 - f.write("static const char* airport_code_pool[] = {\n") 337 - for code in code_pool: 338 - f.write(f" \"{code}\",\n") 339 - f.write("};\n\n") 336 + f.write("static const char airport_code_pool[] =\n") 337 + for i, code in enumerate(code_pool): 338 + if i % 8 == 0: 339 + f.write(" ") # Indent new line 340 + f.write(f'"{code}"') 341 + if (i + 1) % 8 == 0 or (i + 1) == len(code_pool): 342 + f.write("\n") # Newline every 8 codes or at the end 343 + else: 344 + f.write(" ") # Space between codes on the same line 345 + f.write(";\n\n") 340 346 341 347 # Name pool 342 348 f.write("static const char* airport_name_pool[] = {\n") ··· 365 371 f.write(f" {{ {std_h:.2f}f, {dst_h:.2f}f, {start}LL, {end}LL, {off}, {cnt} }},\n") 366 372 f.write("};\n\n") 367 373 f.write("#define AIRPORT_TZ_LIST_COUNT (sizeof(airport_tz_list)/sizeof(airport_tz_list[0]))\n") 368 - f.write("#define AIRPORT_CODE_POOL_COUNT (sizeof(airport_code_pool)/sizeof(airport_code_pool[0]))\n") 374 + f.write("#define AIRPORT_CODE_POOL_COUNT (sizeof(airport_code_pool)/3)\n") 369 375 f.write("#define AIRPORT_NAME_POOL_COUNT (sizeof(airport_name_pool)/sizeof(airport_name_pool[0]))\n") 370 376 371 377 print(