Skip to content

Commit 5e4db38

Browse files
committed
refac
1 parent 2414339 commit 5e4db38

4 files changed

Lines changed: 11 additions & 26 deletions

File tree

gdocs/docs_tools.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,7 +1678,5 @@ async def get_doc_as_markdown(
16781678
_comment_tools = create_comment_tools("document", "document_id")
16791679

16801680
# Extract and register the functions
1681-
read_doc_comments = _comment_tools["read_comments"]
1682-
create_doc_comment = _comment_tools["create_comment"]
1683-
reply_to_comment = _comment_tools["reply_to_comment"]
1684-
resolve_comment = _comment_tools["resolve_comment"]
1681+
list_document_comments = _comment_tools["list_comments"]
1682+
manage_document_comment = _comment_tools["manage_comment"]

gsheets/sheets_tools.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,7 +1247,5 @@ async def create_sheet(
12471247
_comment_tools = create_comment_tools("spreadsheet", "spreadsheet_id")
12481248

12491249
# Extract and register the functions
1250-
read_sheet_comments = _comment_tools["read_comments"]
1251-
create_sheet_comment = _comment_tools["create_comment"]
1252-
reply_to_sheet_comment = _comment_tools["reply_to_comment"]
1253-
resolve_sheet_comment = _comment_tools["resolve_comment"]
1250+
list_spreadsheet_comments = _comment_tools["list_comments"]
1251+
manage_spreadsheet_comment = _comment_tools["manage_comment"]

gslides/slides_tools.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -322,13 +322,9 @@ async def get_page_thumbnail(
322322

323323
# Create comment management tools for slides
324324
_comment_tools = create_comment_tools("presentation", "presentation_id")
325-
read_presentation_comments = _comment_tools["read_comments"]
326-
create_presentation_comment = _comment_tools["create_comment"]
327-
reply_to_presentation_comment = _comment_tools["reply_to_comment"]
328-
resolve_presentation_comment = _comment_tools["resolve_comment"]
325+
list_presentation_comments = _comment_tools["list_comments"]
326+
manage_presentation_comment = _comment_tools["manage_comment"]
329327

330328
# Aliases for backwards compatibility and intuitive naming
331-
read_slide_comments = read_presentation_comments
332-
create_slide_comment = create_presentation_comment
333-
reply_to_slide_comment = reply_to_presentation_comment
334-
resolve_slide_comment = resolve_presentation_comment
329+
list_slide_comments = list_presentation_comments
330+
manage_slide_comment = manage_presentation_comment

tests/gcontacts/test_contacts_tools.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -291,28 +291,21 @@ def test_import_contacts_tools(self):
291291
assert hasattr(contacts_tools, "list_contacts")
292292
assert hasattr(contacts_tools, "get_contact")
293293
assert hasattr(contacts_tools, "search_contacts")
294-
assert hasattr(contacts_tools, "create_contact")
295-
assert hasattr(contacts_tools, "update_contact")
296-
assert hasattr(contacts_tools, "delete_contact")
294+
assert hasattr(contacts_tools, "manage_contact")
297295

298296
def test_import_group_tools(self):
299297
"""Test that group tools can be imported."""
300298
from gcontacts import contacts_tools
301299

302300
assert hasattr(contacts_tools, "list_contact_groups")
303301
assert hasattr(contacts_tools, "get_contact_group")
304-
assert hasattr(contacts_tools, "create_contact_group")
305-
assert hasattr(contacts_tools, "update_contact_group")
306-
assert hasattr(contacts_tools, "delete_contact_group")
307-
assert hasattr(contacts_tools, "modify_contact_group_members")
302+
assert hasattr(contacts_tools, "manage_contact_group")
308303

309304
def test_import_batch_tools(self):
310305
"""Test that batch tools can be imported."""
311306
from gcontacts import contacts_tools
312307

313-
assert hasattr(contacts_tools, "batch_create_contacts")
314-
assert hasattr(contacts_tools, "batch_update_contacts")
315-
assert hasattr(contacts_tools, "batch_delete_contacts")
308+
assert hasattr(contacts_tools, "manage_contacts_batch")
316309

317310

318311
class TestConstants:

0 commit comments

Comments
 (0)