Commit e6f8f097 authored by ThorbenQuast's avatar ThorbenQuast
Browse files

editor: - .pyc not supported anymore (like it is in Sublime, gEdit,...)

        - extend error message if a file cannot be read
parent 435d62be
......@@ -107,11 +107,12 @@ var CodeEditor = Emitter.extend({
var initContent = function(res) {
if (!res.success) {
self.view.alert("<html>An internal server error has occured. <br />" +
self.view.alert("<html>An internal server error has occured: <br />" +
"" + res.error + " <br />" +
"<br /> The editor has been closed. </html>");
self.view.close();
}
self.path = path;
self.path = path;
if (self.writable === null) //only set writable if it has not been set yet
self.writable = res.writable;
self.mtime = res.mtime;
......
......@@ -422,19 +422,22 @@ class FileSystem(object):
content = content.decode('utf8')
#new: check for writing rights
writable = self.checkPermissions(path)
error = None
mtime = os.path.getmtime(path)
except Exception as e:
mtime = 0
content = ""
writable = None
error = str(e)
return json.dumps({
"content": content,
"mtime": mtime,
"success": mtime > 0,
"watch_error": watch_error,
"writable": writable
"writable": writable,
"error": error
})
def checkPermissions(self, path):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment