From 97312178b67e858432fa29de2a1cd60188c5dcb4 Mon Sep 17 00:00:00 2001 From: DidierRLopes Date: Sun, 28 Aug 2022 04:25:07 +0300 Subject: [PATCH] Improve export folder to custom one (#2439) * Improve export folder to custom one * improve based on Darren feedback Co-authored-by: James Maslek --- openbb_terminal/settings_controller.py | 6 +++++- website/content/_index.md | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/openbb_terminal/settings_controller.py b/openbb_terminal/settings_controller.py index 99e62edfed3b..1cbf1c3e22c4 100644 --- a/openbb_terminal/settings_controller.py +++ b/openbb_terminal/settings_controller.py @@ -476,6 +476,8 @@ def call_export(self, other_args: List[str]): help="Folder where to export data. 'default' redirects to OpenBB Terminal 'exports'", default="default", ) + if other_args and "-" not in other_args[0][0]: + other_args.insert(0, "--folder") ns_parser = parse_simple_args(parser, other_args) if ns_parser: @@ -489,7 +491,9 @@ def call_export(self, other_args: List[str]): export_path += "/".join([ns_parser.folder] + self.queue) self.queue = [] - base_path = os.path.dirname(os.path.abspath(__file__)) + export_path = export_path.replace("'", "").replace('"', "") + + base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) default_path = os.path.join(base_path, "exports") success_export = False diff --git a/website/content/_index.md b/website/content/_index.md index f7373a0de964..8ca76ecef295 100644 --- a/website/content/_index.md +++ b/website/content/_index.md @@ -397,7 +397,7 @@ tweak how the terminal behaves. This includes the following: - `dt` adds or removes the datetime from the flair (which is next to the emoji). - `flair` allows you to change the emoji that is used. - `lang` gives the ability to change the terminal language. At this moment, the terminal is only available in English. -- `export` defines the folder you wish to export data to you acquire from the terminal. +- `export` defines the folder you wish to export data you acquire from the terminal. Use quotes for custom locations. - `tz` allows you to change the timezone if this is incorrectly displayed for you. - `autoscaling` automatically scales plots for you if enabled (when green). - `pheight` sets the percentage height of the plot (graphs) displayed (if autoscaling is enabled).