MCPcopy Create free account
hub / github.com/microsoft/SandDance / _wrap_command

Function _wrap_command

python/jupyter-widget/setupbase.py:461–487  ·  view source on GitHub ↗

Wrap a setup command Parameters ---------- cmds: list(str) The names of the other commands to run prior to the command. strict: boolean, optional Wether to raise errors when a pre-command fails.

(cmds, cls, strict=True)

Source from the content-addressed store, hash-verified

459
460
461def _wrap_command(cmds, cls, strict=True):
462 """Wrap a setup command
463
464 Parameters
465 ----------
466 cmds: list(str)
467 The names of the other commands to run prior to the command.
468 strict: boolean, optional
469 Wether to raise errors when a pre-command fails.
470 """
471 class WrappedCommand(cls):
472
473 def run(self):
474 if not getattr(self, 'uninstall', None):
475 try:
476 [self.run_command(cmd) for cmd in cmds]
477 except Exception:
478 if strict:
479 raise
480 else:
481 pass
482 # update package data
483 update_package_data(self.distribution)
484
485 result = cls.run(self)
486 return result
487 return WrappedCommand
488
489
490def _get_file_handler(package_data_spec, data_files_spec):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected