| Index: Source/bindings/scripts/utilities.py
|
| diff --git a/Source/bindings/scripts/utilities.py b/Source/bindings/scripts/utilities.py
|
| index 7a7a3e69f874fd98a634b871080dc63a363aad05..34bcad53400083ac6371947f0e9ccb7841974229 100644
|
| --- a/Source/bindings/scripts/utilities.py
|
| +++ b/Source/bindings/scripts/utilities.py
|
| @@ -18,6 +18,11 @@ class IdlBadFilenameError(Exception):
|
| pass
|
|
|
|
|
| +def idl_filename_to_interface_name(idl_filename):
|
| + # interface name is the root of the basename: InterfaceName.idl
|
| + return os.path.splitext(os.path.basename(idl_filename))[0]
|
| +
|
| +
|
| ################################################################################
|
| # Basic file reading/writing
|
| ################################################################################
|
| @@ -27,6 +32,12 @@ def get_file_contents(filename):
|
| return f.read()
|
|
|
|
|
| +def read_file_to_list(filename):
|
| + """Returns a list of (stripped) lines for a given filename."""
|
| + with open(filename) as f:
|
| + return [line.rstrip('\n') for line in f]
|
| +
|
| +
|
| def write_file(new_text, destination_filename, only_if_changed):
|
| if only_if_changed and os.path.isfile(destination_filename):
|
| with open(destination_filename) as destination_file:
|
|
|