MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / write_debian_copyright

Function write_debian_copyright

src/formattedcode/output_debian.py:58–74  ·  view source on GitHub ↗

Write `debian_copyright` DebianCopyright object to the `output_file` opened file-like object.

(debian_copyright, output_file)

Source from the content-addressed store, hash-verified

56
57
58def 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
77def build_debian_copyright(codebase, **kwargs):

Callers 1

process_codebaseMethod · 0.85

Calls 3

writeMethod · 0.45
dumpsMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected