mirror of
https://github.com/chenxiaolong/avbroot.git
synced 2026-07-03 14:05:11 +02:00
Merge pull request #58 from chenxiaolong/clearotacerts_build
clearotacerts/build.py: Make executable and fix lint warnings
This commit is contained in:
Regular → Executable
+4
-4
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import io
|
||||
import os
|
||||
import shutil
|
||||
@@ -8,7 +10,7 @@ import zipfile
|
||||
def build_empty_zip():
|
||||
stream = io.BytesIO()
|
||||
|
||||
with zipfile.ZipFile(stream, 'w') as z:
|
||||
with zipfile.ZipFile(stream, 'w'):
|
||||
pass
|
||||
|
||||
return stream.getvalue()
|
||||
@@ -20,7 +22,7 @@ def parse_props(raw_prop):
|
||||
for line in raw_prop.decode('UTF-8').splitlines():
|
||||
k, delim, v = line.partition('=')
|
||||
if not delim:
|
||||
raise ArgumentError(f'Malformed line: {repr(line)}')
|
||||
raise ValueError(f'Malformed line: {repr(line)}')
|
||||
|
||||
result[k.strip()] = v.strip()
|
||||
|
||||
@@ -31,8 +33,6 @@ def main():
|
||||
dist_dir = os.path.join(sys.path[0], 'dist')
|
||||
os.makedirs(dist_dir, exist_ok=True)
|
||||
|
||||
module_prop_path = os.path.join(sys.path[0], 'module.prop')
|
||||
|
||||
with open(os.path.join(sys.path[0], 'module.prop'), 'rb') as f:
|
||||
module_prop_raw = f.read()
|
||||
module_prop = parse_props(module_prop_raw)
|
||||
|
||||
Reference in New Issue
Block a user