ProjectDjango/DjangoMigrationsListDialog.py

changeset 161
208fced62e00
parent 145
104b14713e9e
child 163
1622130167bb
--- a/ProjectDjango/DjangoMigrationsListDialog.py	Sat May 23 11:14:54 2020 +0200
+++ b/ProjectDjango/DjangoMigrationsListDialog.py	Mon Jun 22 19:32:12 2020 +0200
@@ -14,9 +14,11 @@
     pass
 
 from PyQt5.QtCore import pyqtSlot, Qt, QProcess, QTimer, QPoint
-from PyQt5.QtWidgets import QDialog, QDialogButtonBox, QAbstractButton, \
-    QHeaderView, QTreeWidgetItem, QMenu, QAbstractItemView, QInputDialog, \
+from PyQt5.QtWidgets import (
+    QDialog, QDialogButtonBox, QAbstractButton,
+    QHeaderView, QTreeWidgetItem, QMenu, QAbstractItemView, QInputDialog,
     QLineEdit
+)
 
 from E5Gui import E5MessageBox
 
@@ -104,8 +106,10 @@
         Private slot called when the process finished or the user pressed the
         button.
         """
-        if self.proc is not None and \
-           self.proc.state() != QProcess.NotRunning:
+        if (
+            self.proc is not None and
+            self.proc.state() != QProcess.NotRunning
+        ):
             self.proc.terminate()
             QTimer.singleShot(2000, self.proc.kill)
             self.proc.waitForFinished(3000)
@@ -309,14 +313,14 @@
                 menu.addAction(
                     self.tr("Make Migrations"),
                     self.__makeMigrations).setEnabled(len(selApps) > 0)
-                menu.addAction(
+                act = menu.addAction(
                     self.tr("Make Empty Migrations"),
-                    lambda: self.__makeMigrations(empty=True))\
-                    .setEnabled(len(selApps) > 0)
-                menu.addAction(
+                    lambda: self.__makeMigrations(empty=True))
+                act.setEnabled(len(selApps) > 0)
+                act = menu.addAction(
                     self.tr("Make Migrations (dry-run)"),
-                    lambda: self.__makeMigrations(dryRun=True))\
-                    .setEnabled(len(selApps) > 0)
+                    lambda: self.__makeMigrations(dryRun=True))
+                act.setEnabled(len(selApps) > 0)
         else:
             menu.addAction(self.tr("Apply Selected Migrations"),
                            self.__applyMigration)

eric ide

mercurial