eric7/Plugins/WizardPlugins/SetupWizard/SetupWizardDialog.py

branch
eric7
changeset 9205
b75da2ba2a1a
parent 9202
81388c6065e8
equal deleted inserted replaced
9204:be84ff69f30e 9205:b75da2ba2a1a
39 Class implementing the setup.py wizard dialog. 39 Class implementing the setup.py wizard dialog.
40 40
41 It displays a dialog for entering the parameters for the setup.py code 41 It displays a dialog for entering the parameters for the setup.py code
42 generator. 42 generator.
43 """ 43 """
44
44 def __init__(self, category, editor, parent=None): 45 def __init__(self, category, editor, parent=None):
45 """ 46 """
46 Constructor 47 Constructor
47 48
48 @param category category of setup file to create 49 @param category category of setup file to create
640 urls[urlItem.text(0)] = urlItem.text(1) 641 urls[urlItem.text(0)] = urlItem.text(1)
641 project["urls"] = urls 642 project["urls"] = urls
642 643
643 classifiers = [] 644 classifiers = []
644 if not self.licenseClassifierCheckBox.isChecked(): 645 if not self.licenseClassifierCheckBox.isChecked():
645 license = tomlkit.table() 646 licenseTbl = tomlkit.table()
646 license["text"] = self.licenseEdit.text() 647 licenseTbl["text"] = self.licenseEdit.text()
647 project["license"] = license 648 project["license"] = licenseTbl
648 else: 649 else:
649 classifiers.append( 650 classifiers.append(
650 self.licenseClassifierComboBox.itemData( 651 self.licenseClassifierComboBox.itemData(
651 self.licenseClassifierComboBox.currentIndex())) 652 self.licenseClassifierComboBox.currentIndex()))
652 653
765 """ 766 """
766 Public slot to handle pressing the OK button. 767 Public slot to handle pressing the OK button.
767 """ 768 """
768 line, index = self.__editor.getCursorPosition() 769 line, index = self.__editor.getCursorPosition()
769 indLevel = self.__editor.indentation(line) // self.__editor.indentationWidth() 770 indLevel = self.__editor.indentation(line) // self.__editor.indentationWidth()
770 if self.__editor.indentationsUseTabs(): 771 indString = (
771 indString = '\t' 772 '\t'
772 else: 773 if self.__editor.indentationsUseTabs() else
773 indString = self.__editor.indentationWidth() * ' ' 774 self.__editor.indentationWidth() * ' '
775 )
774 776
775 if self.__category == "setup.py": 777 if self.__category == "setup.py":
776 sourceCode = self.__getSetupPyCode(indLevel, indString) 778 sourceCode = self.__getSetupPyCode(indLevel, indString)
777 elif self.__category == "setup.cfg": 779 elif self.__category == "setup.cfg":
778 sourceCode = self.__getSetupCfgCode() 780 sourceCode = self.__getSetupCfgCode()

eric ide

mercurial