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

Function write_default_config

mycli/config.py:88–98  ·  view source on GitHub ↗
(destination: str, overwrite: bool = False)

Source from the content-addressed store, hash-verified

86
87
88def write_default_config(destination: str, overwrite: bool = False) -> None:
89 import mycli
90
91 with resources.files(mycli).joinpath("myclirc").open('r') as f:
92 default_config = f.read()
93 destination = os.path.expanduser(destination)
94 if not overwrite and exists(destination):
95 return
96
97 with open(destination, "w") as f:
98 f.write(default_config)
99
100
101def get_mylogin_cnf_path() -> str | None:

Callers 2

__init__Method · 0.90

Calls 4

openMethod · 0.80
joinpathMethod · 0.80
readMethod · 0.80
writeMethod · 0.45

Tested by 1