ProjectDjango/DjangoCheckOptionsDialog.py

changeset 169
b8f263e05c39
parent 168
c6182aab51e9
child 172
ea7980ded4f3
--- a/ProjectDjango/DjangoCheckOptionsDialog.py	Wed Dec 30 11:02:06 2020 +0100
+++ b/ProjectDjango/DjangoCheckOptionsDialog.py	Sat Apr 24 11:25:03 2021 +0200
@@ -40,7 +40,7 @@
         @param parent reference to the parent widget
         @type QWidget
         """
-        super(DjangoCheckOptionsDialog, self).__init__(parent)
+        super().__init__(parent)
         self.setupUi(self)
         
         self.settingsFileButton.setIcon(UI.PixmapCache.getIcon("open"))
@@ -91,11 +91,11 @@
         @return module name
         @rtype str
         """
-        if self.__path.endswith(("/", "\\")):
-            # cope with a bug in eric
-            start = self.__path[:-1]
-        else:
-            start = self.__path
+        start = (
+            self.__path[:-1]
+            if self.__path.endswith(("/", "\\")) else
+            self.__path
+        )
         relPath = Utilities.relativeUniversalPath(path, start)
         mod = os.path.splitext(relPath)[0].replace("/", ".")
         return mod
@@ -146,12 +146,11 @@
         if self.__path:
             proc.setWorkingDirectory(self.__path)
         proc.start(self.__python, args)
-        if proc.waitForStarted():
-            if proc.waitForFinished():
-                output = str(proc.readAllStandardOutput(),
-                             Preferences.getSystem("IOEncoding"), 'replace')
-                for line in output.splitlines():
-                    self.tagsList.addItem(line.strip())
+        if proc.waitForStarted() and proc.waitForFinished():
+            output = str(proc.readAllStandardOutput(),
+                         Preferences.getSystem("IOEncoding"), 'replace')
+            for line in output.splitlines():
+                self.tagsList.addItem(line.strip())
         
         # step 4: re-select tags
         for tag in selectedTags:

eric ide

mercurial