Skip to content

Commit

Permalink
Update usage
Browse files Browse the repository at this point in the history
  • Loading branch information
disrupted committed Dec 14, 2024
1 parent fc35a6c commit 28c8c1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,23 @@ OFFSET = 1234
OFFSET = None

things = ThingsClient(ACCOUNT, initial_offset=OFFSET)
# create a project
project = TodoItem("Things Cloud Project").as_project()
# create a new project
project = TodoItem(title="Things Cloud Project").as_project()
# push to Things Cloud
things.create(project)
things.commit(project)

# create a todo inside project
todo = TodoItem("Try out Things Cloud")
todo = TodoItem(title="Try out Things Cloud")
todo.project = project
things.create(todo)
things.commit(todo)

# schedule for today
todo.today()
things.edit(todo)
things.commit(todo)
```

See [main.py](main.py).

### Progress

- [x] Todos
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def main():
things = ThingsClient(ACCOUNT, initial_offset=OFFSET)

# create a project
# create a new project
project = TodoItem(title="Things Cloud Project").as_project()
things.commit(project)
log.debug("created project", uuid=project.uuid)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_things.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_create():
start_idx = things.offset
assert start_idx == OFFSET
item = TodoItem(title="test_create")
new_idx = things.create(item)
new_idx = things.commit(item)
assert new_idx is not None
assert new_idx == start_idx + 1

Expand Down

0 comments on commit 28c8c1f

Please sign in to comment.