|
|
@ -193,8 +193,8 @@ class SheetsMiddleware():
|
|
|
|
edit_link = self.edit_url.format(row['id']) if row['marked_for_edit'] == '[+] Marked' else ''
|
|
|
|
edit_link = self.edit_url.format(row['id']) if row['marked_for_edit'] == '[+] Marked' else ''
|
|
|
|
if row['edit_link'] != edit_link:
|
|
|
|
if row['edit_link'] != edit_link:
|
|
|
|
logging.info("Updating sheet row {} with edit link {}".format(row['id'], edit_link))
|
|
|
|
logging.info("Updating sheet row {} with edit link {}".format(row['id'], edit_link))
|
|
|
|
self.write_value(worksheet, row, "edit_link", edit_link)
|
|
|
|
self.write_value(row, "edit_link", edit_link)
|
|
|
|
self.mark_modified(worksheet)
|
|
|
|
self.mark_modified(row)
|
|
|
|
|
|
|
|
|
|
|
|
yield row
|
|
|
|
yield row
|
|
|
|
|
|
|
|
|
|
|
@ -232,17 +232,17 @@ class SheetsMiddleware():
|
|
|
|
row_dict["sheet_name"] = worksheet
|
|
|
|
row_dict["sheet_name"] = worksheet
|
|
|
|
return row_dict
|
|
|
|
return row_dict
|
|
|
|
|
|
|
|
|
|
|
|
def write_value(self, worksheet, row, key, value):
|
|
|
|
def write_value(self, row, key, value):
|
|
|
|
"""Write key=value to the given row, as identified by worksheet + row dict."""
|
|
|
|
"""Write key=value to the given row, as identified by worksheet + row dict."""
|
|
|
|
return self.client.write_value(
|
|
|
|
return self.client.write_value(
|
|
|
|
self.sheet_id,
|
|
|
|
self.sheet_id,
|
|
|
|
worksheet,
|
|
|
|
row["sheet_name"],
|
|
|
|
row["index"],
|
|
|
|
row["index"],
|
|
|
|
self.column_map[key],
|
|
|
|
self.column_map[key],
|
|
|
|
value,
|
|
|
|
value,
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def mark_modified(self, worksheet):
|
|
|
|
def mark_modified(self, row):
|
|
|
|
"""Mark worksheet as having had a change made, bumping it to the top of
|
|
|
|
"""Mark row as having had a change made, bumping its worksheet to the top of
|
|
|
|
the most-recently-modified queue."""
|
|
|
|
the most-recently-modified queue."""
|
|
|
|
self.worksheets[worksheet] = monotonic()
|
|
|
|
self.worksheets[row["sheet_name"]] = monotonic()
|
|
|
|