MCPcopy Index your code
hub / github.com/dbcli/mycli / get_mylogin_cnf_path

Function get_mylogin_cnf_path

mycli/config.py:101–115  ·  view source on GitHub ↗

Return the path to the login path file or None if it doesn't exist.

()

Source from the content-addressed store, hash-verified

99
100
101def get_mylogin_cnf_path() -> str | None:
102 """Return the path to the login path file or None if it doesn't exist."""
103 mylogin_cnf_path = os.getenv("MYSQL_TEST_LOGIN_FILE")
104
105 if mylogin_cnf_path is None:
106 app_data = os.getenv("APPDATA")
107 default_dir = os.path.join(app_data, "MySQL") if app_data else "~"
108 mylogin_cnf_path = os.path.join(default_dir, ".mylogin.cnf")
109
110 mylogin_cnf_path = os.path.expanduser(mylogin_cnf_path)
111
112 if exists(mylogin_cnf_path):
113 logger.debug("Found login path file at '{0}'".format(mylogin_cnf_path))
114 return mylogin_cnf_path
115 return None
116
117
118def open_mylogin_cnf(name: str) -> TextIOWrapper | None:

Calls 2

joinMethod · 0.80
debugMethod · 0.45