#NEWLINE# def quote_completions( self , completions , cword_prequote , first_colon_pos ) : #NEWLINE# #INDENT# "\n        If the word under the cursor started with a quote (as indicated by a nonempty ``cword_prequote``), escapes\n        occurrences of that quote character in the completions, and adds the quote to the beginning of each completion.\n        Otherwise, escapes all characters that bash splits words on (``COMP_WORDBREAKS``), and removes portions of\n        completions before the first colon.\n\n        If there is only one completion, and it doesn't end with a **continuation character** (``/``, ``:``, or ``=``),\n        adds a space after the completion.\n\n        This method is exposed for overriding in subclasses; there is no need to use it directly.\n        " #NEWLINE# comp_wordbreaks = os . environ . get ( '_ARGCOMPLETE_COMP_WORDBREAKS' , os . environ . get ( 'COMP_WORDBREAKS' , ' \t"\'@><=;|&(:.' ) ) #NEWLINE# if USING_PYTHON2 : #NEWLINE# #INDENT# comp_wordbreaks = comp_wordbreaks . decode ( sys_encoding ) #NEWLINE# #UNINDENT# punctuation_chars = '();<>|&!`' #NEWLINE# for char in punctuation_chars : #NEWLINE# #INDENT# if ( char not in comp_wordbreaks ) : #NEWLINE# #INDENT# comp_wordbreaks += char #NEWLINE# #UNINDENT# #UNINDENT# if ( cword_prequote == '' ) : #NEWLINE# #INDENT# if first_colon_pos : #NEWLINE# #INDENT# completions = [ c [ ( first_colon_pos + 1 ) : ] for c in completions ] #NEWLINE# #UNINDENT# for wordbreak_char in comp_wordbreaks : #NEWLINE# #INDENT# completions = [ c . replace ( wordbreak_char , ( '\\' + wordbreak_char ) ) for c in completions ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( char == '"' ) : #NEWLINE# #INDENT# for char in '`$!' : #NEWLINE# #INDENT# completions = [ c . replace ( char , ( '\\' + char ) ) for c in completions ] #NEWLINE# #UNINDENT# #UNINDENT# completions = [ ( cword_prequote + c . replace ( cword_prequote , ( '\\' + cword_prequote ) ) ) for c in completions ] #NEWLINE# #UNINDENT# continuation_chars = '=/:' #NEWLINE# if ( ( len ( completions ) == 1 ) and ( completions [ 0 ] [ ( - 1 ) ] not in continuation_chars ) ) : #NEWLINE# #INDENT# if ( ( cword_prequote == '' ) and ( not completions [ 0 ] . endswith ( ' ' ) ) ) : #NEWLINE# #INDENT# completions [ 0 ] += ' ' #NEWLINE# #UNINDENT# #UNINDENT# return completions