diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-08 16:33:50 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-08 16:33:50 +0200 |
commit | 13656b2aa1d679d67835a42c78d5e861428352e8 (patch) | |
tree | 6c9d35c201ed7e981fd3efb8d1dc47432b2719d1 /tools | |
parent | 9cdfaa6fe30b6f354121e26a358af173280a0ed3 (diff) |
only keep most relevant Model name in fdi2mpi
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/fdi2mpi.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/fdi2mpi.py b/tools/fdi2mpi.py index 8229c53..2f2f148 100755 --- a/tools/fdi2mpi.py +++ b/tools/fdi2mpi.py @@ -155,7 +155,7 @@ def mkfilename(attrs, current_vendor): '/' not in attrs['Device']['Product']: m = attrs['Device']['Product'] if 'Model' in attrs.get('Device', {}): - m = attrs['Device']['Model'] + m = attrs['Device']['Model'][0] if type(m) == type([]): m = '_'.join(m) @@ -193,6 +193,10 @@ def write_mpi(attrs, filename): if product.startswith(vendor): attrs['Device']['Product'] = product[len(vendor):].strip() + # only keep the most specific model name + if attrs['Device'].has_key('Model'): + attrs['Device']['Model'] = attrs['Device']['Model'][0] + assert set(attrs.keys()) <= set(sections) f = open(os.path.join('media-players', filename + '.mpi'), 'w') |