(self, **options)
| 256 | return namespace |
| 257 | |
| 258 | def handle(self, **options): |
| 259 | # Execute the command and exit. |
| 260 | if options["command"]: |
| 261 | exec(options["command"], {**globals(), **self.get_namespace(**options)}) |
| 262 | return |
| 263 | |
| 264 | # Execute stdin if it has anything to read and exit. |
| 265 | # Not supported on Windows due to select.select() limitations. |
| 266 | if ( |
| 267 | sys.platform != "win32" |
| 268 | and not sys.stdin.isatty() |
| 269 | and select.select([sys.stdin], [], [], 0)[0] |
| 270 | ): |
| 271 | exec(sys.stdin.read(), {**globals(), **self.get_namespace(**options)}) |
| 272 | return |
| 273 | |
| 274 | available_shells = ( |
| 275 | [options["interface"]] if options["interface"] else self.shells |
| 276 | ) |
| 277 | |
| 278 | for shell in available_shells: |
| 279 | try: |
| 280 | return getattr(self, shell)(options) |
| 281 | except ImportError: |
| 282 | pass |
| 283 | raise CommandError("Couldn't import {} interface.".format(shell)) |
nothing calls this directly
no test coverage detected