Plugins/DocumentationPlugins/Ericdoc/EricdocConfigDialog.py

changeset 15
f6ccc31d6e72
parent 13
1af94a91f439
child 55
b5c84934de9c
equal deleted inserted replaced
14:092aa8fafa4e 15:f6ccc31d6e72
2 2
3 # Copyright (c) 2003 - 2010 Detlev Offenbach <detlev@die-offenbachs.de> 3 # Copyright (c) 2003 - 2010 Detlev Offenbach <detlev@die-offenbachs.de>
4 # 4 #
5 5
6 """ 6 """
7 Module implementing a dialog to enter the parameters for eric4-doc. 7 Module implementing a dialog to enter the parameters for eric5-doc.
8 """ 8 """
9 9
10 import sys 10 import sys
11 import os 11 import os
12 import copy 12 import copy
15 from PyQt4.QtGui import * 15 from PyQt4.QtGui import *
16 16
17 from E4Gui.E4Completers import E4DirCompleter 17 from E4Gui.E4Completers import E4DirCompleter
18 18
19 from .Ui_EricdocConfigDialog import Ui_EricdocConfigDialog 19 from .Ui_EricdocConfigDialog import Ui_EricdocConfigDialog
20 from DocumentationTools.Config import eric4docDefaultColors, eric4docColorParameterNames 20 from DocumentationTools.Config import eric5docDefaultColors, eric5docColorParameterNames
21 import Utilities 21 import Utilities
22 22
23 from eric4config import getConfig 23 from eric5config import getConfig
24 24
25 class EricdocConfigDialog(QDialog, Ui_EricdocConfigDialog): 25 class EricdocConfigDialog(QDialog, Ui_EricdocConfigDialog):
26 """ 26 """
27 Class implementing a dialog to enter the parameters for eric4-doc. 27 Class implementing a dialog to enter the parameters for eric5-doc.
28 """ 28 """
29 def __init__(self, ppath, parms = None, parent = None): 29 def __init__(self, ppath, parms = None, parent = None):
30 """ 30 """
31 Constructor 31 Constructor
32 32
60 '''</body></html>''' 60 '''</body></html>'''
61 ) 61 )
62 62
63 # get a copy of the defaults to store the user settings 63 # get a copy of the defaults to store the user settings
64 self.parameters = copy.deepcopy(self.defaults) 64 self.parameters = copy.deepcopy(self.defaults)
65 self.colors = eric4docDefaultColors.copy() 65 self.colors = eric5docDefaultColors.copy()
66 66
67 # combine it with the values of parms 67 # combine it with the values of parms
68 if parms is not None: 68 if parms is not None:
69 for key, value in list(parms.items()): 69 for key, value in list(parms.items()):
70 if key.endswith("Color"): 70 if key.endswith("Color"):
143 parms = {} 143 parms = {}
144 args = [] 144 args = []
145 145
146 # 1. the program name 146 # 1. the program name
147 args.append(sys.executable) 147 args.append(sys.executable)
148 args.append(Utilities.normabsjoinpath(getConfig('ericDir'), "eric4-doc.py")) 148 args.append(Utilities.normabsjoinpath(getConfig('ericDir'), "eric5-doc.py"))
149 149
150 # 2. the commandline options 150 # 2. the commandline options
151 # 2a. general commandline options 151 # 2a. general commandline options
152 if self.parameters['outputDirectory'] != self.defaults['outputDirectory']: 152 if self.parameters['outputDirectory'] != self.defaults['outputDirectory']:
153 parms['outputDirectory'] = self.parameters['outputDirectory'] 153 parms['outputDirectory'] = self.parameters['outputDirectory']
187 if os.path.isabs(self.parameters['cssFile']): 187 if os.path.isabs(self.parameters['cssFile']):
188 args.append(self.parameters['cssFile']) 188 args.append(self.parameters['cssFile'])
189 else: 189 else:
190 args.append(os.path.join(self.ppath, self.parameters['cssFile'])) 190 args.append(os.path.join(self.ppath, self.parameters['cssFile']))
191 for key, value in list(self.colors.items()): 191 for key, value in list(self.colors.items()):
192 if self.colors[key] != eric4docDefaultColors[key]: 192 if self.colors[key] != eric5docDefaultColors[key]:
193 parms[key] = self.colors[key] 193 parms[key] = self.colors[key]
194 args.append("--%s=%s" % \ 194 args.append("--%s=%s" % \
195 (eric4docColorParameterNames[key], self.colors[key])) 195 (eric5docColorParameterNames[key], self.colors[key]))
196 196
197 # 2c. QtHelp commandline options 197 # 2c. QtHelp commandline options
198 parms['qtHelpEnabled'] = self.parameters['qtHelpEnabled'] 198 parms['qtHelpEnabled'] = self.parameters['qtHelpEnabled']
199 if self.parameters['qtHelpEnabled']: 199 if self.parameters['qtHelpEnabled']:
200 args.append('--create-qhp') 200 args.append('--create-qhp')

eric ide

mercurial