Skip to content

Commit

Permalink
Perbarui appdirs ke 1.4.4 dan gunakan user_data_dir untuk kuki
Browse files Browse the repository at this point in the history
  • Loading branch information
laymonage committed May 24, 2020
1 parent 705d0b6 commit fad5892
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ pip install kbbi

### Manual

1. Lakukan instalasi untuk paket-paket prasyarat ([`requests`][requests]
dan [`BeautifulSoup4`][beautifulsoup4]).
1. Lakukan instalasi untuk paket-paket prasyarat ([`requests`][requests],
[`BeautifulSoup4`][beautifulsoup4], dan [`appdirs`][appdirs]).
2. Klonakan repositori ini atau unduh [`kbbi.py`][kbbi-py].
3. Letakkan `kbbi.py` dalam direktori yang Anda inginkan.

Expand Down Expand Up @@ -229,9 +229,9 @@ ketika membuat objek `AutentikasiKBBI`.

Secara *default*, lokasi tersebut adalah:

- Unix: `~/.config/kbbi/kuki.json`
- Unix: `~/.local/share/kbbi/kuki.json`
- Windows: `%localappdata%\laymonage\kbbi\kuki.json`
- Mac: `~/Library/Application Support/kbbi/kuki.json`
- macOS: `~/Library/Application Support/kbbi/kuki.json`

### Melalui CLI

Expand Down Expand Up @@ -337,6 +337,7 @@ penyalahgunaan yang mungkin muncul dari proyek ini.
[kbbi]: https://kbbi.kemdikbud.go.id
[requests]: https://pypi.org/project/requests
[beautifulsoup4]: https://pypi.org/project/beautifulsoup4
[appdirs]: https://pypi.org/project/appdirs
[kbbi-py]: https://github.com/laymonage/kbbi-python/raw/master/src/kbbi/kbbi.py
[CONTRIBUTING.md]: https://github.com/laymonage/kbbi-python/blob/master/CONTRIBUTING.md
[LICENSE]: https://github.com/laymonage/kbbi-python/blob/master/LICENSE
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
appdirs>=1.4.3,<2.0
appdirs>=1.4.4,<2.0
beautifulsoup4>=4.8.2,<5.0
requests>=2.23.0,<3.0
6 changes: 3 additions & 3 deletions src/kbbi/kbbi.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
from bs4 import BeautifulSoup

APPDIR = AppDirs("kbbi", "laymonage")
CONFIG_DIR = Path(APPDIR.user_config_dir)
CONFIG_DIR.mkdir(parents=True, exist_ok=True)
DATA_DIR = Path(APPDIR.user_data_dir)
DATA_DIR.mkdir(parents=True, exist_ok=True)


class KBBI:
Expand Down Expand Up @@ -507,7 +507,7 @@ class AutentikasiKBBI:

host = "https://kbbi.kemdikbud.go.id"
lokasi = "Account/Login"
lokasi_kuki = CONFIG_DIR / "kuki.json"
lokasi_kuki = DATA_DIR / "kuki.json"

def __init__(self, posel=None, sandi=None, lokasi_kuki=None):
"""Melakukan autentikasi dengan alamat posel dan sandi yang diberikan.
Expand Down

0 comments on commit fad5892

Please sign in to comment.