This commit is contained in:
Kovid Goyal 2009-08-16 11:39:44 -06:00
parent babe84e4e5
commit 5ab738e805

View File

@ -6,7 +6,7 @@ import traceback
from PyQt4.QtCore import QThread, SIGNAL from PyQt4.QtCore import QThread, SIGNAL
import mechanize import mechanize
from calibre.constants import __version__ from calibre.constants import __version__, iswindows, isosx
from calibre import browser from calibre import browser
URL = 'http://status.calibre-ebook.com/latest' URL = 'http://status.calibre-ebook.com/latest'
@ -18,6 +18,8 @@ class CheckForUpdates(QThread):
br = browser() br = browser()
req = mechanize.Request(URL) req = mechanize.Request(URL)
req.add_header('CALIBRE_VERSION', __version__) req.add_header('CALIBRE_VERSION', __version__)
req.add_header('CALIBRE_OS',
'win' if iswindows else 'osx' if isosx else 'oth')
version = br.open(req).read().strip() version = br.open(req).read().strip()
if version and version != __version__: if version and version != __version__:
self.emit(SIGNAL('update_found(PyQt_PyObject)'), version) self.emit(SIGNAL('update_found(PyQt_PyObject)'), version)