From 41e08fe2482985bd8f51633e641a2f39aabfb325 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Sat, 7 May 2011 15:54:26 -0400 Subject: [PATCH] Ocarina: Start through a function call I was starting Ocarina through "import ocarina" in the launcher. This was apparently a bad idea, since the import lock will never be released. This lock prevents other threads from importing modules, so when I tried to use urllib2 to download album art the call blocked until after I closed Ocarina. --- ocarina/__init__.py | 9 +++++---- scripts/makebin.sh | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ocarina/__init__.py b/ocarina/__init__.py index 04168bce..b57f693d 100644 --- a/ocarina/__init__.py +++ b/ocarina/__init__.py @@ -25,7 +25,8 @@ import queue import library import callbacks -callbacks.on_get_art("images/ocarina.png", 0) -libsaria.startup() -print "Startup took:", uptime() -gtk.main() +def run(): + callbacks.on_get_art("images/ocarina.png", 0) + libsaria.startup() + print "Startup took:", uptime() + gtk.main() diff --git a/scripts/makebin.sh b/scripts/makebin.sh index cad4bb13..a5d26678 100644 --- a/scripts/makebin.sh +++ b/scripts/makebin.sh @@ -13,6 +13,7 @@ function gen_ocarina() OUT="ocarina.py" echo "#!$PY" > $OUT echo "import ocarina" >> $OUT + echo "ocarina.run()" >> $OUT chmod +x $OUT }