Skip to content

Commit 18ba722

Browse files
committed
log any errors occurring.
1 parent f1da323 commit 18ba722

File tree

2 files changed

+51
-38
lines changed

2 files changed

+51
-38
lines changed

parseCSS.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def __init__(self, filename):
3939
if os.path.exists(filename):
4040
self.parseFile()
4141
else:
42-
warn( "filename %s not found" % filename)
42+
logger.error( "filename %s not found" % filename)
4343

4444
def parseFile(self):
4545
parser = tinycss.make_parser()

talkshow.py

+50-37
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
import os
22
import math
3-
from wrappers import *
4-
from widget import *
5-
import glob
6-
import subprocess
7-
import animated_property
8-
if sys.platform == 'win32':
9-
import _winreg
103

11-
12-
import CommandBar
134
from talkshowLogger import logger
14-
155
debug = logger.debug
166
info = logger.info
177
warn = logger.warn
188

9+
try:
10+
import CommandBar
11+
from wrappers import *
12+
from widget import *
13+
import glob
14+
import subprocess
15+
import animated_property
16+
if sys.platform == 'win32':
17+
import _winreg
18+
except(Exception):
19+
logger.exception("exception!")
20+
raise
21+
22+
23+
24+
1925
#TODO: make this configurable
2026
ORIENTATION = 1
2127

@@ -814,31 +820,6 @@ def DoScan(self,TimeNow):
814820

815821

816822
self.TimeOld = TimeNow
817-
818-
#environment.set("character_spacing", -2)
819-
820-
821-
try:
822-
screenWidth = talkshowConfig.windowWidth
823-
screenHeight = talkshowConfig.windowHeight
824-
if screenHeight == 0 or screenWidth == 0:
825-
screenWidth = int(style.page.width)
826-
screenHeight = int(style.page.height)
827-
except:
828-
screenWidth = int(style.page.width)
829-
screenHeight = int(style.page.height)
830-
831-
832-
screen = Screen("KommHelp Talkshow", "",screenWidth, screenHeight)
833-
834-
835-
logger.debug("initialising talkshow.")
836-
837-
838-
talkshow = Talkshow(screen)
839-
840-
screen.event_handler = talkshow
841-
842823

843824
# boilerplate
844825
def tick():
@@ -859,6 +840,38 @@ def tick():
859840
talkshow.DoScan(TimeNow)
860841

861842
return True
843+
844+
845+
try:
846+
847+
848+
try:
849+
screenWidth = talkshowConfig.windowWidth
850+
screenHeight = talkshowConfig.windowHeight
851+
if screenHeight == 0 or screenWidth == 0:
852+
screenWidth = int(style.page.width)
853+
screenHeight = int(style.page.height)
854+
except:
855+
screenWidth = int(style.page.width)
856+
screenHeight = int(style.page.height)
857+
858+
859+
screen = Screen("KommHelp Talkshow", "",screenWidth, screenHeight)
860+
861+
862+
logger.debug("initialising talkshow.")
863+
864+
865+
talkshow = Talkshow(screen)
866+
867+
screen.event_handler = talkshow
868+
869+
870+
871+
872+
pc = PeriodicCall(tick,0)
873+
pyglet.app.run()
862874

863-
pc = PeriodicCall(tick,0)
864-
pyglet.app.run()
875+
except(Exception):
876+
logger.exception("exception!")
877+
raise

0 commit comments

Comments
 (0)