Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Strand Lab
Strand Lab Cellxgene Gateway
Commits
16b54f94
Commit
16b54f94
authored
Jan 18, 2021
by
Gregor Sturm
Browse files
Use url_for to generate URLs
parent
942410bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
cellxgene_gateway/filecrawl.py
View file @
16b54f94
...
...
@@ -14,6 +14,7 @@ from cellxgene_gateway.dir_util import (
make_annotations
,
annotations_suffix
,
)
from
flask
import
url_for
def
recurse_dir
(
path
):
...
...
@@ -44,13 +45,10 @@ def recurse_dir(path):
"name"
:
x
[:
-
13
]
if
(
len
(
x
)
>
13
and
x
[
-
13
]
in
[
"-"
,
"_"
])
else
(
x
[:
-
4
]
if
x
.
endswith
(
".csv"
)
else
x
),
"path"
:
os
.
path
.
join
(
full_path
,
x
).
replace
(
env
.
cellxgene_data
,
""
),
"path"
:
os
.
path
.
join
(
full_path
,
x
).
replace
(
env
.
cellxgene_data
,
""
),
}
for
x
in
sorted
(
os
.
listdir
(
full_path
))
if
x
.
endswith
(
".csv"
)
and
os
.
path
.
isfile
(
os
.
path
.
join
(
full_path
,
x
))
if
x
.
endswith
(
".csv"
)
and
os
.
path
.
isfile
(
os
.
path
.
join
(
full_path
,
x
))
]
return
[
{
...
...
@@ -91,7 +89,7 @@ def render_entries(entries):
def
get_url
(
entry
):
return
f
"/
view
/
{
entry
[
'path'
].
lstrip
(
'/'
)
}
/"
return
url_for
(
"do_
view
"
,
entry
)
def
get_class
(
entry
):
...
...
cellxgene_gateway/templates/index.html
View file @
16b54f94
...
...
@@ -35,12 +35,12 @@
Links:
</h1>
<div
class=
"list-group"
style=
"width:50%;padding-left:65px"
>
<a
href=
"
/
filecrawl
.html
"
class=
"list-group-item list-group-item-action"
>
<a
href=
"
{{ url_for('
filecrawl
') }}
"
class=
"list-group-item list-group-item-action"
>
<u>
File Crawler: Allows you to view all uploaded data.
</u></a>
</div>
<div
class=
"list-group"
style=
"width:50%;padding-left:65px"
>
<a
href=
"
/cache
_status"
class=
"list-group-item list-group-item-action"
>
<a
href=
"
{{ url_for('do_GET
_status
') }}
"
class=
"list-group-item list-group-item-action"
>
<u>
Cache Status: view status of launched cellxgene servers.
</u></a>
</div>
...
...
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