def get_short_printable_repr(self): """ :return: A string with a short printable representation of self """ if self.get_token() is not None: # I want to show the token variable and value in the output token = self.get_token() dt_str = "%s=%s" % (filter_non_printable(token.get_name()), filter_non_printable(token.get_value())) return "...%s..." % dt_str[: self.MAX_PRINTABLE - 6] else: # I'll simply show the first N parameter and values until the # MAX_PRINTABLE is achieved return filter_non_printable(str(self))[: self.MAX_PRINTABLE]
def get_short_printable_repr(self): """ :return: A string with a short printable representation of self """ if self.get_token() is not None: # I want to show the token variable and value in the output token = self.get_token() dt_str = '%s=%s' % (filter_non_printable(token.get_name()), filter_non_printable(token.get_value())) return '...%s...' % dt_str[:self.MAX_PRINTABLE-6] else: # I'll simply show the first N parameter and values until the # MAX_PRINTABLE is achieved return filter_non_printable(str(self))[:self.MAX_PRINTABLE]
def get_short_printable_repr(self): """ :return: A string with a short printable representation of self """ if len(filter_non_printable(str(self))) <= self.MAX_PRINTABLE: return filter_non_printable(str(self)) if self.get_token() is not None: # I want to show the token variable and value in the output for k, v in self.items(): if isinstance(v, DataToken): dt_str = "%s=%s" % (filter_non_printable(v.get_name()), filter_non_printable(v.get_value())) return "...%s..." % dt_str[: self.MAX_PRINTABLE] else: # I'll simply show the first N parameter and values until the # MAX_PRINTABLE is achieved return filter_non_printable(str(self))[: self.MAX_PRINTABLE]
def get_short_printable_repr(self): """ :return: A string with a short printable representation of self """ if len(filter_non_printable(str(self))) <= self.MAX_PRINTABLE: return filter_non_printable(str(self)) if self.get_token() is not None: # I want to show the token variable and value in the output for k, v in self.items(): if isinstance(v, DataToken): dt_str = '%s=%s' % (filter_non_printable( v.get_name()), filter_non_printable(v.get_value())) return '...%s...' % dt_str[:self.MAX_PRINTABLE] else: # I'll simply show the first N parameter and values until the # MAX_PRINTABLE is achieved return filter_non_printable(str(self))[:self.MAX_PRINTABLE]
def get_short_printable_repr(self): """ :return: A string with a short printable representation of self """ printable_self = filter_non_printable(str(self)) if len(printable_self) <= self.MAX_PRINTABLE: return printable_self if self.get_token() is not None: # I want to show the token variable and value in the output # pylint: disable=E1133 for k, v in self.items(): for ele in v: if isinstance(ele, DataToken): dt_str = '%s=%s' % (filter_non_printable(ele.get_name()), filter_non_printable(ele.get_value())) return '...%s...' % dt_str[:self.MAX_PRINTABLE] # pylint: enable=E1133 else: # I'll simply show the first N parameter and values until the # MAX_PRINTABLE is achieved return printable_self[:self.MAX_PRINTABLE]