Added connecting status
This commit is contained in:
4
main.py
4
main.py
@@ -154,6 +154,7 @@ def mountDisk(state: AppState) -> None:
|
|||||||
["mkdir", "-p", f"/mnt/{state.config.diskSerial}"],
|
["mkdir", "-p", f"/mnt/{state.config.diskSerial}"],
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
|
sleep(0.5)
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
[
|
[
|
||||||
"mount",
|
"mount",
|
||||||
@@ -164,6 +165,7 @@ def mountDisk(state: AppState) -> None:
|
|||||||
],
|
],
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
|
sleep(0.5)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@@ -179,6 +181,7 @@ def unmountDisk(state: AppState) -> None:
|
|||||||
],
|
],
|
||||||
check=True,
|
check=True,
|
||||||
)
|
)
|
||||||
|
print("unmounting disk")
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@@ -230,6 +233,7 @@ def main() -> None:
|
|||||||
and event.event == "connected"
|
and event.event == "connected"
|
||||||
and event.serial == state.config.diskSerial
|
and event.serial == state.config.diskSerial
|
||||||
):
|
):
|
||||||
|
state.diskState == "connecting"
|
||||||
mountDisk(state)
|
mountDisk(state)
|
||||||
|
|
||||||
except Empty:
|
except Empty:
|
||||||
|
|||||||
Reference in New Issue
Block a user