Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix stock screener #5440

Merged
merged 6 commits into from
Sep 20, 2023
Merged
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
28 changes: 14 additions & 14 deletions openbb_terminal/stocks/screener/screener_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ScreenerController(BaseController):
if PRESETS_PATH.exists():
preset_choices.update(
{
filepath.name.strip(".ini"): filepath
filepath.name.replace(".ini", ""): filepath
for filepath in PRESETS_PATH.iterdir()
if filepath.suffix == ".ini"
}
Expand All @@ -66,7 +66,7 @@ class ScreenerController(BaseController):
if PRESETS_PATH_DEFAULT.exists():
preset_choices.update(
{
filepath.name.strip(".ini"): filepath
filepath.name.replace(".ini", ""): filepath
for filepath in PRESETS_PATH_DEFAULT.iterdir()
if filepath.suffix == ".ini"
}
Expand Down Expand Up @@ -243,8 +243,8 @@ def call_overview(self, other_args: List[str]):

if ns_parser:
preset = (
self.preset.strip(".ini")
if self.preset.strip(".ini") in finviz_model.d_signals
self.preset.replace(".ini", "")
if self.preset.replace(".ini", "") in finviz_model.d_signals
else self.preset
)

Expand Down Expand Up @@ -321,8 +321,8 @@ def call_valuation(self, other_args: List[str]):

if ns_parser:
preset = (
self.preset.strip(".ini")
if self.preset.strip(".ini") in finviz_model.d_signals
self.preset.replace(".ini", "")
if self.preset.replace(".ini", "") in finviz_model.d_signals
else self.preset
)
sort_map = screener_helper.finviz_map("valuation")
Expand Down Expand Up @@ -398,8 +398,8 @@ def call_financial(self, other_args: List[str]):

if ns_parser:
preset = (
self.preset.strip(".ini")
if self.preset.strip(".ini") in finviz_model.d_signals
self.preset.replace(".ini", "")
if self.preset.replace(".ini", "") in finviz_model.d_signals
else self.preset
)
sort_map = screener_helper.finviz_map("financial")
Expand Down Expand Up @@ -475,8 +475,8 @@ def call_ownership(self, other_args: List[str]):

if ns_parser:
preset = (
self.preset.strip(".ini")
if self.preset.strip(".ini") in finviz_model.d_signals
self.preset.replace(".ini", "")
if self.preset.replace(".ini", "") in finviz_model.d_signals
else self.preset
)
sort_map = screener_helper.finviz_map("ownership")
Expand Down Expand Up @@ -553,8 +553,8 @@ def call_performance(self, other_args: List[str]):
sort_map = screener_helper.finviz_map("performance")
if ns_parser:
preset = (
self.preset.strip(".ini")
if self.preset.strip(".ini") in finviz_model.d_signals
self.preset.replace(".ini", "")
if self.preset.replace(".ini", "") in finviz_model.d_signals
else self.preset
)
self.screen_tickers = finviz_view.screener(
Expand Down Expand Up @@ -628,8 +628,8 @@ def call_technical(self, other_args: List[str]):

if ns_parser:
preset = (
self.preset.strip(".ini")
if self.preset.strip(".ini") in finviz_model.d_signals
self.preset.replace(".ini", "")
if self.preset.replace(".ini", "") in finviz_model.d_signals
else self.preset
)
sort_map = screener_helper.finviz_map("technical")
Expand Down
4 changes: 2 additions & 2 deletions openbb_terminal/stocks/screener/screener_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
if PRESETS_PATH.exists():
preset_choices.update(
{
filepath.name.strip(".ini"): filepath
filepath.name.replace(".ini", ""): filepath
for filepath in PRESETS_PATH.iterdir()
if filepath.suffix == ".ini"
}
Expand All @@ -28,7 +28,7 @@
if PRESETS_PATH_DEFAULT.exists():
preset_choices.update(
{
filepath.name.strip(".ini"): filepath
filepath.name.replace(".ini", ""): filepath
for filepath in PRESETS_PATH_DEFAULT.iterdir()
if filepath.suffix == ".ini"
}
Expand Down
Loading