Skip to content
Snippets Groups Projects
Commit 092a783e authored by Christopher Bohn's avatar Christopher Bohn :thinking:
Browse files

completed (more or less) timeline tracker

parent ed13704f
Branches
Tags
No related merge requests found
...@@ -197,6 +197,12 @@ class IssueBoardTimeline: ...@@ -197,6 +197,12 @@ class IssueBoardTimeline:
self.headers.append(stop_time) self.headers.append(stop_time)
def write_to_csv(self): def write_to_csv(self):
# try again to make the header sorted
# self.headers[1:].sort()
sorted_headers = sorted(self.headers[1:])
sorted_headers.insert(0, self.headers[0])
self.headers = sorted_headers
# end try again
with open(self.csv_filename, 'w', newline='') as csv_file: with open(self.csv_filename, 'w', newline='') as csv_file:
writer = csv.DictWriter(csv_file, fieldnames=self.headers) writer = csv.DictWriter(csv_file, fieldnames=self.headers)
writer.writeheader() writer.writeheader()
...@@ -210,6 +216,7 @@ def get_tz_aware_datetime(datetime_string): ...@@ -210,6 +216,7 @@ def get_tz_aware_datetime(datetime_string):
timestamp = datetime.fromisoformat(datetime_string) timestamp = datetime.fromisoformat(datetime_string)
if timestamp.tzinfo is None or timestamp.tzinfo.utcoffset(timestamp) is None: if timestamp.tzinfo is None or timestamp.tzinfo.utcoffset(timestamp) is None:
timestamp = datetime.fromisoformat(f'{datetime_string}+00:00') timestamp = datetime.fromisoformat(f'{datetime_string}+00:00')
# timestamp = datetime.fromisoformat(f'{datetime_string}-06:00')
return timestamp return timestamp
...@@ -227,8 +234,12 @@ if __name__ == '__main__': ...@@ -227,8 +234,12 @@ if __name__ == '__main__':
""" """
if __name__ == '__main__': if __name__ == '__main__':
"""
sprint_start = timezone('US/Central').localize(datetime(2019, 11, 20, 14, 30, 0, 0)) sprint_start = timezone('US/Central').localize(datetime(2019, 11, 20, 14, 30, 0, 0))
sprint_stop = timezone('US/Central').localize(datetime(2019, 12, 4, 14, 30, 0, 0)) sprint_stop = timezone('US/Central').localize(datetime(2019, 12, 4, 14, 30, 0, 0))
"""
sprint_start = timezone('US/Central').localize(datetime(2019, 12, 4, 14, 30, 0, 0))
sprint_stop = timezone('US/Central').localize(datetime(2019, 12, 13, 12, 00, 0, 0))
with open('1198-capstones.json', mode='r') as json_file: with open('1198-capstones.json', mode='r') as json_file:
capstones = json.load(json_file) capstones = json.load(json_file)
for capstone in capstones: for capstone in capstones:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment