Project/DebuggerPropertiesDialog.py

branch
Py2 comp.
changeset 3057
10516539f238
parent 2525
8b507a9a2d40
parent 2995
63d874899b8b
child 3058
0a02c433f52d
equal deleted inserted replaced
3056:9986ec0e559a 3057:10516539f238
25 from eric5config import getConfig 25 from eric5config import getConfig
26 26
27 27
28 class DebuggerPropertiesDialog(QDialog, Ui_DebuggerPropertiesDialog): 28 class DebuggerPropertiesDialog(QDialog, Ui_DebuggerPropertiesDialog):
29 """ 29 """
30 Class implementing a dialog for entering project specific debugger settings. 30 Class implementing a dialog for entering project specific debugger
31 settings.
31 """ 32 """
32 def __init__(self, project, parent=None, name=None): 33 def __init__(self, project, parent=None, name=None):
33 """ 34 """
34 Constructor 35 Constructor
35 36
42 self.setObjectName(name) 43 self.setObjectName(name)
43 self.setupUi(self) 44 self.setupUi(self)
44 45
45 self.debugClientCompleter = E5FileCompleter(self.debugClientEdit) 46 self.debugClientCompleter = E5FileCompleter(self.debugClientEdit)
46 self.interpreterCompleter = E5FileCompleter(self.interpreterEdit) 47 self.interpreterCompleter = E5FileCompleter(self.interpreterEdit)
47 self.translationLocalCompleter = E5DirCompleter(self.translationLocalEdit) 48 self.translationLocalCompleter = E5DirCompleter(
49 self.translationLocalEdit)
48 50
49 self.project = project 51 self.project = project
50 52
51 if self.project.debugProperties["INTERPRETER"]: 53 if self.project.debugProperties["INTERPRETER"]:
52 self.interpreterEdit.setText(self.project.debugProperties["INTERPRETER"]) 54 self.interpreterEdit.setText(
55 self.project.debugProperties["INTERPRETER"])
53 else: 56 else:
54 if self.project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2", "Python3"]: 57 if self.project.pdata["PROGLANGUAGE"][0] in \
58 ["Python", "Python2", "Python3"]:
55 self.interpreterEdit.setText(sys.executable) 59 self.interpreterEdit.setText(sys.executable)
56 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": 60 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby":
57 self.interpreterEdit.setText("/usr/bin/ruby") 61 self.interpreterEdit.setText("/usr/bin/ruby")
58 if self.project.debugProperties["DEBUGCLIENT"]: 62 if self.project.debugProperties["DEBUGCLIENT"]:
59 self.debugClientEdit.setText(self.project.debugProperties["DEBUGCLIENT"]) 63 self.debugClientEdit.setText(
64 self.project.debugProperties["DEBUGCLIENT"])
60 else: 65 else:
61 if self.project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2"]: 66 if self.project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2"]:
62 debugClient = os.path.join(getConfig('ericDir'), 67 debugClient = os.path.join(
63 "DebugClients", "Python", "DebugClient.py") 68 getConfig('ericDir'),
69 "DebugClients", "Python", "DebugClient.py")
64 elif self.project.pdata["PROGLANGUAGE"][0] == "Python3": 70 elif self.project.pdata["PROGLANGUAGE"][0] == "Python3":
65 debugClient = os.path.join(getConfig('ericDir'), 71 debugClient = os.path.join(
66 "DebugClients", "Python3", "DebugClient.py") 72 getConfig('ericDir'),
73 "DebugClients", "Python3", "DebugClient.py")
67 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": 74 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby":
68 debugClient = os.path.join(getConfig('ericDir'), 75 debugClient = os.path.join(getConfig('ericDir'),
69 "DebugClients", "Ruby", "DebugClient.rb") 76 "DebugClients", "Ruby", "DebugClient.rb")
70 else: 77 else:
71 debugClient = "" 78 debugClient = ""
112 @pyqtSlot() 119 @pyqtSlot()
113 def on_debugClientButton_clicked(self): 120 def on_debugClientButton_clicked(self):
114 """ 121 """
115 Private slot to handle the Debug Client selection. 122 Private slot to handle the Debug Client selection.
116 """ 123 """
117 filters = self.project.dbgFilters[self.project.pdata["PROGLANGUAGE"][0]] 124 filters = self.project.dbgFilters[
125 self.project.pdata["PROGLANGUAGE"][0]]
118 filters += self.trUtf8("All Files (*)") 126 filters += self.trUtf8("All Files (*)")
119 file = E5FileDialog.getOpenFileName( 127 file = E5FileDialog.getOpenFileName(
120 self, 128 self,
121 self.trUtf8("Select Debug Client"), 129 self.trUtf8("Select Debug Client"),
122 self.debugClientEdit.text(), 130 self.debugClientEdit.text(),
130 Public method to store the entered/modified data. 138 Public method to store the entered/modified data.
131 """ 139 """
132 self.project.debugProperties["INTERPRETER"] = \ 140 self.project.debugProperties["INTERPRETER"] = \
133 self.interpreterEdit.text() 141 self.interpreterEdit.text()
134 if not self.project.debugProperties["INTERPRETER"]: 142 if not self.project.debugProperties["INTERPRETER"]:
135 if self.project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2", "Python3"]: 143 if self.project.pdata["PROGLANGUAGE"][0] in \
144 ["Python", "Python2", "Python3"]:
136 self.project.debugProperties["INTERPRETER"] = sys.executable 145 self.project.debugProperties["INTERPRETER"] = sys.executable
137 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": 146 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby":
138 self.project.debugProperties["INTERPRETER"] = "/usr/bin/ruby" 147 self.project.debugProperties["INTERPRETER"] = "/usr/bin/ruby"
139 148
140 self.project.debugProperties["DEBUGCLIENT"] = \ 149 self.project.debugProperties["DEBUGCLIENT"] = \
141 self.debugClientEdit.text() 150 self.debugClientEdit.text()
142 if not self.project.debugProperties["DEBUGCLIENT"]: 151 if not self.project.debugProperties["DEBUGCLIENT"]:
143 if self.project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2"]: 152 if self.project.pdata["PROGLANGUAGE"][0] in ["Python", "Python2"]:
144 debugClient = os.path.join(getConfig('ericDir'), 153 debugClient = os.path.join(
145 "DebugClients", "Python", "DebugClient.py") 154 getConfig('ericDir'),
155 "DebugClients", "Python", "DebugClient.py")
146 elif self.project.pdata["PROGLANGUAGE"][0] == "Python3": 156 elif self.project.pdata["PROGLANGUAGE"][0] == "Python3":
147 debugClient = os.path.join(getConfig('ericDir'), 157 debugClient = os.path.join(
148 "DebugClients", "Python3", "DebugClient.py") 158 getConfig('ericDir'),
159 "DebugClients", "Python3", "DebugClient.py")
149 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby": 160 elif self.project.pdata["PROGLANGUAGE"][0] == "Ruby":
150 debugClient = os.path.join(getConfig('ericDir'), 161 debugClient = os.path.join(getConfig('ericDir'),
151 "DebugClients", "Ruby", "DebugClient.rb") 162 "DebugClients", "Ruby", "DebugClient.rb")
152 else: 163 else:
153 debugClient = "" 164 debugClient = ""

eric ide

mercurial