Commit 6e410949 authored by murban's avatar murban
Browse files

Raise warning when trying to access a folder without permission. Fix a small...

Raise warning when trying to access a folder without permission. Fix a small bug in the remote filesystem: Line indentation of the parentfolder has been wrong
parent 0ab07dc2
......@@ -89,19 +89,6 @@ class FSAjaxController(AbstractController):
return'Couldn\'t load files: %s' % str(e), encode_json=True)
@cherrypy.expose['POST', 'GET'])
def folderup(self, path):
path = os.path.expanduser(os.path.expandvars(path))
path = path[:-1] if path.endswith(os.sep) and path!=os.sep else path
path = os.path.dirname(path)
path = self.convert(path, 'string')
return self.success({'folderuppath': path})
except Exception, e:
return'Couldn\'t load files: %s' % str(e))
@cherrypy.expose['POST', 'GET'])
......@@ -72,6 +72,7 @@ class FileSystem(object):
def get_file_list(self, path, deep=False, filter=[], reverse=False, hide_hidden=True, encode_json=False):
filelist = []
path_expand = os.path.expanduser(os.path.expandvars(path))
for elem in os.listdir(path_expand):
# hide hidden files?
if elem.startswith('.') and hide_hidden:
......@@ -100,6 +101,8 @@ class FileSystem(object):
extension = elem.split('.')[-1]
filelist.append({'name': elem, 'type': 'f', 'parent': path, 'extension': extension, 'mtime': mtime, 'size': size, 'path': fullpath})
except Exception, e:
filelist.append({'warning': str(e)})
# Determine the parent
parentpath = path_expand[:-1] if path_expand.endswith(os.sep) and path_expand!=os.sep else path_expand
......@@ -48,7 +48,11 @@ var Symbolview = Class.extend({
$.each(data.filelist, function(i, file) {
if (file.warning) {
} else {
var contentdiv = _this.makeIcon(file);
// owner.view.mainContainer.isotope('insert', contentdiv);
Supports Markdown
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