taskcheck 0.3.3.post1__tar.gz → 0.3.3.post2__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.3.post1
3
+ Version: 0.3.3.post2
4
4
  Summary: Automatic scheduler for taskwarrior
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -78,14 +78,21 @@ instance:
78
78
 
79
79
  ## Algorithm
80
80
 
81
- The algorithm allocates a fixed amount of time for each task (e.g. 1 hour) and then recomputes the
82
- urgency and restart the allocation procedure.
81
+ The algorithm simulates what happens if you work on a task for a certain time on a given day.
83
82
 
84
- If after 1 hour the long task has decreased urgency, that will be noticed and the newer most urgent
83
+ For each day X starting from today, it sorts the tasks by decreasing urgency.
84
+ It start from the most urgent tasks that can be allocated on day X depending on the task's
85
+ `time_map` and on your calendars. It allocates a few number of hours to the task,
86
+ then recomputes the urgencies exactly as Taskwarrior would do
87
+ if it was running on day X. Having recomputed the urgencies, it restarts.
88
+
89
+ If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
85
90
  task will get scheduled in its place.
86
91
 
87
- The minimum time for a task is by default 2 hours, but you can change it by tuning the `min_block`
88
- taskwarrior UDA.
92
+ For `today`, taskcheck will consider as allocated the hours already past.
93
+
94
+ The maximum time that is allocated at each attempt is by default 2 hours
95
+ (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
89
96
 
90
97
  ## Configuration
91
98
 
@@ -144,7 +151,3 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
144
151
  -i, --install: install taskcheck configuration
145
152
  -r, --report: show tasks planned until a certain time
146
153
  ```
147
-
148
- ## TODO
149
-
150
- - [ ] Consider due dates are nearer while planning in the future
@@ -65,14 +65,21 @@ instance:
65
65
 
66
66
  ## Algorithm
67
67
 
68
- The algorithm allocates a fixed amount of time for each task (e.g. 1 hour) and then recomputes the
69
- urgency and restart the allocation procedure.
68
+ The algorithm simulates what happens if you work on a task for a certain time on a given day.
70
69
 
71
- If after 1 hour the long task has decreased urgency, that will be noticed and the newer most urgent
70
+ For each day X starting from today, it sorts the tasks by decreasing urgency.
71
+ It start from the most urgent tasks that can be allocated on day X depending on the task's
72
+ `time_map` and on your calendars. It allocates a few number of hours to the task,
73
+ then recomputes the urgencies exactly as Taskwarrior would do
74
+ if it was running on day X. Having recomputed the urgencies, it restarts.
75
+
76
+ If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
72
77
  task will get scheduled in its place.
73
78
 
74
- The minimum time for a task is by default 2 hours, but you can change it by tuning the `min_block`
75
- taskwarrior UDA.
79
+ For `today`, taskcheck will consider as allocated the hours already past.
80
+
81
+ The maximum time that is allocated at each attempt is by default 2 hours
82
+ (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
76
83
 
77
84
  ## Configuration
78
85
 
@@ -131,7 +138,3 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
131
138
  -i, --install: install taskcheck configuration
132
139
  -r, --report: show tasks planned until a certain time
133
140
  ```
134
-
135
- ## TODO
136
-
137
- - [ ] Consider due dates are nearer while planning in the future
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "taskcheck"
3
- version = "0.3.3-1"
3
+ version = "0.3.3-2"
4
4
  description = "Automatic scheduler for taskwarrior"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -179,7 +179,7 @@ DEFAULT_EMOJI_KEYWORDS = {
179
179
 
180
180
 
181
181
  def get_tasks(config, tasks, year, month, day):
182
- regex = re.compile(rf"{year}-{month}-{day} - ([PDTHM0-9]+)")
182
+ regex = re.compile(rf"{year:04d}-{month:02d}-{day:02d} - ([PDTHM0-9]+)")
183
183
  valid_tasks = []
184
184
  for task in tasks:
185
185
  for line in task["scheduling"].split("\n"):
@@ -265,6 +265,10 @@ def generate_report(config, constraint, verbose=False):
265
265
  console = Console()
266
266
  tasks = fetch_tasks()
267
267
 
268
+ if config.get("include_unplanned"):
269
+ unplanned_tasks = get_unplanned_tasks(config, tasks)
270
+ display_unplanned_tasks(console, config, unplanned_tasks)
271
+
268
272
  for year, month, day in get_days_in_constraint(constraint):
269
273
  this_day_tasks = get_tasks(config, tasks, year, month, day)
270
274
 
@@ -272,10 +276,6 @@ def generate_report(config, constraint, verbose=False):
272
276
 
273
277
  display_tasks_table(console, config, this_day_tasks)
274
278
 
275
- if config.get("include_unplanned"):
276
- unplanned_tasks = get_unplanned_tasks(config, tasks)
277
- display_unplanned_tasks(console, config, unplanned_tasks)
278
-
279
279
 
280
280
  def fetch_tasks():
281
281
  """Fetch tasks from the task manager and return them as a JSON object."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: taskcheck
3
- Version: 0.3.3.post1
3
+ Version: 0.3.3.post2
4
4
  Summary: Automatic scheduler for taskwarrior
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -78,14 +78,21 @@ instance:
78
78
 
79
79
  ## Algorithm
80
80
 
81
- The algorithm allocates a fixed amount of time for each task (e.g. 1 hour) and then recomputes the
82
- urgency and restart the allocation procedure.
81
+ The algorithm simulates what happens if you work on a task for a certain time on a given day.
83
82
 
84
- If after 1 hour the long task has decreased urgency, that will be noticed and the newer most urgent
83
+ For each day X starting from today, it sorts the tasks by decreasing urgency.
84
+ It start from the most urgent tasks that can be allocated on day X depending on the task's
85
+ `time_map` and on your calendars. It allocates a few number of hours to the task,
86
+ then recomputes the urgencies exactly as Taskwarrior would do
87
+ if it was running on day X. Having recomputed the urgencies, it restarts.
88
+
89
+ If after 2 hours a long task has decreased its urgency, it will be noticed and the newer most urgent
85
90
  task will get scheduled in its place.
86
91
 
87
- The minimum time for a task is by default 2 hours, but you can change it by tuning the `min_block`
88
- taskwarrior UDA.
92
+ For `today`, taskcheck will consider as allocated the hours already past.
93
+
94
+ The maximum time that is allocated at each attempt is by default 2 hours
95
+ (or less if the task is shorter), but you can change it by tuning the Taskwarrior UDA `min_block`.
89
96
 
90
97
  ## Configuration
91
98
 
@@ -144,7 +151,3 @@ additional_attributes_unplanned = ["due", "urgency"] # additional attributes to
144
151
  -i, --install: install taskcheck configuration
145
152
  -r, --report: show tasks planned until a certain time
146
153
  ```
147
-
148
- ## TODO
149
-
150
- - [ ] Consider due dates are nearer while planning in the future
File without changes