From 107137311a019b649ab66d01658b9267c9aa6687 Mon Sep 17 00:00:00 2001 From: aphorton Date: Thu, 15 Jan 2015 15:43:31 -0600 Subject: [PATCH] fix indentation in returned parser source #56 This fixes a bug in source_parser.py, where main() was assumed to be indented with spaces. --- gooey/python_bindings/source_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gooey/python_bindings/source_parser.py b/gooey/python_bindings/source_parser.py index ad0474d..7acba8a 100644 --- a/gooey/python_bindings/source_parser.py +++ b/gooey/python_bindings/source_parser.py @@ -116,8 +116,8 @@ def get_indent(line): def format_source_to_return_parser(source, cutoff_line, restart_line, col_offset, parser_name): top = source[:cutoff_line - 1] bottom = source[restart_line:] - - return_statement = ['{}return {}\n\n'.format(' ' * col_offset, parser_name)] + indentation = source[cutoff_line - 1][:col_offset] + return_statement = ['{}return {}\n\n'.format(indentation, parser_name)] # stitch it all back together excluding the Gooey decorator new_source = (line for line in chain(top, return_statement, bottom)