Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions python/quip.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,25 @@ def add_to_spreadsheet(self, thread_id, *rows, **kwargs):
section_id=section_id,
operation=operation)


def update_spreadsheet_headers(self, thread_id, *headers, **kwargs):
"""Updates the headers of the named (or first) spreadsheet in the
given document.
client = quip.QuipClient(...)
client.add_to_spreadsheet(thread_id, "Header1", "Header2", "Header3")
"""
content = "".join(["<td>%s</td>" % header for header in headers])
if kwargs.get("name"):
spreadsheet = self.get_named_spreadsheet(kwargs["name"], thread_id)
else:
spreadsheet = self.get_first_spreadsheet(thread_id)
section_id = self.get_first_row_item_id(spreadsheet)
return self.edit_document(
thread_id=thread_id,
content=content,
section_id=section_id,
operation=self.PREPEND)

def update_spreadsheet_row(self, thread_id, header, value, updates, **args):
"""Finds the row where the given header column is the given value, and
applies the given updates. Updates is a dict from header to
Expand Down