Project

General

Profile

« Previous | Next » 

Revision 6637

dict2redmine: url_term(): Prefix any provider in the URL to the term name, to create a namespace. Each hierarchical component of the provider is stored in a URL comment.

View differences:

dict2redmine
23 23
    return text
24 24

  
25 25
def url_term(url):
26
    match = re.search(r'[\w:-]+$', url)
26
    '''Prefixes any provider in the URL to the term name, to create a namespace.
27
    Each hierarchical component of the provider is stored in a URL comment.
28
    '''
29
    match = re.match(r'^('+url_comment_re+r'*).*?([\w:-]+)$', url)
27 30
    assert match
28
    return match.group(0)
31
    provider_str, term = match.groups()
32
    provider = map(url_comment_text, re.findall(url_comment_re, provider_str))
33
    
34
    return ':'.join(provider+[term])
29 35

  
30 36
##### Redmine
31 37

  

Also available in: Unified diff