def __init__(self, command, ignore_stderr_regexp=None, dry_run=None):
if typepy.type.List(command).is_type():
# concatenate command arguments to create a command if the command
# argument is list.
command = " ".join(command)
self.__command = command
if dry_run is not None:
self.__dry_run = dry_run
else:
self.__dry_run = self.default_is_dry_run
self.__stdout = None
self.__stderr = None
self.__returncode = None
self.__ignore_stderr_regexp = ignore_stderr_regexp
self.__debug_logging_method = self.__get_logging_method(logbook.DEBUG)
self.error_log_level = self.default_error_log_level
if self.is_save_history:
if len(self.__command_history) >= self.history_size:
self.__command_history.pop(0)
self.__command_history.append(command)
评论列表
文章目录