Implemented most of the api placeholders #23

Merged
LazIvanS merged 7 commits from feat_9.functional_api into develop 2021-04-28 23:02:43 +03:00
2 changed files with 14 additions and 3 deletions
Showing only changes of commit 5ddadac47c - Show all commits

View File

@@ -26,9 +26,12 @@ class Application(tk.Tk):
def login(self):
"""Возвращает пользователя - его можно потом сериализовать"""
# Пользователь сохранен! Авторизация не нужна!
user = User.load()
if user is not None:
return user
try:
user = User.load()
if user is not None:
return user
except Exception as e:
print("Failed to restore login:", e)
# Не удалось - нужен логин
self.frame = LoginFrame(master=self, url=DEFAULT_URL)
while not self.frame.loggedIn:

View File

@@ -161,6 +161,9 @@ class User(UserApi):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
Remove the login file from homedir
"""
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print("Debug mode is on - no login storing")
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if not os.path.exists(USER_TOKEN_PATH):
return
try:
@@ -172,6 +175,9 @@ class User(UserApi):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
Store user token in homedir
"""
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
print("Debug mode is on - no login storing")
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
return
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
try:
with open(USER_TOKEN_PATH, "w") as handler:
json.dump(self.token.__dict__, handler)
@@ -183,6 +189,8 @@ class User(UserApi):
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
"""
Restore user token from the file in homedir
"""
if "DEBUG" in os.environ:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
raise RuntimeError("Debug mode is on - no login storing")
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
if os.path.exists(USER_TOKEN_PATH):
try:
with open(USER_TOKEN_PATH, "r") as handler:
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:54:31 +03:00 (Migrated from github.com)
Review
            created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user)
```suggestion created_item = ToDoItem(id=random.randint(100, 1000), text=text, user=self.user) ```
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print
AlekseyLobanov commented 2021-04-26 23:55:12 +03:00 (Migrated from github.com)
Review

Кажется, лишний print

Кажется, лишний print