Skip to content

Commit

Permalink
refactor: add api module
Browse files Browse the repository at this point in the history
  • Loading branch information
Thungghuan committed Oct 8, 2022
1 parent c3b16e7 commit 0ce251e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion get_token.py → api/get_token.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
import requests
from des import str_enc
from api.des import str_enc


def get_token(username: str, password: str):
Expand Down
2 changes: 1 addition & 1 deletion cli/check.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from enum import Enum
import questionary
from bus import Bus
from api.bus import Bus


class CheckState(Enum):
Expand Down
6 changes: 5 additions & 1 deletion cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from cli.console import reset_console
from cli.reserve import ReserveBusMenu
from cli.token import load_token
from bus import Bus
from api.bus import Bus
from enum import Enum


Expand Down Expand Up @@ -101,3 +101,7 @@ def back_main_menu(self):
def main():
menu = Menu()
menu.run()


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion cli/reserve.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import Enum
from datetime import datetime
import questionary
from bus import Bus
from api.bus import Bus


class ReserveState(Enum):
Expand Down
2 changes: 1 addition & 1 deletion cli/token.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import questionary
from get_token import check_token_expired, get_token
import os.path as path
from api.get_token import check_token_expired, get_token

TOKEN_PATH = ".token"

Expand Down

0 comments on commit 0ce251e

Please sign in to comment.