Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
8169f246
Commit
8169f246
authored
Feb 24, 2013
by
Marcel
Browse files
Fix typos.
parent
8ed489aa
Changes
5
Show whitespace changes
Inline
Side-by-side
vispa/controller/__init__.py
View file @
8169f246
...
@@ -117,7 +117,7 @@ class AbstractController(object):
...
@@ -117,7 +117,7 @@ class AbstractController(object):
raise
Exception
(
'TypeError: conversion with unknown type flag.'
)
raise
Exception
(
'TypeError: conversion with unknown type flag.'
)
def
get_fs
(
self
,
workspace_id
=
None
):
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
# try to get the workspace id from the session
if
'workspace_id'
in
cherrypy
.
session
.
keys
():
if
'workspace_id'
in
cherrypy
.
session
.
keys
():
workspace_id
=
cherrypy
.
session
[
'workspace_id'
]
workspace_id
=
cherrypy
.
session
[
'workspace_id'
]
...
...
vispa/controller/filesystem.py
View file @
8169f246
...
@@ -76,7 +76,7 @@ class FSAjaxController(AbstractController):
...
@@ -76,7 +76,7 @@ class FSAjaxController(AbstractController):
fs
=
self
.
get
(
'fs'
)
fs
=
self
.
get
(
'fs'
)
# get the files with the filter
# 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
# sort by name first
files
=
sorted
(
files
,
key
=
lambda
entry
:
str
(
entry
[
'name'
]))
files
=
sorted
(
files
,
key
=
lambda
entry
:
str
(
entry
[
'name'
]))
# sort files by file/folder
# sort files by file/folder
...
...
vispa/controller/platform.py
View file @
8169f246
...
@@ -50,10 +50,8 @@ class PlatformController(AbstractController):
...
@@ -50,10 +50,8 @@ class PlatformController(AbstractController):
@
cherrypy
.
tools
.
profile
()
@
cherrypy
.
tools
.
profile
()
@
cherrypy
.
tools
.
allow
(
methods
=
[
'GET'
])
@
cherrypy
.
tools
.
allow
(
methods
=
[
'GET'
])
@
cherrypy
.
tools
.
stats
(
page
=
'index'
)
@
cherrypy
.
tools
.
stats
(
page
=
'index'
)
#
@cherrypy.tools.render(template='sites/index.html')
@
cherrypy
.
tools
.
render
(
template
=
'sites/index.html'
)
def
index
(
self
,
*
args
,
**
kwargs
):
def
index
(
self
,
*
args
,
**
kwargs
):
print
self
.
get
(
'workspace_id'
)
return
"index"
db
=
cherrypy
.
request
.
db
db
=
cherrypy
.
request
.
db
username
=
cherrypy
.
request
.
user
.
name
username
=
cherrypy
.
request
.
user
.
name
use_websockets
=
vispa
.
config
(
'websockets'
,
'enabled'
,
False
)
use_websockets
=
vispa
.
config
(
'websockets'
,
'enabled'
,
False
)
...
...
vispa/extensions/dummy/static/js/extension.js
View file @
8169f246
...
@@ -85,6 +85,10 @@ var DummyContent = ExtensionContentFull.extend({
...
@@ -85,6 +85,10 @@ var DummyContent = ExtensionContentFull.extend({
return
this
;
return
this
;
},
},
getIdentifier
:
function
()
{
return
'
/user/vispa/analyses/ttH.txt
'
;
},
getContent
:
function
()
{
getContent
:
function
()
{
this
.
nodes
.
content
=
$
(
'
<div />
'
)
this
.
nodes
.
content
=
$
(
'
<div />
'
)
.
addClass
(
'
dummy-full-body
'
)
.
addClass
(
'
dummy-full-body
'
)
...
...
vispa/filesystem.py
View file @
8169f246
# @package FileSystem
# -*- coding: utf-8 -*-
# @package FileSystem
#
I
mports
#
i
mports
import
os
import
os
from
datetime
import
datetime
from
datetime
import
datetime
from
distutils
import
dir_util
import
locale
import
locale
import
shutil
import
shutil
import
random
import
cStringIO
from
mimetypes
import
guess_type
from
mimetypes
import
guess_type
import
shutil
from
zipfile
import
ZipFile
from
zipfile
import
ZipFile
import
xmlrpclib
class
FileSystem
(
object
):
class
FileSystem
(
object
):
...
@@ -266,8 +261,9 @@ class FileSystem(object):
...
@@ -266,8 +261,9 @@ class FileSystem(object):
f
=
open
(
path
,
"r"
)
f
=
open
(
path
,
"r"
)
content
=
f
.
read
()
content
=
f
.
read
()
f
.
close
()
f
.
close
()
content
=
" "
if
content
==
""
else
content
if
content
==
''
:
return
xmlrpclib
.
Binary
(
content
),
"File opened!"
content
=
' '
return
content
def
is_browser_file
(
self
,
path
):
def
is_browser_file
(
self
,
path
):
extension
=
path
.
split
(
"."
)[
-
1
]
extension
=
path
.
split
(
"."
)[
-
1
]
...
@@ -312,16 +308,3 @@ class FileSystem(object):
...
@@ -312,16 +308,3 @@ class FileSystem(object):
# return
# return
return
self
.
handle_file_name_collision
(
newname
,
path
)
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment