| 893 | } |
| 894 | |
| 895 | bool PythonConsole::isComment(const QString& source) const |
| 896 | { |
| 897 | if (source.isEmpty()) { |
| 898 | return false; |
| 899 | } |
| 900 | int i = 0; |
| 901 | while (i < source.length()) { |
| 902 | QChar ch = source.at(i++); |
| 903 | if (ch.isSpace()) { |
| 904 | continue; |
| 905 | } |
| 906 | else if (ch == QLatin1Char('#')) { |
| 907 | return true; |
| 908 | } |
| 909 | else { |
| 910 | return false; |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | return false; |
| 915 | } |
| 916 | |
| 917 | /** |
| 918 | * Prints the Python statement cmd to the console. |