-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgltt
More file actions
25 lines (20 loc) · 751 Bytes
/
gltt
File metadata and controls
25 lines (20 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#! /usr/bin/env python3
"""Top-level package for Git log to timesheet."""
__author__ = """Bimochan Shrestha"""
__email__ = 'bmochan@gmail.com'
__version__ = '0.1.1'
from sys import argv
import re
import subprocess
if __name__ == '__main__':
standup_msg = (argv[1])
lines = standup_msg.split("\n")
separated_lines = []
for line in reversed(lines):
lines_without_hyphen = re.sub('^[\w\d]*\s(.)', '', line)
separated_lines.append(lines_without_hyphen)
for counter, separated_line in enumerate(separated_lines):
cleaned_line= re.sub('\((.*?)\)(\s<(.*)>)?', '', separated_line)
cleaned_line = cleaned_line.strip()
result = str(counter+1) + ") " + cleaned_line
print(result.rstrip())