UI/UserInterface.py

changeset 4621
b46304716d28
parent 4619
aa2319888257
child 4629
99aaac59be4f
equal deleted inserted replaced
4620:49d9c6b58678 4621:b46304716d28
4769 os.path.join(os.path.dirname(sys.executable), "doc")) 4769 os.path.join(os.path.dirname(sys.executable), "doc"))
4770 else: 4770 else:
4771 pythonDocDir = Utilities.getEnvironmentEntry( 4771 pythonDocDir = Utilities.getEnvironmentEntry(
4772 "PYTHON3DOCDIR", 4772 "PYTHON3DOCDIR",
4773 '/usr/share/doc/packages/python3/html') 4773 '/usr/share/doc/packages/python3/html')
4774 if not pythonDocDir.startswith("http://") and \ 4774 if not pythonDocDir.startswith(("http://", "https://")):
4775 not pythonDocDir.startswith("https://"):
4776 if pythonDocDir.startswith("file://"): 4775 if pythonDocDir.startswith("file://"):
4777 pythonDocDir = pythonDocDir[7:] 4776 pythonDocDir = pythonDocDir[7:]
4778 if not os.path.splitext(pythonDocDir)[1]: 4777 if not os.path.splitext(pythonDocDir)[1]:
4779 home = Utilities.normjoinpath(pythonDocDir, 'index.html') 4778 home = Utilities.normjoinpath(pythonDocDir, 'index.html')
4780 4779
4836 Utilities.getEnvironmentEntry("PYTHON2DOCDIR", default) 4835 Utilities.getEnvironmentEntry("PYTHON2DOCDIR", default)
4837 else: 4836 else:
4838 pythonDocDir = Utilities.getEnvironmentEntry( 4837 pythonDocDir = Utilities.getEnvironmentEntry(
4839 "PYTHON2DOCDIR", 4838 "PYTHON2DOCDIR",
4840 '/usr/share/doc/packages/python/html') 4839 '/usr/share/doc/packages/python/html')
4841 if not pythonDocDir.startswith("http://") and \ 4840 if not pythonDocDir.startswith(("http://", "https://")):
4842 not pythonDocDir.startswith("https://"):
4843 if pythonDocDir.startswith("file://"): 4841 if pythonDocDir.startswith("file://"):
4844 pythonDocDir = pythonDocDir[7:] 4842 pythonDocDir = pythonDocDir[7:]
4845 if not os.path.splitext(pythonDocDir)[1]: 4843 if not os.path.splitext(pythonDocDir)[1]:
4846 home = Utilities.normjoinpath(pythonDocDir, 'index.html') 4844 home = Utilities.normjoinpath(pythonDocDir, 'index.html')
4847 else: 4845 else:
4907 if qtDocDir.startswith("qthelp://"): 4905 if qtDocDir.startswith("qthelp://"):
4908 if not os.path.splitext(qtDocDir)[1]: 4906 if not os.path.splitext(qtDocDir)[1]:
4909 home = qtDocDir + "/index.html" 4907 home = qtDocDir + "/index.html"
4910 else: 4908 else:
4911 home = qtDocDir 4909 home = qtDocDir
4912 elif qtDocDir.startswith("http://") or qtDocDir.startswith("https://"): 4910 elif qtDocDir.startswith(("http://", "https://")):
4913 home = qtDocDir 4911 home = qtDocDir
4914 else: 4912 else:
4915 if qtDocDir.startswith("file://"): 4913 if qtDocDir.startswith("file://"):
4916 qtDocDir = qtDocDir[7:] 4914 qtDocDir = qtDocDir[7:]
4917 if not os.path.splitext(qtDocDir)[1]: 4915 if not os.path.splitext(qtDocDir)[1]:
4960 self.tr("Documentation"), 4958 self.tr("Documentation"),
4961 self.tr("""<p>The PyQt4 documentation starting point""" 4959 self.tr("""<p>The PyQt4 documentation starting point"""
4962 """ has not been configured.</p>""")) 4960 """ has not been configured.</p>"""))
4963 return 4961 return
4964 4962
4965 if not pyqt4DocDir.startswith("http://") and \ 4963 if not pyqt4DocDir.startswith(("http://", "https://")):
4966 not pyqt4DocDir.startswith("https://"):
4967 home = "" 4964 home = ""
4968 if pyqt4DocDir: 4965 if pyqt4DocDir:
4969 if pyqt4DocDir.startswith("file://"): 4966 if pyqt4DocDir.startswith("file://"):
4970 pyqt4DocDir = pyqt4DocDir[7:] 4967 pyqt4DocDir = pyqt4DocDir[7:]
4971 if not os.path.splitext(pyqt4DocDir)[1]: 4968 if not os.path.splitext(pyqt4DocDir)[1]:
5023 self.tr("Documentation"), 5020 self.tr("Documentation"),
5024 self.tr("""<p>The PyQt5 documentation starting point""" 5021 self.tr("""<p>The PyQt5 documentation starting point"""
5025 """ has not been configured.</p>""")) 5022 """ has not been configured.</p>"""))
5026 return 5023 return
5027 5024
5028 if not pyqt5DocDir.startswith("http://") and \ 5025 if not pyqt5DocDir.startswith(("http://", "https://")):
5029 not pyqt5DocDir.startswith("https://"):
5030 home = "" 5026 home = ""
5031 if pyqt5DocDir: 5027 if pyqt5DocDir:
5032 if pyqt5DocDir.startswith("file://"): 5028 if pyqt5DocDir.startswith("file://"):
5033 pyqt5DocDir = pyqt5DocDir[7:] 5029 pyqt5DocDir = pyqt5DocDir[7:]
5034 if not os.path.splitext(pyqt5DocDir)[1]: 5030 if not os.path.splitext(pyqt5DocDir)[1]:
5076 5072
5077 def __showEricDoc(self): 5073 def __showEricDoc(self):
5078 """ 5074 """
5079 Private slot to show the Eric documentation. 5075 Private slot to show the Eric documentation.
5080 """ 5076 """
5081 home = Utilities.normjoinpath( 5077 home = Preferences.getHelp("EricDocDir")
5082 getConfig('ericDocDir'), "Source", "index.html") 5078 if not home:
5083 5079 home = Utilities.normjoinpath(
5084 if not home.startswith("http://") and \ 5080 getConfig('ericDocDir'), "Source", "index.html")
5085 not home.startswith("https://") and \ 5081
5086 not home.startswith("qthelp://"): 5082 if not home.startswith(("http://", "https://", "qthelp://")):
5087 if not os.path.exists(home): 5083 if not os.path.exists(home):
5088 E5MessageBox.warning( 5084 E5MessageBox.warning(
5089 self, 5085 self,
5090 self.tr("Documentation Missing"), 5086 self.tr("Documentation Missing"),
5091 self.tr("""<p>The documentation starting point""" 5087 self.tr("""<p>The documentation starting point"""
5125 self.tr("Documentation"), 5121 self.tr("Documentation"),
5126 self.tr("""<p>The PySide documentation starting point""" 5122 self.tr("""<p>The PySide documentation starting point"""
5127 """ has not been configured.</p>""")) 5123 """ has not been configured.</p>"""))
5128 return 5124 return
5129 5125
5130 if not pysideDocDir.startswith("http://") and \ 5126 if not pysideDocDir.startswith(("http://", "https://")):
5131 not pysideDocDir.startswith("https://"):
5132 if pysideDocDir.startswith("file://"): 5127 if pysideDocDir.startswith("file://"):
5133 pysideDocDir = pysideDocDir[7:] 5128 pysideDocDir = pysideDocDir[7:]
5134 if not os.path.splitext(pysideDocDir)[1]: 5129 if not os.path.splitext(pysideDocDir)[1]:
5135 home = Utilities.normjoinpath(pysideDocDir, 'index.html') 5130 home = Utilities.normjoinpath(pysideDocDir, 'index.html')
5136 else: 5131 else:

eric ide

mercurial