From 23b7e0e5daf024e87d967ede3dfe6777a07e7469 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Sun, 19 Jun 2016 22:44:54 +0200 Subject: Fix threading problems with ipython --- helpers/key.py | 8 ++++---- helpers/mapping.py | 2 +- helpers/music_file.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'helpers') diff --git a/helpers/key.py b/helpers/key.py index 9a6cb3b..e9e485d 100644 --- a/helpers/key.py +++ b/helpers/key.py @@ -72,7 +72,7 @@ class Key: ) def set_description(self, description): - self.description = description + self.description = [str(desc) for desc in description] def set_color(self, color): self.custom_color = tuple(color) @@ -97,7 +97,7 @@ class Key: self.surface.blit(text, (5,5)) is_first_line = True - offset = 11 + text_police.get_linesize() + offset = 11 + text_police.get_linesize() - 4 first_line_offset = 18 for description in self.description: text = text_police.render(description, True, (0,0,0)) @@ -105,8 +105,8 @@ class Key: self.surface.blit(text, (first_line_offset, 9)) is_first_line = False else: - self.surface.blit(text, (5, offset)) - offset += text_police.get_linesize() + self.surface.blit(text, (3, offset)) + offset += text_police.get_linesize() - 4 background_surface.blit(self.surface, self.position) self.draw_lock.release() diff --git a/helpers/mapping.py b/helpers/mapping.py index ee5623a..84e9941 100644 --- a/helpers/mapping.py +++ b/helpers/mapping.py @@ -130,7 +130,7 @@ class Mapping: should_redraw_key = key.draw(self.background) if should_redraw_key: - threading.Thread(target = key.poll_redraw, args = [self.background]).start() + threading.Thread(name = "MSPollRedraw", target = key.poll_redraw, args = [self.background]).start() self.blit() def blit(self): diff --git a/helpers/music_file.py b/helpers/music_file.py index b834104..5101f7f 100644 --- a/helpers/music_file.py +++ b/helpers/music_file.py @@ -10,7 +10,7 @@ class MusicFile: self.sound = None self.loaded = False - threading.Thread(target = self.load_sound, args = [lock]).start() + threading.Thread(name = "MSMusicLoad", target = self.load_sound, args = [lock]).start() def load_sound(self, lock): lock.acquire() -- cgit v1.2.3