Skip to content

Commit f7b69d6

Browse files
committed
update clear
1 parent b9dd1a6 commit f7b69d6

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

colrev/packages/colrev_cli_pdf_prep_man/src/pdf_prep_man_cli.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@
2727
# pylint: disable=too-few-public-methods
2828

2929

30+
def clear_screen() -> None:
31+
"""Clear the terminal without spawning a subprocess."""
32+
print("\033[2J\033[H", end="")
33+
34+
3035
class CoLRevCLIPDFManPrep(base_classes.PDFPrepManPackageBaseClass):
3136
"""Manually prepare PDFs based on a CLI (not yet implemented)."""
3237

@@ -297,11 +302,7 @@ def _man_pdf_prep_item_init(
297302
item: dict,
298303
stat: str,
299304
) -> dict:
300-
current_platform = platform.system()
301-
if current_platform in ["Linux", "Darwin"]:
302-
os.system("clear")
303-
else:
304-
os.system("cls")
305+
clear_screen()
305306

306307
# to do : if authors mismatch: color those that do/do not match
307308
print(stat)

0 commit comments

Comments
 (0)