Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1265f247
authored
Jan 30, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
store: refactor file_dict creation to new function
parent
3cd9fb33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
11 deletions
+14
-11
miscellaneous/store-server/CloudStore.py
+14
-11
No files found.
miscellaneous/store-server/CloudStore.py
View file @
1265f247
...
...
@@ -305,18 +305,21 @@ def list_directory(home, path):
return
json
.
dumps
((
os
.
path
.
basename
(
path
),
'F'
,
os
.
path
.
getsize
(
path
),
os
.
path
.
getmtime
(
path
)))
# List directory and return list
else
:
tuplelist
=
[]
filelist
=
os
.
listdir
(
path
)
# Add type support
for
item
in
filelist
:
static_route
=
path
+
"/"
+
item
if
os
.
path
.
isdir
(
static_route
):
is_dir
=
'D'
else
:
is_dir
=
'F'
element
=
{
'NAME'
:
item
,
'TYPE'
:
is_dir
,
'SIZE'
:
os
.
path
.
getsize
(
static_route
)
/
1024
,
'MTIME'
:
os
.
path
.
getmtime
(
static_route
)
}
tuplelist
.
append
(
element
)
return
json
.
dumps
(
tuplelist
)
dictlist
=
[
file_dict
(
os
.
path
.
join
(
path
,
f
),
home
)
for
f
in
filelist
]
return
json
.
dumps
(
dictlist
)
def
file_dict
(
path
,
home
):
basename
=
os
.
path
.
basename
(
path
.
rstrip
(
'/'
))
if
os
.
path
.
isdir
(
path
):
is_dir
=
'D'
else
:
is_dir
=
'F'
return
{
'NAME'
:
basename
,
'TYPE'
:
is_dir
,
'SIZE'
:
os
.
path
.
getsize
(
path
)
/
1024
,
'MTIME'
:
os
.
path
.
getmtime
(
path
),
'DIR'
:
os
.
path
.
relpath
(
os
.
path
.
dirname
(
path
),
home
)}
def
getQuotaStatus
(
neptun
):
output
=
subprocess
.
check_output
([
ROOT_BIN_FOLDER
+
'/'
+
USER_MANAGER
,
'status'
,
neptun
],
stderr
=
subprocess
.
STDOUT
)
...
...
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