예제 #1
0
 def __repr__(self):
     l = ['<UnitOfWork>']
     l.append('  <new>')
     l += [ '    %s' % indent(repr(x), 6) for x in self.new ]
     l.append('  <clean>')
     l += [ '    %s' % indent(repr(x), 6) for x in self.clean ]
     l.append('  <dirty>')
     l += [ '    %s' % indent(repr(x), 6) for x in self.dirty ]
     l.append('  <deleted>')
     l += [ '    %s' % indent(repr(x), 6) for x in self.deleted ]
     return '\n'.join(l)
예제 #2
0
 def __repr__(self):
     l = ['<UnitOfWork>']
     l.append('  <new>')
     l += [ '    %s' % indent(repr(x), 6) for x in self.new ]
     l.append('  <clean>')
     l += [ '    %s' % indent(repr(x), 6) for x in self.clean ]
     l.append('  <dirty>')
     l += [ '    %s' % indent(repr(x), 6) for x in self.dirty ]
     l.append('  <deleted>')
     l += [ '    %s' % indent(repr(x), 6) for x in self.deleted ]
     return '\n'.join(l)
 def __repr__(self):
     l = [ '<imap>' ]
     for k,v in sorted(self._objects.iteritems()):
         l.append(indent('  %s : %s => %r'
                         % (k[0].__name__, k[1], v),
                         4))
     return '\n'.join(l)
예제 #4
0
 def __repr__(self):
     l = [ '<imap (%d)>' % len(self._objects) ]
     for k,v in six.iteritems(self._objects):
         l.append(indent('  %s : %s => %r'
                         % (k[0].__name__, k[1], v),
                         4))
     return '\n'.join(l)
예제 #5
0
 def __repr__(self):
     l = ['<imap (%d)>' % len(self._objects)]
     for k, v in six.iteritems(self._objects):
         l.append(indent('  %s : %s => %r' % (k[0].__name__, k[1], v), 4))
     return '\n'.join(l)
예제 #6
0
 def __repr__(self):
     l = ['<session>']
     l.append('  ' + indent(repr(self.uow), 2))
     l.append('  ' + indent(repr(self.imap), 2))
     return '\n'.join(l)
예제 #7
0
 def __repr__(self):
     l = ['<session>']
     l.append('  ' + indent(repr(self.uow), 2))
     l.append('  ' + indent(repr(self.imap), 2))
     return '\n'.join(l)
예제 #8
0
 def test_indent(self):
     s='''The quick brown fox jumped over the lazy dog'''
     lines = utils.indent(utils.wordwrap(s, width=20), 4).split('\n')
     self.assertEqual(lines[0], 'The quick brown fox')
     self.assertEqual(lines[1], '    jumped over the lazy')
     self.assertEqual(lines[2], '    dog')
예제 #9
0
 def __repr__(self):
     l = ["<imap (%d)>" % len(self._objects)]
     for k, v in sorted(self._objects.iteritems()):
         l.append(indent("  %s : %s => %r" % (k[0].__name__, k[1], v), 4))
     return "\n".join(l)