示例#1
0
class StatsCruncherApp(App):

    def __init__(self, player, group, lines, **kwargs):
        super(StatsCruncherApp, self).__init__(**kwargs)
        self.group = group
        self.lines = lines
        self.parser = Parse_Line()
        self.info_pane = InfoForm(self.group)

    def update(self, dt):
        line = self.lines.readline()
        if line != "":
            self.parser.parse(line.split(" "), self.group)
        self.info_pane.update_stats(self.group)



    def build(self):
        self.root.add_widget(self.info_pane)
        Clock.schedule_interval(self.update, .1 / 60.0)
        self.info_pane.add_member(self.group.player)
示例#2
0
 def __init__(self, player, group, lines, **kwargs):
     super(StatsCruncherApp, self).__init__(**kwargs)
     self.group = group
     self.lines = lines
     self.parser = Parse_Line()
     self.info_pane = InfoForm(self.group)