Bluez support cleanup.
[wammu.git] / Wammu / Webbrowser.py
blob7a065a526c0a94f118a7adb89e6cc432c1e99fe1
1 # -*- coding: UTF-8 -*-
2 # vim: expandtab sw=4 ts=4 sts=4:
3 '''
4 Wammu - Phone manager
5 webbrowser wrapper
6 '''
7 __author__ = 'Michal Čihař'
8 __email__ = 'michal@cihar.com'
9 __license__ = '''
10 Copyright (c) 2003 - 2007 Michal Čihař
12 This program is free software; you can redistribute it and/or modify it
13 under the terms of the GNU General Public License version 2 as published by
14 the Free Software Foundation.
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 more details.
21 You should have received a copy of the GNU General Public License along with
22 this program; if not, write to the Free Software Foundation, Inc.,
23 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 '''
26 import webbrowser
27 import threading
29 class BrowserThread(threading.Thread):
30 '''
31 Thread which opens URL in browser.
32 '''
34 def __init__(self, url):
35 '''
36 Creates new BrowserThread object.
38 @param url: URL to open when thread is started.
39 '''
40 threading.Thread.__init__(self)
41 self._url = url
43 def run(self):
44 '''
45 Actually opens browser.
46 '''
47 webbrowser.open(self._url)
49 def Open(url):
50 '''
51 Convenience wrapper to open URL in browser without blocking main
52 thread.
53 '''
54 BrowserThread(url).start()