-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathn4pushback.py~
50 lines (30 loc) · 1.29 KB
/
n4pushback.py~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import subprocess
import os
# python solution was devised because some characters in note4 path made sh fail sometimes
remoteTarget='/storage/9C33-6BBD/Android/data/zaza.stable/files'
#localSource='/cygdrive/c/Users/thomas/andro/ws/zazadev205/win32/current'
localSource='/cygdrive/c/Users/thomas/Dropbox/current_zazanim_projects/lassitude'
def pushframes(files):
os.chdir(localSource)
#result=subprocess.run(['adb','pull','-p',remoteSource+'/'+frames[0]])
#print(result)
for frame in files :
print("file to push :"+frame)
result=subprocess.run(['adb','push',frame,remoteTarget+'/'+frame])
print(result)
#result=subprocess.run(['adb','shell','ls',remoteSource],stdout=subprocess.PIPE)
#print(result.stdout)
#frames=result.stdout.decode('utf-8').splitlines()
frames=os.listdir(localSource)
print(frames)
#filteredFrames=[]
#filtering empty lines created by parsing return of adb ls
#for frame in frames:
# if frame:#not empty
# filteredFrames.append(frame)
#print('filtered frames:')
#print(filteredFrames)
pushframes(frames)
#subprocess.run(['cd',localTarget],stdout=subprocess.PIPE)
#specifying target files fails (maybe because I pass cygwin path )
#result=subprocess.run(['adb','pull','-p',remoteSource+'/'+frames[0],localTarget+'/'+frames[0]])