:param *args: :type *args:
(*args)
| 18020 | # ============================== PROGRESS METER ========================================== # |
| 18021 | |
| 18022 | def convert_args_to_single_string(*args): |
| 18023 | """ |
| 18024 | |
| 18025 | :param *args: |
| 18026 | :type *args: |
| 18027 | |
| 18028 | """ |
| 18029 | max_line_total, width_used, total_lines, = 0, 0, 0 |
| 18030 | single_line_message = '' |
| 18031 | # loop through args and built a SINGLE string from them |
| 18032 | for message in args: |
| 18033 | # fancy code to check if string and convert if not is not need. Just always convert to string :-) |
| 18034 | # if not isinstance(message, str): message = str(message) |
| 18035 | message = str(message) |
| 18036 | longest_line_len = max([len(l) for l in message.split('\n')]) |
| 18037 | width_used = max(longest_line_len, width_used) |
| 18038 | max_line_total = max(max_line_total, width_used) |
| 18039 | lines_needed = _GetNumLinesNeeded(message, width_used) |
| 18040 | total_lines += lines_needed |
| 18041 | single_line_message += message + '\n' |
| 18042 | return single_line_message, width_used, total_lines |
| 18043 | |
| 18044 | |
| 18045 | METER_REASON_CANCELLED = 'cancelled' |
nothing calls this directly
no test coverage detected