272 self.__dict["@@Globals@@"]._addglobal( |
272 self.__dict["@@Globals@@"]._addglobal( |
273 Attribute(self.__module, "const " + var.name, |
273 Attribute(self.__module, "const " + var.name, |
274 self.__file, var.line)) |
274 self.__file, var.line)) |
275 |
275 |
276 |
276 |
277 def readmodule_ex(module, path=[]): |
277 def readmodule_ex(module, path=None): |
278 """ |
278 """ |
279 Read a JavaScript file and return a dictionary of functions and variables. |
279 Read a JavaScript file and return a dictionary of functions and variables. |
280 |
280 |
281 @param module name of the JavaScript file (string) |
281 @param module name of the JavaScript file (string) |
282 @param path path the file should be searched in (list of strings) |
282 @param path path the file should be searched in (list of strings) |
290 # we've seen this file before... |
290 # we've seen this file before... |
291 return _modules[module] |
291 return _modules[module] |
292 |
292 |
293 # search the path for the file |
293 # search the path for the file |
294 f = None |
294 f = None |
295 fullpath = list(path) |
295 fullpath = [] if path is None else path[:] |
296 f, file, (suff, mode, type) = ClassBrowsers.find_module(module, fullpath) |
296 f, file, (suff, mode, type) = ClassBrowsers.find_module(module, fullpath) |
297 if f: |
297 if f: |
298 f.close() |
298 f.close() |
299 if type not in SUPPORTED_TYPES: |
299 if type not in SUPPORTED_TYPES: |
300 # not CORBA IDL source, can't do anything with this module |
300 # not CORBA IDL source, can't do anything with this module |