forked from VimPlug/jedi
modules.py used old code for caching, which didn't work. removed it.
This commit is contained in:
15
modules.py
15
modules.py
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
import re
|
import re
|
||||||
import tokenize
|
import tokenize
|
||||||
import os
|
|
||||||
|
|
||||||
import parsing
|
import parsing
|
||||||
import builtin
|
import builtin
|
||||||
@@ -17,23 +16,15 @@ class Module(builtin.CachedModule):
|
|||||||
:param source: The source code of the file.
|
:param source: The source code of the file.
|
||||||
:param path: The module path of the file.
|
:param path: The module path of the file.
|
||||||
"""
|
"""
|
||||||
module_cache = {}
|
|
||||||
|
|
||||||
def __init__(self, path, source):
|
def __init__(self, path, source):
|
||||||
super(Module, self).__init__(path=path)
|
super(Module, self).__init__(path=path)
|
||||||
self.source = source
|
self.source = source
|
||||||
self._line_cache = None
|
self._line_cache = None
|
||||||
|
|
||||||
def _get_source(self):
|
def _get_source(self):
|
||||||
return self.source
|
s = self.source
|
||||||
|
del self.source # memory efficiency
|
||||||
def _load_module(self):
|
return s
|
||||||
self._parser = parsing.PyFuzzyParser(self.source, self.path)
|
|
||||||
del self.source # efficiency
|
|
||||||
|
|
||||||
# insert into cache
|
|
||||||
to_cache = (os.path.getmtime(self.path), self._parser)
|
|
||||||
Module.module_cache[self.path] = to_cache
|
|
||||||
|
|
||||||
|
|
||||||
class ModuleWithCursor(Module):
|
class ModuleWithCursor(Module):
|
||||||
|
|||||||
Reference in New Issue
Block a user