Retrieve a module from below this path or package. @param modname: a str naming a module to be loaded. For entries, this is a top-level, undotted package name, and for packages it is the name of the module without the package prefix. For example, if you have a
(self, modname)
| 206 | raise NotImplementedError() |
| 207 | |
| 208 | def __getitem__(self, modname): |
| 209 | """ |
| 210 | Retrieve a module from below this path or package. |
| 211 | |
| 212 | @param modname: a str naming a module to be loaded. For entries, this |
| 213 | is a top-level, undotted package name, and for packages it is the name |
| 214 | of the module without the package prefix. For example, if you have a |
| 215 | PythonModule representing the 'twisted' package, you could use:: |
| 216 | |
| 217 | twistedPackageObj['python']['modules'] |
| 218 | |
| 219 | to retrieve this module. |
| 220 | |
| 221 | @raise KeyError: if the module is not found. |
| 222 | |
| 223 | @return: a PythonModule. |
| 224 | """ |
| 225 | for module in self.iterModules(): |
| 226 | if module.name == self._subModuleName(modname): |
| 227 | return module |
| 228 | raise KeyError(modname) |
| 229 | |
| 230 | def __iter__(self): |
| 231 | """ |
nothing calls this directly
no test coverage detected