mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle errors in update thread gracefully
This commit is contained in:
parent
ab242cc96d
commit
8a111f5730
@ -13,7 +13,7 @@
|
||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
import urllib, re
|
||||
import urllib, re, traceback
|
||||
|
||||
from PyQt4.QtCore import QThread, SIGNAL
|
||||
|
||||
@ -23,6 +23,7 @@ from libprs500.ebooks.BeautifulSoup import BeautifulSoup
|
||||
class CheckForUpdates(QThread):
|
||||
|
||||
def run(self):
|
||||
try:
|
||||
src = urllib.urlopen('http://pypi.python.org/pypi/libprs500').read()
|
||||
soup = BeautifulSoup(src)
|
||||
meta = soup.find('link', rel='meta', title='DOAP')
|
||||
@ -33,4 +34,6 @@ class CheckForUpdates(QThread):
|
||||
version = match.group(1)
|
||||
if version != __version__:
|
||||
self.emit(SIGNAL('update_found(PyQt_PyObject)'), version)
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
Loading…
x
Reference in New Issue
Block a user