From 460b00786a47bc5f0442ea4a633cd5b2ba42085b Mon Sep 17 00:00:00 2001 From: Salvatore Larosa Date: Sat, 31 Aug 2013 17:38:30 +0200 Subject: [PATCH] [pyqgis-console] adds a "\n" at the end of the header text if it has not been inserted from translators --- python/console/console_output.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/console/console_output.py b/python/console/console_output.py index de7d76929ae4..6784c277e952 100644 --- a/python/console/console_output.py +++ b/python/console/console_output.py @@ -137,7 +137,13 @@ def insertInitText(self): "Python {0} on {1}\n" "## Type help(iface) for more info and list of methods.\n").format(sys.version, socket.gethostname()) - initText = self.setText(txtInit) + ## some translation string for the console header ends without '\n' + ## and the first command in console will be appended at the header text. + ## The following code add a '\n' at the end of the string if not present. + if txtInit.endswith('\n'): + initText = self.setText(txtInit) + else: + initText = self.setText(txtInit + '\n') def refreshLexerProperties(self): self.setLexers()