Skip to content
Permalink
Browse files

[console] Prepend introductory text with '#' to avoid attempting to f…

…ormat it as Python code
  • Loading branch information
nyalldawson committed Mar 30, 2021
1 parent 18d8a76 commit 0f54df6675ae49e41c41d9e398c5bab9bd95592a
Showing with 2 additions and 0 deletions.
  1. +2 −0 python/console/console_output.py
@@ -141,6 +141,8 @@ def insertInitText(self):
"Use iface to access QGIS API interface or type help(iface) for more info\n"
"Security warning: typing commands from an untrusted source can harm your computer")

txtInit = '\n'.join(['# ' + line for line in txtInit.split('\n')])

# 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.

0 comments on commit 0f54df6

Please sign in to comment.