Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
pipelet
Pipelet
Commits
1ed1108b
Commit
1ed1108b
authored
Aug 19, 2010
by
Marc Betoule
Browse files
working index and product
parent
5adf82ff
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
pipelet/web.py
pipelet/web.py
+13
-10
No files found.
pipelet/web.py
View file @
1ed1108b
...
...
@@ -93,17 +93,17 @@ class Web:
ss
=
""
print
s
for
stat
in
e
:
ss
=
'<a href="product?
currdir
=%s&status=%s" class=%s>%d</a>, '
%
(
s
[
1
],
stat
[
0
],
stat
[
0
],
stat
[
1
])
+
ss
ss
+=
'<a href="delseg?
currdir
=%
s
"> (delete) </a>'
%
s
[
1
]
ss
=
'<a href="product?
segid
=%s&status=%s" class=%s>%d</a>, '
%
(
s
[
2
],
stat
[
0
],
stat
[
0
],
stat
[
1
])
+
ss
ss
+=
'<a href="delseg?
segid
=%
d
"> (delete) </a>'
%
s
[
2
]
diff
=
s
[
1
].
count
(
'/'
)
-
indent
if
diff
==
1
:
html
+=
'<ul> <li id=%
s
><a href="code?
currdir
=%
s
">%s</a> : %s
\n
'
%
(
s
[
1
],
s
[
1
],
s
[
0
],
ss
)
html
+=
'<ul> <li id=%
d
><a href="code?
segid
=%
d
">%s</a> : %s
\n
'
%
(
s
[
2
],
s
[
2
],
s
[
0
],
ss
)
elif
diff
==
0
:
html
+=
'</li><li id=%
s
><a href="code?
currdir
=%
s
">%s</a> : %s
\n
'
%
(
s
[
1
],
s
[
1
],
s
[
0
],
ss
)
html
+=
'</li><li id=%
d
><a href="code?
segid
=%
d
">%s</a> : %s
\n
'
%
(
s
[
2
],
s
[
3
],
s
[
0
],
ss
)
elif
diff
>
1
:
html
+=
'<li id=%
s
><a href="code?
currdir
=%
s
">%s</a> : %s
\n
'
%
(
s
[
1
],
s
[
1
],
s
[
0
],
ss
)
html
+=
'<li id=%
d
><a href="code?
segid
=%
d
">%s</a> : %s
\n
'
%
(
s
[
2
],
s
[
2
],
s
[
0
],
ss
)
else
:
html
+=
'</li> </ul>
\n
'
*
abs
(
diff
)
+
'<li id=%
s
> <a href="code?
currdir
=%
s
">%s</a> : %s'
%
(
s
[
1
],
s
[
1
],
s
[
0
],
ss
)
html
+=
'</li> </ul>
\n
'
*
abs
(
diff
)
+
'<li id=%
d
> <a href="code?
segid
=%
d
">%s</a> : %s'
%
(
s
[
2
],
s
[
2
],
s
[
0
],
ss
)
indent
+=
diff
conn
.
close
()
html
+=
'</li></ul>'
*
(
indent
-
l
[
0
][
1
].
count
(
'/'
)
+
1
)
...
...
@@ -112,7 +112,7 @@ class Web:
@
cherrypy
.
expose
@
read_access
def
product
(
self
,
currdir
=
None
,
status
=
None
):
def
product
(
self
,
segid
=
None
,
status
=
None
):
""" Products index.
Print the content of the product directory.
...
...
@@ -124,12 +124,15 @@ class Web:
"""
conn
=
sqlite3
.
connect
(
self
.
db_file
,
check_same_thread
=
True
)
with
conn
:
l
=
conn
.
execute
(
'select seg, str_prod from tasks where curr_dir=? and status=?'
,(
currdir
,
status
)).
fetchall
()
seg
,
currdir
=
conn
.
execute
(
'select seg, curr_dir from segments where seg_id = ?'
,(
segid
,)).
fetchone
()
l
=
conn
.
execute
(
'select str_prod from tasks where seg_id=? and status=?'
,(
segid
,
status
)).
fetchall
()
conn
.
close
()
html
=
html_tmp
+
'<h1> Data products for %s tasks in segment %s </h1>'
%
(
status
,
l
[
0
][
0
]
)
html
=
html_tmp
+
'<h1> Data products for %s tasks in segment %s </h1>'
%
(
status
,
seg
)
html
+=
'<div class="list"><p>Directory : %s</p> %d <span class="%s">%s</span> tasks <ul> '
%
(
currdir
,
len
(
l
),
status
,
status
)
for
e
in
l
:
html
+=
'<li><a href="pipedir?directory=%s"> %s </a></li>'
%
(
e
[
1
],
e
[
1
])
html
+=
'<li><a href="pipedir?directory=%s"> %s </a></li>'
%
(
e
[
0
],
e
[
0
])
html
+=
'</ul></div></body></html>'
return
html
...
...
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