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