#NEWLINE# def shlex_split( x ) : #NEWLINE# #INDENT# 'Helper function to split lines into segments.\n    ' #NEWLINE# endofline = [ ] #NEWLINE# while ( x != '' ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# comps = shlex . split ( x ) #NEWLINE# if ( len ( x ) >= 1 ) : #NEWLINE# #INDENT# comps . append ( '' . join ( endofline ) ) #NEWLINE# #UNINDENT# return comps #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# endofline = ( [ x [ ( - 1 ) : ] ] + endofline ) #NEWLINE# x = x [ : ( - 1 ) ] #NEWLINE# #UNINDENT# #UNINDENT# return [ '' . join ( endofline ) ]