microsoft-todo-cli 1.1.0__py3-none-any.whl → 1.2.0__py3-none-any.whl
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.
- {microsoft_todo_cli-1.1.0.dist-info → microsoft_todo_cli-1.2.0.dist-info}/METADATA +2 -1
- {microsoft_todo_cli-1.1.0.dist-info → microsoft_todo_cli-1.2.0.dist-info}/RECORD +10 -10
- tests/test_cli_commands.py +16 -0
- todocli/__init__.py +1 -1
- todocli/cli.py +12 -0
- todocli/graphapi/wrapper.py +3 -0
- {microsoft_todo_cli-1.1.0.dist-info → microsoft_todo_cli-1.2.0.dist-info}/WHEEL +0 -0
- {microsoft_todo_cli-1.1.0.dist-info → microsoft_todo_cli-1.2.0.dist-info}/entry_points.txt +0 -0
- {microsoft_todo_cli-1.1.0.dist-info → microsoft_todo_cli-1.2.0.dist-info}/licenses/LICENSE +0 -0
- {microsoft_todo_cli-1.1.0.dist-info → microsoft_todo_cli-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-todo-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Fast, minimal command-line client for Microsoft To-Do
|
|
5
5
|
Home-page: https://github.com/underwear/microsoft-todo-cli
|
|
6
6
|
Author: underwear
|
|
@@ -116,6 +116,7 @@ todo new "Task" -I # Important
|
|
|
116
116
|
todo new "Task" -R daily # Recurring
|
|
117
117
|
todo new "Task" -R weekly:mon,fri # Recurring on specific days
|
|
118
118
|
todo new "Task" -S "Step 1" -S "Step 2" # With subtasks
|
|
119
|
+
todo new "Task" -N "Note content" # With note
|
|
119
120
|
|
|
120
121
|
# View single task
|
|
121
122
|
todo show "Task" # Show task details
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
microsoft_todo_cli-1.
|
|
1
|
+
microsoft_todo_cli-1.2.0.dist-info/licenses/LICENSE,sha256=1xYliB2ZJeYUr4HpX68WiziquLEEHtHs4diJdPCi7ec,1064
|
|
2
2
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
3
|
tests/run_tests.py,sha256=gi0SgUUTBgav9WjSOmGYBH2pVIfxXokk3NXmrPfgxhQ,1651
|
|
4
4
|
tests/test_checklist_cli.py,sha256=-JhpcXokmYdMKQXhn3FeIDg2xKzD7irfnfzSWjeKvpo,4497
|
|
5
5
|
tests/test_checklist_item_model.py,sha256=t3t5eTDw471dU1ruFHGF6vXdYuD_rHJ8ni8inuhQdKM,3752
|
|
6
6
|
tests/test_checklist_wrapper.py,sha256=fs68UBUaVRu7RXnlgdC84qSKpzT8nHz5d5srK__xBck,2080
|
|
7
|
-
tests/test_cli_commands.py,sha256=
|
|
7
|
+
tests/test_cli_commands.py,sha256=QZ8xmnmq7sJXrBO0V4RDnWcC7ol8iXHMNIXwHMb4TJ4,18326
|
|
8
8
|
tests/test_cli_output.py,sha256=a55uOtFe3GupKczWv_sPvzz9FbEsbNAtFiHiGklSLc0,6234
|
|
9
9
|
tests/test_cli_url_integration.py,sha256=2zHTLa63olTUFisYn_p0Buu6eMlal7p7xyuXiq0rC-A,4546
|
|
10
10
|
tests/test_datetime_parser.py,sha256=eVurIgTf-P0g4wv09i4fJ3lrAqjB0K6i89UNMWi_9aA,9195
|
|
@@ -19,11 +19,11 @@ tests/test_recurrence.py,sha256=-pVYKrL5RvtsL3YhTJOfB92MTgKwDFz-0_1JImmlCYU,6386
|
|
|
19
19
|
tests/test_update_command.py,sha256=Hq--wFbfcUtZ7s83Q8tQVZTFokraWxjqqKRFUG5307E,7740
|
|
20
20
|
tests/test_utils.py,sha256=mXgtng8oB8f1NkUb8qITAM8rnJOHiBYa4zm3eYln6Q4,5003
|
|
21
21
|
tests/test_wrapper.py,sha256=wlO3U4_L-LbMWyMPHPd6dMWOliHt_h7ZCoqF7dvSCvc,6546
|
|
22
|
-
todocli/__init__.py,sha256=
|
|
23
|
-
todocli/cli.py,sha256=
|
|
22
|
+
todocli/__init__.py,sha256=MpAT5hgNoHnTtG1XRD_GV_A7QrHVU6vJjGSw_8qMGA4,22
|
|
23
|
+
todocli/cli.py,sha256=IYbG8jnq0c3EzKH3ik70rZzvEBxDgulYhQ2Ib06CMhY,50701
|
|
24
24
|
todocli/graphapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
todocli/graphapi/oauth.py,sha256=AA4X3ZhmCLTEH3ZrbsihemcO7UUfFCzRUxko9tZOIo0,3993
|
|
26
|
-
todocli/graphapi/wrapper.py,sha256=
|
|
26
|
+
todocli/graphapi/wrapper.py,sha256=taFUuixSgelPkbqu9Bx7d8etHA_MNGEKywFfQPI1HIk,23176
|
|
27
27
|
todocli/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
28
28
|
todocli/models/checklistitem.py,sha256=KO1CZD8YvL7MqByOW4CQIGuDLyUM4DGCObs0ATpHXYo,1968
|
|
29
29
|
todocli/models/todolist.py,sha256=StdyeA0rY-PDIst2-82FvgSgy_IxvzoqpOVUVJO6rmc,914
|
|
@@ -32,8 +32,8 @@ todocli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
32
32
|
todocli/utils/datetime_util.py,sha256=fcx1ZK-59Sn270avEenvFOiTOvSgTJPVGD8qe6LxxIg,10283
|
|
33
33
|
todocli/utils/recurrence_util.py,sha256=a-Vcbr3YNPioOtHEMwQMViKGqq5qxwkzdX3gAdhI_Zw,3233
|
|
34
34
|
todocli/utils/update_checker.py,sha256=X--k4dkSq3bhNvoLdPwDBjdu2atGJjCze7349zbAnDo,2049
|
|
35
|
-
microsoft_todo_cli-1.
|
|
36
|
-
microsoft_todo_cli-1.
|
|
37
|
-
microsoft_todo_cli-1.
|
|
38
|
-
microsoft_todo_cli-1.
|
|
39
|
-
microsoft_todo_cli-1.
|
|
35
|
+
microsoft_todo_cli-1.2.0.dist-info/METADATA,sha256=z-yi9Bf4i7L_cmjrpG0C8Qk066H2TEd-vr8FCSfKWGw,9484
|
|
36
|
+
microsoft_todo_cli-1.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
37
|
+
microsoft_todo_cli-1.2.0.dist-info/entry_points.txt,sha256=PqRWcETcJ1IRkrRYErjmilmH6y205R8VPX8QmgWWWGg,42
|
|
38
|
+
microsoft_todo_cli-1.2.0.dist-info/top_level.txt,sha256=EIZMq91YloWqg-5RgfD9gxCiO-nGcrkciT9GnLyMDnc,14
|
|
39
|
+
microsoft_todo_cli-1.2.0.dist-info/RECORD,,
|
tests/test_cli_commands.py
CHANGED
|
@@ -129,6 +129,22 @@ class TestCLIArgumentParsing(unittest.TestCase):
|
|
|
129
129
|
args = self.parser.parse_args(["new", "buy milk"])
|
|
130
130
|
self.assertEqual(args.step, [])
|
|
131
131
|
|
|
132
|
+
def test_new_command_with_note_flag(self):
|
|
133
|
+
"""Test 'new' command with -N flag"""
|
|
134
|
+
args = self.parser.parse_args(["new", "-N", "Remember to check prices", "buy milk"])
|
|
135
|
+
self.assertEqual(args.task_name, "buy milk")
|
|
136
|
+
self.assertEqual(args.note, "Remember to check prices")
|
|
137
|
+
|
|
138
|
+
def test_new_command_with_note_long_flag(self):
|
|
139
|
+
"""Test 'new' command with --note flag"""
|
|
140
|
+
args = self.parser.parse_args(["new", "--note", "My note", "buy milk"])
|
|
141
|
+
self.assertEqual(args.note, "My note")
|
|
142
|
+
|
|
143
|
+
def test_new_command_without_note(self):
|
|
144
|
+
"""Test 'new' command defaults note to None"""
|
|
145
|
+
args = self.parser.parse_args(["new", "buy milk"])
|
|
146
|
+
self.assertIsNone(args.note)
|
|
147
|
+
|
|
132
148
|
def test_new_command_with_all_flags(self):
|
|
133
149
|
"""Test 'new' command with all flags"""
|
|
134
150
|
args = self.parser.parse_args(
|
todocli/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.
|
|
1
|
+
__version__ = "1.2.0"
|
todocli/cli.py
CHANGED
|
@@ -152,6 +152,7 @@ def new(args):
|
|
|
152
152
|
due_datetime = parse_datetime(due_date_time_str)
|
|
153
153
|
|
|
154
154
|
recurrence = parse_recurrence(args.recurrence)
|
|
155
|
+
note_content = getattr(args, "note", None)
|
|
155
156
|
|
|
156
157
|
task_id = wrapper.create_task(
|
|
157
158
|
name,
|
|
@@ -160,6 +161,7 @@ def new(args):
|
|
|
160
161
|
due_datetime=due_datetime,
|
|
161
162
|
important=args.important,
|
|
162
163
|
recurrence=recurrence,
|
|
164
|
+
note=note_content,
|
|
163
165
|
)
|
|
164
166
|
|
|
165
167
|
steps = getattr(args, "step", []) or []
|
|
@@ -175,6 +177,8 @@ def new(args):
|
|
|
175
177
|
msg = f"Created task '{name}' in '{task_list}'"
|
|
176
178
|
if steps:
|
|
177
179
|
msg += f" with {len(steps)} step(s)"
|
|
180
|
+
if note_content:
|
|
181
|
+
msg += " with note"
|
|
178
182
|
|
|
179
183
|
result = {
|
|
180
184
|
"action": "created",
|
|
@@ -185,6 +189,8 @@ def new(args):
|
|
|
185
189
|
}
|
|
186
190
|
if step_ids:
|
|
187
191
|
result["step_ids"] = step_ids
|
|
192
|
+
if note_content:
|
|
193
|
+
result["note"] = note_content
|
|
188
194
|
|
|
189
195
|
_output_result(args, result)
|
|
190
196
|
|
|
@@ -1200,6 +1206,12 @@ def setup_parser():
|
|
|
1200
1206
|
default=[],
|
|
1201
1207
|
help="Add a step (checklist item); can be repeated",
|
|
1202
1208
|
)
|
|
1209
|
+
subparser.add_argument(
|
|
1210
|
+
"-N",
|
|
1211
|
+
"--note",
|
|
1212
|
+
help="Add a note to the task",
|
|
1213
|
+
metavar="TEXT",
|
|
1214
|
+
)
|
|
1203
1215
|
_add_list_flag(subparser)
|
|
1204
1216
|
_add_json_flag(subparser)
|
|
1205
1217
|
subparser.set_defaults(func=new)
|
todocli/graphapi/wrapper.py
CHANGED
|
@@ -172,6 +172,7 @@ def create_task(
|
|
|
172
172
|
due_datetime: datetime | None = None,
|
|
173
173
|
important: bool = False,
|
|
174
174
|
recurrence: dict | None = None,
|
|
175
|
+
note: str | None = None,
|
|
175
176
|
):
|
|
176
177
|
_require_list(list_name, list_id)
|
|
177
178
|
|
|
@@ -191,6 +192,8 @@ def create_task(
|
|
|
191
192
|
"importance": TaskImportance.HIGH if important else TaskImportance.NORMAL,
|
|
192
193
|
"recurrence": recurrence,
|
|
193
194
|
}
|
|
195
|
+
if note:
|
|
196
|
+
request_body["body"] = {"content": note, "contentType": "text"}
|
|
194
197
|
session = get_oauth_session()
|
|
195
198
|
response = session.post(endpoint, json=request_body)
|
|
196
199
|
if response.ok:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|