File: kiwi.utils.PropertyObject.html

package info (click to toggle)
kiwi 1.9.22-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 11,976 kB
  • ctags: 5,619
  • sloc: python: 15,767; ansic: 193; xml: 77; makefile: 53; sh: 18
file content (229 lines) | stat: -rw-r--r-- 11,572 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>API docs for &ldquo;kiwi.utils.PropertyObject&rdquo;</title>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
    <link href="apidocs.css" type="text/css" rel="stylesheet" />
    
    
  </head>
  <body>
    <h1 class="class">Class k.u.PropertyObject(<span title="object">object</span>):</h1>
    <p>
      <span id="part">Part of <a href="kiwi.html">kiwi</a>.<a href="kiwi.utils.html">utils</a></span>
      
      <a href="classIndex.html#kiwi.utils.PropertyObject">View In Hierarchy</a>
    </p>
    <div>
      <p>Known subclasses: <a href="kiwi.ui.entry.KiwiEntry.html">kiwi.ui.entry.KiwiEntry</a>, <a href="kiwi.ui.hyperlink.HyperLink.html">kiwi.ui.hyperlink.HyperLink</a>, <a href="kiwi.ui.objectlist.Column.html">kiwi.ui.objectlist.Column</a>, <a href="kiwi.ui.objectlist.ObjectList.html">kiwi.ui.objectlist.ObjectList</a>, <a href="kiwi.ui.widgets.button.ProxyButton.html">kiwi.ui.widgets.button.ProxyButton</a>, <a href="kiwi.ui.widgets.checkbutton.ProxyCheckButton.html">kiwi.ui.widgets.checkbutton.ProxyCheckButton</a>, <a href="kiwi.ui.widgets.colorbutton.ProxyColorButton.html">kiwi.ui.widgets.colorbutton.ProxyColorButton</a>, <a href="kiwi.ui.widgets.combo.ProxyComboBox.html">kiwi.ui.widgets.combo.ProxyComboBox</a>, <a href="kiwi.ui.widgets.combo.ProxyComboBoxEntry.html">kiwi.ui.widgets.combo.ProxyComboBoxEntry</a>, <a href="kiwi.ui.widgets.combo.ProxyComboEntry.html">kiwi.ui.widgets.combo.ProxyComboEntry</a>, <a href="kiwi.ui.widgets.entry.ProxyDateEntry.html">kiwi.ui.widgets.entry.ProxyDateEntry</a>, <a href="kiwi.ui.widgets.filechooser.ProxyFileChooserButton.html">kiwi.ui.widgets.filechooser.ProxyFileChooserButton</a>, <a href="kiwi.ui.widgets.filechooser.ProxyFileChooserWidget.html">kiwi.ui.widgets.filechooser.ProxyFileChooserWidget</a>, <a href="kiwi.ui.widgets.fontbutton.ProxyFontButton.html">kiwi.ui.widgets.fontbutton.ProxyFontButton</a>, <a href="kiwi.ui.widgets.label.ProxyLabel.html">kiwi.ui.widgets.label.ProxyLabel</a>, <a href="kiwi.ui.widgets.radiobutton.ProxyRadioButton.html">kiwi.ui.widgets.radiobutton.ProxyRadioButton</a>, <a href="kiwi.ui.widgets.scale.ProxyHScale.html">kiwi.ui.widgets.scale.ProxyHScale</a>, <a href="kiwi.ui.widgets.scale.ProxyVScale.html">kiwi.ui.widgets.scale.ProxyVScale</a>, <a href="kiwi.ui.widgets.spinbutton.ProxySpinButton.html">kiwi.ui.widgets.spinbutton.ProxySpinButton</a>, <a href="kiwi.ui.widgets.textview.ProxyTextView.html">kiwi.ui.widgets.textview.ProxyTextView</a></p>
    </div>
    <div><p>I am an object which maps GObject properties to attributes To be able to
use me, you must also inherit from a gobject.GObject subclass.</p>
Example:
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">from</span> kiwi.utils <span class="py-keyword">import</span> PropertyObject, gproperty</pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span><span class="py-keyword">class</span> <span class="py-defname">Person</span>(PropertyObject, gobject.GObject):
<span class="py-prompt">&gt;&gt;&gt; </span>    gproperty(<span class="py-string">'name'</span>, str)
<span class="py-prompt">&gt;&gt;&gt; </span>    gproperty(<span class="py-string">'age'</span>, int)
<span class="py-prompt">&gt;&gt;&gt; </span>    gproperty(<span class="py-string">'married'</span>, bool, False)</pre>
<pre class="py-doctest">
<span class="py-prompt">&gt;&gt;&gt; </span>test = Test()
<span class="py-prompt">&gt;&gt;&gt; </span>test.age = 20
<span class="py-prompt">&gt;&gt;&gt; </span>test.age
<span class="py-output">20</span>
<span class="py-output"></span><span class="py-prompt">&gt;&gt;&gt; </span>test.married
<span class="py-output">False</span></pre>
<table class="fieldTable"></table></div>
    
    
    <div id="splitTables">
      <table class="children sortable" id="id362">
  
  
  
  
  <tr class="method">
    
    
    <td>Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#__init__">__init__</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="classmethod">
    
    
    <td>Class Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#__class_init__">__class_init__</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#__post_init__">__post_init__</a></td>
    <td><span>A hook which is called after the constructor is called.
</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#_set">_set</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#_get">_get</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#get_attribute_names">get_attribute_names</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#is_default_value">is_default_value</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#do_set_property">do_set_property</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="kiwi.utils.PropertyObject.html#do_get_property">do_get_property</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr>
  
</table>
      
      
    </div>
    
    
    
    <div class="function">
        <a name="kiwi.utils.PropertyObject.__init__"></a>
        <a name="__init__"></a>
        <div class="functionHeader">
        
        def __init__(self, **kwargs):
        
      </div>
        <div class="functionBody">
          <div class="interfaceinfo">overridden in <a href="kiwi.ui.entry.KiwiEntry.html">kiwi.ui.entry.KiwiEntry</a>, <a href="kiwi.ui.hyperlink.HyperLink.html">kiwi.ui.hyperlink.HyperLink</a>, <a href="kiwi.ui.objectlist.Column.html">kiwi.ui.objectlist.Column</a>, <a href="kiwi.ui.objectlist.ObjectList.html">kiwi.ui.objectlist.ObjectList</a>, <a href="kiwi.ui.widgets.button.ProxyButton.html">kiwi.ui.widgets.button.ProxyButton</a>, <a href="kiwi.ui.widgets.checkbutton.ProxyCheckButton.html">kiwi.ui.widgets.checkbutton.ProxyCheckButton</a>, <a href="kiwi.ui.widgets.colorbutton.ProxyColorButton.html">kiwi.ui.widgets.colorbutton.ProxyColorButton</a>, <a href="kiwi.ui.widgets.combo.ProxyComboBox.html">kiwi.ui.widgets.combo.ProxyComboBox</a>, <a href="kiwi.ui.widgets.combo.ProxyComboBoxEntry.html">kiwi.ui.widgets.combo.ProxyComboBoxEntry</a>, <a href="kiwi.ui.widgets.combo.ProxyComboEntry.html">kiwi.ui.widgets.combo.ProxyComboEntry</a>, <a href="kiwi.ui.widgets.entry.ProxyDateEntry.html">kiwi.ui.widgets.entry.ProxyDateEntry</a>, <a href="kiwi.ui.widgets.filechooser.ProxyFileChooserButton.html">kiwi.ui.widgets.filechooser.ProxyFileChooserButton</a>, <a href="kiwi.ui.widgets.filechooser.ProxyFileChooserWidget.html">kiwi.ui.widgets.filechooser.ProxyFileChooserWidget</a>, <a href="kiwi.ui.widgets.fontbutton.ProxyFontButton.html">kiwi.ui.widgets.fontbutton.ProxyFontButton</a>, <a href="kiwi.ui.widgets.label.ProxyLabel.html">kiwi.ui.widgets.label.ProxyLabel</a>, <a href="kiwi.ui.widgets.radiobutton.ProxyRadioButton.html">kiwi.ui.widgets.radiobutton.ProxyRadioButton</a>, <a href="kiwi.ui.widgets.scale.ProxyHScale.html">kiwi.ui.widgets.scale.ProxyHScale</a>, <a href="kiwi.ui.widgets.scale.ProxyVScale.html">kiwi.ui.widgets.scale.ProxyVScale</a>, <a href="kiwi.ui.widgets.spinbutton.ProxySpinButton.html">kiwi.ui.widgets.spinbutton.ProxySpinButton</a>, <a href="kiwi.ui.widgets.textview.ProxyTextView.html">kiwi.ui.widgets.textview.ProxyTextView</a></div>
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="kiwi.utils.PropertyObject.__class_init__"></a>
        <a name="__class_init__"></a>
        <div class="functionHeader">
        @classmethod<br />
        def __class_init__(cls, namespace):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="kiwi.utils.PropertyObject.__post_init__"></a>
        <a name="__post_init__"></a>
        <div class="functionHeader">
        
        def __post_init__(self):
        
      </div>
        <div class="functionBody">
          <div class="interfaceinfo">overridden in <a href="kiwi.ui.widgets.entry.ProxyEntry.html">kiwi.ui.widgets.entry.ProxyEntry</a></div>
          <div>A hook which is called after the constructor is called. It's mainly here
to workaround http://bugzilla.gnome.org/show_bug.cgi?id=425501 so you can 
set properties at construction time
<table class="fieldTable"></table></div>
        </div>
      </div><div class="function">
        <a name="kiwi.utils.PropertyObject._set"></a>
        <a name="_set"></a>
        <div class="functionHeader">
        
        def _set(self, name, value):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="kiwi.utils.PropertyObject._get"></a>
        <a name="_get"></a>
        <div class="functionHeader">
        
        def _get(self, name):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="kiwi.utils.PropertyObject.get_attribute_names"></a>
        <a name="get_attribute_names"></a>
        <div class="functionHeader">
        
        def get_attribute_names(self):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="kiwi.utils.PropertyObject.is_default_value"></a>
        <a name="is_default_value"></a>
        <div class="functionHeader">
        
        def is_default_value(self, attr, value):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="kiwi.utils.PropertyObject.do_set_property"></a>
        <a name="do_set_property"></a>
        <div class="functionHeader">
        
        def do_set_property(self, pspec, value):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="kiwi.utils.PropertyObject.do_get_property"></a>
        <a name="do_get_property"></a>
        <div class="functionHeader">
        
        def do_get_property(self, pspec):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div>
    
    <address>
      <a href="index.html">API Documentation</a> for Kiwi, generated by <a href="http://codespeak.net/~mwh/pydoctor/">pydoctor</a> at 2008-05-29 16:06:17.
    </address>
  </body>
</html>