clean up load loop code a little
Haldean Brown
3 years ago
155 | 155 | print("failed to load screen: {}".format(e)) |
156 | 156 | return None |
157 | 157 | |
158 | def load_loop(self): | |
159 | self.new_screen = self.load() | |
160 | if self.new_screen is not None: | |
161 | self.current_anim = None | |
162 | ||
163 | 158 | def anim_loop(self): |
164 | 159 | current_anim = self.current_anim |
165 | 160 | current_screen = self.current_screen |
188 | 183 | def run_load_loop(): |
189 | 184 | while True: |
190 | 185 | try: |
191 | self.load_loop() | |
186 | self.new_screen = self.load() | |
187 | if self.new_screen is not None: | |
188 | self.current_anim = None | |
192 | 189 | except Exception: |
193 | 190 | traceback.print_exc() |
194 | 191 | time.sleep(5) |