Lines Matching full:self

24     def __init__(self, key, value):  argument
25 self.key = key
26 self.value = value
27 self.annotations = []
28 self.since = ""
32 def __init__(self, name, signature): argument
33 self.name = name
34 self.signature = signature
35 self.annotations = []
36 self.doc_string = ""
37 self.since = ""
41 def __init__(self, name, h_type_implies_unix_fd=True): argument
42 self.name = name
43 self.h_type_implies_unix_fd = h_type_implies_unix_fd
44 self.in_args = []
45 self.out_args = []
46 self.annotations = []
47 self.doc_string = ""
48 self.since = ""
49 self.deprecated = False
50 self.unix_fd = False
54 def __init__(self, name): argument
55 self.name = name
56 self.args = []
57 self.annotations = []
58 self.doc_string = ""
59 self.since = ""
60 self.deprecated = False
64 def __init__(self, name, signature, access): argument
65 self.name = name
66 self.signature = signature
67 self.access = access
68 self.annotations = []
69 self.arg = Arg("value", self.signature)
70 self.arg.annotations = self.annotations
71 self.readable = False
72 self.writable = False
73 if self.access == "readwrite":
74 self.readable = True
75 self.writable = True
76 elif self.access == "read":
77 self.readable = True
78 elif self.access == "write":
79 self.writable = True
81 raise ValueError('Invalid access type "{}"'.format(self.access))
82 self.doc_string = ""
83 self.since = ""
84 self.deprecated = False
85 self.emits_changed_signal = True
89 def __init__(self, name): argument
90 self.name = name
91 self.methods = []
92 self.signals = []
93 self.properties = []
94 self.annotations = []
95 self.doc_string = ""
96 self.doc_string_brief = ""
97 self.since = ""
98 self.deprecated = False
112 def __init__(self, xml_data, h_type_implies_unix_fd=True): argument
113 self._parser = xml.parsers.expat.ParserCreate()
114 self._parser.CommentHandler = self.handle_comment
115 self._parser.CharacterDataHandler = self.handle_char_data
116 self._parser.StartElementHandler = self.handle_start_element
117 self._parser.EndElementHandler = self.handle_end_element
119 self.parsed_interfaces = []
120 self._cur_object = None
122 self.state = DBusXMLParser.STATE_TOP
123 self.state_stack = []
124 self._cur_object = None
125 self._cur_object_stack = []
127 self.doc_comment_last_symbol = ""
129 self._h_type_implies_unix_fd = h_type_implies_unix_fd
131 self._parser.Parse(xml_data)
138 def handle_comment(self, data): argument
194 self.doc_comment_last_symbol = symbol
195 self.doc_comment_params = params
196 self.doc_comment_body = body
198 def handle_char_data(self, data): argument
202 def handle_start_element(self, name, attrs): argument
203 old_state = self.state
204 old_cur_object = self._cur_object
205 if self.state == DBusXMLParser.STATE_IGNORED:
206 self.state = DBusXMLParser.STATE_IGNORED
207 elif self.state == DBusXMLParser.STATE_TOP:
209 self.state = DBusXMLParser.STATE_NODE
211 self.state = DBusXMLParser.STATE_IGNORED
212 elif self.state == DBusXMLParser.STATE_NODE:
214 self.state = DBusXMLParser.STATE_INTERFACE
216 self._cur_object = iface
217 self.parsed_interfaces.append(iface)
219 self.state = DBusXMLParser.STATE_ANNOTATION
221 self._cur_object.annotations.append(anno)
222 self._cur_object = anno
224 self.state = DBusXMLParser.STATE_IGNORED
227 if "name" in attrs and self.doc_comment_last_symbol == attrs["name"]:
228 self._cur_object.doc_string = self.doc_comment_body
229 if "short_description" in self.doc_comment_params:
230 short_description = self.doc_comment_params["short_description"]
231 self._cur_object.doc_string_brief = short_description
232 if "since" in self.doc_comment_params:
233 self._cur_object.since = self.doc_comment_params["since"].strip()
235 elif self.state == DBusXMLParser.STATE_INTERFACE:
237 self.state = DBusXMLParser.STATE_METHOD
239 attrs["name"], h_type_implies_unix_fd=self._h_type_implies_unix_fd
241 self._cur_object.methods.append(method)
242 self._cur_object = method
244 self.state = DBusXMLParser.STATE_SIGNAL
246 self._cur_object.signals.append(signal)
247 self._cur_object = signal
249 self.state = DBusXMLParser.STATE_PROPERTY
251 self._cur_object.properties.append(prop)
252 self._cur_object = prop
254 self.state = DBusXMLParser.STATE_ANNOTATION
256 self._cur_object.annotations.append(anno)
257 self._cur_object = anno
259 self.state = DBusXMLParser.STATE_IGNORED
262 if "name" in attrs and self.doc_comment_last_symbol == attrs["name"]:
263 self._cur_object.doc_string = self.doc_comment_body
264 if "since" in self.doc_comment_params:
265 self._cur_object.since = self.doc_comment_params["since"].strip()
267 elif self.state == DBusXMLParser.STATE_METHOD:
269 self.state = DBusXMLParser.STATE_ARG
276 self._cur_object.in_args.append(arg)
278 self._cur_object.out_args.append(arg)
281 self._cur_object = arg
283 self.state = DBusXMLParser.STATE_ANNOTATION
285 self._cur_object.annotations.append(anno)
286 self._cur_object = anno
288 self.state = DBusXMLParser.STATE_IGNORED
291 if self.doc_comment_last_symbol == old_cur_object.name:
292 if "name" in attrs and attrs["name"] in self.doc_comment_params:
293 doc_string = self.doc_comment_params[attrs["name"]]
295 self._cur_object.doc_string = doc_string
296 if "since" in self.doc_comment_params:
297 self._cur_object.since = self.doc_comment_params[
301 elif self.state == DBusXMLParser.STATE_SIGNAL:
303 self.state = DBusXMLParser.STATE_ARG
308 self._cur_object.args.append(arg)
309 self._cur_object = arg
311 self.state = DBusXMLParser.STATE_ANNOTATION
313 self._cur_object.annotations.append(anno)
314 self._cur_object = anno
316 self.state = DBusXMLParser.STATE_IGNORED
319 if self.doc_comment_last_symbol == old_cur_object.name:
320 if "name" in attrs and attrs["name"] in self.doc_comment_params:
321 doc_string = self.doc_comment_params[attrs["name"]]
323 self._cur_object.doc_string = doc_string
324 if "since" in self.doc_comment_params:
325 self._cur_object.since = self.doc_comment_params[
329 elif self.state == DBusXMLParser.STATE_PROPERTY:
331 self.state = DBusXMLParser.STATE_ANNOTATION
333 self._cur_object.annotations.append(anno)
334 self._cur_object = anno
336 self.state = DBusXMLParser.STATE_IGNORED
338 elif self.state == DBusXMLParser.STATE_ARG:
340 self.state = DBusXMLParser.STATE_ANNOTATION
342 self._cur_object.annotations.append(anno)
343 self._cur_object = anno
345 self.state = DBusXMLParser.STATE_IGNORED
347 elif self.state == DBusXMLParser.STATE_ANNOTATION:
349 self.state = DBusXMLParser.STATE_ANNOTATION
351 self._cur_object.annotations.append(anno)
352 self._cur_object = anno
354 self.state = DBusXMLParser.STATE_IGNORED
359 self.state, name
363 self.state_stack.append(old_state)
364 self._cur_object_stack.append(old_cur_object)
366 def handle_end_element(self, name): argument
367 self.state = self.state_stack.pop()
368 self._cur_object = self._cur_object_stack.pop()