diff -Nru wxsaku.orig/wxsaku.py wxsaku/wxsaku.py --- wxsaku.orig/wxsaku.py 2006-12-31 19:12:38.000000000 +0900 +++ wxsaku/wxsaku.py 2006-12-31 21:59:59.031250000 +0900 @@ -2,15 +2,16 @@ import os, re, time import wx, wx.html from threading import Thread + +from shingetsu import daemon from shingetsu import config from shingetsu.cache import * from shingetsu.title import file_decode, str_encode -BROUSER = '/usr/bin/firefox "%s"' - images = ('jpeg', 'jpg', 'gif', 'png') -class WxSaku(wx.App): +#class WxSaku(wx.App): +class WxSaku(wx.PySimpleApp): def OnInit(self): self.cachelist = [] self.currentThread = None @@ -362,7 +363,7 @@ rec.free() buf.append('') - self.SetPage(''.join(buf)) + self.SetPage(''.join(buf).decode('utf-8')) self.HistoryClear() def RenderRecord(self, rec, buf): @@ -433,9 +434,11 @@ self.HistoryClear() def OnLinkClicked(self, linkinfo): - cmd = BROUSER % linkinfo.GetHref() - cmd = cmd + ' &' - os.system(cmd) + class Browser(Thread): + def run(self): + import webbrowser + webbrowser.open(linkinfo.GetHref()) + Browser().start() def OnCellMouseHover(self, cell, x, y): linkobj = cell.GetLink() @@ -556,6 +559,7 @@ return time.strftime('%Y-%m-%d %H:%M', time.localtime(int(stamp))) def main(): + daemon.setup() os.chdir(os.path.dirname(config.__file__)) app = WxSaku()