[BugFix] - Remove unused old code (#6395)

* Remove unused old code

* Remvove  from settings choices

* Fix CLI exit when FileNotFound error on routine

---------

Co-authored-by: Henrique Joaquim <henriquecjoaquim@gmail.com>
This commit is contained in:
Igor Radovanovic
2024-05-13 10:21:11 +02:00
committed by GitHub
parent 0139dbf7a2
commit b99655a973
3 changed files with 9 additions and 102 deletions

View File

@@ -16,7 +16,6 @@ from pathlib import Path
from types import MethodType
from typing import Any, Dict, List, Optional
import certifi
import pandas as pd
import requests
from openbb import obb
@@ -37,7 +36,6 @@ from openbb_cli.controllers.utils import (
bootup,
first_time_user,
get_flair_and_username,
is_installer,
parse_and_split_input,
print_goodbye,
print_rich_table,
@@ -66,13 +64,6 @@ logger = logging.getLogger(__name__)
env_file = str(ENV_FILE_SETTINGS)
session = Session()
if is_installer():
# Necessary for installer so that it can locate the correct certificates for
# API calls and https
# https://stackoverflow.com/questions/27835619/urllib-and-ssl-certificate-verify-failed-error/73270162#73270162
os.environ["REQUESTS_CA_BUNDLE"] = certifi.where()
os.environ["SSL_CERT_FILE"] = certifi.where()
class CLIController(BaseController):
"""CLI Controller class."""
@@ -432,8 +423,9 @@ class CLIController(BaseController):
else:
return
with open(routine_path) as fp:
raw_lines = list(fp)
try:
with open(routine_path) as fp:
raw_lines = list(fp)
# Capture ARGV either as list if args separated by commas or as single value
if ns_parser.routine_args:
@@ -487,6 +479,12 @@ class CLIController(BaseController):
)
self.queue = self.queue[1:]
except FileNotFoundError:
session.console.print(
f"[red]File '{routine_path}' doesn't exist.[/red]\n"
)
return
def handle_job_cmds(jobs_cmds: Optional[List[str]]) -> Optional[List[str]]:
"""Handle job commands."""