summaryrefslogtreecommitdiff
path: root/gerbonara/ipc356.py
diff options
context:
space:
mode:
Diffstat (limited to 'gerbonara/ipc356.py')
-rw-r--r--gerbonara/ipc356.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/gerbonara/ipc356.py b/gerbonara/ipc356.py
index ae341be..06a87f0 100644
--- a/gerbonara/ipc356.py
+++ b/gerbonara/ipc356.py
@@ -120,15 +120,15 @@ class Netlist(CamFile):
return parser.parse(data, Path(filename))
def save(self, filename, settings=None, drop_comments=True):
- with open(filename, 'w', encoding='utf-8') as f:
- f.write(self.to_ipc356(settings, drop_comments=drop_comments))
+ with open(filename, 'wb') as f:
+ f.write(self.write_to_bytes(settings, drop_comments=drop_comments))
- def to_ipc356(self, settings=None, drop_comments=True, job_name=None):
+ def write_to_bytes(self, settings=None, drop_comments=True, job_name=None):
if settings is None:
settings = self.import_settings.copy() or FileSettings()
settings.zeros = None
settings.number_format = (5,6)
- return '\n'.join(self._generate_lines(settings, drop_comments=drop_comments))
+ return '\n'.join(self._generate_lines(settings, drop_comments=drop_comments)).encode('utf-8')
def _generate_lines(self, settings, drop_comments, job_name=None):
yield 'C IPC-D-356 generated by Gerbonara'