-
Notifications
You must be signed in to change notification settings - Fork 5
/
copy_tutorial.py
49 lines (40 loc) · 1.52 KB
/
copy_tutorial.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
"""A poor man's cookiecutter for the tutorial. Creates a copy of all tutorial code and substitutes the original rtsp directions with custom ones
"""
import os
import glob
subs={}
# if you need to change the camera ip adresses of the tutorial, enable this:
"""
subs={
"rtsp://admin:[email protected]" : "rtsp://admin:[email protected]", # first camera used in the tutorial and its substitution
"rtsp://admin:[email protected]" : "rtsp://admin:[email protected]" # second camera used in the tutorial and its substitution
}
"""
"""
subs={
"rtsp://admin:[email protected]" : "rtsp://admin:[email protected]", # first camera used in the tutorial and its substitution
"rtsp://admin:[email protected]" : "rtsp://admin:[email protected]" # second camera used in the tutorial and its substitution
}
"""
#"""
subs={
"rtsp://admin:[email protected]" : "rtsp://admin:[email protected]", # first camera used in the tutorial and its substitution
"rtsp://admin:[email protected]" : "rtsp://admin:[email protected]" # second camera used in the tutorial and its substitution
}
#"""
os.system("mkdir tmp")
os.system("cp -f api_level_1/tutorial/* tmp/")
os.system("cp -f api_level_2/tutorial/* tmp/")
os.system("cp -f aux/run_tutorial.bash tmp/")
os.system("cp -f aux/run_tutorial_shmem.bash tmp/")
lis=glob.glob("tmp/*.py")
for l in lis:
print(l)
f=open(l,"r")
st=f.read()
f.close()
for key in subs:
st=st.replace(key,subs[key])
f=open(l,"w")
f.write(st)
f.close()