From 13bfea6aff1ffed3aa172b5e7ae5540b7e2c3a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 28 Jan 2024 21:11:46 +0100 Subject: [PATCH] Fix invalid escape sequences. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- mountconfig/mountconfig.py | 4 ++-- serviceconfig/serviceconfig.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mountconfig/mountconfig.py b/mountconfig/mountconfig.py index 260f215..eb28cae 100755 --- a/mountconfig/mountconfig.py +++ b/mountconfig/mountconfig.py @@ -2617,7 +2617,7 @@ class MountEntryDialog(KDialogBase): and not os.path.isfile(self.currentMountEntry.getMountPoint()) and not self.currentMountEntry.mounttype == 'swap'): ask = KMessageBox.warningYesNoCancel(self, - i18n("""The mountpoint '%1' does not exist. You will not be able to enable it until it is created.\ + i18n("""The mountpoint '%1' does not exist. You will not be able to enable it until it is created.\ \nShould I create the mountpoint?""").arg(self.currentMountEntry.getMountPoint()), i18n("Mountpoint does not exist")) if ask==KMessageBox.Cancel: @@ -2626,7 +2626,7 @@ class MountEntryDialog(KDialogBase): os.mkdir(self.currentMountEntry.getMountPoint()) elif os.path.isfile(self.currentMountEntry.getMountPoint()): if KMessageBox.warningContinueCancel(self, - i18n("""The mountpoint '%1' is a file, but it has to be a directory. You will probably not \ + i18n("""The mountpoint '%1' is a file, but it has to be a directory. You will probably not \ be able to enable it.\nContinue?""").arg(self.currentMountEntry.getMountPoint()), i18n("Invalid mountpoint"))!=KMessageBox.Continue: return diff --git a/serviceconfig/serviceconfig.py b/serviceconfig/serviceconfig.py index 1a0c802..42bb543 100755 --- a/serviceconfig/serviceconfig.py +++ b/serviceconfig/serviceconfig.py @@ -1437,9 +1437,9 @@ class CommandRunner(KDialogBase): def slotReadyReadStdout(self): # Remove the colors used by some programs. # FIXME: this probably isn't neccessary anymore. - uncolor = lambda text: re.compile('\\x1b\[[0-9]+;01m').sub("", \ - re.compile('\\x1b\[0m').sub("", re.compile('\\033\[1;[0-9]+m').sub("", \ - re.compile('\\033\[0m').sub("", text)))) + uncolor = lambda text: re.compile('\\x1b\\[[0-9]+;01m').sub("", \ + re.compile('\\x1b\\[0m').sub("", re.compile('\\033\\[1;[0-9]+m').sub("", \ + re.compile('\\033\\[0m').sub("", text)))) self.output += uncolor(str(self.kid.readStdout())) self.outputtextview.setText(self.output) self.outputtextview.ensureVisible(0,self.outputtextview.contentsHeight())