Fix flake8

This commit is contained in:
RemiZOffAlex
2020-08-17 19:57:37 +03:00
parent a9736c09fe
commit ae5c629782
46 changed files with 229 additions and 336 deletions

View File

@@ -1,19 +1,18 @@
__author__ = 'RemiZOffAlex'
__email__ = 'remizoffalex@mail.ru'
__url__ = 'https://remizoffalex.ru'
from . import jsonrpc, login_required
from .. import app, lib, models
@jsonrpc.method('note')
def note_id(id: int)->dict:
def note_id(id: int) -> dict:
"""Заметка
"""
note = models.db_session.query(
models.Note
).filter(
models.Note.id==id
models.Note.id == id
).first()
if note is None:
raise ValueError
@@ -28,7 +27,7 @@ def note_id(id: int)->dict:
@jsonrpc.method('note.add')
@login_required
def note_add(title: str, body: str)->dict:
def note_add(title: str, body: str) -> dict:
"""Добавление новой заметки
"""
newNote = models.Note(
@@ -47,7 +46,7 @@ def note_add(title: str, body: str)->dict:
@jsonrpc.method('note.destroy')
@login_required
def note_destroy(id: int)->bool:
def note_destroy(id: int) -> bool:
"""Полное уничтожение заметки
Аргументы:
@@ -56,7 +55,7 @@ def note_destroy(id: int)->bool:
note = models.db_session.query(
models.Note
).filter(
models.Note.id==id
models.Note.id == id
).first()
if note is None:
raise ValueError
@@ -69,13 +68,13 @@ def note_destroy(id: int)->bool:
@jsonrpc.method('note.update')
@login_required
def note_update(id: int, title: str, body: str)->dict:
def note_update(id: int, title: str, body: str) -> dict:
"""Обновить заметку
"""
note = models.db_session.query(
models.Note
).filter(
models.Note.id==id
models.Note.id == id
).first()
if note is None:
raise ValueError
@@ -92,7 +91,7 @@ def note_update(id: int, title: str, body: str)->dict:
@jsonrpc.method('notes')
def notes_list(page: int)->list:
def notes_list(page: int) -> list:
"""Список заметок
"""
notes = models.db_session.query(
@@ -118,7 +117,7 @@ def notes_list(page: int)->list:
@jsonrpc.method('notes.count')
def notes_count()->int:
def notes_count() -> int:
"""Количество заметок
"""
result = models.db_session.query(