Cleaning the code

This commit is contained in:
Salvatore Larosa 2012-09-25 16:31:51 +02:00
parent 59ff69eae1
commit a0566c79b7

View File

@ -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)