How to use the astor.source_repr.split_lines function in astor

To help you get started, we’ve selected a few astor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github berkerpeksag / astor / tests / test_misc.py View on Github external
def test_split_lines_unicode_support(self):
        source = [u'copy', '\n']
        self.assertEqual(split_lines(source), source)
github bsc-wdc / compss / compss / programming_model / bindings / tmp / python / src / pycompss / util / translators / astor_source_gen / pycompss_source_gen.py View on Github external
def long_long_line_ps(source):
        # A log pretty source printer for ASTOR because OSL parser does
        # not accept breaking statements into different lines
        from astor.source_repr import split_lines
        return ''.join(split_lines(source, maxline=200))
github fake-name / ReadableWebProxy / WebMirror / management / FeedDbManage.py View on Github external
def better_pretty_source(sauce):
	# I specifically don't want to wrap lines basically ever.
	# the code editor interface is ~180 cols.
	t1 = astor.source_repr.split_lines(sauce, maxline=170)
	t2 = astor.source_repr.flatten(t1)
	ret = ''.join(t2)
	return ret
github bsc-wdc / compss / compss / programming_model / bindings / tmp / python / src / pycompss / util / translators / astor_source_gen / pycompss_source_gen.py View on Github external
def long_line_ps(source):
        # A log pretty source printer for ASTOR because OSL parser does
        # not accept breaking statements into different lines
        from astor.source_repr import split_lines
        return ''.join(split_lines(source, maxline=120))