ProjectFlask/FlaskMigrateExtension/MigrateSummaryDialog.py

changeset 36
548dea93941c
parent 35
65a377b7a52c
child 39
120f30d7b949
equal deleted inserted replaced
35:65a377b7a52c 36:548dea93941c
24 """ 24 """
25 def __init__(self, project, migrateProject, migrations="", parent=None): 25 def __init__(self, project, migrateProject, migrations="", parent=None):
26 """ 26 """
27 Constructor 27 Constructor
28 28
29 @param project reference to the project object
30 @type Project
29 @param migrateProject reference to the migrate project extension 31 @param migrateProject reference to the migrate project extension
30 @type MigrateProject 32 @type MigrateProject
31 @param project reference to the project object
32 @type Project
33 @param migrations directory path containing the migrations 33 @param migrations directory path containing the migrations
34 @type str 34 @type str
35 @param parent reference to the parent widget 35 @param parent reference to the parent widget
36 @type QWidget 36 @type QWidget
37 """ 37 """
153 self.downgradeButton.setEnabled(enable) 153 self.downgradeButton.setEnabled(enable)
154 154
155 @pyqtSlot() 155 @pyqtSlot()
156 def on_upgradeButton_clicked(self): 156 def on_upgradeButton_clicked(self):
157 """ 157 """
158 Private slot to upgrade to the selected revision 158 Private slot to upgrade to the selected revision.
159 """ 159 """
160 itm = self.summaryWidget.selectedItems()[0] 160 itm = self.summaryWidget.selectedItems()[0]
161 rev = itm.text(1) 161 rev = itm.text(1)
162 self.__migrateProject.upgradeDatabase(revision=rev) 162 self.__migrateProject.upgradeDatabase(revision=rev)
163 self.showSummary() 163 self.showSummary()
164 164
165 @pyqtSlot() 165 @pyqtSlot()
166 def on_downgradeButton_clicked(self): 166 def on_downgradeButton_clicked(self):
167 """ 167 """
168 Private slot to downgrade to the selected revision 168 Private slot to downgrade to the selected revision.
169 """ 169 """
170 itm = self.summaryWidget.selectedItems()[0] 170 itm = self.summaryWidget.selectedItems()[0]
171 rev = itm.text(1) 171 rev = itm.text(1)
172 self.__migrateProject.downgradeDatabase(revision=rev) 172 self.__migrateProject.downgradeDatabase(revision=rev)
173 self.showSummary() 173 self.showSummary()
174 174
175 @pyqtSlot(QAbstractButton) 175 @pyqtSlot(QAbstractButton)
176 def on_buttonBox_clicked(self, button): 176 def on_buttonBox_clicked(self, button):
177 """ 177 """
178 Private slot handling a button press of the button box 178 Private slot handling a button press of the button box.
179 179
180 @param button reference to the pressed button 180 @param button reference to the pressed button
181 @type QAbstractButton 181 @type QAbstractButton
182 """ 182 """
183 if button is self.buttonBox.button(QDialogButtonBox.Cancel): 183 if button is self.buttonBox.button(QDialogButtonBox.Cancel):

eric ide

mercurial