From e9ffd91d6cfabe4624686f0c083998cb22313acb Mon Sep 17 00:00:00 2001 From: Till Hofmann Date: Feb 17 2019 09:53:51 +0000 Subject: Add patch to correctly deal with three asterisks --- diff --git a/gtimelog-0.11.2-break-with-three-asterisks.patch b/gtimelog-0.11.2-break-with-three-asterisks.patch new file mode 100644 index 0000000..5bf968a --- /dev/null +++ b/gtimelog-0.11.2-break-with-three-asterisks.patch @@ -0,0 +1,63 @@ +diff --git a/src/gtimelog/CONTRIBUTORS.rst b/src/gtimelog/CONTRIBUTORS.rst +index 70df8f5..9f1cab5 100644 +--- a/src/gtimelog/CONTRIBUTORS.rst ++++ b/src/gtimelog/CONTRIBUTORS.rst +@@ -33,6 +33,7 @@ In alphabetic order: + - Rohan Mitchell + - Shirish Agarwal शिरीष अग्रवाल + - Thom May ++- Till Hofmann + - Tomaz Canabrava + - Živilė Gedminaitė + +diff --git a/src/gtimelog/tests/test_timelog.py b/src/gtimelog/tests/test_timelog.py +index 76263b2..3153700 100644 +--- a/src/gtimelog/tests/test_timelog.py ++++ b/src/gtimelog/tests/test_timelog.py +@@ -1245,6 +1245,31 @@ class TestTimeLog(Mixins, unittest.TestCase): + ("-200 did stuff", None)) + + ++class TestTotals(unittest.TestCase): ++ ++ TEST_TIMELOG = textwrap.dedent( ++ """ ++ 2018-12-09 08:30: start at home ++ 2018-12-09 08:40: emails ++ 2018-12-09 09:10: travel to work *** ++ 2018-12-09 09:15: coffee ** ++ 2018-12-09 12:15: coding ++ """) ++ ++ def setUp(self): ++ self.tw = make_time_window( ++ StringIO(self.TEST_TIMELOG), ++ datetime.datetime(2018, 12, 9, 8, 0), ++ datetime.datetime(2018, 12, 9, 23, 59), ++ datetime.time(2, 0), ++ ) ++ ++ def test_TimeWindow_totals(self): ++ work, slack = self.tw.totals() ++ self.assertEqual(work, datetime.timedelta(hours=3, minutes=10)) ++ self.assertEqual(slack, datetime.timedelta(hours=0, minutes=5)) ++ ++ + class TestFiltering(unittest.TestCase): + + TEST_TIMELOG = textwrap.dedent(""" +diff --git a/src/gtimelog/timelog.py b/src/gtimelog/timelog.py +index 9fa0b37..471e2e1 100644 +--- a/src/gtimelog/timelog.py ++++ b/src/gtimelog/timelog.py +@@ -359,7 +359,9 @@ class TimeCollection(object): + continue + if filter_text is not None and filter_text not in entry: + continue +- if '**' in entry: ++ if '***' in entry: ++ continue ++ elif '**' in entry: + total_slacking += duration + else: + total_work += duration diff --git a/gtimelog.spec b/gtimelog.spec index cfa01e5..5e4faae 100644 --- a/gtimelog.spec +++ b/gtimelog.spec @@ -1,11 +1,12 @@ Name: gtimelog Version: 0.11.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Unobtrusively keep track of your time License: GPLv2 URL: http://mg.pov.lt/gtimelog/ Source0: https://github.com/%{name}/%{name}/archive/%{version}.tar.gz +Patch0: gtimelog-0.11.2-break-with-three-asterisks.patch BuildArch: noarch BuildRequires: python3-devel @@ -25,6 +26,7 @@ to be as unobtrusive as possible. %prep %setup -q +%patch0 -p1 %build @@ -64,6 +66,9 @@ appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/appdata/%{name}.a %changelog +* Sun Feb 17 2019 Till Hofmann - 0.11.2-2 +- Add patch to correctly deal with three asterisks + * Sun Feb 17 2019 Till Hofmann - 0.11.2-1 - Update to 0.11.2