Skip to content

Commit

Permalink
Refactor for PEP8 compliance and code clean-up (#12)
Browse files Browse the repository at this point in the history
* refactored variable publicUuid

* Remove unneccessary put and post headers

Use same headers for all requests instead. Setting Content-Type
is not required anymore after switch from requests to aiohttp
as aiohttp sets Content-Type headers automatically.
.

* remove unneccessary elif

* break up too long lines

* Rename methods and parameters for PEP8 compliance

* break up to long lines

* remove unnecessary else

* remove unnecessary pass

* updated README.md

* update changelog and version to 0.3.0
  • Loading branch information
tr4nt0r authored Feb 16, 2024
1 parent a351cef commit 9126e0b
Show file tree
Hide file tree
Showing 7 changed files with 132 additions and 147 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 0.3.0

* Refactor for PEP8 compliance and code clean-up (breaking change) ([tr4nt0r](https://github.com/tr4nt0r))

## 0.2.0

* Add new method does_user_exist ([tr4nt0r](https://github.com/tr4nt0r))
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,23 @@ async def main():
await bring.login()

# Get information about all available shopping lists
lists = (await bring.loadLists())["lists"]
lists = (await bring.load_lists())["lists"]

# Save an item with specifications to a certain shopping list
await bring.saveItem(lists[0]['listUuid'], 'Milk', 'low fat')
await bring.save_item(lists[0]['listUuid'], 'Milk', 'low fat')

# Save another item
await bring.saveItem(lists[0]['listUuid'], 'Carrots')
await bring.save_item(lists[0]['listUuid'], 'Carrots')

# Get all the items of a list
items = await bring.getItems(lists[0]['listUuid'])
items = await bring.get_list(lists[0]['listUuid'])
print(items)

# Check off an item
await bring.completeItem(lists[0]['listUuid'], 'Carrots')
await bring.complete_item(lists[0]['listUuid'], 'Carrots')

# Remove an item from a list
await bring.removeItem(lists[0]['listUuid'], 'Milk')
await bring.remove_item(lists[0]['listUuid'], 'Milk')

asyncio.run(main())
```
Expand Down
Loading

0 comments on commit 9126e0b

Please sign in to comment.