Project

General

Profile

« Previous | Next » 

Revision 6635

dict2redmine: Added url_comment_text()

View differences:

bin/dict2redmine
12 12

  
13 13
def simplify_url(url): return re.sub(r'\(.*?\)', r'', url)
14 14

  
15
def url_comment_text(comment):
16
    if not comment: return comment
17
    
18
    match = re.match(r'^\((?:\d+:)?(.*?)\)$', comment)
19
    assert match
20
    text, = match.groups()
21
    return text
22

  
15 23
def url_term(url):
16 24
    match = re.search(r'[\w:-]+$', url)
17 25
    assert match

Also available in: Unified diff