Helpviewer/HelpDocsInstaller.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 2999
28c75409a78f
child 3058
0a02c433f52d
--- a/Helpviewer/HelpDocsInstaller.py	Tue Oct 15 22:03:54 2013 +0200
+++ b/Helpviewer/HelpDocsInstaller.py	Fri Oct 18 23:00:41 2013 +0200
@@ -68,11 +68,13 @@
         changes = False
         
         qt4Docs = ["designer", "linguist", "qt"]
-        qt5Docs = ["activeqt", "qtconcurrent", "qtcore", "qtdbus", "qtdesigner", "qtdoc",
-            "qtgraphicaleffects", "qtgui", "qthelp", "qtimageformats", "qtlinguist",
-            "qtmultimedia", "qtnetwork", "qtopengl", "qtprintsupport", "qtqml", "qtquick",
-            "qtscript", "qtsql", "qtsvg", "qttestlib", "qtuitools", "qtwebkit",
-            "qtwebkitexamples", "qtwidgets", "qtxml", "qtxmlpatterns"]
+        qt5Docs = [
+            "activeqt", "qtconcurrent", "qtcore", "qtdbus", "qtdesigner",
+            "qtdoc", "qtgraphicaleffects", "qtgui", "qthelp", "qtimageformats",
+            "qtlinguist", "qtmultimedia", "qtnetwork", "qtopengl",
+            "qtprintsupport", "qtqml", "qtquick", "qtscript", "qtsql", "qtsvg",
+            "qttestlib", "qtuitools", "qtwebkit", "qtwebkitexamples",
+            "qtwidgets", "qtxml", "qtxmlpatterns"]
         for qtDocs, version in [(qt4Docs, 4), (qt5Docs, 5)]:
             for doc in qtDocs:
                 changes |= self.__installQtDoc(doc, version, engine)
@@ -110,10 +112,12 @@
             qchFile = lst[1]
         
         if version == 4:
-            docsPath = QDir(QLibraryInfo.location(QLibraryInfo.DocumentationPath) + \
-                       QDir.separator() + "qch")
+            docsPath = QDir(
+                QLibraryInfo.location(QLibraryInfo.DocumentationPath) + \
+                QDir.separator() + "qch")
         elif version == 5:
-            docsPath = QDir(QLibraryInfo.location(QLibraryInfo.DocumentationPath))
+            docsPath = QDir(
+                QLibraryInfo.location(QLibraryInfo.DocumentationPath))
         else:
             # unsupported Qt version
             return False
@@ -127,13 +131,15 @@
         for f in files:
             if f.startswith(name):
                 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f)
-                namespace = QHelpEngineCore.namespaceName(fi.absoluteFilePath())
+                namespace = QHelpEngineCore.namespaceName(
+                    fi.absoluteFilePath())
                 if not namespace:
                     continue
                 
                 if dt.isValid() and \
                    namespace in engine.registeredDocumentations() and \
-                   fi.lastModified().toString(Qt.ISODate) == dt.toString(Qt.ISODate) and \
+                   fi.lastModified().toString(Qt.ISODate) == \
+                    dt.toString(Qt.ISODate) and \
                    qchFile == fi.absoluteFilePath():
                     return False
                 
@@ -142,8 +148,9 @@
                 
                 if not engine.registerDocumentation(fi.absoluteFilePath()):
                     self.errorMessage.emit(
-                        self.trUtf8("""<p>The file <b>{0}</b> could not be registered."""
-                                    """<br/>Reason: {1}</p>""")\
+                        self.trUtf8(
+                            """<p>The file <b>{0}</b> could not be"""
+                            """ registered. <br/>Reason: {1}</p>""")\
                             .format(fi.absoluteFilePath, engine.error())
                     )
                     return False
@@ -186,11 +193,13 @@
             if f == "source.qch":
                 fi = QFileInfo(docsPath.absolutePath() + QDir.separator() + f)
                 if dt.isValid() and \
-                   fi.lastModified().toString(Qt.ISODate) == dt.toString(Qt.ISODate) and \
+                   fi.lastModified().toString(Qt.ISODate) == \
+                    dt.toString(Qt.ISODate) and \
                    qchFile == fi.absoluteFilePath():
                     return False
                 
-                namespace = QHelpEngineCore.namespaceName(fi.absoluteFilePath())
+                namespace = QHelpEngineCore.namespaceName(
+                    fi.absoluteFilePath())
                 if not namespace:
                     continue
                 
@@ -199,8 +208,9 @@
                 
                 if not engine.registerDocumentation(fi.absoluteFilePath()):
                     self.errorMessage.emit(
-                        self.trUtf8("""<p>The file <b>{0}</b> could not be registered."""
-                                    """<br/>Reason: {1}</p>""")\
+                        self.trUtf8(
+                            """<p>The file <b>{0}</b> could not be"""
+                            """ registered. <br/>Reason: {1}</p>""")\
                             .format(fi.absoluteFilePath, engine.error())
                     )
                     return False

eric ide

mercurial