Skip to content

Commit

Permalink
BUG: Decoupled config files should not depend
Browse files Browse the repository at this point in the history
The ITK*snake_case.py and the ITK*Config.py files
should not be dependant on each other during
the build process.  Previous attempt to decouple
the process resulted in accidently leaving
overly perscriptive checking, and unnecessary
file creation dependancy order that is not
required.
  • Loading branch information
hjmjohnson committed Oct 16, 2020
1 parent 2504f43 commit 4c3d376
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions Wrapping/Generators/SwigInterface/igenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,21 +1242,13 @@ def generate_swig_input(moduleName):
generate_swig_input(moduleName)

snake_case_file = options.snake_case_file
main_config_file = snake_case_file.replace("_snake_case.py","Config.py")
if not os.path.exists(main_config_file):
print(
f"ERROR: required {main_config_file} file does not exist\n"
f"can not append to {snake_case_file}\n"
with open(snake_case_file, "w") as ff:
ff.write("snake_case_functions = (")
# Ensure that the functions are sorted alphabetically to ensure consistency
# in the generated file structure.
sorted_snake_case_process_object_functions = sorted(
snake_case_process_object_functions
)
sys.exit(-1)
else:
with open(snake_case_file, "w") as ff:
ff.write("snake_case_functions = (")
# Ensure that the functions are sorted alphabetically to ensure consistency
# in the generated file structure.
sorted_snake_case_process_object_functions = sorted(
snake_case_process_object_functions
)
for function in sorted_snake_case_process_object_functions:
ff.write("'" + function + "', ")
ff.write(")\n")
for function in sorted_snake_case_process_object_functions:
ff.write("'" + function + "', ")
ff.write(")\n")

0 comments on commit 4c3d376

Please sign in to comment.