summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2021-02-15 00:35:17 +0000
committerRob Austein <sra@hactrn.net>2021-02-15 00:35:17 +0000
commit5c1f5611e2d35a27cde3207cf98ed1a8950fdc8b (patch)
tree5b9950f94224e9a13833bd8a091cd311473b22bb
parent19904d9aca94471f60b49d7093908b21c4e926cc (diff)
Unused and fairly sketchy code
-rwxr-xr-xtrac2md.py30
1 files changed, 0 insertions, 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