mirror of
https://github.com/qgis/QGIS.git
synced 2025-11-27 00:07:16 -05:00
Cleaning the code
This commit is contained in:
parent
59ff69eae1
commit
a0566c79b7
@ -315,14 +315,12 @@ class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
|
|||||||
self.historyIndex = len(self.history)
|
self.historyIndex = len(self.history)
|
||||||
|
|
||||||
def writeHistoryFile(self):
|
def writeHistoryFile(self):
|
||||||
#hystoryFile = os.path.join(str(QDir.homePath()),".qgis","console_history.txt")
|
|
||||||
wH = open(_historyFile, 'w')
|
wH = open(_historyFile, 'w')
|
||||||
for s in self.history:
|
for s in self.history:
|
||||||
wH.write(s + '\n')
|
wH.write(s + '\n')
|
||||||
wH.close()
|
wH.close()
|
||||||
|
|
||||||
def readHistoryFile(self):
|
def readHistoryFile(self):
|
||||||
#hystoryFile = os.path.join(str(QDir.homePath()),".qgis","console_history.txt")
|
|
||||||
fileExist = QFile.exists(_historyFile)
|
fileExist = QFile.exists(_historyFile)
|
||||||
if fileExist:
|
if fileExist:
|
||||||
rH = open(_historyFile, 'r')
|
rH = open(_historyFile, 'r')
|
||||||
@ -505,11 +503,9 @@ class PythonEdit(QsciScintilla, code.InteractiveInterpreter):
|
|||||||
if cmd == '_save':
|
if cmd == '_save':
|
||||||
self.writeHistoryFile()
|
self.writeHistoryFile()
|
||||||
print QCoreApplication.translate("PythonConsole", "## History saved successfully ##")
|
print QCoreApplication.translate("PythonConsole", "## History saved successfully ##")
|
||||||
#del self.buffer[-1]
|
|
||||||
elif cmd == '_clear':
|
elif cmd == '_clear':
|
||||||
self.clearHistoryFile()
|
self.clearHistoryFile()
|
||||||
print QCoreApplication.translate("PythonConsole", "## History cleared successfully ##")
|
print QCoreApplication.translate("PythonConsole", "## History cleared successfully ##")
|
||||||
#del self.buffer[-1]
|
|
||||||
output = sys.stdout.get_and_clean_data()
|
output = sys.stdout.get_and_clean_data()
|
||||||
if output:
|
if output:
|
||||||
self.append(output)
|
self.append(output)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user