コード例 #1
0
 def _load_all_profiles(self):
     for d in self.directories:
         for profile in os.listdir(d):
             if os.path.isdir(d + '/' + profile):
                 try:
                     self.profiles[profile] = p.Profile(
                         profile, self.load_profile_config(profile, d))
                 except configobj.ParseError:
                     pass
コード例 #2
0
ファイル: gui_profile_loader.py プロジェクト: CZerta/tuned
 def _load_all_profiles(self):
     for d in self.directories:
         for profile in os.listdir(d):
             if self._is_dir_profile(os.path.join(d, profile)):
                 try:
                     self.profiles[profile] = p.Profile(profile,
                             self.load_profile_config(profile, d))
                 except Error:
                     pass
コード例 #3
0
ファイル: tuned-gui.py プロジェクト: wrightrocket/tuned
    def data_to_profile_config(self):
        name = self.entry_profile_name.get_text()
        config = configobj.ConfigObj()

        activated = self.combobox_include_profile.get_active()
        model = self.combobox_include_profile.get_model()

        include = model[activated][0]
        if self.togglebutton_include_profile.get_active():
            config['main'] = {'include': include}
        for children in self.notebook_plugins:
            acumulate_options = {}
            for item in children.get_model():
                if item[0] != 'None':
                    acumulate_options[item[1]] = item[0]
            config[self.notebook_plugins.get_menu_label_text(children)] = \
             acumulate_options
        return profile.Profile(name, config)
コード例 #4
0
    def data_to_profile_config(self):
        name = self._gobj('entryProfileName').get_text()
        config = configobj.ConfigObj(list_values=False, interpolation=False)

        activated = self._gobj('comboboxIncludeProfile').get_active()
        model = self._gobj('comboboxIncludeProfile').get_model()

        include = model[activated][0]
        if self._gobj('togglebuttonIncludeProfile').get_active():
            config['main'] = {'include': include}
        for children in self._gobj('notebookPlugins'):
            acumulate_options = {}
            for item in children.get_model():
                if item[0] != 'None':
                    acumulate_options[item[1]] = item[0]
            config[self._gobj('notebookPlugins').get_menu_label_text(children)] = \
             acumulate_options
        return profile.Profile(name, config)