ppapi/generators/idl_node.py
def Dump(self, depth=0, comments=False, out=sys.stdout):
    """Dump this object and its children"""
    if self.cls in ['Comment', 'Copyright']:
      is_comment = True
    else:
      is_comment = False

    # Skip this node if it's a comment, and we are not printing comments
    if not comments and is_comment:
      return

    tab = ''.rjust(depth * 2)
    if is_comment:
      out.write('%sComment\n' % tab)
      for line in self.GetName().split('\n'):
        out.write('%s  "%s"\n' % (tab, line))
    else:
      ver = IDLRelease.__str__(self)
      if self.releases:
        release_list = ': ' + ' '.join(self.releases)
      else:
        release_list = ': undefined'
      out.write('%s%s%s%s\n' % (tab, self, ver, release_list))
    if self.typelist:
      out.write('%s  Typelist: %s\n' % (tab, self.typelist.GetReleases()[0]))
    properties = self._property_node.GetPropertyList()
    if properties:
      out.write('%s  Properties\n' % tab)
      for p in properties:
        if is_comment and p == 'NAME':
          # Skip printing the name for comments, since we printed above already
          continue
        out.write('%s    %s : %s\n' % (tab, p, self.GetProperty(p)))
    for child in self._children:
      child.Dump(depth+1, comments=comments, out=out)
Dump this object and its children
Dump this object and its children
Dump this object and its children
def Dump(self, depth=0, comments=False, out=sys.stdout):
    if self.cls in ['Comment', 'Copyright']:
      is_comment = True
    else:
      is_comment = False
    if not comments and is_comment:
      return
    tab = ''.rjust(depth * 2)
    if is_comment:
      out.write('%sComment\n' % tab)
      for line in self.GetName().split('\n'):
        out.write('%s  "%s"\n' % (tab, line))
    else:
      ver = IDLRelease.__str__(self)
      if self.releases:
        release_list = ': ' + ' '.join(self.releases)
      else:
        release_list = ': undefined'
      out.write('%s%s%s%s\n' % (tab, self, ver, release_list))
    if self.typelist:
      out.write('%s  Typelist: %s\n' % (tab, self.typelist.GetReleases()[0]))
    properties = self._property_node.GetPropertyList()
    if properties:
      out.write('%s  Properties\n' % tab)
      for p in properties:
        if is_comment and p == 'NAME':
          continue
        out.write('%s    %s : %s\n' % (tab, p, self.GetProperty(p)))
    for child in self._children:
      child.Dump(depth+1, comments=comments, out=out)
def Dump ( self , depth = 0 , comments = False , out = sys . stdout ) : if self . cls in [ 'Comment' , 'Copyright' ] : is_comment = True else : is_comment = False if not comments and is_comment : return tab = '' . rjust ( depth * 2 ) if is_comment : out . write ( '%sComment\n' % tab ) for line in self . GetName ( ) . split ( '\n' ) : out . write ( '%s  "%s"\n' % ( tab , line ) ) else : ver = IDLRelease . __str__ ( self ) if self . releases : release_list = ': ' + ' ' . join ( self . releases ) else : release_list = ': undefined' out . write ( '%s%s%s%s\n' % ( tab , self , ver , release_list ) ) if self . typelist : out . write ( '%s  Typelist: %s\n' % ( tab , self . typelist . GetReleases ( ) [ 0 ] ) ) properties = self . _property_node . GetPropertyList ( ) if properties : out . write ( '%s  Properties\n' % tab ) for p in properties : if is_comment and p == 'NAME' : continue out . write ( '%s    %s : %s\n' % ( tab , p , self . GetProperty ( p ) ) ) for child in self . _children : child . Dump ( depth + 1 , comments = comments , out = out )
Dump this object and its children
Dump this object and its children
"""Dump this object and its children""" # Skip this node if it's a comment, and we are not printing comments # Skip printing the name for comments, since we printed above already
self
depth
comments
out