Exemple #1
0
 def _logger_on_changed(self, old, new):
     if new is True:
         turn_logging_on()
     else:
         turn_logging_off()
Exemple #2
0
 def _logger_on_changed(self, old, new):
     if new is True:
         turn_logging_on()
     else:
         turn_logging_off()
Exemple #3
0
    MachineLearning = t.Instance(MachineLearningConfig)
    view = tui.View(
        tui.Group(tui.Item('General', style='custom', show_label=False, ),
            label = 'General'),
        tui.Group(tui.Item('Model', style='custom', show_label=False, ),
            label = 'Model'),
        tui.Group(tui.Item('EELS', style='custom', show_label=False, ),
            label = 'EELS'),
        tui.Group(tui.Item('MachineLearning', style='custom', show_label=False,),
            label = 'Machine Learning'),
        title = 'Preferences',
        handler = PreferencesHandler,)
    
    def gui(self):
        self.edit_traits()
        
    def save(self):
        config = ConfigParser.SafeConfigParser(allow_no_value = True)
        template2config(template, config)
        config.write(open(defaults_file, 'w'))

    
preferences = Preferences(
            EELS = template['EELS'],
            General = template['General'],
            Model = template['Model'],
            MachineLearning = template['MachineLearning'])
            
if preferences.General.logger_on:
    turn_logging_on(verbose = 0)
Exemple #4
0
            show_label=False,
        ),
                  label='EDS'),
        tui.Group(tui.Item(
            'MachineLearning',
            style='custom',
            show_label=False,
        ),
                  label='Machine Learning'),
        title='Preferences',
        handler=PreferencesHandler,
    )

    def gui(self):
        self.edit_traits()

    def save(self):
        config = ConfigParser.SafeConfigParser(allow_no_value=True)
        template2config(template, config)
        config.write(open(defaults_file, 'w'))


preferences = Preferences(EELS=template['EELS'],
                          EDS=template['EDS'],
                          General=template['General'],
                          Model=template['Model'],
                          MachineLearning=template['MachineLearning'])

if preferences.General.logger_on:
    turn_logging_on(verbose=0)