diff --git a/asn1_value_editor/standalone_editor.py b/asn1_value_editor/standalone_editor.py index 10c3f2e4b00dbb6cdc61373f1994c834bcb0cbb9..d2a0c92c774c9defc617a7cb5f9ae2660c45d449 100755 --- a/asn1_value_editor/standalone_editor.py +++ b/asn1_value_editor/standalone_editor.py @@ -14,7 +14,7 @@ This version needs ASN.1 version 3.x.x - Copyright (c) 2012-2015 European Space Agency + Copyright (c) 2012-2017 European Space Agency Designed and implemented by Maxime Perrotin @@ -242,7 +242,14 @@ class SingleValueEditor(QObject): self.widgets[name] = {'widget': loader.load(uiFile)} uiFile.close() widget = self.widgets[name]['widget'] - pyType = self.tc[name.replace('_', '-')] + for tc in self.tc.iterkeys(): + if tc.lower().replace('_', '-') == name.lower().replace('_', '-'): + tcNameWithCase = tc + break + else: + raise TypeError ("No type named {} is defined in the ASN.1 model" + .format(name)) + pyType = self.tc[tcNameWithCase] self.widgets[name]['editor'] = widget.findChild(asn1Editor, 'ASN1EDITOR') self.widgets[name]['editor'].log = logger okButton = widget.findChild(QToolButton, 'okButton') @@ -266,6 +273,7 @@ class SingleValueEditor(QObject): widget = self.widgets[param] # Create a ctypes instance of the variable and set it to the editor + # print dir(self.asn1ctypes), self.asn1ctypes.__file__ instance = getattr(self.asn1ctypes, asnType.replace('-', '_'))() widget['editor'].asn1Instance = instance logger.info('Created instance of ' + asnType)