#---------- logical_lines.py----------# # Determine the logical lines in a file that might have # continuation characters. 'logical_lines()' returns a # list. The self-test prints the logical lines as # physical lines (for all specified files and options). import re def logical_lines(s, continuation='\\', strip_trailing_space=0): c = continuation if strip_trailing_space: s = re.sub(r'(?m)(%s)(\s+)$'%[c], r'\1', s) pat_log = r'(?sm)^.*?$(?