Lines Matching refs:Hooks
15 1) A "file system hooks" class provides an interface to a filesystem.
17 One hooks class is defined (Hooks), which uses the interface provided
19 class for other hooks classes.
30 uses a file system hooks class to interact with the file system. Both
61 __all__ = ["BasicModuleLoader","Hooks","ModuleLoader","FancyModuleLoader",
150 class Hooks(_Verbose):
152 """Hooks into the filesystem and interpreter.
208 """Default module loader; uses file system hooks.
210 By defining suitable hooks, you might be able to load modules from
216 def __init__(self, hooks = None, verbose = VERBOSE):
218 self.hooks = hooks or Hooks(verbose)
221 return self.hooks.default_path()
224 return self.hooks.modules_dict()
227 return self.hooks
229 def set_hooks(self, hooks):
230 self.hooks = hooks
234 if self.hooks.is_builtin(name):
236 if self.hooks.is_frozen(name):
244 fullname = self.hooks.path_join(dir, name)
245 if self.hooks.path_isdir(fullname):
251 for info in self.hooks.get_suffixes():
253 fullname = self.hooks.path_join(dir, name+suff)
255 fp = self.hooks.openfile(fullname, mode)
257 except self.hooks.openfile_error:
266 return self.hooks.init_builtin(name)
268 return self.hooks.init_frozen(name)
270 m = self.hooks.load_dynamic(name, filename, file)
272 m = self.hooks.load_source(name, filename, file)
274 m = self.hooks.load_compiled(name, filename, file)
276 m = self.hooks.load_package(name, filename, file)
312 code = self.hooks.get_frozen_object(name)
323 m = self.hooks.add_module(name)
330 d = self.hooks.modules_dict()
359 def set_hooks(self, hooks):
360 return self.loader.set_hooks(hooks)