MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / execute

Function execute

tools/python-3.11.9-amd64/Lib/distutils/util.py:289–305  ·  view source on GitHub ↗

Perform some action that affects the outside world (eg. by writing to the filesystem). Such actions are special because they are disabled by the 'dry_run' flag. This method takes care of all that bureaucracy for you; all you have to do is supply the function to call and an arg

(func, args, msg=None, verbose=0, dry_run=0)

Source from the content-addressed store, hash-verified

287
288
289def execute (func, args, msg=None, verbose=0, dry_run=0):
290 """Perform some action that affects the outside world (eg. by
291 writing to the filesystem). Such actions are special because they
292 are disabled by the 'dry_run' flag. This method takes care of all
293 that bureaucracy for you; all you have to do is supply the
294 function to call and an argument tuple for it (to embody the
295 "external action" being performed), and an optional message to
296 print.
297 """
298 if msg is None:
299 msg = "%s%r" % (func.__name__, args)
300 if msg[-2:] == ',)': # correct for singleton tuple
301 msg = msg[0:-2] + ')'
302
303 log.info(msg)
304 if not dry_run:
305 func(*args)
306
307
308def strtobool (val):

Callers 2

executeMethod · 0.90
byte_compileFunction · 0.70

Calls 1

infoMethod · 0.45

Tested by

no test coverage detected