From e73d0a50b1d78d38d36001ba70d900081630f216 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 21 May 2013 16:57:06 +0200 Subject: mbim-codegen: require a 'Service' entry in the data file --- build-aux/mbim-codegen/ObjectList.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'build-aux/mbim-codegen') diff --git a/build-aux/mbim-codegen/ObjectList.py b/build-aux/mbim-codegen/ObjectList.py index 1aa27e4..90324fe 100644 --- a/build-aux/mbim-codegen/ObjectList.py +++ b/build-aux/mbim-codegen/ObjectList.py @@ -52,6 +52,7 @@ class ObjectList: def __init__(self, objects_dictionary): self.command_list = [] self.struct_list = [] + self.service = '' # Loop items in the list, creating Message objects for the messages for object_dictionary in objects_dictionary: @@ -59,9 +60,14 @@ class ObjectList: self.command_list.append(Message(object_dictionary)) elif object_dictionary['type'] == 'Struct': self.struct_list.append(Struct(object_dictionary)) + elif object_dictionary['type'] == 'Service': + self.service = object_dictionary['name'] else: raise ValueError('Cannot handle object type \'%s\'' % object_dictionary['type']) + if self.service == '': + raise ValueError('Service name not specified') + # Populate struct usages for struct in self.struct_list: for command in self.command_list: -- cgit v1.2.1