Write `debian_copyright` DebianCopyright object to the `output_file` opened file-like object.
(debian_copyright, output_file)
| 56 | |
| 57 | |
| 58 | def write_debian_copyright(debian_copyright, output_file): |
| 59 | """ |
| 60 | Write `debian_copyright` DebianCopyright object to the `output_file` opened |
| 61 | file-like object. |
| 62 | """ |
| 63 | # note the output_closing may feel contrived but is more or less dictated |
| 64 | # by the Click behaviour |
| 65 | close_of = False |
| 66 | try: |
| 67 | if isinstance(output_file, str): |
| 68 | output_file = open(output_file, 'w') |
| 69 | close_of = True |
| 70 | output_file.write(debian_copyright.dumps()) |
| 71 | output_file.write('\n') |
| 72 | finally: |
| 73 | if close_of: |
| 74 | output_file.close() |
| 75 | |
| 76 | |
| 77 | def build_debian_copyright(codebase, **kwargs): |
no test coverage detected