+ # if given a newline-separated list of strings, then expand it into a list
+ if isinstance(strings, str):
+ expanded_strings = strings.split("\n")
+ elif isinstance(strings, list):
+ expanded_strings = strings
+ else:
+ raise TypeError
+
+ # eliminate any blank strings from the list
+ non_blank_strings = []
+ for string in expanded_strings:
+ if string:
+ non_blank_strings.append(string)
+
+ handles = []
+ for line in non_blank_strings:
+ handle = GacksHandle(string = rspec)
+ handles.append(handle)
+
+ return handles
+
+def handles_to_strings(handles):
+ strings = []
+ for handle in handles:
+ strings.append(handle.as_string())
+ return strings
+
+def rspec_to_handles(rspec):
+ return strings_to_handles(rspec)
+
+def find_handle_in_list(list, uStart, uStop, tStart, tStop):
+ for item in list:
+ if item.unitStart == uStart and \
+ item.unitStop == uStop and \
+ item.timeStart == tStart and \
+ item.timeStop == tStop:
+ return item
+ return None