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.' INVALID_FILE_MESSAGE = 'File is invalid.'
NO_COMPLETIONS_MESSAGE = 'No completions found; errors in the file?' NO_COMPLETIONS_MESSAGE = 'No completions found; errors in the file?'
FILE_TOO_SHORT_MESSAGE = ( 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 ) ) MIN_LINES_IN_FILE_TO_PARSE ) )
NO_DIAGNOSTIC_MESSAGE = 'No diagnostic for current line!' NO_DIAGNOSTIC_MESSAGE = 'No diagnostic for current line!'

View File

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

View File

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

View File

@ -90,8 +90,8 @@ def LoadDictIntoVimGlobals( new_globals, overwrite = True ):
# We need to use json.dumps because that won't use the 'u' prefix on strings # We need to use json.dumps because that won't use the 'u' prefix on strings
# which Vim would bork on. # 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 ) ) extend_option ) )
# Changing the returned dict will NOT change the value in Vim. # Changing the returned dict will NOT change the value in Vim.

View File

@ -204,10 +204,10 @@ class YouCompleteMe( object ):
def DebugInfo( self ): def DebugInfo( self ):
debug_info = BaseRequest.PostDataToHandler( BuildRequestData(), debug_info = BaseRequest.PostDataToHandler( BuildRequestData(),
'debug_info' ) 'debug_info' )
debug_info += '\nServer running at: {}'.format( debug_info += '\nServer running at: {0}'.format(
BaseRequest.server_location ) BaseRequest.server_location )
if self._server_stderr or self._server_stdout: 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_stdout,
self._server_stderr ) self._server_stderr )