File: initialize.py

package info (click to toggle)
python-jedi 0.10.0~git1%2Bf05c071-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,064 kB
  • ctags: 3,014
  • sloc: python: 16,997; makefile: 149; ansic: 13
file content (24 lines) | stat: -rw-r--r-- 729 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""Python initialization for jedi module."""

try:
    import traceback
except Exception as excinfo:
    raise Exception('Failed to import traceback: {0}'.format(excinfo))

try:
    import os, sys, vim
    jedi_path = os.path.join(vim.eval('expand(s:script_path)'), 'jedi')
    sys.path.insert(0, jedi_path)
    jedi_vim_path = vim.eval('expand(s:script_path)')
    sys.path.insert(0, jedi_vim_path)
except Exception as excinfo:
    raise Exception('Failed to add to sys.path: {0}\n{1}'.format(
        excinfo, traceback.format_exc()))

try:
    import jedi_vim
except Exception as excinfo:
    raise Exception('Failed to import jedi_vim: {0}\n{1}'.format(
        excinfo, traceback.format_exc()))
finally:
    sys.path.pop(1)