Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
Refactor code, add tests, better tokens handling
  • Loading branch information
schizza committed May 8, 2024
1 parent 64b8862 commit 6090013
Show file tree
Hide file tree
Showing 24 changed files with 16,739 additions and 369 deletions.
131 changes: 131 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,134 @@ log.log
__pycache__/

.vscode/

/config
config2/*

tests/testing_config/deps
tests/testing_config/home-assistant.log*

# Hide sublime text stuff
*.sublime-project
*.sublime-workspace

# Hide some OS X stuff
.DS_Store
.AppleDouble
.LSOverride
Icon

# Thumbnails
._*

# IntelliJ IDEA
.idea
*.iml

# pytest
.pytest_cache
.cache

# GITHUB Proposed Python stuff:
*.py[cod]

# C extensions
*.so

# Packages
*.egg
*.egg-info
dist
build
eggs
.eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
lib
lib64
pip-wheel-metadata

# Logs
*.log
pip-log.txt

# Unit test / coverage reports
.coverage
coverage.xml
nosetests.xml
htmlcov/
test-reports/
test-results.xml
test-output.xml
pytest-*.txt

# Translations
*.mo

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

.python-version

# emacs auto backups
*~
*#
*.orig

# venv stuff
pyvenv.cfg
pip-selfcheck.json
venv
.venv
Pipfile*
share/*
/Scripts/

# vimmy stuff
*.swp
*.swo
tags
ctags.tmp

# vagrant stuff
virtualization/vagrant/setup_done
virtualization/vagrant/.vagrant
virtualization/vagrant/config

# Visual Studio Code
.vscode/*
!.vscode/cSpell.json
!.vscode/extensions.json
!.vscode/tasks.json
.env

# Windows Explorer
desktop.ini
/home-assistant.pyproj
/home-assistant.sln
/.vs/*

# mypy
/.mypy_cache/*
/.dmypy.json

# Secrets
.lokalise_token

# monkeytype
monkeytype.sqlite3

# This is left behind by Azure Restore Cache
tmp_cache

# python-language-server / Rope
.ropeproject

# Will be created from script/split_tests.py
pytest_buckets.txt
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,21 @@ All notable changes to this project will be documented in this file.

### Added

- better excetions handling and logging
- better exceptions handling and logging
- `class Komens`
- count unread messages
- tests and coverage

### Changed

- `async_schools_list` moved to `Bakalari` class
- Refactor login functions
- Refactor token handling

### Fixed

- Invalid refresh token
- Refactor send_request to better maintenance

## [0.0.1]

Expand All @@ -21,7 +29,7 @@ All notable changes to this project will be documented in this file.
- main `class Bakalari`

- supports saving `access token` and `refresh token` localy
- automaticaly refreshes access token with refresh token if refresh token is not expired
- automatically refreshes access token with refresh token if refresh token is not expired

- `class Schools` in `datastructures.py` lists all schools with their API points

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ Now supports to download list of schools with their API points.
* first login with username and password and stores access and refresh token
* automaticaly refreshes access token with refresh token if refresh token is not expired
* save access and refresh token localy to be cached

## Class Komens

* count unread messages `count_unread_messages`
9 changes: 0 additions & 9 deletions __init__.py

This file was deleted.

Loading

0 comments on commit 6090013

Please sign in to comment.