When restoring the project now we maintain the original EOLs

- Not doing it in KiAuto raised problems, so now we also do it in
  KiBot

Related to #265
This commit is contained in:
Salvador E. Tropea 2022-09-02 09:38:16 -03:00
parent 560ce80c7d
commit 0631836f29
1 changed files with 4 additions and 2 deletions

View File

@ -174,13 +174,15 @@ class GS(object):
@staticmethod
def read_pro():
if GS.pro_file:
with open(GS.pro_file, 'rt') as f:
# Note: We use binary mode to preserve the original end of lines
# Otherwise git could see changes in the file
with open(GS.pro_file, 'rb') as f:
return f.read()
@staticmethod
def write_pro(prj):
if GS.pro_file and prj:
with open(GS.pro_file, 'wt') as f:
with open(GS.pro_file, 'wb') as f:
f.write(prj)
@staticmethod