Example #1
0
 def __xml__(self):
     return xml(self.data)
Example #2
0
File: aview.py Project: crnt/kdi
                # 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
Example #3
0
 def __xml__(self):
     return ''.join(['<item>%s</item>' % xml(x) for x in self._iteritems()])
Example #4
0
 def __xml__(self):
     return xml(self.data)
Example #5
0
 def __xml__(self):
     return xml(self.unzipped)
Example #6
0
 def __xml__(self):
     if self.isNull():
         return ''
     else:
         return xml(self.target)
Example #7
0
File: aview.py Project: asiasun/kdi
         # 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
Example #8
0
File: vstruct.py Project: crnt/kdi
 def __xml__(self):
     return ''.join([
         '<%s>%s</%s>' % (a, xml(getattr(self, a)), a)
         for a in self._iterattrs()
     ])
Example #9
0
 def __xml__(self):
     return ''.join(['<%s>%s</%s>' % (a, xml(getattr(self,a)), a)
                     for a in self._iterattrs()])
Example #10
0
File: offset.py Project: crnt/kdi
 def __xml__(self):
     if self.isNull():
         return ''
     else:
         return xml(self.target)
Example #11
0
File: offset.py Project: crnt/kdi
 def __xml__(self):
     return ''.join(
         ['<item>%s</item>' % xml(x) for x in self._iteritems()])