eric6/Debugger/DebugUI.py

changeset 8230
8b5c6896655b
parent 8222
5994b80b8760
child 8243
cc717c2ae956
--- a/eric6/Debugger/DebugUI.py	Mon Apr 12 19:25:18 2021 +0200
+++ b/eric6/Debugger/DebugUI.py	Mon Apr 12 19:54:29 2021 +0200
@@ -837,10 +837,7 @@
         """
         self.editorOpen = True
         
-        if fn:
-            editor = self.viewmanager.getOpenEditor(fn)
-        else:
-            editor = None
+        editor = self.viewmanager.getOpenEditor(fn) if fn else None
         self.__checkActions(editor)
         
     def __lastEditorClosed(self):
@@ -867,10 +864,7 @@
         
         @param editor editor window
         """
-        if editor:
-            fn = editor.getFileName()
-        else:
-            fn = None
+        fn = editor.getFileName() if editor else None
         
         cap = 0
         if fn:
@@ -1635,10 +1629,7 @@
         for row in range(model.rowCount()):
             index = model.index(row, 0)
             filename, line, cond = model.getBreakPointByIndex(index)[:3]
-            if not cond:
-                formattedCond = ""
-            else:
-                formattedCond = " : {0}".format(cond[:20])
+            formattedCond = " : {0}".format(cond[:20]) if cond else ""
             bpSuffix = " : {0:d}{1}".format(line, formattedCond)
             act = self.breakpointsMenu.addAction(
                 "{0}{1}".format(
@@ -1987,10 +1978,8 @@
         
         # Get the command line arguments, the working directory and the
         # exception reporting flag.
-        if runProject:
-            cap = self.tr("Run Project")
-        else:
-            cap = self.tr("Run Script")
+        cap = (self.tr("Run Project") if runProject
+               else self.tr("Run Script"))
         dlg = StartDialog(
             cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory,
             self.envHistory, self.exceptions, self.ui, 1,
@@ -2127,10 +2116,8 @@
         
         # Get the command line arguments, the working directory and the
         # exception reporting flag.
-        if debugProject:
-            cap = self.tr("Debug Project")
-        else:
-            cap = self.tr("Debug Script")
+        cap = (self.tr("Debug Project") if debugProject
+               else self.tr("Debug Script"))
         dlg = StartDialog(
             cap, self.lastUsedVenvName, self.argvHistory, self.wdHistory,
             self.envHistory, self.exceptions, self.ui, 0,

eric ide

mercurial