--- a/ProjectFlask/ServerStartOptionsDialog.py Thu Dec 30 12:13:22 2021 +0100 +++ b/ProjectFlask/ServerStartOptionsDialog.py Wed Sep 21 16:30:15 2022 +0200 @@ -19,10 +19,11 @@ """ Class implementing a dialog to enter parameters to start the server. """ + def __init__(self, options, parent=None): """ Constructor - + @param options dictionary containing the current server start options @type dict @param parent reference to the parent widget @@ -30,39 +31,39 @@ """ super().__init__(parent) self.setupUi(self) - + ericProject = ericApp().getObject("Project") - + self.certFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) - self.certFilePicker.setFilters(self.tr( - "Certificate Files (*.pem);;" - "Certificate Files (*.cert *.cer *.crt)" - )) + self.certFilePicker.setFilters( + self.tr( + "Certificate Files (*.pem);;" "Certificate Files (*.cert *.cer *.crt)" + ) + ) self.certFilePicker.setDefaultDirectory(ericProject.getProjectPath()) - + self.keyFilePicker.setMode(EricPathPickerModes.OPEN_FILE_MODE) - self.keyFilePicker.setFilters(self.tr( - "Key Files (*.pem *.key)" - )) + self.keyFilePicker.setFilters(self.tr("Key Files (*.pem *.key)")) self.keyFilePicker.setDefaultDirectory(ericProject.getProjectPath()) - + self.developmentCheckBox.setChecked(options.get("development", False)) self.hostEdit.setText(options.get("host", "")) self.portSpinBox.setValue(int(options.get("port", "5000"))) - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + def getDataDict(self): """ Public method to get a dictionary containing the entered data. - + @return dictionary containing the entered data @rtype dict """ - options = {} - - options["development"] = self.developmentCheckBox.isChecked() + options = { + "development": self.developmentCheckBox.isChecked(), + } + host = self.hostEdit.text() if host: options["host"] = host @@ -73,5 +74,5 @@ options["cert"] = self.certFilePicker.text() if self.keyFilePicker.text(): options["key"] = self.keyFilePicker.text() - + return options