Skip to content

Commit

Permalink
Respect file argument to print_x functions
Browse files Browse the repository at this point in the history
The utils.print_x functions take a `file` argument that was not used in their implementation.
This lead to errors and warnings being printed to stdout instead of stderr.

Fixes iluxonchik#33
  • Loading branch information
SECtim authored Jan 2, 2024
1 parent 84bca57 commit 0b653a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions rfc_bibtex/utils.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import sys

def print_red(text, end='\n', file=sys.stdout):
print(f'\u001b[1m\u001b[31m{text}\u001b[0m', end=end)
print(f'\u001b[1m\u001b[31m{text}\u001b[0m', end=end, file=file)

def print_green(text, end='\n', file=sys.stdout):
print(f'\u001b[1m\u001b[32m{text}\u001b[0m', end=end)
print(f'\u001b[1m\u001b[32m{text}\u001b[0m', end=end, file=file)

def print_yellow(text, end='\n', file=sys.stdout):
print(f'\u001b[33m\u001b[33m{text}\u001b[0m', end=end)
print(f'\u001b[33m\u001b[33m{text}\u001b[0m', end=end, file=file)

def print_magenta(text, end='\n', file=sys.stdout):
print(f'\u001b[35m\u001b[31m{text}\u001b[0m', end=end)
print(f'\u001b[35m\u001b[31m{text}\u001b[0m', end=end, file=file)

0 comments on commit 0b653a3

Please sign in to comment.