File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -71,17 +71,17 @@ def main(
71
71
if color :
72
72
color_field (f , invert )
73
73
else :
74
- print (f )
74
+ click . echo (f )
75
75
else :
76
76
if color :
77
77
color_record (record , invert )
78
78
else :
79
- print (record )
79
+ click . echo (record )
80
80
if limit and counter >= limit :
81
81
break
82
82
83
83
if count :
84
- print (f"{ file .name } : { matched_records } " )
84
+ click . echo (f"{ file .name } : { matched_records } " )
85
85
86
86
# non-zero exit if no records match
87
87
return exit (0 if any_matches else 1 )
Original file line number Diff line number Diff line change 1
1
from os import environ
2
2
from typing import get_args
3
3
4
+ import click
4
5
from pymarc import Field , Record
5
6
from termcolor import cprint
6
7
from termcolor ._types import Color
@@ -72,10 +73,10 @@ def color_field(field: Field, invert: bool) -> None:
72
73
for subfield in field .subfields :
73
74
cprint (f"{ DELIMITER } { subfield .code } " , COLORS ["SUBFIELD" ], end = "" )
74
75
cprint (f"{ subfield .value } " , COLORS ["DATA" ], end = "" )
75
- print ()
76
+ click . echo ()
76
77
77
78
78
79
def color_record (record : Record , invert : bool ) -> None :
79
80
for field in record :
80
81
color_field (field , invert )
81
- print ()
82
+ click . echo ()
You can’t perform that action at this time.
0 commit comments