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
7 changed files with 439 additions and 90 deletions

View File

@@ -13,13 +13,13 @@ from drf_yasg import openapi
from .api import router from .api import router
schema_view = get_schema_view( schema_view = get_schema_view(
openapi.Info( openapi.Info(
title="ToDo List", title="ToDo List",
default_version='v1', default_version="v1",
description="Swagger Interface for ToDo List", description="Swagger Interface for ToDo List",
), ),
public=True, public=True,
permission_classes=(permissions.AllowAny,), permission_classes=(permissions.AllowAny,),
) )
urlpatterns = [ urlpatterns = [
@@ -28,5 +28,5 @@ urlpatterns = [
path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"), path("api/token/refresh/", TokenRefreshView.as_view(), name="token_refresh"),
path("api/", include(router.urls)), path("api/", include(router.urls)),
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")), path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), path("swagger/", schema_view.with_ui("swagger", cache_timeout=0), name="schema-swagger-ui"),
] ]

View File

@@ -13,12 +13,13 @@ API_TODO_ITEMS_DELETE = "api/todo_items/{0}/"
API_LISTS_LIST = "api/lists/" API_LISTS_LIST = "api/lists/"
API_LISTS_CREATE = "api/lists/" API_LISTS_CREATE = "api/lists/"
API_LISTS_READ = "lists/{0}/" API_LISTS_READ = "api/lists/{0}/"
API_LISTS_UPDATE = "lists/{0}/" API_LISTS_UPDATE = "api/lists/{0}/"
API_LISTS_PARTIAL_UPDATE = "lists/{0}/" API_LISTS_PARTIAL_UPDATE = "api/lists/{0}/"
API_LISTS_DELETE = "lists/{0}/" API_LISTS_DELETE = "api/lists/{0}/"
API_TOKEN = "api/token/" API_TOKEN_CREATE = "api/token/"
API_TOKEN_REFRESH = "api/token/refresh/"
class UserApi(object): class UserApi(object):
@@ -61,11 +62,23 @@ class UserApi(object):
""" """
token = UserApi._raise_or_return_( token = UserApi._raise_or_return_(
requests.post(url=self.get_api(API_TOKEN), json={"username": user, "password": passwd}) requests.post(
url=self.get_api(API_TOKEN_CREATE), json={"username": user, "password": passwd}
)
) )
self.token = SimpleNamespace(**token) self.token = SimpleNamespace(**token)
return self.token return self.token
def refresh(self):
"""
Refresh existing token
"""
token = UserApi._raise_or_return_(
requests.post(url=self.get_api(API_TOKEN_REFRESH), json={"refresh": self.token.refresh})
)
self.token.access = token["access"]
return self.token
def lists_list(self, **argv): def lists_list(self, **argv):
""" """
List all the exsiting to-do lists. List all the exsiting to-do lists.
@@ -102,6 +115,43 @@ class UserApi(object):
) )
) )
def lists_delete(self, id):
"""
Auth required
Deletes a to-do list by id
Parameters
----------
id: to-do list id to delete
"""
return UserApi._raise_or_return_(
requests.delete(
url=self.get_api(API_LISTS_DELETE.format(id)),
headers=self._access_token_(),
)
)
def lists_update(self, title, id):
"""
Rename a new to-do list
Auth required
Parameters
----------
title : str
New name for a list.
id : int
"""
return UserApi._raise_or_return_(
requests.put(
url=self.get_api(API_LISTS_UPDATE.format(id)),
json={"title": title},
headers=self._access_token_(),
)
)
def todo_items_list(self, **argv): def todo_items_list(self, **argv):
""" """
List all the exsiting to-do items. List all the exsiting to-do items.
@@ -119,6 +169,67 @@ class UserApi(object):
) )
) )
def todo_items_create(self, parent, text="Note"):
"""
Create a new to-do item
Auth required
Parameters
----------
parent : id of parent list
text : str, optional
New note. The default is "Note".
"""
return UserApi._raise_or_return_(
requests.post(
url=self.get_api(API_TODO_ITEMS_CREATE),
json={"text": text, "parent": parent, "finished": False},
headers=self._access_token_(),
)
)
def todo_items_delete(self, id):
"""
Auth required
Deletes a to-do item by id
Parameters
----------
id: to-do item id to delete
"""
return UserApi._raise_or_return_(
requests.delete(
url=self.get_api(API_TODO_ITEMS_DELETE.format(id)),
headers=self._access_token_(),
)
)
def todo_items_update(self, id, text, finished, parent):
"""
Rename a new to-do list
Auth required
Parameters
----------
id : int
Note id
text : str
New note for the item.
finished : bool
New state for the item
parent : int
Parent list id
"""
return UserApi._raise_or_return_(
requests.put(
url=self.get_api(API_TODO_ITEMS_UPDATE.format(id)),
json={"text": text, "finished": finished, "parent": parent},
headers=self._access_token_(),
)
)
# def create(self, title="Untitled"): # def create(self, title="Untitled"):
# """ # """
# Create a new to-do list # Create a new to-do list
@@ -215,4 +326,8 @@ class UserApi(object):
@staticmethod @staticmethod
def _raise_or_return_(response): def _raise_or_return_(response):
response.raise_for_status() response.raise_for_status()
return response.json() try:
return response.json()
except Exception as e:
print(e)
return response.content

View File

@@ -1,48 +1,50 @@
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
import random
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
from user import User from user import User
def print_lists(lists): def print_lists(lists):
for item in lists: for item in lists:
print(f"List: '{item}'", f"Id: {item.id}", "|", "|".join([str(x) for x in item.items])) print(
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
f"List: '{item.title}'", f"Id: {item.id}", "|", "|".join([str(x) for x in item.items_])
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
DEFAULT_URL = "http://127.0.0.1:8000" DEFAULT_URL = "http://127.0.0.1:8000"
user = User(url=DEFAULT_URL) user = User(url=DEFAULT_URL)
AlekseyLobanov commented 2021-04-26 23:53:55 +03:00 (Migrated from github.com)
Review
user.lists_[0].modify(title=f"A new title {random.random()}")
```suggestion user.lists_[0].modify(title=f"A new title {random.random()}") ```
user.auth("root", "root") user.auth("root", "root")
user.refresh()
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Fetch existing lists: # Fetch existing lists:
lists = user.fetchUserLists() print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print("Fecthing...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Remove user list by id:
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
user.removeUserList(5)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
lists = user.fetchUserLists()
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print(f"Removing {5}...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Append a new list to user: # Append a new list to user:
print("Appending list...") print("Appending list...")
scroll = user.appendUserList(title="a new list!") scroll = user.appendUserList(title="a new list!")
print_lists(lists) print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Modify list 0: # Modify list 0:
print("Modifyng list...") print("Modifyng list...")
lists[0].modify(title="A new title") user.lists_[0].modify(title=f"A new title{random.random()}")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists) print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Append item to list: # Append item to list:
print("Appending item to last list...") print("Appending item to last list...")
item = lists[-1].append(text="this is an item") item = user.lists_[-1].append(text="this is an item")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists) print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Modifying item # Modifying item
print("Modifyng appended item...") print("Modifyng appended item...")
item.modify(finished=True, text="this is an updated item") item.modify(finished=True, text="this is an updated item")
print_lists(lists) print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Removing item at 0 # Removing item at from last list
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print("Removing item 0 from list 0...") print("Removing the last item from the last list...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
lists[0].remove(0) user.lists_[-1].remove(-1)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(lists) print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
# Remove user list by id:
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
i = user.lists_[0].id
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print(f"Removing {i}...")
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
user.removeUserList(i)
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
print_lists(user.fetchUserLists())
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада
AlekseyLobanov commented 2021-04-26 23:53:26 +03:00 (Migrated from github.com)
Review

Зачем тут numpy? Лучше нинада

Зачем тут numpy? Лучше нинада

View File

@@ -38,6 +38,13 @@ class LoginFrame(tk.Frame):
print(ex) print(ex)
message.invalid_login() message.invalid_login()
# Если захочется реализовать в логине
"""
@property
def remember(self):
return self.rbtn_var.get()
"""
def initAUTH(self) -> None: def initAUTH(self) -> None:
""" """
Создает окно авторизации программы Создает окно авторизации программы
@@ -66,3 +73,16 @@ class LoginFrame(tk.Frame):
# Кнопка авториазции # Кнопка авториазции
btn = tk.Button(self, text="Войти", command=self.login_clicked) btn = tk.Button(self, text="Войти", command=self.login_clicked)
btn.grid(row=14, column=12, columnspan=3, rowspan=1, sticky="nsew") btn.grid(row=14, column=12, columnspan=3, rowspan=1, sticky="nsew")
# Если захочется реализовать в логине
"""
# Запомнить пользователя
self.rbtn_var = tk.IntVar(value=0)
rbtn = tk.Checkbutton(
self,
text="Запомнить меня",
variable=self.rbtn_var,
command=None
)
rbtn.grid(row=15, column=12, columnspan=3, rowspan=1, sticky="nsew")
"""

View File

@@ -4,13 +4,14 @@ import sys
import tkinter as tk import tkinter as tk
from login import LoginFrame from login import LoginFrame
from workspace import WorkSpaceFrame from workspace import WorkSpaceFrame
from user import User
if "win" in sys.platform.lower(): if "win" in sys.platform.lower():
DEFAULT_URL = "http://localhost:8000" DEFAULT_URL = "http://localhost:8000"
else: else:
DEFAULT_URL = "http://0.0.0.0:8000" DEFAULT_URL = "http://0.0.0.0:8000"
BASE_W = 580 BASE_W = 600
BASE_H = 400 BASE_H = 400
TITLE_APP = "ToDo Application" TITLE_APP = "ToDo Application"
@@ -24,11 +25,22 @@ class Application(tk.Tk):
def login(self): def login(self):
"""Возвращает пользователя - его можно потом сериализовать""" """Возвращает пользователя - его можно потом сериализовать"""
# Пользователь сохранен! Авторизация не нужна!
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) self.frame = LoginFrame(master=self, url=DEFAULT_URL)
while not self.frame.loggedIn: while not self.frame.loggedIn:
self.update_idletasks() self.update_idletasks()
self.update() self.update()
self.frame.destroy() self.frame.destroy()
# Нужно запомнить пользователя
# if self.frame.remember:
# self.frame.user.save()
return self.frame.user return self.frame.user
def main(self, user): def main(self, user):

View File

@@ -1,85 +1,140 @@
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
import os import os
import random
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: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
from datetime import datetime from datetime import datetime
from types import SimpleNamespace
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: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
from pathlib import Path
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: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
import json
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: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
from api import UserApi from api import UserApi
LIST_UPDATEBLE = ["title"]
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
TODO_ITEM_UPDATEBLE = ["text", "finished"]
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
UPDATE_ERROR = "Failed to update property: {0}"
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: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
DATETIME_STR = "%Y-%m-%dT%H:%M:%S.%fZ"
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: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
USER_TOKEN_PATH = os.path.join(Path.home(), ".todo_config.json")
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: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: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
def bad_arguments(x, d):
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 list((set(x) - set(d)))
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: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: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
def date_or_str(inpt):
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 type(inpt) is datetime:
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 inpt
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
elif type(inpt) is str:
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 datetime.strptime(inpt, DATETIME_STR)
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
else:
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 datetime.now()
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: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
class ToDoList(object): class ToDoList(object):
def __init__(self, id, title, created_at=None, items=[], parent=None): def __init__(self, id, title, created_at=None, items=None, parent=None, user=None):
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: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
self.id = id self.id = id
self.title = title self.title = title
self.items = items self.items_ = [] if items is None else items
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: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
self.created_at = created_at self.created_at = date_or_str(created_at)
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: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
self.user = 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
def __iter__(self): def __iter__(self):
for item in self.items: for item in self.items_:
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: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
yield item yield item
def __getitem__(self, index): def __getitem__(self, index):
return self.items[index] return self.items_[index]
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: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
def __len__(self): def __len__(self):
return len(self.items) return len(self.items_)
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: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
def __str__(self): def __str__(self):
return f"[{self.id}] {self.title}" return f"[{self.id}] {self.title}"
def index(self, value): def index(self, value):
return self.items.index(value) return self.items_.index(value)
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: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
# ToDo
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
def remove(self, index): def remove(self, index):
self.items.remove(self.items[index]) """
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: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
self.sync() Remove item AT INDEX from db
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: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: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
item = self.items_[index]
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
self.items_.remove(item)
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
item.dispose()
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
# ToDo
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
def append(self, text): def append(self, text):
item = ToDoItem(id=None, text=text, created_at=datetime.now()) """
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: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
self.items.append(item) Add a new item to db
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: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
item.sync() """
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: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
self.sync() 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
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 item 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: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
else:
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
created_item = self.user.todo_items_create(parent=self.id, text=text)
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
created_item = ToDoItem(**created_item, 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
self.items_.append(created_item)
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 created_item
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
def modify(self, **argv): def modify(self, **argv):
bad = bad_arguments(argv.keys(), LIST_UPDATEBLE)
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 len(bad) > 0:
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(UPDATE_ERROR.format(bad[0]))
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
for key, value in argv.items(): for key, value in argv.items():
setattr(self, key, value) setattr(self, key, value)
self.sync() self.sync()
# ToDo def dispose(self):
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: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(f"To-do list id '{self.id}' is being disposed of...")
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
for item in self.items_:
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
item.dispose()
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 "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
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
self.user.lists_delete(self.id)
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: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
def sync(self): def sync(self):
# ToDo send request or store in form
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(f"Item '{self}' is being synchronized...") print(f"Item '{self}' is being synchronized...")
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
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
self.user.lists_update(title=self.title, id=self.id)
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
class ToDoItem(object): class ToDoItem(object):
def __init__(self, id, text, finished=False, created_at=None, parent=None): def __init__(self, id, text, finished=False, created_at=None, parent=None, user=None):
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: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
self.id = id self.id = id
self.text = text self.text = text
self.finished = finished self.finished = finished
self.created_at = created_at self.created_at = date_or_str(created_at)
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: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
self.parent = parent
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
self.user = 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
def __str__(self): def __str__(self):
return f"[{self.id}] {self.text}" return f"[{self.id}] {self.text}"
def modify(self, **argv): def modify(self, **argv):
bad = bad_arguments(argv.keys(), TODO_ITEM_UPDATEBLE)
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 len(bad) > 0:
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(UPDATE_ERROR.format(bad[0]))
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
for key, value in argv.items(): for key, value in argv.items():
setattr(self, key, value) setattr(self, key, value)
self.sync() self.sync()
# ToDo def dispose(self):
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: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
def sync(self): print(f"To-do item id '{self.id}' is being disposed of...")
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: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
# ToDo send request or store in form
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(f"Item '{self}' is being synchronized...")
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: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: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
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:55:12 +03:00 (Migrated from github.com)
Review

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

Кажется, лишний print
def auth(self, user, passwd):
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 "DEBUG" in os.environ: if "DEBUG" in os.environ:
return return
UserApi.auth(self, user, passwd) self.user.todo_items_delete(self.id)
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: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
# ToDo def sync(self):
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: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
items = [ print(f"Item '{self}' is being synchronized...")
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: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 "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
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
self.user.todo_items_update(
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
id=self.id, text=self.text, finished=self.finished, parent=self.parent
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: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: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: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
def make_debug_lists():
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
ToDoList( ToDoList(
id=i, id=i,
title=f"List {i}", title=f"List {i}",
AlekseyLobanov commented 2021-04-26 23:55:48 +03:00 (Migrated from github.com)
Review

Не python_style_name. Лучше to_do_lists

Не python_style_name. Лучше `to_do_lists`
AlekseyLobanov commented 2021-04-26 23:56:10 +03:00 (Migrated from github.com)
Review

По идее, у каждого элемента должен быть родитель

По идее, у каждого элемента должен быть родитель
@@ -92,17 +147,106 @@ 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
for i in range(10) for i in range(10)
] ]
# ToDo
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: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
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:55:12 +03:00 (Migrated from github.com)
Review

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

Кажется, лишний print
def auth(self, user, passwd):
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: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
Basic authentification
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: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 "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
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
return UserApi.auth(self, user, passwd)
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: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
def remove(self):
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: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
Remove the login file from homedir
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: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 "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):
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:
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
os.remove(USER_TOKEN_PATH)
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
except Exception as e:
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("Failed to remove tokens:", e)
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: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
def save(self):
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: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
Store user token in homedir
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: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 "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:
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
with open(USER_TOKEN_PATH, "w") 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:55:12 +03:00 (Migrated from github.com)
Review

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

Кажется, лишний print
json.dump(self.token.__dict__, 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:55:12 +03:00 (Migrated from github.com)
Review

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

Кажется, лишний print
except Exception as e:
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("Failed to store tokens:", e)
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: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
@staticmethod
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
def load():
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: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
Restore user token from the file in homedir
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: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 "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):
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:
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
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:55:12 +03:00 (Migrated from github.com)
Review

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

Кажется, лишний print
user = User(token=SimpleNamespace(**json.load(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:55:12 +03:00 (Migrated from github.com)
Review

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

Кажется, лишний print
user.refresh()
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 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
except Exception as e:
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("Failed to restore tokens:", e)
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 None
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: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
# Storing lists - mostly for debug purposes
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
lists_ = make_debug_lists()
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: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
def fetchUserLists(self): def fetchUserLists(self):
return self.items """
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: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
Fetch existing user lists from the server
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
returns: fetched list of ToDoList sorted by creation datetime
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: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("Fetching lists...")
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 "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
return self.lists_
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
user_lists = self.lists_list()["results"]
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
user_items = self.todo_items_list()["results"]
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
todo_lists = {x["id"]: ToDoList(**x, user=self) for x in user_lists}
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
todo_items = [ToDoItem(**x, user=self) for x in user_items]
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
for todo_item in todo_items:
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
# Catching stray items
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 hasattr(toDoItem, "parent"):
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
# toDoItem.dispose()
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
# continue
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
todo_lists[todo_item.parent].items_.append(todo_item)
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
for todo_list in todo_lists.values():
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
todo_list.items_ = sorted(todo_list.items_, key=lambda x: x.created_at)
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
self.lists_ = sorted(todo_lists.values(), key=lambda x: x.created_at)
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 self.lists_
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
# ToDo
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
def removeUserList(self, id): def removeUserList(self, id):
self.items = [item for item in self.items if item.id != id] """
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: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
Remove existing user to-do list BY ID from the serverreturns:
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: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
to_remove = [item for item in self.lists_ if item.id == id][0]
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
self.lists_.remove(to_remove)
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 ("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
to_remove.dispose()
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 self.lists_
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
# ToDo
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
def appendUserList(self, title): def appendUserList(self, title):
item = ToDoList(id=None, title=title, created_at=datetime.now()) """
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: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
self.items.append(item) Create a new user list
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: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
item.sync() title: title of list to create
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: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 item returns: created item
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: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: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 "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
item = ToDoList(id=random.randint(100, 1000), title=title, created_at=datetime.now())
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
self.lists_.append(item)
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 item
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
created_list = self.lists_create(title=title)
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
created_list = ToDoList(**created_list)
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 created_list
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: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

View File

@@ -61,8 +61,9 @@ class ToDoItemWidget(tk.Frame):
class ToDoListWidget(tk.Frame): class ToDoListWidget(tk.Frame):
def __init__(self, *args, **argv): def __init__(self, *args, delete_list, **argv):
super().__init__(*args, **argv) super().__init__(*args, **argv)
self.delete_list = delete_list
def fill(self, itemList): def fill(self, itemList):
@@ -82,7 +83,7 @@ class ToDoListWidget(tk.Frame):
add = tk.Button(self, text="Добавить заметку", command=self.add_command) add = tk.Button(self, text="Добавить заметку", command=self.add_command)
add.pack(side="top") add.pack(side="top")
delete = tk.Button(self, text="Удалить лист", command=placeholder) delete = tk.Button(self, text="Удалить лист", command=self.delete_list)
delete.pack(side="top") delete.pack(side="top")
def update(self, itemList=None): def update(self, itemList=None):
@@ -106,6 +107,17 @@ class ToDoListWidget(tk.Frame):
class WorkSpaceFrame(tk.Frame): class WorkSpaceFrame(tk.Frame):
def delete_list(self, *args):
selection = self.listBox.curselection()
cur = selection[0]
self.user.removeUserList(self.lists[cur].id)
self.lists = self.user.fetchUserLists()
self.update_lists()
if len(self.lists) > 1:
self.listBox.selection_set(first=cur - 1)
elif len(self.lists) > 0:
self.listBox.selection_set(first=0)
def __init__(self, user, master=None, url=None) -> None: def __init__(self, user, master=None, url=None) -> None:
""" """
Функция инициаизации класса Функция инициаизации класса
@@ -118,15 +130,27 @@ class WorkSpaceFrame(tk.Frame):
self.pack(fill=tk.BOTH, expand=1) self.pack(fill=tk.BOTH, expand=1)
self.initLayout(user) self.initLayout(user)
def destroy(self):
tk.Tk.destroy(self)
if self.rbtn_var.get() > 0:
self.user.save()
else:
self.user.remove()
def initLayout(self, user): def initLayout(self, user):
# Запомнить пользователя
self.rbtn_var = tk.IntVar(value=1)
rbtn = tk.Checkbutton(self, text="Запомнить меня", variable=self.rbtn_var, command=None)
rbtn.pack(anchor="n")
# data # data
self.lists = user.fetchUserLists() self.lists = user.fetchUserLists()
text = tk.Text(self, width=15, height=1) self.add_list_text = tk.Text(self, width=15, height=1)
text.pack(anchor="sw") self.add_list_text.pack(anchor="sw")
add = tk.Button(self, text="Добавить лист", command=placeholder) add = tk.Button(self, text="Добавить лист", command=self.add_list)
add.pack(anchor="sw") add.pack(anchor="sw")
# select list box # select list box
@@ -142,22 +166,54 @@ class WorkSpaceFrame(tk.Frame):
# add scroll bar to list box # add scroll bar to list box
self.listBox.config(yscrollcommand=scrollbar.set) self.listBox.config(yscrollcommand=scrollbar.set)
# fill list box # init list view
self.update_lists()
# canvas for todo lists
canvas = tk.Canvas(self)
canvas.pack(side="left", fill="both", expand=1)
scrollbar = tk.Scrollbar(self, orient="vertical")
scrollbar.config(command=canvas.yview)
scrollbar.pack(side="left", fill="y")
canvas.configure(yscrollcommand=scrollbar.set)
# todo lists
self.toDoList = ToDoListWidget(self, delete_list=self.delete_list)
self.toDoList.grid_propagate(True)
# self.toDoList = ToDoListWidget(canvas)
self.toDoList.pack(side="left", fill="y")
canvas.bind("<Configure>", lambda *argv: canvas.configure(scrollregion=canvas.bbox("all")))
canvas.create_window((0, 0), window=self.toDoList, anchor="nw")
# select list!
if len(self.lists) > 0:
self.listBox.selection_set(first=0)
self.listBox_selected()
def update_lists(self):
self.listBox.delete(0, "end")
for item in self.lists: for item in self.lists:
s = f"{str(item)}: {item.created_at.strftime('%Y-%m-%d %H:%M:%S')}" s = f"{str(item)}: {item.created_at.strftime('%Y-%m-%d %H:%M:%S')}"
self.listBox.insert(tk.END, s) self.listBox.insert(tk.END, s)
self.listBox.pack() self.listBox.pack()
len(self.lists) > 0 and self.listBox.selection_set(first=0) return len(self.lists)
# todo lists def add_list(self, *args):
self.toToList = ToDoListWidget(self) text = self.add_list_text.get(1.0, "end").strip()
self.toToList.pack(side="left", fill="both", expand=1) if len(text) == 0:
print("empty name! Not adding!")
return
self.user.appendUserList(title=text)
self.lists = self.user.fetchUserLists()
# fill list box
self.update_lists()
len(self.lists) > 0 and self.listBox.selection_set(first=len(self.lists) - 1)
def listBox_selected(self, *args): def listBox_selected(self, *args):
self.toDoList.clear()
self.toToList.clear()
selection = self.listBox.curselection() selection = self.listBox.curselection()
cur = selection[0] cur = selection[0]
self.toToList.fill(self.lists[cur]) self.toDoList.fill(self.lists[cur])