Skip to content

Commit

Permalink
Fix terminal exit after --sort p/e (#4013)
Browse files Browse the repository at this point in the history
* fix scr sort exit

* rewrite unit test output

* rewind slash replace

* rewind slash replace

* fix regex

* rewrite expected scr tests

* black

Co-authored-by: James Maslek <jmaslek11@gmail.com>
  • Loading branch information
montezdesousa and jmaslek authored Jan 23, 2023
1 parent 851f9ca commit 5600578
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion openbb_terminal/stocks/screener/screener_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def parse_input(self, an_input: str) -> List:
See `BaseController.parse_input()` for details.
"""
# Filtering out sorting parameters with forward slashes like P/E
sort_filter = r"((\ -s |\ --sort ).*?(P\/E|Fwd P\/E|P\/S|P\/B|P\/C|P\/FCF)*)"
f0 = r"(p\/e|fwd p\/e|p\/s|p\/b|p\/c|p\/fcf)"
f1 = r"(P\/E|Fwd P\/E|P\/S|P\/B|P\/C|P\/FCF)"

sort_filter = r"((\ -s |\ --sort ).*?" + r"(" + f0 + r"|" + f1 + r")" + r"*)"

custom_filters = [sort_filter]

Expand Down

0 comments on commit 5600578

Please sign in to comment.