From 5c1f5611e2d35a27cde3207cf98ed1a8950fdc8b Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 15 Feb 2021 00:35:17 +0000 Subject: Unused and fairly sketchy code --- trac2md.py | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/trac2md.py b/trac2md.py index c97b569..7e3a495 100755 --- a/trac2md.py +++ b/trac2md.py @@ -26,36 +26,6 @@ wikiheading_patterns = tuple( (level, re.compile("^{} (.*)[ \t]*=*$".format("=" * level))) for level in range(1, 7)) -def to_timestamp(tm): - ''' Convert to timestamp which can be jsonified ''' - - tm = tm.replace('+00:00', '') - date = datetime.strptime(tm, '%Y-%m-%dT%H:%M:%S') - ts = str(time.mktime(date.timetuple()))[:-2] # Strip the .0 - return ts - - -def strip_wikilink(content): - ''' Need to remove wiki link format from custom fields. They come in a - variety of forms that can be comma or whitespace separated. They can also - include link names which must also be removed. - - [https://bugzilla.redhat.com/show_bug.cgi?id=772777] - [https://bugzilla.com/123456789], [http://bugzilla.com/7777777 7777777] - [https://bugzilla.com/6666666 6666666] - ''' - - links = [] - if wikilink_pattern.search(content): - # Looks like we have a link in here - links = [] - mylist = re.findall(r'\[([^]]*)\]', content) - for i in mylist: - links.append(i.split(' ', 1)[0]) - return ', '.join(links) - else: - return content - def convert_headers(line): ''' Convert wikiformat headers -- cgit v1.2.3