Commit 233f67f6 authored by Jérome Perrin's avatar Jérome Perrin

monaco_editor: jedi wip (no longer use /tmp/)

parent 6389af5a
...@@ -21,6 +21,9 @@ import time ...@@ -21,6 +21,9 @@ import time
import erp5.portal_type import erp5.portal_type
import tempfile
STUBS_BASE_PATH = os.path.join(tempfile.gettempdir(), 'erp5-stubs')
last_reload_time = time.time() last_reload_time = time.time()
# increase default cache duration # increase default cache duration
...@@ -356,7 +359,7 @@ def ERP5Site_getPythonSourceCodeCompletionList(self, data, REQUEST=None): ...@@ -356,7 +359,7 @@ def ERP5Site_getPythonSourceCodeCompletionList(self, data, REQUEST=None):
data['position']['line'], data['position']['line'],
data['position']['column'] - 1, data['position']['column'] - 1,
script_name, script_name,
sys_path=['/tmp/ahaha/'] + list(sys.path), sys_path=[STUBS_BASE_PATH] + list(sys.path),
) )
def _get_param_name(p): def _get_param_name(p):
...@@ -763,7 +766,7 @@ def XXX_skins_class_exists(name): ...@@ -763,7 +766,7 @@ def XXX_skins_class_exists(name):
"""Returns true if a skin class exists for this name. """Returns true if a skin class exists for this name.
""" """
return os.path.exists( return os.path.exists(
"/tmp/ahaha/erp5/skins_tool/{name}.pyi".format(name=name)) "{STUBS_BASE_PATH}/erp5/skins_tool/{name}.pyi".format(STUBS_BASE_PATH=STUBS_BASE_PATH, name=name))
def TypeInformation_getStub(self): def TypeInformation_getStub(self):
...@@ -1404,7 +1407,8 @@ def ERP5Site_dumpModuleCode(self, component_or_script=None): ...@@ -1404,7 +1407,8 @@ def ERP5Site_dumpModuleCode(self, component_or_script=None):
f.write(content) f.write(content)
portal = self.getPortalObject() portal = self.getPortalObject()
module_dir = '/tmp/ahaha/erp5/' # TODO mkdir_p(STUBS_BASE_PATH)
module_dir = os.path.join(STUBS_BASE_PATH, 'erp5')
mkdir_p(module_dir) mkdir_p(module_dir)
# generate erp5/__init__.py # generate erp5/__init__.py
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment