flatpak: converting history string dates to datetime instances

This commit is contained in:
Vinicius Moreira
2019-10-08 15:53:00 -03:00
parent 35b716b4ab
commit d98636dd36
2 changed files with 8 additions and 1 deletions

View File

@@ -11,6 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Improvements
- AUR:
- Optional dependencies are not checked by default in their installation popup.
- Flatpak:
- History panel now shows formatted dates
- History panel can now me maximized, minimized and allows to copy column content.
- Minor UI improvements

View File

@@ -1,5 +1,6 @@
import re
import subprocess
from datetime import datetime
from io import StringIO
from typing import List
@@ -196,7 +197,11 @@ def get_app_commits_data(app_ref: str, origin: str) -> List[dict]:
commit = {}
for idx, data in enumerate(res):
commit[data[0].strip().lower()] = data[1].strip()
attr = data[0].strip().lower()
commit[attr] = data[1].strip()
if attr == 'date':
commit[attr] = datetime.strptime(commit[attr], '%Y-%m-%d %H:%M:%S +0000')
if (idx + 1) % 3 == 0:
commits.append(commit)