Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Commit

Permalink
Simplify comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
lefcha committed Jul 19, 2016
1 parent c924381 commit 76b7561
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 98 deletions.
6 changes: 2 additions & 4 deletions todoist/managers/biz_invitations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class BizInvitationsManager(Manager):

def accept(self, invitation_id, invitation_secret):
"""
Appends a request to the queue, to accept a business invitation to
share a project.
Accepts a business invitation to share a project.
"""
cmd = {
'type': 'biz_accept_invitation',
Expand All @@ -24,8 +23,7 @@ def accept(self, invitation_id, invitation_secret):

def reject(self, invitation_id, invitation_secret):
"""
Appends a request to the queue, to reject a business invitation to
share a project.
Rejects a business invitation to share a project.
"""
cmd = {
'type': 'biz_reject_invitation',
Expand Down
12 changes: 4 additions & 8 deletions todoist/managers/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class FiltersManager(Manager, AllMixin, GetByIdMixin, SyncMixin):

def add(self, name, query, **kwargs):
"""
Creates a local filter object, and appends the equivalent request to
the queue.
Creates a local filter object.
"""
obj = models.Filter({'name': name, 'query': query}, self.api)
obj.temp_id = obj['id'] = self.api.generate_uuid()
Expand All @@ -28,8 +27,7 @@ def add(self, name, query, **kwargs):

def update(self, filter_id, **kwargs):
"""
Updates a filter remotely, by appending the equivalent request to the
queue.
Updates a filter remotely.
"""
args = {'id': filter_id}
args.update(kwargs)
Expand All @@ -42,8 +40,7 @@ def update(self, filter_id, **kwargs):

def delete(self, filter_id):
"""
Deletes a filter remotely, by appending the equivalent request to the
queue.
Deletes a filter remotely.
"""
cmd = {
'type': 'filter_delete',
Expand All @@ -56,8 +53,7 @@ def delete(self, filter_id):

def update_orders(self, id_order_mapping):
"""
Updates the orders of multiple filters remotely, by appending the
equivalent request to the queue.
Updates the orders of multiple filters remotely.
"""
cmd = {
'type': 'filter_update_orders',
Expand Down
9 changes: 3 additions & 6 deletions todoist/managers/invitations.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class InvitationsManager(Manager, SyncMixin):

def accept(self, invitation_id, invitation_secret):
"""
Appends a request to the queue, to accept an invitation to share a
project.
Accepts an invitation to share a project.
"""
cmd = {
'type': 'accept_invitation',
Expand All @@ -24,8 +23,7 @@ def accept(self, invitation_id, invitation_secret):

def reject(self, invitation_id, invitation_secret):
"""
Appends a request to the queue, to reject an invitation to share a
project.
Rejets an invitation to share a project.
"""
cmd = {
'type': 'reject_invitation',
Expand All @@ -39,8 +37,7 @@ def reject(self, invitation_id, invitation_secret):

def delete(self, invitation_id):
"""
Appends a request to the queue, to delete an invitation to share a
project.
Delete an invitation to share a project.
"""
cmd = {
'type': 'delete_invitation',
Expand Down
27 changes: 9 additions & 18 deletions todoist/managers/items.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class ItemsManager(Manager, AllMixin, GetByIdMixin, SyncMixin):

def add(self, content, project_id, **kwargs):
"""
Creates a local item object, by appending the equivalent request to the
queue.
Creates a local item object.
"""
obj = models.Item({'content': content, 'project_id': project_id},
self.api)
Expand All @@ -29,8 +28,7 @@ def add(self, content, project_id, **kwargs):

def update(self, item_id, **kwargs):
"""
Updates an item remotely, by appending the equivalent request to the
queue.
Updates an item remotely.
"""
args = {'id': item_id}
args.update(kwargs)
Expand All @@ -43,8 +41,7 @@ def update(self, item_id, **kwargs):

def delete(self, item_ids):
"""
Deletes items remotely, by appending the equivalent request to the
queue.
Deletes items remotely.
"""
cmd = {
'type': 'item_delete',
Expand All @@ -57,8 +54,7 @@ def delete(self, item_ids):

def move(self, project_items, to_project):
"""
Moves items to another project remotely, by appending the equivalent
request to the queue.
Moves items to another project remotely.
"""
cmd = {
'type': 'item_move',
Expand All @@ -85,8 +81,7 @@ def close(self, item_id):

def complete(self, item_ids, force_history=0):
"""
Marks items as completed remotely, by appending the equivalent request to the
queue.
Marks items as completed remotely.
"""
cmd = {
'type': 'item_complete',
Expand All @@ -100,8 +95,7 @@ def complete(self, item_ids, force_history=0):

def uncomplete(self, item_ids, update_item_orders=1, restore_state=None):
"""
Marks items as not completed remotely, by appending the equivalent request to the
queue.
Marks items as not completed remotely.
"""
args = {
'ids': item_ids,
Expand All @@ -119,8 +113,7 @@ def uncomplete(self, item_ids, update_item_orders=1, restore_state=None):
def update_date_complete(self, item_id, new_date_utc=None, date_string=None,
is_forward=None):
"""
Completes a recurring task remotely, by appending the equivalent
request to the queue.
Completes a recurring task remotely.
"""
args = {
'id': item_id,
Expand All @@ -140,8 +133,7 @@ def update_date_complete(self, item_id, new_date_utc=None, date_string=None,

def update_orders_indents(self, ids_to_orders_indents):
"""
Updates the order and indents of multiple items remotely, by appending
the equivalent request to the queue.
Updates the order and indents of multiple items remotely.
"""
cmd = {
'type': 'item_update_orders_indents',
Expand All @@ -154,8 +146,7 @@ def update_orders_indents(self, ids_to_orders_indents):

def update_day_orders(self, ids_to_orders):
"""
Updates in the local state the day orders of multiple items remotely,
by appending the equivalent request to the queue.
Updates in the local state the day orders of multiple items remotely.
"""
cmd = {
'type': 'item_update_day_orders',
Expand Down
12 changes: 4 additions & 8 deletions todoist/managers/labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class LabelsManager(Manager, AllMixin, GetByIdMixin, SyncMixin):

def add(self, name, **kwargs):
"""
Creates a local label object, and appends the equivalent request to the
queue.
Creates a local label object.
"""
obj = models.Label({'name': name}, self.api)
obj.temp_id = obj['id'] = self.api.generate_uuid()
Expand All @@ -28,8 +27,7 @@ def add(self, name, **kwargs):

def update(self, label_id, **kwargs):
"""
Updates a label remotely, by appending the equivalent request to the
queue.
Updates a label remotely.
"""
args = {'id': label_id}
args.update(kwargs)
Expand All @@ -42,8 +40,7 @@ def update(self, label_id, **kwargs):

def delete(self, label_id):
"""
Deletes a label remotely, by appending the equivalent request to the
queue.
Deletes a label remotely.
"""
cmd = {
'type': 'label_delete',
Expand All @@ -56,8 +53,7 @@ def delete(self, label_id):

def update_orders(self, id_order_mapping):
"""
Updates the orders of multiple labels remotely, by appending the
equivalent request to the queue.
Updates the orders of multiple labels remotely.
"""
cmd = {
'type': 'label_update_orders',
Expand Down
3 changes: 1 addition & 2 deletions todoist/managers/live_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class LiveNotificationsManager(Manager, GetByIdMixin, AllMixin, SyncMixin):

def set_last_read(self, id):
"""
Sets in the local state the last notification read, and appends the
equivalent request to the queue.
Sets in the local state the last notification read.
"""
cmd = {
'type': 'live_notifications_set_last_read',
Expand Down
12 changes: 4 additions & 8 deletions todoist/managers/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class GenericNotesManager(Manager, AllMixin, GetByIdMixin, SyncMixin):

def update(self, note_id, **kwargs):
"""
Updates an note remotely, by appending the equivalent request to the
queue.
Updates an note remotely.
"""
args = {'id': note_id}
args.update(kwargs)
Expand All @@ -23,8 +22,7 @@ def update(self, note_id, **kwargs):

def delete(self, note_id):
"""
Deletes an note remotely, by appending the equivalent request to the
queue.
Deletes an note remotely.
"""
cmd = {
'type': 'note_delete',
Expand All @@ -42,8 +40,7 @@ class NotesManager(GenericNotesManager):

def add(self, item_id, content, **kwargs):
"""
Creates a local item note object, and appends the equivalent request to
the queue.
Creates a local item note object.
"""
obj = models.Note({'item_id': item_id, 'content': content}, self.api)
obj.temp_id = obj['id'] = self.api.generate_uuid()
Expand All @@ -65,8 +62,7 @@ class ProjectNotesManager(GenericNotesManager):

def add(self, project_id, content, **kwargs):
"""
Creates a local project note object, and appends the equivalent request
to the queue.
Creates a local project note object.
"""
obj = models.ProjectNote({'project_id': project_id, 'content': content},
self.api)
Expand Down
18 changes: 6 additions & 12 deletions todoist/managers/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class ProjectsManager(Manager, AllMixin, GetByIdMixin, SyncMixin):

def add(self, name, **kwargs):
"""
Creates a local project object, and appends the equivalent request to
the queue.
Creates a local project object.
"""
obj = models.Project({'name': name}, self.api)
obj.temp_id = obj['id'] = '$' + self.api.generate_uuid()
Expand All @@ -28,8 +27,7 @@ def add(self, name, **kwargs):

def update(self, project_id, **kwargs):
"""
Updates a project remotely, by appending the equivalent request to the
queue.
Updates a project remotely.
"""
obj = self.get_by_id(project_id)
if obj:
Expand All @@ -46,8 +44,7 @@ def update(self, project_id, **kwargs):

def delete(self, project_ids):
"""
Deletes a project remotely, by appending the equivalent request to the
queue.
Deletes a project remotely.
"""
cmd = {
'type': 'project_delete',
Expand All @@ -60,8 +57,7 @@ def delete(self, project_ids):

def archive(self, project_id):
"""
Marks project as archived remotely, by appending the equivalent request
to the queue.
Marks project as archived remotely.
"""
cmd = {
'type': 'project_archive',
Expand All @@ -74,8 +70,7 @@ def archive(self, project_id):

def unarchive(self, project_id):
"""
Marks project as not archived remotely, by appending the equivalent
request to the queue.
Marks project as not archived remotely.
"""
cmd = {
'type': 'project_unarchive',
Expand All @@ -88,8 +83,7 @@ def unarchive(self, project_id):

def update_orders_indents(self, ids_to_orders_indents):
"""
Updates the orders and indents of multiple projects remotely, appending
the equivalent request to the queue.
Updates the orders and indents of multiple projects remotely.
"""
cmd = {
'type': 'project_update_orders_indents',
Expand Down
9 changes: 3 additions & 6 deletions todoist/managers/reminders.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ class RemindersManager(Manager, AllMixin, GetByIdMixin, SyncMixin):

def add(self, item_id, **kwargs):
"""
Creates a local reminder object, and appends the equivalent request
to the queue.
Creates a local reminder object.
"""
obj = models.Reminder({'item_id': item_id}, self.api)
obj.temp_id = obj['id'] = self.api.generate_uuid()
Expand All @@ -28,8 +27,7 @@ def add(self, item_id, **kwargs):

def update(self, reminder_id, **kwargs):
"""
Updates a reminder remotely, by appending the equivalent request to the
queue.
Updates a reminder remotely.
"""
args = {'id': reminder_id}
args.update(kwargs)
Expand All @@ -42,8 +40,7 @@ def update(self, reminder_id, **kwargs):

def delete(self, reminder_id):
"""
Deletes a reminder remotely, by appending the equivalent request to the
queue.
Deletes a reminder remotely.
"""
cmd = {
'type': 'reminder_delete',
Expand Down
4 changes: 2 additions & 2 deletions todoist/managers/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class UserManager(Manager):

def update(self, **kwargs):
"""
Updates the user data, by appending the equivalent request to the queue.
Updates the user data.
"""
cmd = {
'type': 'user_update',
Expand All @@ -17,7 +17,7 @@ def update(self, **kwargs):

def update_goals(self, **kwargs):
"""
Update the user's karma goals.
Updates the user's karma goals.
"""
cmd = {
'type': 'update_goals',
Expand Down

0 comments on commit 76b7561

Please sign in to comment.