(self, netrc_path, new_entry)
| 205 | f.write(new_contents) |
| 206 | |
| 207 | def _create_netrc_file(self, netrc_path, new_entry): |
| 208 | dirname = os.path.split(netrc_path)[0] |
| 209 | if not os.path.isdir(dirname): |
| 210 | os.makedirs(dirname) |
| 211 | with os.fdopen( |
| 212 | os.open(netrc_path, os.O_WRONLY | os.O_CREAT, 0o600), 'w' |
| 213 | ) as f: |
| 214 | f.write(new_entry + '\n') |
| 215 | |
| 216 | def _append_netrc_entry(self, contents, new_entry): |
| 217 | if contents.endswith('\n'): |
no test coverage detected