Esempio n. 1
0
 def __call__(self, hdrs, content, limit):
     lines = utils.pretty_json(content)
     if lines:
         txt = []
         sofar = 0
         for i in lines:
             sofar += len(i)
             txt.append(urwid.Text(("text", i)), )
             if sofar > limit:
                 break
         trailer(sum(len(i) for i in lines), txt, limit)
         return "JSON", txt
Esempio n. 2
0
 def __call__(self, hdrs, content, limit):
     lines = utils.pretty_json(content)
     if lines:
         txt = []
         sofar = 0
         for i in lines:
             sofar += len(i)
             txt.append(urwid.Text(("text", i)))
             if sofar > limit:
                 break
         trailer(sum(len(i) for i in lines), txt, limit)
         return "JSON", txt