plugin_descriptor.py
Go to the documentation of this file.
1 # Copyright (c) 2011, Dirk Thomas, Dorian Scholz, TU Darmstadt
2 # All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions
6 # are met:
7 #
8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above
11 # copyright notice, this list of conditions and the following
12 # disclaimer in the documentation and/or other materials provided
13 # with the distribution.
14 # * Neither the name of the TU Darmstadt nor the names of its
15 # contributors may be used to endorse or promote products derived
16 # from this software without specific prior written permission.
17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 # POSSIBILITY OF SUCH DAMAGE.
30 
31 
32 class PluginDescriptor(object):
33  """Information about one Plugin."""
34 
35  def __init__(self, plugin_id, attributes=None):
36  self._dict = {}
37  self._dict['plugin_id'] = plugin_id
38  self._dict['attributes'] = attributes or {}
39 
40  def plugin_id(self):
41  return self._dict['plugin_id']
42 
43  def attributes(self):
44  return self._dict['attributes']
45 
46  def action_attributes(self):
47  return self._dict.get('action', {})
48 
49  def set_action_attributes(self, label, statustip=None, icon=None, icontype=None):
50  self._dict['action'] = {
51  'label': label,
52  'statustip': statustip,
53  'icon': icon,
54  'icontype': icontype,
55  }
56 
57  def groups(self):
58  return self._dict.get('groups', [])
59 
60  def add_group_attributes(self, label, statustip=None, icon=None, icontype=None):
61  if 'groups' not in self._dict:
62  self._dict['groups'] = []
63  self._dict['groups'].append({
64  'label': label,
65  'statustip': statustip,
66  'icon': icon,
67  'icontype': icontype,
68  })
def __init__(self, plugin_id, attributes=None)
def add_group_attributes(self, label, statustip=None, icon=None, icontype=None)
def set_action_attributes(self, label, statustip=None, icon=None, icontype=None)


qt_gui
Author(s): Dirk Thomas
autogenerated on Fri Jun 24 2022 02:42:37