Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions list-pulls.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
notes.
'''
# W.J. van der Laan 2017-2021
# The Bitcoin Core developers 2017-2021, 2025
# SPDX-License-Identifier: MIT
import subprocess
import re
import json
import time
import sys, os
from collections import namedtuple, defaultdict

Expand Down Expand Up @@ -463,4 +463,3 @@ def get_category(repo_info, labels, message):
with open('pulls.json','w') as f:
json.dump(data_out, f, sort_keys=True,
indent=4, separators=(',', ': '))

15 changes: 10 additions & 5 deletions termlib/attr.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
class Attr:
'''
"""
Terminal output attributes.
'''
"""
@staticmethod
def fg(r, g, b):
return f'\x1b[38;2;{r};{g};{b}m'

@staticmethod
def bg(r, g, b):
return f'\x1b[48;2;{r};{g};{b}m'

@staticmethod
def fg_hex(color):
if color[0] == '#':
color = color[1:]
assert(len(color) == 6)
assert len(color) == 6
return Attr.fg(int(color[0:2], 16), int(color[2:4], 16), int(color[4:6], 16))

@staticmethod
def bg_hex(color):
if color[0] == '#':
color = color[1:]
assert(len(color) == 6)
assert len(color) == 6
return Attr.bg(int(color[0:2], 16), int(color[2:4], 16), int(color[4:6], 16))

def close(attr):
@staticmethod
def close():
# Close an attribute (restore terminal to "neutral")
return Attr.RESET

Expand Down
6 changes: 5 additions & 1 deletion termlib/tableprinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ def __init__(self, out, attr, columns):
self.columns = columns

def format_row(self, rec):
return ' '.join((entry[0] + pad(str(entry[1]), col.width, col.align) + self.attr.close(entry[0]) for entry, col in zip(rec, self.columns)))
return ' '.join(
(entry[0] +
pad(str(entry[1]), col.width, col.align) +
self.attr.close()
for entry, col in zip(rec, self.columns)))

def print_row(self, rec):
self.out.write(f'{self.format_row(rec)}\n')
Expand Down
5 changes: 1 addition & 4 deletions treehash512.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin Core developers
# Copyright (c) 2017, 2025 The Bitcoin Core developers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Copyright (c) 2017, 2025 The Bitcoin Core developers
# Copyright (c) 2017-present The Bitcoin Core developers

nit: If this is touched, might as well remove the years, or just append -present, to avoid having to re-touch this again in the future for style fixups.

# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Expand All @@ -11,9 +11,7 @@
treehash512.py [<commithash>]
'''
import os
from sys import stdin,stdout,stderr
import sys
import argparse
import hashlib
import subprocess

Expand Down Expand Up @@ -78,4 +76,3 @@ def main():

if __name__ == '__main__':
main()