8 print >>sys
.stderr
, """
13 appname
, device
= sys
.argv
15 root
= os
.path
.dirname(__file__
)
16 devices
= ConfigParser
.ConfigParser()
17 devices
.read([os
.path
.join(root
, 'doc', 'devices.ini')])
19 if device
not in devices
.sections():
20 print 'Unknown device:', device
23 files_to_update
= ['panucci.conf', 'panucci-all.conf']
24 files_to_update
= [os
.path
.join(root
, 'data', x
) for x
in files_to_update
]
26 def config_from_file(filename
):
27 parser
= ConfigParser
.ConfigParser()
28 parser
.read([filename
])
31 parsers
= map(config_from_file
, files_to_update
)
33 for key
, value
in devices
.items(device
):
34 for parser
in parsers
:
35 parser
.set('options', key
, value
)
37 for parser
, filename
in zip(parsers
, files_to_update
):
38 parser
.write(open(filename
, 'w'))