Lint fixes

This commit is contained in:
Florian Bruhin 2014-05-01 00:24:53 +02:00
parent 533d82417e
commit b9d7c7e7d9

View File

@ -363,7 +363,8 @@ class CurCommandDispatcher(QObject):
logging.debug("Calling \"{}\" with args {}".format(executable, args)) logging.debug("Calling \"{}\" with args {}".format(executable, args))
proc.start(executable, args) proc.start(executable, args)
def _on_editor_cleanup(self, oshandle, filename): def _editor_cleanup(self, oshandle, filename):
"""Clean up temporary file."""
os.close(oshandle) os.close(oshandle)
try: try:
os.remove(filename) os.remove(filename)
@ -392,7 +393,7 @@ class CurCommandDispatcher(QObject):
text = webelem.javascript_escape(text) text = webelem.javascript_escape(text)
logging.debug("Read back: {}".format(text)) logging.debug("Read back: {}".format(text))
elem.evaluateJavaScript("this.value='{}'".format(text)) elem.evaluateJavaScript("this.value='{}'".format(text))
self._on_editor_cleanup(oshandle, filename) self._editor_cleanup(oshandle, filename)
def on_editor_error(self, oshandle, filename, error): def on_editor_error(self, oshandle, filename, error):
"""Display an error message and clean up when editor crashed.""" """Display an error message and clean up when editor crashed."""
@ -403,8 +404,8 @@ class CurCommandDispatcher(QObject):
QProcess.WriteError: ("An error occurred when attempting to write " QProcess.WriteError: ("An error occurred when attempting to write "
"to the process."), "to the process."),
QProcess.ReadError: ("An error occurred when attempting to read " QProcess.ReadError: ("An error occurred when attempting to read "
"from the process."), "from the process."),
QProcess.UnknownError: "An unknown error occurred.", QProcess.UnknownError: "An unknown error occurred.",
} }
message.error("Error while calling editor: {}".format(messages[error])) message.error("Error while calling editor: {}".format(messages[error]))
self._on_editor_cleanup(oshandle, filename) self._editor_cleanup(oshandle, filename)