Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 7108a370 authored by Jérôme Euzenat's avatar Jérôme Euzenat
Browse files

Merge branch 'master' of gitlab.inria.fr:moex/pysake

parents 598a45cd 64b7cf0b
No related branches found
No related tags found
No related merge requests found
from configobj import ConfigObj
import re
def read_parameter_file( path ):
instring = False
......@@ -39,3 +40,24 @@ def get_parameter( params, key, default='' ):
value = value[1:-1]
return value.replace( '___', '\n' )
def set_link_labels( text ):
regExp = '^(.*?)(\[?\[?[0-9]{8}(a|b)?-NOOR\]?\]?)(.*)$'
lookForLabels = True;
newText = ''
while lookForLabels:
match = re.match(regExp,text)
if match:
label = match.group(2)
pos = text.find(label)
newText += text[:pos]
text = text[pos+len(label):]
if label.startswith('['):
label = label[1:-1]
if label.startswith('['):
label = label[1:-1]
newText += "["+label+"](../"+label+")"
else:
newText += text
lookForLabels = False
return newText
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment