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.,
|
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
import urllib, re
|
import urllib, re, traceback
|
||||||
|
|
||||||
from PyQt4.QtCore import QThread, SIGNAL
|
from PyQt4.QtCore import QThread, SIGNAL
|
||||||
|
|
||||||
@ -23,6 +23,7 @@ from libprs500.ebooks.BeautifulSoup import BeautifulSoup
|
|||||||
class CheckForUpdates(QThread):
|
class CheckForUpdates(QThread):
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
|
try:
|
||||||
src = urllib.urlopen('http://pypi.python.org/pypi/libprs500').read()
|
src = urllib.urlopen('http://pypi.python.org/pypi/libprs500').read()
|
||||||
soup = BeautifulSoup(src)
|
soup = BeautifulSoup(src)
|
||||||
meta = soup.find('link', rel='meta', title='DOAP')
|
meta = soup.find('link', rel='meta', title='DOAP')
|
||||||
@ -33,4 +34,6 @@ class CheckForUpdates(QThread):
|
|||||||
version = match.group(1)
|
version = match.group(1)
|
||||||
if version != __version__:
|
if version != __version__:
|
||||||
self.emit(SIGNAL('update_found(PyQt_PyObject)'), version)
|
self.emit(SIGNAL('update_found(PyQt_PyObject)'), version)
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user