Lines Matching refs:file
15 def __init__(self, file, *args, **kwargs): argument
16 self.file_in = file
22 self.file = open(self.file_in, *self.args, **self.kwargs)
24 self.file = self.file_in
25 return self.file
28 if self.file != self.file_in:
29 self.file.close()
33 def _emit(self, header, trailer, encoded_bytes, indent, file=sys.stdout, argument
35 with FileHandler(file, 'w') as file:
37 file, len_format)
39 def _emit_to_output(self, header, trailer, encoded_bytes, indent, file, argument
41 print(AUTOGEN_MESSAGE, file=file)
42 print(header, end='', file=file)
45 print("\n" + indent, end='', file=file)
47 print(" ", end='', file=file)
48 print("0x{:02x},".format(b), end='', file=file)
49 print("\n" + trailer, file=file)
51 print(len_format.format(len(encoded_bytes)), file=file)
53 def _emit_raw(self, encoded_bytes, file): argument
54 with FileHandler(file, 'wb') as file:
58 file.buffer.write(encoded_bytes)
61 file.write(encoded_bytes)
63 def emit_c_public(self, file=sys.stdout): argument
72 file=file)
74 def emit_c_public_hash(self, file=sys.stdout): argument
85 file=file)
87 def emit_raw_public(self, file=sys.stdout): argument
88 self._emit_raw(self.get_public_bytes(), file=file)
90 def emit_raw_public_hash(self, file=sys.stdout): argument
93 self._emit_raw(digest.finalize(), file=file)
95 def emit_rust_public(self, file=sys.stdout): argument
102 file=file)
104 def emit_public_pem(self, file=sys.stdout): argument
105 with FileHandler(file, 'w') as file:
106 print(str(self.get_public_pem(), 'utf-8'), file=file, end='')
108 def emit_private(self, minimal, format, file=sys.stdout): argument
115 file=file)