Commits

Arun Mahapatra  committed 7f6d318

ropevim 2to3-fied

  • Participants
  • Parent commits 6d27262

Comments (0)

Files changed (1)

     def ask_completion(self, prompt, values, starting=None):
         if self.get('vim_completion') and 'i' in call('mode()'):
             if not self.get('extended_complete', False):
-                proposals = u','.join(u"'%s'" % self._completion_text(proposal)
+                proposals = ','.join("'%s'" % self._completion_text(proposal)
                                       for proposal in values)
             else:
-                proposals = u','.join(self._extended_completion(proposal)
+                proposals = ','.join(self._extended_completion(proposal)
                                       for proposal in values)
 
             col = int(call('col(".")'))
             if starting:
                 col -= len(starting)
-            command = u'call complete(%s, [%s])' % (col, proposals)
+            command = 'call complete(%s, [%s])' % (col, proposals)
             vim.command(command.encode(self._get_encoding()))
             return None
         return self.ask_values(prompt, values, starting=starting,
         return result
 
     def get_text(self):
-        return self._decode_line('\n'.join(self.buffer)) + u'\n'
+        return self._decode_line('\n'.join(self.buffer)) + '\n'
 
     def get_region(self):
         start = self._position_to_offset(*self.buffer.mark('<'))
         else:
             type_ = type_.ljust(5)[:5]
         ci['menu'] = ' '.join((scope, type_, info))
-        ret =  u'{%s}' % \
-               u','.join(u'"%s":"%s"' % \
+        ret =  '{%s}' % \
+               ','.join('"%s":"%s"' % \
                          (key, value.replace('"', '\\"')) \
-                         for (key, value) in ci.iteritems())
+                         for (key, value) in ci.items())
         return ret
 
 
 
 
 def echo(message):
-    if isinstance(message, unicode):
+    if isinstance(message, str):
         message = message.encode(vim.eval('&encoding'))
-    print message
+    print(message)
 
 def call(command):
     return vim.eval(command)
     def __call__(self, arg_lead, cmd_line, cursor_pos):
         # don't know if self.values can be empty but better safe then sorry
         if self.values:
-            if not isinstance(self.values[0], basestring):
+            if not isinstance(self.values[0], str):
                 result = [proposal.name for proposal in self.values \
                           if proposal.name.startswith(arg_lead)]
             else:
                     'lucky_assist': '<M-?>'}
 
 def _init_variables():
-    for variable, default in variables.items():
+    for variable, default in list(variables.items()):
         vim.command('if !exists("g:%s")\n' % variable +
                     '  let g:%s = %s\n' % (variable, default))
 
 def _enable_shortcuts(env):
     if env.get('enable_shortcuts'):
-        for command, shortcut in shortcuts.items():
+        for command, shortcut in list(shortcuts.items()):
             vim.command('map %s :call %s()<cr>' %
                         (shortcut, _vim_name(command)))
-        for command, shortcut in insert_shortcuts.items():
+        for command, shortcut in list(insert_shortcuts.items()):
             command_name = _vim_name(command) + 'InsertMode'
             vim.command('func! %s()\n' % command_name +
                         'call %s()\n' % _vim_name(command) +