Commit 8169f246 authored by Marcel's avatar Marcel
Browse files

Fix typos.

parent 8ed489aa
......@@ -117,7 +117,7 @@ class AbstractController(object):
raise Exception('TypeError: conversion with unknown type flag.')
def get_fs(self, workspace_id=None):
if not workspace_id and workspace_id !== 0:
if not workspace_id and workspace_id != 0:
# try to get the workspace id from the session
if 'workspace_id' in cherrypy.session.keys():
workspace_id = cherrypy.session['workspace_id']
......
......@@ -76,7 +76,7 @@ class FSAjaxController(AbstractController):
fs = self.get('fs')
# get the files with the filter
files = fs.get_file_list(json[u'path', json[u'deep'], json[u'ext_filter'], json[u'reverse_filter'])
files = fs.get_file_list(json[u'path'], json[u'deep'], json[u'ext_filter'], json[u'reverse_filter'])
# sort by name first
files = sorted(files, key=lambda entry: str(entry['name']))
# sort files by file/folder
......
......@@ -50,10 +50,8 @@ class PlatformController(AbstractController):
@cherrypy.tools.profile()
@cherrypy.tools.allow(methods=['GET'])
@cherrypy.tools.stats(page='index')
#@cherrypy.tools.render(template='sites/index.html')
@cherrypy.tools.render(template='sites/index.html')
def index(self, *args, **kwargs):
print self.get('workspace_id')
return "index"
db = cherrypy.request.db
username = cherrypy.request.user.name
use_websockets = vispa.config('websockets', 'enabled', False)
......
......@@ -85,6 +85,10 @@ var DummyContent = ExtensionContentFull.extend({
return this;
},
getIdentifier: function() {
return '/user/vispa/analyses/ttH.txt';
},
getContent: function() {
this.nodes.content = $('<div />')
.addClass('dummy-full-body')
......
# @package FileSystem
# @package FileSystem
# -*- coding: utf-8 -*-
# Imports
# imports
import os
from datetime import datetime
from distutils import dir_util
import locale
import shutil
import random
import cStringIO
from mimetypes import guess_type
import shutil
from zipfile import ZipFile
import xmlrpclib
class FileSystem(object):
......@@ -266,8 +261,9 @@ class FileSystem(object):
f = open(path, "r")
content = f.read()
f.close()
content = " " if content == "" else content
return xmlrpclib.Binary(content), "File opened!"
if content == '':
content = ' '
return content
def is_browser_file(self, path):
extension = path.split(".")[-1]
......@@ -312,16 +308,3 @@ class FileSystem(object):
# return
return self.handle_file_name_collision(newname, path)
##
# Creates a unique ID
# p = 1e-18
def uniqueId(l=10):
chars = "abcdefghijklmnopqrstuvwxyz"
chars += "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
chars += "0123456789"
code = ""
for i in range(l):
rnd = int(round(random.uniform(0, len(chars) - 1)))
code += chars[rnd]
return code
\ No newline at end of file
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