3 # Usage: device.py <device name>
8 bin_dir
= os
.path
.dirname(sys
.argv
[0])
11 _file
= open(bin_dir
+ "doc/devices.txt")
14 _list
= _str
.splitlines()
20 if i
.strip(":") == _device
:
24 check_list
.append(i
.strip())
28 _file
= open(bin_dir
+ "data/panucci.conf")
31 panucci_conf
= _str
.splitlines()
33 _file
= open(bin_dir
+ "data/panucci-all.conf")
36 panucci_all_conf
= _str
.splitlines()
38 for i
in range(len(panucci_conf
)):
39 _option
= panucci_conf
[i
].split("=")[0].strip()
41 new_option
= j
.split("=")[0].strip()
42 if new_option
== _option
:
45 for i
in range(len(panucci_all_conf
)):
46 _option
= panucci_all_conf
[i
].split("=")[0].strip()
48 new_option
= j
.split("=")[0].strip()
49 if new_option
== _option
:
50 panucci_all_conf
[i
] = j
52 _file
= open(bin_dir
+ "data/panucci.conf.new", "w")
53 for i
in panucci_conf
:
57 _file
= open(bin_dir
+ "data/panucci-all.conf.new", "w")
58 for i
in panucci_all_conf
: