Fixing python 2.6 compatibility

string.format() requires the number inside '{}' for Python 2.6.
This commit is contained in:
Strahinja Val Markovic 2013-10-04 15:44:16 -07:00
parent ddef46fdbe
commit cb98dc8537
5 changed files with 8 additions and 8 deletions

View File

@ -33,7 +33,7 @@ NO_COMPILE_FLAGS_MESSAGE = 'Still no compile flags, no completions yet.'
INVALID_FILE_MESSAGE = 'File is invalid.'
NO_COMPLETIONS_MESSAGE = 'No completions found; errors in the file?'
FILE_TOO_SHORT_MESSAGE = (
'File is less than {} lines long; not compiling.'.format(
'File is less than {0} lines long; not compiling.'.format(
MIN_LINES_IN_FILE_TO_PARSE ) )
NO_DIAGNOSTIC_MESSAGE = 'No diagnostic for current line!'

View File

@ -100,7 +100,7 @@ class CsharpCompleter( Completer ):
def DebugInfo( self ):
if self._ServerIsRunning():
return 'Server running at: {}\nLogfiles:\n{}\n{}'.format(
return 'Server running at: {0}\nLogfiles:\n{1}\n{2}'.format(
self._PortToHost(), self._filename_stdout, self._filename_stderr )
else:
return 'Server is not running'
@ -118,7 +118,7 @@ class CsharpCompleter( Completer ):
solutionfile = solutionfiles[ 0 ]
else:
raise RuntimeError(
'Found multiple solution files instead of one!\n{}'.format(
'Found multiple solution files instead of one!\n{0}'.format(
solutionfiles ) )
omnisharp = os.path.join(

View File

@ -74,7 +74,7 @@ class ServerState( object ):
if completer:
return completer
raise ValueError( 'No semantic completer exists for filetypes: {}'.format(
raise ValueError( 'No semantic completer exists for filetypes: {0}'.format(
current_filetypes ) )

View File

@ -90,7 +90,7 @@ def LoadDictIntoVimGlobals( new_globals, overwrite = True ):
# We need to use json.dumps because that won't use the 'u' prefix on strings
# which Vim would bork on.
vim.eval( 'extend( g:, {}, {})'.format( json.dumps( new_globals ),
vim.eval( 'extend( g:, {0}, {1})'.format( json.dumps( new_globals ),
extend_option ) )

View File

@ -204,10 +204,10 @@ class YouCompleteMe( object ):
def DebugInfo( self ):
debug_info = BaseRequest.PostDataToHandler( BuildRequestData(),
'debug_info' )
debug_info += '\nServer running at: {}'.format(
debug_info += '\nServer running at: {0}'.format(
BaseRequest.server_location )
if self._server_stderr or self._server_stdout:
debug_info += '\nServer logfiles:\n {}\n {}'.format(
debug_info += '\nServer logfiles:\n {0}\n {1}'.format(
self._server_stdout,
self._server_stderr )