diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-05-22 18:34:25 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-07-03 16:08:55 +0200 |
commit | 49754e94e47914e3754c8b1ac4744ad93372f6e8 (patch) | |
tree | 3c47080b48093b5abd689ffb7b23a903044104b3 /build-aux/qmi-codegen/Container.py | |
parent | 6e6279e486b4e2ce02b21495a9f7d7d97342e5bf (diff) |
qmi-codegen: when referring to common types, add a copy of the source type
Diffstat (limited to 'build-aux/qmi-codegen/Container.py')
-rw-r--r-- | build-aux/qmi-codegen/Container.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/build-aux/qmi-codegen/Container.py b/build-aux/qmi-codegen/Container.py index 556a755..b232b39 100644 --- a/build-aux/qmi-codegen/Container.py +++ b/build-aux/qmi-codegen/Container.py @@ -56,9 +56,13 @@ class Container: for common in common_objects_dictionary: if common['type'] == 'TLV' and \ common['common-ref'] == field_dictionary['common-ref']: - # Replace the reference with the actual common dictionary + # Replace the reference with a copy of the common dictionary + # If the source reference has prerequisites, add them to the copy + copy = dict(common) + if 'prerequisites' in field_dictionary: + copy['prerequisites'] = field_dictionary['prerequisites'] dictionary.remove(field_dictionary) - dictionary.append(common) + dictionary.append(copy) break else: raise RuntimeError('Common type \'%s\' not found' % field_dictionary['name']) |