From f05e6c6336f68d201d57005a715025e12029c619 Mon Sep 17 00:00:00 2001 From: Bryan Schumaker Date: Tue, 30 Nov 2010 21:19:29 -0500 Subject: [PATCH] Set default page During startup, we should check if the initial page exists. If it doesn't we will switch to the default page instead. --- html/web_radio.html | 22 ++++++++++++++++++++++ ocarina/body.py | 4 +++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 html/web_radio.html diff --git a/html/web_radio.html b/html/web_radio.html new file mode 100644 index 00000000..bda3ba11 --- /dev/null +++ b/html/web_radio.html @@ -0,0 +1,22 @@ + + + + +
+ + + + + + + + + + + +
Select a radio station
Pandora
Grooveshark
+ + + + + diff --git a/ocarina/body.py b/ocarina/body.py index 3152c54f..02a090c7 100644 --- a/ocarina/body.py +++ b/ocarina/body.py @@ -61,7 +61,9 @@ def init(): def init_page(page_name): page = prefs.init_pref("ocarina.body.page", page_name) - child = contents[page] + child = contents.get(page, None) + if child == None: + child = contents.get(page_name) num = body.page_num(child) body.set_current_page(num) child.visible()