⚲
Project
General
Profile
Sign in
Register
Home
Projects
Documentation
Help
Search
:
Arvados
All Projects
Arvados
Activity
Roadmap
Backlogs
Issues
Wiki
Repository
Documentation
Download (941 Bytes)
Bug #8878
» keep_block_to_file.py
Peter Amstutz
, 04/10/2016 08:26 PM
#!/usr/bin/env python
import
re
import
sys
import
arvados.collection
from
arvados.keep
import
KeepLocator
for
collectionsWithMissing
in
sys
.
argv
[
1
:]:
g
=
re
.
match
(
r
"\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\d-\d\d:\d\d_(.....-.....-...............)_missing\.txt"
,
collectionsWithMissing
)
collection
=
g
.
group
(
1
)
blocklist
=
open
(
collectionsWithMissing
)
missingblocks
=
set
()
for
b
in
blocklist
:
missingblocks
.
add
(
b
.
strip
())
def
scanfiles
(
name
,
cur
):
if
isinstance
(
cur
,
arvados
.
collection
.
ArvadosFile
):
segs
=
cur
.
segments
()
for
s
in
segs
:
st
=
KeepLocator
(
s
.
locator
).
stripped
()
if
st
in
missingblocks
:
print
"
\"
%s
\"
,
\"
%s
\"
,
\"
%s
\"
"
%
(
collection
,
name
,
st
)
else
:
for
k
,
d
in
cur
.
items
():
scanfiles
(
"%s/%s"
%
(
name
,
k
),
d
)
scanfiles
(
"."
,
arvados
.
collection
.
CollectionReader
(
collection
))
« Previous
1
2
3
4
5
Next »
(2-2/5)
Loading...