Home | Trees | Indices | Help |
---|
|
1 # Copyright (C) 2003, 2004, 2005, 2006 Red Hat Inc. <http://www.redhat.com/> 2 # Copyright (C) 2003 David Zeuthen 3 # Copyright (C) 2004 Rob Taylor 4 # Copyright (C) 2005, 2006 Collabora Ltd. <http://www.collabora.co.uk/> 5 # 6 # Permission is hereby granted, free of charge, to any person 7 # obtaining a copy of this software and associated documentation 8 # files (the "Software"), to deal in the Software without 9 # restriction, including without limitation the rights to use, copy, 10 # modify, merge, publish, distribute, sublicense, and/or sell copies 11 # of the Software, and to permit persons to whom the Software is 12 # furnished to do so, subject to the following conditions: 13 # 14 # The above copyright notice and this permission notice shall be 15 # included in all copies or substantial portions of the Software. 16 # 17 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 24 # DEALINGS IN THE SOFTWARE. 25 26 from xml.parsers.expat import ParserCreate 27 from dbus.exceptions import IntrospectionParserException 2830 __slots__ = ('map', 'in_iface', 'in_method', 'sig') 366438 parser = ParserCreate('UTF-8', ' ') 39 parser.buffer_text = True 40 parser.StartElementHandler = self.StartElementHandler 41 parser.EndElementHandler = self.EndElementHandler 42 parser.Parse(data) 43 return self.map4446 if not self.in_iface: 47 if (not self.in_method and name == 'interface'): 48 self.in_iface = attributes['name'] 49 else: 50 if (not self.in_method and name == 'method'): 51 self.in_method = attributes['name'] 52 elif (self.in_method and name == 'arg'): 53 if attributes.get('direction', 'in') == 'in': 54 self.sig += attributes['type']5566 """Return a dict mapping ``interface.method`` strings to the 67 concatenation of all their 'in' parameters, and mapping 68 ``interface.signal`` strings to the concatenation of all their 69 parameters. 70 71 Example output:: 72 73 { 74 'com.example.SignalEmitter.OneString': 's', 75 'com.example.MethodImplementor.OneInt32Argument': 'i', 76 } 77 78 :Parameters: 79 `data` : str 80 The introspection XML. Must be an 8-bit string of UTF-8. 81 """ 82 try: 83 return _Parser().parse(data) 84 except Exception as e: 85 raise IntrospectionParserException('%s: %s' % (e.__class__, e))86
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun Mar 6 17:56:49 2016 | http://epydoc.sourceforge.net |