Asserts that a path is writable and returns the expanded path
(path)
| 21 | |
| 22 | |
| 23 | def resolve_given_outfile_path(path): |
| 24 | """Asserts that a path is writable and returns the expanded path""" |
| 25 | if path is None: |
| 26 | return |
| 27 | outfile = os.path.expanduser(os.path.expandvars(path)) |
| 28 | if not os.access(os.path.dirname(os.path.abspath(outfile)), os.W_OK): |
| 29 | raise ParamValidationError('Unable to write to file: %s' % outfile) |
| 30 | return outfile |
| 31 | |
| 32 | |
| 33 | def is_parsed_result_successful(parsed_result): |