Skip to content

Commit a114b9b

Browse files
committed
ports/quectel: fixed boot.py syntax.
1 parent 04a5261 commit a114b9b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

ports/quectel/modules/_boot.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,27 @@
1515
import uos
1616
import ujson
1717

18-
'''
18+
"""
1919
Mark.Zhu - 2022/12/02
2020
Added the littlefs2 mount function,it will be called after a failed attempt to mount littlefs1
21-
'''
21+
"""
2222
# global datacall_flag
2323
datacall_flag = 1
2424

2525
def _repl_enable():
2626
global datacall_flag
2727
if "system_config.json" in uos.listdir("/"):
28-
with open("/system_config.json", "r", encoding='utf-8') as fd:
28+
with open("/system_config.json", "r", encoding="utf-8") as fd:
2929
try:
3030
json_data = ujson.load(fd)
3131
datacall_flag = json_data.get("datacallFlag", 1)
3232

3333
except ValueError:
34-
with open("/usr/system_config.json", "w", encoding='utf-8') as fdw:
34+
with open("/usr/system_config.json", "w", encoding="utf-8") as fdw:
3535
new_json_data = ujson.dumps({"replFlag": 0, "datacallFlag": datacall_flag})
3636
fdw.write(new_json_data)
3737
else:
38-
with open("/system_config.json", "w+", encoding='utf-8') as fd:
38+
with open("/system_config.json", "w+", encoding="utf-8") as fd:
3939
repl_data = ujson.dumps({"replFlag": 0})
4040
fd.write(repl_data)
4141

@@ -46,20 +46,20 @@ def _repl_enable():
4646
except Exception:
4747
from uos import VfsLfs2 as VfsLfs
4848

49-
udev = uos.FlashDevice('customer_fs', 4096)
49+
udev = uos.FlashDevice("customer_fs", 4096)
5050
try:
51-
uos.mount(udev, '/')
51+
uos.mount(udev, "/")
5252
except Exception as e:
53-
if 'ENODEV' in str(e):
53+
if "ENODEV" in str(e):
5454
VfsLfs.mkfs(udev)
55-
uos.mount(udev, '/')
56-
if 'usr' not in uos.listdir():
57-
uos.mkdir('usr')
58-
if 'bak' not in uos.listdir():
59-
uos.mkdir('bak')
55+
uos.mount(udev, "/")
56+
if "usr" not in uos.listdir():
57+
uos.mkdir("usr")
58+
if "bak" not in uos.listdir():
59+
uos.mkdir("bak")
6060

6161
except Exception:
62-
print('error occurs in boot step.')
62+
print("error occurs in boot step.")
6363

6464
finally:
6565
_repl_enable()

0 commit comments

Comments
 (0)