src/eric7/Utilities/ClassBrowsers/jsclbr.py

branch
eric7
changeset 9490
77b8d3a635b7
parent 9473
3f23dbf37dbe
child 9612
93b496cc3c88
equal deleted inserted replaced
9489:c03b8323d11a 9490:77b8d3a635b7
18 from . import ClbrBaseClasses 18 from . import ClbrBaseClasses
19 19
20 SUPPORTED_TYPES = [ClassBrowsers.JS_SOURCE] 20 SUPPORTED_TYPES = [ClassBrowsers.JS_SOURCE]
21 21
22 _modules = {} # cache of modules we've seen 22 _modules = {} # cache of modules we've seen
23
24
25 def clearModulesCache():
26 """
27 Function to clear the cached modules.
28 """
29 _modules.clear()
23 30
24 31
25 class VisibilityMixin(ClbrBaseClasses.ClbrVisibilityMixinBase): 32 class VisibilityMixin(ClbrBaseClasses.ClbrVisibilityMixinBase):
26 """ 33 """
27 Mixin class implementing the notion of visibility. 34 Mixin class implementing the notion of visibility.
284 self.__module, "const " + var.name, self.__file, var.line 291 self.__module, "const " + var.name, self.__file, var.line
285 ) 292 )
286 ) 293 )
287 294
288 295
289 def readmodule_ex(module, path=None): 296 def readmodule_ex(module, path=None, isTypeFile=False):
290 """ 297 """
291 Read a JavaScript file and return a dictionary of functions and variables. 298 Read a JavaScript file and return a dictionary of functions and variables.
292 299
293 @param module name of the JavaScript file (string) 300 @param module name of the JavaScript file
294 @param path path the file should be searched in (list of strings) 301 @type str
302 @param path path the file should be searched in
303 @type list of str
304 @param isTypeFile flag indicating a file of this type
305 @type bool
295 @return the resulting dictionary 306 @return the resulting dictionary
307 @rtype dict
296 """ 308 """
297 global _modules 309 global _modules
298 310
299 if module in _modules: 311 if module in _modules:
300 # we've seen this file before... 312 # we've seen this file before...

eric ide

mercurial