taskcheck 0.3.0__tar.gz → 0.3.0.post1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taskcheck
3
- Version: 0.3.0
3
+ Version: 0.3.0.post1
4
4
  Summary: Automatic scheduler for taskwarrior
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "taskcheck"
3
- version = "0.3.0"
3
+ version = "0.3.0-1"
4
4
  description = "Automatic scheduler for taskwarrior"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -3,9 +3,12 @@ import json
3
3
  from datetime import datetime, timedelta
4
4
  from pathlib import Path
5
5
  import appdirs
6
+ from rich.console import Console
6
7
 
7
8
  from taskcheck.ical import ical_to_dict
8
9
 
10
+ console = Console()
11
+
9
12
  config_dir = Path(appdirs.user_config_dir("task"))
10
13
 
11
14
  # Taskwarrior status to avoid
@@ -5,6 +5,7 @@ from dataclasses import dataclass
5
5
  from datetime import datetime, timedelta
6
6
  from taskcheck.common import (
7
7
  AVOID_STATUS,
8
+ console,
8
9
  get_calendars,
9
10
  get_long_range_time_map,
10
11
  get_tasks,
@@ -285,6 +286,13 @@ def update_tasks_with_scheduling_info(task_info, verbose):
285
286
  stdout=subprocess.DEVNULL,
286
287
  stderr=subprocess.DEVNULL,
287
288
  )
289
+ due = task.get("due")
290
+ end_date = datetime.strptime(end_date, "%Y-%m-%d")
291
+ if due is not None and end_date > datetime.strptime(due, "%Y%m%dT%H%M%SZ"):
292
+ console.print(
293
+ f"[red]Warning: Task {task['id']} ('{task['description']}') is not going to be completed on time.[/red]"
294
+ )
295
+
288
296
  if verbose:
289
297
  print(
290
298
  f"Updated task {task['id']} with scheduled dates {start_date} to {end_date}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taskcheck
3
- Version: 0.3.0
3
+ Version: 0.3.0.post1
4
4
  Summary: Automatic scheduler for taskwarrior
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
File without changes
File without changes
File without changes