def __xml__(self): return xml(self.data)
# Display this record (unless we're counting down # non-printing records) if not nonprinting: # Transform data try: xv = xform(x) except Exception, ex: print 'Unable to apply transform: %s' % opt.xform print ' %s: %s' % (ex.__class__.__name__, ex) sys.exit(1) # Display if opt.xml: print '<item file="%s" offset="%s">%s</item>' % \ (qqescape(f.name), qqescape(str(pos)), xml(xv)) else: if not opt.brief: print '%s %d (%s:%d): %s' % (x, nItems, f.name, pos, opt.xform) for line in alien.tools.iter_format_struct( xv, layouts[opt.layout], opt.width): print line if not opt.brief: print else: # Non-printing item; count down nonprinting -= 1 # Advance position pointers
def __xml__(self): return ''.join(['<item>%s</item>' % xml(x) for x in self._iteritems()])
def __xml__(self): return xml(self.unzipped)
def __xml__(self): if self.isNull(): return '' else: return xml(self.target)
# Display this record (unless we're counting down # non-printing records) if not nonprinting: # Transform data try: xv = xform(x) except Exception, ex: print 'Unable to apply transform: %s' % opt.xform print ' %s: %s' % (ex.__class__.__name__, ex) sys.exit(1) # Display if opt.xml: print '<item file="%s" offset="%s">%s</item>' % \ (qqescape(f.name), qqescape(str(pos)), xml(xv)) else: if not opt.brief: print '%s %d (%s:%d): %s'%(x, nItems, f.name, pos, opt.xform) for line in alien.tools.iter_format_struct(xv, layouts[opt.layout], opt.width): print line if not opt.brief: print else: # Non-printing item; count down nonprinting -= 1 # Advance position pointers pos += sz base += sz
def __xml__(self): return ''.join([ '<%s>%s</%s>' % (a, xml(getattr(self, a)), a) for a in self._iterattrs() ])
def __xml__(self): return ''.join(['<%s>%s</%s>' % (a, xml(getattr(self,a)), a) for a in self._iterattrs()])
def __xml__(self): return ''.join( ['<item>%s</item>' % xml(x) for x in self._iteritems()])