Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Olivier Stasse
Gepetto Utils
Commits
dd95a061
Commit
dd95a061
authored
Apr 19, 2018
by
Guilhem Saurel
Browse files
doc.py: generates an index
parent
9fda3fd1
Changes
1
Hide whitespace changes
Inline
Side-by-side
scripts/doc.py
View file @
dd95a061
...
...
@@ -10,16 +10,30 @@ DOC = Path('/net/pongo/vol/vol_projects/partage_gepetto/Doc')
GITLAB
=
'https://gepgitlab.laas.fr'
RAINBOARD
=
'http://rainboard.laas.fr'
VERSION
=
'16.04'
INDEX
=
DOC
/
'index.html'
HEAD
=
DOC
/
'index.head.html'
if
__name__
==
'__main__'
:
for
project
,
namespace
,
branch
in
requests
.
get
(
f
'
{
RAINBOARD
}
/doc'
).
json
()[
'ret'
]:
with
INDEX
.
open
(
'w'
)
as
f
:
with
HEAD
.
open
()
as
head
:
f
.
write
(
head
.
read
())
for
project
,
namespace
,
branch
in
sorted
(
requests
.
get
(
f
'
{
RAINBOARD
}
/doc'
).
json
()[
'ret'
]):
url
=
f
'
{
GITLAB
}
/
{
namespace
}
/
{
project
}
/-/jobs/artifacts/
{
branch
}
/download'
path
=
DOC
/
namespace
/
project
/
branch
r
=
requests
.
get
(
url
,
{
'job'
:
f
'robotpkg-
{
project
}
-
{
VERSION
}
'
},
stream
=
True
)
try
:
z
=
ZipFile
(
BytesIO
(
r
.
content
))
path
=
DOC
/
namespace
/
project
/
branch
path
.
mkdir
(
parents
=
True
,
exist_ok
=
True
)
z
.
extractall
(
str
(
path
))
except
BadZipFile
:
continue
pass
if
path
.
exists
():
with
INDEX
.
open
(
'a'
)
as
f
:
link
=
path
.
relative_to
(
DOC
)
print
(
f
'<tr><td>
{
project
}
</td><td>
{
namespace
}
</td><td><a href="
{
link
}
">
{
branch
}
</a></td></tr>'
,
file
=
f
)
with
INDEX
.
open
(
'a'
)
as
f
:
print
(
'</table></body></html>'
,
file
=
f
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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