Skip to content

Commit

Permalink
Add Code Spell Check configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
romanc committed Dec 22, 2024
1 parent 56b4587 commit b4c441f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ Steps to deploy (a copy of) this bot include
- get a [Telegram bot token](https://core.telegram.org/bots#creating-a-new-bot)
- create a config file: `mv config.ini.example config.ini` and configure the token in it
- run the bot: `uv run src/zh_trashbot/bot.py`

## VSCode setup

Recommended extensions are Python language support and Code Spell Checker.
16 changes: 16 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: "0.2"
ignorePaths:
- .venv
dictionaryDefinitions: []
dictionaries: []
words:
- Cattaneo
- trashbot
- venv
- Züri
ignoreWords:
- cargotram
- etram
- levelname
- tada
import: []
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ dependencies = [
readme = "README.md"
license = {file = "LICENSE.txt"}
authors = [
{name = "romanc"}
{name = "Roman Cattaneo"}
]
maintainers = [
{name = "romanc"}
{name = "Roman Cattaneo"}
]
keywords = ["Züri", "telegram", "bot", "waste", "trash", "collection", "recycling"]
classifiers = [
Expand Down
6 changes: 3 additions & 3 deletions src/zh_trashbot/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,11 @@ def queryCollectionAPI(choice, user_data):
today = datetime.today().strftime('%Y-%m-%d')

baseurl = "http://openerz.metaodi.ch/api/calendar.json"
openerz = "%s?sort=date&types=%s&zip=%s&start=%s" % (baseurl, choice,
openERZ = "%s?sort=date&types=%s&zip=%s&start=%s" % (baseurl, choice,
zip, today)
openerz += "&limit=0" if limit == "none" else "&limit=%s" % limit
openERZ += "&limit=0" if limit == "none" else "&limit=%s" % limit

with urllib.request.urlopen(openerz) as url:
with urllib.request.urlopen(openERZ) as url:
data = json.loads(url.read().decode())
count = data['_metadata']['total_count']
if count == 0:
Expand Down

0 comments on commit b4c441f

Please sign in to comment.