Commit 33a4fafe authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Passage en bynet

parent 85c310c1
...@@ -47,7 +47,7 @@ def scan_volume(path): ...@@ -47,7 +47,7 @@ def scan_volume(path):
["du", "--exclude", ".snapshot", "-b", "-d4", volume]).decode("utf-8").splitlines() ["du", "--exclude", ".snapshot", "-b", "-d4", volume]).decode("utf-8").splitlines()
logger.debug("Volume scanned in %s", datetime.now() - starttime) logger.debug("Volume scanned in %s", datetime.now() - starttime)
for l in lines: for l in lines:
logger.debug(l) logger.debug("Scanning %s",l)
(size, path) = l.split('\t') (size, path) = l.split('\t')
# On ne garde que le chemin qui nous intéresse # On ne garde que le chemin qui nous intéresse
path = path.replace(volume, '').split('/') path = path.replace(volume, '').split('/')
...@@ -55,8 +55,9 @@ def scan_volume(path): ...@@ -55,8 +55,9 @@ def scan_volume(path):
if len(path) == 4: if len(path) == 4:
logger.debug("path: %s, size: %s", path, size) logger.debug("path: %s, size: %s", path, size)
(channel, quality) = path[3].split('.') (channel, quality) = path[3].split('.')
data.append({'year': path[0], 'network': path[1], 'station': path[2], data.append({'year': path[1], 'network': path[0], 'station': path[2],
'channel': channel, 'quality': quality, 'size': size}) 'channel': channel, 'quality': quality, 'size': size})
logger.debug(data[-1])
return data return data
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment