MCPcopy Index your code
hub / github.com/geekcomputers/Python / open_web_target

Function open_web_target

JARVIS/actions.py:58–66  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

56
57
58def open_web_target(target):
59 cleaned = normalize_text(target)
60 url = KNOWN_SITES.get(cleaned)
61 if not url and "." in cleaned:
62 url = target if target.startswith(("http://", "https://")) else f"https://{target}"
63 if not url or not is_safe_url(url):
64 return "I can only open safe web addresses."
65 webbrowser.open(url)
66 return f"Opening {url}."
67
68
69def run_action(action):

Callers 1

run_actionFunction · 0.85

Calls 3

normalize_textFunction · 0.85
is_safe_urlFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected