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
fe050459
Commit
fe050459
authored
Oct 17, 2014
by
asseldonk
Browse files
added shutil.move(source, destination)
parent
65f3e741
Changes
2
Show whitespace changes
Inline
Side-by-side
vispa/controller/filesystem.py
View file @
fe050459
...
...
@@ -155,6 +155,18 @@ class FSAjaxController(AbstractController):
# so convert it with the convert function
fs
.
remove
(
path
)
@
cherrypy
.
expose
@
cherrypy
.
tools
.
ajax
()
def
move
(
self
,
source
,
destination
):
self
.
release_session
()
fs
=
self
.
get
(
'fs'
)
self
.
release_database
()
source
=
json
.
loads
(
source
)
destination
=
json
.
loads
(
destination
)
# 'source' and 'destination' can be a unicode/string or list of unicodes/strings
# so convert it with the convert function
fs
.
move
(
source
,
destination
)
@
cherrypy
.
expose
@
cherrypy
.
tools
.
ajax
()
def
compress
(
self
,
path
,
paths
,
name
):
...
...
vispa/remote/filesystem.py
View file @
fe050459
...
...
@@ -286,6 +286,12 @@ class FileSystem(object):
else
:
os
.
remove
(
path
)
def
move
(
self
,
source
,
destination
):
source
=
self
.
expand
(
source
)
destination
=
self
.
expand
(
destination
)
if
os
.
path
.
isdir
(
destination
):
shutil
.
move
(
source
,
destination
)
def
compress
(
self
,
path
,
paths
,
name
):
# paths has to be a list of strings
paths
=
paths
if
isinstance
(
paths
,
(
list
,
tuple
))
else
[
paths
]
...
...
Write
Preview
Markdown
is supported
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