Exemple #1
0
    def get_preset_config(self,
                          preset_name=None,
                          pretty_preset_name=None,
                          json=True):

        if not preset_name:
            preset_name = 'default'

        if not pretty_preset_name:
            pretty_preset_name = preset_name.capitalize().replace('_', ' ')

        # Preparing preset data
        preset_dict = {
            'preset_name': preset_name,
            'pretty_preset_name': pretty_preset_name,
        }
        gf.get_tree_widget_checked_state(self.tree_widget, preset_dict)

        key = 'search_type:{0}:preset_name:{1}'.format(self.stype.get_code(),
                                                       preset_name)

        if json:
            data_dict = gf.to_json(preset_dict)
        else:
            data_dict = preset_dict

        data = {
            'data': data_dict,
            'key': key,
            'login': '******',
            'project_code': self.stype.get_project().get_code(),
        }

        return data
Exemple #2
0
 def get_scripts_tree_state(self):
     return gf.to_json(gf.tree_state(self.scripts_tree_widget, {}),
                       use_ast=True)