def get_choice(self): try: txt = Widgets.get_active_text(self.comboboxentry_speed) options = { 'Instant': 5, 'Fast': 50, 'Medium': 150, 'Slow': 500 } choice = options[txt] except Exception,info: print info choice = 150
def get_choice(self): try: languages = { 'Catalan': 'ca', 'Dutch': 'nl', 'English': 'en', 'French': 'fr', 'Norwegian': 'no', 'Romenian':'ro', 'Spanish':'es', 'Italian':'it' } choice = languages[Widgets.get_active_text(self.comboboxentry_language)] except Exception,info: print info choice = 'en'