Commit e17691d6 authored by lmueller's avatar lmueller
Browse files

fixed bug in topology-string resolver

parent 4f2302e3
#!/usr/bin/python3
import sys
import json
import argparse
......@@ -28,22 +29,23 @@ def parse_topology(s, l):
if flag:
flag = False
else:
if elements[i] == 'i':
if i == 0:
result.append({'start': 1, 'end':elements[i+1]-1 , 'location': 'inside'})
elif i+1 == len(elements):
result.append({'start': elements[i-1]+1, 'end':l , 'location': 'inside'})
if elements[i] == 'i' or elements[i] == 'o':
location = ""
if elements[i] == 'i':
location = "inside"
else:
result.append({'start': elements[i-1]+1, 'end':elements[i+1]-1 , 'location': 'inside'})
elif elements[i] == 'o':
location = "outside"
if i == 0:
result.append({'start': 1, 'end':elements[i+1]-1 , 'location': 'outside'})
if len(elements) == 1:
result.append({'start': 1, 'end': l , 'location': location})
else:
result.append({'start': 1, 'end': elements[i+1]-1 , 'location': location})
elif i+1 == len(elements):
result.append({'start': elements[i-1]+1, 'end':l , 'location': 'outside'})
result.append({'start': elements[i-1]+1, 'end':l , 'location': location})
else:
result.append({'start': elements[i-1]+1, 'end':elements[i+1]-1 , 'location': 'outside'})
result.append({'start': elements[i-1]+1, 'end': elements[i+1]-1 , 'location': location})
else:
result.append({'start': elements[i], 'end':elements[i+1] , 'location': 'membrane'})
result.append({'start': elements[i], 'end': elements[i+1] , 'location': 'membrane'})
flag = True
return (result)
......
Markdown is supported
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