Skip to content
This repository was archived by the owner on Feb 9, 2023. It is now read-only.

Commit e8fa990

Browse files
committed
adb_core: stop the pause after connection
the connection has been made and the data has been read. there is no need for a pause to be made after the method
1 parent 309e924 commit e8fa990

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

adb_core.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from __future__ import print_function
1919
import socket
20-
import time
20+
from time import sleep
2121

2222

2323
class AdbCore():
@@ -41,7 +41,6 @@ def adb_connect(self):
4141
if not self.adb_status(self.adb_read(raw=True)):
4242
print("Can not detect your device")
4343
exit(1) # raising an exception is messy
44-
time.sleep(1)
4544

4645
def adb_write(self, command):
4746
# first the command needs it's length adding as a prefix
@@ -64,7 +63,7 @@ def adb_command(self, command, pause=0.0):
6463
# a new socket must be created for every command
6564
self.adb_connect()
6665
self.adb_write(command)
67-
time.sleep(pause)
66+
sleep(pause)
6867
return_data = self.adb_read(raw=True)
6968
if self.adb_status(return_data):
7069
return return_data[4:]
@@ -75,4 +74,4 @@ def adb_command(self, command, pause=0.0):
7574
def adb_status(data):
7675
if data[:4] == "OKAY":
7776
return True
78-
return False
77+
return False

0 commit comments

Comments
 (0)