mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
38a53cfa37
commit
5217601f0c
@ -715,13 +715,13 @@ def build_forms(srcdir, info=None):
|
||||
dat = re.compile(r'QtGui.QApplication.translate\(.+?,\s+"(.+?)(?<!\\)",.+?\)', re.DOTALL).sub(r'_("\1")', dat)
|
||||
dat = dat.replace('_("MMM yyyy")', '"MMM yyyy"')
|
||||
dat = pat.sub(sub, dat)
|
||||
dat = dat.replace('from QtWebKit.QWebView import QWebView',
|
||||
'from PyQt4 import QtWebKit\nfrom PyQt4.QtWebKit import QWebView')
|
||||
|
||||
if form.endswith('viewer%smain.ui'%os.sep):
|
||||
info('\t\tPromoting WebView')
|
||||
dat = dat.replace('self.view = QtWebKit.QWebView(', 'self.view = DocumentView(')
|
||||
dat = dat.replace('self.view = QWebView(', 'self.view = DocumentView(')
|
||||
dat = dat.replace('from QtWebKit.QWebView import QWebView',
|
||||
'from PyQt4 import QtWebKit\nfrom PyQt4.QtWebKit import QWebView')
|
||||
dat += '\n\nfrom calibre.gui2.viewer.documentview import DocumentView'
|
||||
|
||||
open(compiled_form, 'wb').write(dat)
|
||||
|
Loading…
x
Reference in New Issue
Block a user