Commit acb508a6 authored by Jonathan Schaeffer's avatar Jonathan Schaeffer
Browse files

Correction de l'algo is_permanent.

Bug introduit en commit #c1eda5c0
parent 67d3a83f
......@@ -162,22 +162,21 @@ def cli(configfile, force_scan, dryrun, verbose, version):
statistics = scan_volumes(cfg['volumes'])
statistics.append(scan_node_volumes(cfg['node_volumes']))
# add the network_type (is the network permanent or not) to the statistic
# also insert the extended network code.
extender = FdsnExtender()
for stat in statistics:
if re.match('^[1-9XYZ]', stat['network']):
stat['is_permanent'] = True
if len(stat['network']) < 3 :
try:
stat['network'] = extender.extend(
stat['network'], int(stat['year']))
except ValueError:
logger.debug("Network %s exists ?" % stat['network'])
else:
stat['is_permanent'] = False
# Les réseaux commençant par 1 à 9 et X Y Z sont des réseaux non
# permanents
stat['is_permanent'] = not re.match('^[1-9XYZ]', stat['network'])
# Si le réseau temporaire est en 2 lettres, alors on veut son nom
# étendu
if not stat['is_permanent'] and len(stat['network']) < 3 :
try:
stat['network'] = extender.extend(
stat['network'], int(stat['year']))
except ValueError:
logger.debug("Network %s exists ?" % stat['network'])
stat['date'] = today
logger.debug(stat)
......
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