[FL-2052] New build system based on scons (#1269)
This commit is contained in:
@@ -8,14 +8,14 @@ def timestamp():
|
||||
|
||||
|
||||
def file_hash(path: str, algo: str, block_size: int = 4096):
|
||||
fd = open(path, "rb")
|
||||
h = hashlib.new(algo)
|
||||
while True:
|
||||
data = fd.read(block_size)
|
||||
if len(data) > 0:
|
||||
h.update(data)
|
||||
else:
|
||||
break
|
||||
with open(path, "rb") as fd:
|
||||
while True:
|
||||
data = fd.read(block_size)
|
||||
if len(data) > 0:
|
||||
h.update(data)
|
||||
else:
|
||||
break
|
||||
return h.hexdigest()
|
||||
|
||||
|
||||
|
@@ -99,5 +99,5 @@ class FlipperFormatFile:
|
||||
self.lines = file.readlines()
|
||||
|
||||
def save(self, filename: str):
|
||||
with open(filename, "w") as file:
|
||||
with open(filename, "w", newline="\n") as file:
|
||||
file.write("\n".join(self.lines))
|
||||
|
Reference in New Issue
Block a user