Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package queue for openSUSE:Factory checked in at 2024-12-30 14:36:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/queue (Old) and /work/SRC/openSUSE:Factory/.queue.new.1881 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "queue" Mon Dec 30 14:36:30 2024 rev:2 rq:1233710 version:1.2.0 Changes: -------- --- /work/SRC/openSUSE:Factory/queue/queue.changes 2024-12-17 19:23:35.858011191 +0100 +++ /work/SRC/openSUSE:Factory/.queue.new.1881/queue.changes 2024-12-30 14:36:32.482671669 +0100 @@ -1,0 +2,15 @@ +Sat Dec 28 20:52:59 UTC 2024 - Dominik Heidler <[email protected]> + +- Version 1.2.0 +- Only use dark_grey if available +- Do osc sr in release.sh + +------------------------------------------------------------------- +Sat Dec 28 17:02:00 UTC 2024 - Dominik Heidler <[email protected]> + +- Version 1.1.0 +- Color scheduled and running entries differently +- Enable multi column limiting +- Add hint about config location + +------------------------------------------------------------------- Old: ---- queue-1.0.0.tar.gz New: ---- queue-1.2.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ queue.spec ++++++ --- /var/tmp/diff_new_pack.IPx2Ju/_old 2024-12-30 14:36:33.190700812 +0100 +++ /var/tmp/diff_new_pack.IPx2Ju/_new 2024-12-30 14:36:33.194700977 +0100 @@ -17,23 +17,23 @@ Name: queue -Version: 1.0.0 +Version: 1.2.0 Release: 0 Summary: Tool for queuing shell commands License: GPL-3.0-or-later URL: https://github.com/asdil12/%{name} Source0: https://github.com/asdil12/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -BuildRequires: python3-base >= 3.6 -BuildRequires: python3-pip -BuildRequires: python3-setuptools -BuildRequires: python3-wheel BuildRequires: fdupes BuildRequires: help2man BuildRequires: python-rpm-macros BuildRequires: python3 +BuildRequires: python3-base >= 3.6 +BuildRequires: python3-pip BuildRequires: python3-psutil +BuildRequires: python3-setuptools BuildRequires: python3-termcolor BuildRequires: python3-tomlkit +BuildRequires: python3-wheel Requires: python3-psutil Requires: python3-termcolor Requires: python3-tomlkit ++++++ queue-1.0.0.tar.gz -> queue-1.2.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/queue-1.0.0/bin/queue new/queue-1.2.0/bin/queue --- old/queue-1.0.0/bin/queue 2024-12-16 15:41:57.000000000 +0100 +++ new/queue-1.2.0/bin/queue 2024-12-28 21:52:49.000000000 +0100 @@ -8,6 +8,7 @@ import psutil import subprocess import shlex +import termcolor from termcolor import cprint sys.path.insert(0, os.path.abspath(os.path.dirname(__file__) + '/..')) @@ -20,7 +21,7 @@ def setup_argparser(): - ap = argparse.ArgumentParser() + ap = argparse.ArgumentParser(epilog="The config file is located at ~/.config/queue/config.toml") ap.add_argument('cmd', nargs=argparse.REMAINDER, type=str, help="Add command to queue") ap.add_argument('-v', '--version', action='version', version=f'queue version {__version__}') @@ -87,7 +88,7 @@ running = len([e for e in qfile.load(running_file) if e['queue'] == queue]) finished = len([e for e in qfile.load(finished_file) if e['queue'] == queue]) rows.append([queue, str(scheduled), str(running), str(finished)]) - table.print_table(('Queue', 'Scheduled', 'Running', 'Finished'), rows, limit_col=0) + table.print_table(['Queue', 'Scheduled', 'Running', 'Finished'], rows, limit_col=0) elif args.list: q = qfile.load(queue_file) @@ -95,8 +96,8 @@ id_len = math.floor(math.log10(max(len(q),1))) + 1 for i, e in enumerate(q): i += 1 - rows.append((f"{i:>{id_len}}", cmdfmt(e), *envpwdfmt(e))) - table.print_table((f"{'#':>{id_len}}", 'Command', 'Working directory', 'Environment'), rows, limit_col=3) + rows.append([f"{i:>{id_len}}", cmdfmt(e), *envpwdfmt(e)]) + table.print_table([f"{'#':>{id_len}}", 'Command', 'Working directory', 'Environment'], rows, limit_col=3) elif args.run: my_pid = os.getpid() @@ -207,9 +208,9 @@ continue runtime = htdiff(now(), e['started'], args.absolute_timeranges) orphaned = not psutil.pid_exists(e['qpid']) - rows.append((e['queue'], cmdfmt(e), runtime, *envpwdfmt(e))) + rows.append([e['queue'], cmdfmt(e), runtime, *envpwdfmt(e)]) color_rows.append(['red']*5 if orphaned else None) - table.print_table(('Queue', 'Command', 'Runtime', 'Working directory', 'Environment'), rows, limit_col=4, colors=color_rows) + table.print_table(['Queue', 'Command', 'Runtime', 'Working directory', 'Environment'], rows, limit_col=4, colors=color_rows) elif args.show_finished: q = qfile.load(finished_file) @@ -219,9 +220,9 @@ if args.queue_explicitly_set and args.queue != e['queue']: continue runtime = htdiff(e['finished'], e['started'], args.absolute_timeranges) - rows.append((e['queue'], cmdfmt(e), str(e['returncode']), runtime, *envpwdfmt(e))) + rows.append([e['queue'], cmdfmt(e), str(e['returncode']), runtime, *envpwdfmt(e)]) color_rows.append(['red']*6 if e['returncode'] else None) - table.print_table(('Queue', 'Command', 'Status', 'Runtime', 'Working directory', 'Environment'), rows, limit_col=5, colors=color_rows) + table.print_table(['Queue', 'Command', 'Status', 'Runtime', 'Working directory', 'Environment'], rows, limit_col=5, colors=color_rows) else: qr = reversed(qfile.load(running_file)) @@ -239,19 +240,19 @@ rows = [] color_rows = [] for e in qs: - rows.append((e['queue'], cmdfmt(e), f"sched:{e['i']}", "", *envpwdfmt(e))) - color_rows.append(None) + rows.append([e['queue'], cmdfmt(e), f"sched:{e['i']}", "", *envpwdfmt(e)]) + color_rows.append(['dark_grey' if 'dark_grey' in termcolor.COLORS else None]*6) for e in qr: if args.queue_explicitly_set and args.queue != e['queue']: continue runtime = htdiff(now(), e['started'], args.absolute_timeranges) orphaned = not psutil.pid_exists(e['qpid']) - rows.append((e['queue'], cmdfmt(e), "running", runtime, *envpwdfmt(e))) - color_rows.append(['red']*6 if orphaned else None) + rows.append([e['queue'], cmdfmt(e), "running", runtime, *envpwdfmt(e)]) + color_rows.append(['red']*6 if orphaned else ['cyan']*6) for e in qf: if args.queue_explicitly_set and args.queue != e['queue']: continue runtime = htdiff(e['finished'], e['started'], args.absolute_timeranges) - rows.append((e['queue'], cmdfmt(e), f"exit:{e['returncode']}", runtime, *envpwdfmt(e))) + rows.append([e['queue'], cmdfmt(e), f"exit:{e['returncode']}", runtime, *envpwdfmt(e)]) color_rows.append(['red']*6 if e['returncode'] else None) - table.print_table(('Queue', 'Command', 'Status', 'Runtime', 'Working directory', 'Environment'), rows, limit_col=5, colors=color_rows) + table.print_table(['Queue', 'Command', 'Status', 'Runtime', 'Working directory', 'Environment'], rows, limit_col=[5,4], colors=color_rows) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/queue-1.0.0/cmdqueue/table.py new/queue-1.2.0/cmdqueue/table.py --- old/queue-1.0.0/cmdqueue/table.py 2024-12-16 15:41:57.000000000 +0100 +++ new/queue-1.2.0/cmdqueue/table.py 2024-12-28 21:52:49.000000000 +0100 @@ -1,19 +1,54 @@ import os from termcolor import colored -def print_row(col_lens, row, separator='|', space=' ', outer_space=True, limit_col=None, separator_on_extra_rows=True, colors=None): - line_length = sum(col_lens) + 3*(len(col_lens)-1) + (2 if outer_space else 0) - if limit_col != None: +def print_row(col_lens, row, separator='|', space=' ', outer_space=True, limit_cols=None, separator_on_extra_rows=True, colors=None): + """ + col_lens: list containing max size for each column + row: list containing cells + separator: separator between columns + space: space character to fillup empty space in each column + outer_space: add a space (see above) char at start & end of row + limit_cols: id or list of ids of column(s) to shrink to fit the table into the terminal + separator_on_extra_rows: continue column separators on multiline rows (will make copying text harder but looks better) + colors: list of same length as row containing color names for the columns (each entry can be None for default color) + """ + + limit_col_max_len = max(col_lens) # this value is never used but python complains otherwise + limit_col = None + col_lens = col_lens.copy() + if limit_cols != None: + # try to limit each column mentioned in limit_cols try: termwidth = os.get_terminal_size().columns - # without this min() the table uses the full term width if limit_col is set - extra_line_space = min(termwidth - line_length, 0) - limit_col_max_len = col_lens[limit_col] + extra_line_space except: - limit_col_max_len = col_lens[limit_col] - limit_col_max_len = max(limit_col_max_len, 1) - else: - limit_col_max_len = max(col_lens) + termwidth = None + if isinstance(limit_cols, int): + limit_cols = [limit_cols] + else: + limit_cols = list(limit_cols) + for i, col in enumerate(limit_cols): + if termwidth: + # without this min() the table uses the full term width if limit_col is set + line_length = sum(col_lens) + 3*(len(col_lens)-1) + (2 if outer_space else 0) + extra_line_space = min(termwidth - line_length, 0) + limit_col_max_len = col_lens[col] + extra_line_space + else: + limit_col_max_len = col_lens[col] + if limit_col_max_len > 1: + limit_col = col + break + else: + # we would only have enough space to display ⦠so let's drop the column completely + # and try to limit the next one in the list + row.pop(col) + col_lens.pop(col) + if colors: + colors.pop(col) + # recalculate col ids in limit_cols + for j in range(i, len(limit_cols)): + if limit_cols[j] > col: + limit_cols[j] -= 1 + extra_rows = [row] for in_extra_row, row in enumerate(extra_rows): row_normalized = [] @@ -27,15 +62,22 @@ extra_rows.append(extra_row) #print(extra_rows) col = col[0] - if limit_col == i and len(col) > limit_col_max_len: - col = col[:limit_col_max_len-1] + 'â¦' if limit_col == i: + if len(col) > limit_col_max_len: + if limit_col_max_len == 2: + col = col[:limit_col_max_len-1] + 'â¦' + else: + # remove chars in the middle to hopefully preserve important stuff + col = col[:limit_col_max_len-1] + 'â¦' + # fill up with spaces to ensure that columns of each row stay below each other row_normalized.append(col.ljust(limit_col_max_len, space)) else: + # fill up with spaces to ensure that columns of each row stay below each other row_normalized.append(col.ljust(col_lens[i], space)) if colors: for i, color in enumerate(colors): - row_normalized[i] = colored(row_normalized[i], color) + if color: + row_normalized[i] = colored(row_normalized[i], color) if in_extra_row and not separator_on_extra_rows: line = (space * 3).join(row_normalized) else: @@ -63,13 +105,14 @@ separator_on_extra_rows: support multiline fields (field being a list instead of a string) colors: two dimensional array containing table colors """ + # generate list containing max size for each column col_lens = [get_col_len(hc) for hc in headers or rows[0]] for row in rows: for i, col_len in enumerate(col_lens): col_lens[i] = max(col_len, get_col_len(row[i])) if headers: - print_row(col_lens, headers, separator, outer_space=outer_space, limit_col=limit_col) - print_row(col_lens, ['']*len(col_lens), '+', '-', outer_space, limit_col=limit_col) + print_row(col_lens, headers, separator, outer_space=outer_space, limit_cols=limit_col) + print_row(col_lens, ['']*len(col_lens), '+', '-', outer_space, limit_cols=limit_col) for i, row in enumerate(rows): row_colors = colors[i] if colors else None - print_row(col_lens, row, separator, outer_space=outer_space, limit_col=limit_col, separator_on_extra_rows=separator_on_extra_rows, colors=row_colors) + print_row(col_lens, row, separator, outer_space=outer_space, limit_cols=limit_col, separator_on_extra_rows=separator_on_extra_rows, colors=row_colors) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/queue-1.0.0/cmdqueue/version.py new/queue-1.2.0/cmdqueue/version.py --- old/queue-1.0.0/cmdqueue/version.py 2024-12-16 15:41:57.000000000 +0100 +++ new/queue-1.2.0/cmdqueue/version.py 2024-12-28 21:52:49.000000000 +0100 @@ -1 +1 @@ -__version__ = '1.0.0' +__version__ = '1.2.0' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/queue-1.0.0/queue.changes new/queue-1.2.0/queue.changes --- old/queue-1.0.0/queue.changes 2024-12-16 15:41:57.000000000 +0100 +++ new/queue-1.2.0/queue.changes 2024-12-28 21:52:49.000000000 +0100 @@ -1,4 +1,19 @@ ------------------------------------------------------------------- +Sat Dec 28 20:52:45 UTC 2024 - Dominik Heidler <[email protected]> + +- Version 1.2.0 +- Only use dark_grey if available +- Do osc sr in release.sh + +------------------------------------------------------------------- +Sat Dec 28 17:01:51 UTC 2024 - Dominik Heidler <[email protected]> + +- Version 1.1.0 +- Color scheduled and running entries differently +- Enable multi column limiting +- Add hint about config location + +------------------------------------------------------------------- Mon Dec 16 14:41:53 UTC 2024 - Dominik Heidler <[email protected]> - Version 1.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/queue-1.0.0/release.sh new/queue-1.2.0/release.sh --- old/queue-1.0.0/release.sh 2024-12-16 15:41:57.000000000 +0100 +++ new/queue-1.2.0/release.sh 2024-12-28 21:52:49.000000000 +0100 @@ -27,4 +27,4 @@ read -p "Submit RPM? " osc ci -#osc sr +osc sr
