Ejemplo n.º 1
0
 def load(self, last):
     i = 10
     label = None
     if last - 100 < 0:
         chain = self.chain[:last]
     else:
         chain = self.chain[last - 100:last]
     chain.reverse()
     for c in chain:
         if i == 10:
             label = Label(size_hint=(None, None), text='')
             label.index = c['header']['index'] - 10
             self.ids.chain.add_widget(label, 1)
             i = 0
         label.text += json.dumps(c, indent=4) + '\n'
         label._label.refresh()
         label.size = label._label.texture.size
         i += 1
     if last - 100 < 0:
         self.ids.chain.remove_widget(self.ids.load)