src/eric7/Utilities/ClassBrowsers/rbclbr.py

branch
eric7
changeset 9490
77b8d3a635b7
parent 9473
3f23dbf37dbe
child 9612
93b496cc3c88
equal deleted inserted replaced
9489:c03b8323d11a 9490:77b8d3a635b7
163 _commentsub = re.compile(r"""#[^\n]*\n|#[^\n]*$""").sub 163 _commentsub = re.compile(r"""#[^\n]*\n|#[^\n]*$""").sub
164 164
165 _modules = {} # cache of modules we've seen 165 _modules = {} # cache of modules we've seen
166 166
167 167
168 def clearModulesCache():
169 """
170 Function to clear the cached modules.
171 """
172 _modules.clear()
173
174
168 class VisibilityMixin(ClbrBaseClasses.ClbrVisibilityMixinBase): 175 class VisibilityMixin(ClbrBaseClasses.ClbrVisibilityMixinBase):
169 """ 176 """
170 Mixin class implementing the notion of visibility. 177 Mixin class implementing the notion of visibility.
171 """ 178 """
172 179
253 ClbrBaseClasses.Attribute.__init__(self, module, name, file, lineno) 260 ClbrBaseClasses.Attribute.__init__(self, module, name, file, lineno)
254 VisibilityMixin.__init__(self) 261 VisibilityMixin.__init__(self)
255 self.setPrivate() 262 self.setPrivate()
256 263
257 264
258 def readmodule_ex(module, path=None): 265 def readmodule_ex(module, path=None, isTypeFile=False):
259 """ 266 """
260 Read a Ruby file and return a dictionary of classes, functions and modules. 267 Read a Ruby file and return a dictionary of classes, functions and modules.
261 268
262 @param module name of the Ruby file (string) 269 @param module name of the Ruby file
263 @param path path the file should be searched in (list of strings) 270 @type str
271 @param path path the file should be searched in
272 @type list of str
273 @param isTypeFile flag indicating a file of this type
274 @type bool
264 @return the resulting dictionary 275 @return the resulting dictionary
276 @rtype dict
265 """ 277 """
266 global _modules 278 global _modules
267 279
268 if module in _modules: 280 if module in _modules:
269 # we've seen this file before... 281 # we've seen this file before...

eric ide

mercurial