Add tags column to sheetsync

New tags column shunts all columns after it right by 1.

Note we parse tags by splitting on commas then discarding whitespace.
If this would create an empty string tag, it is ignored.
Example: "foo, bar baz,a,,bc " -> ["foo", "bar baz", "a", "bc"]
pull/181/head
Mike Lang 4 years ago committed by Mike Lang
parent 68b75fa891
commit 29571fb60b

@ -91,6 +91,7 @@ class SheetSync(object):
'image_links': 6, 'image_links': 6,
'marked_for_edit': 7, 'marked_for_edit': 7,
'notes': 8, 'notes': 8,
'tags': 9,
'video_link': 11, 'video_link': 11,
'state': 12, 'state': 12,
'edit_link': 13, 'edit_link': 13,
@ -106,6 +107,7 @@ class SheetSync(object):
'event_end': self.parse_bustime, 'event_end': self.parse_bustime,
'poster_moment': lambda v: v == u'[\u2713]', # check mark 'poster_moment': lambda v: v == u'[\u2713]', # check mark
'image_links': lambda v: [link.strip() for link in v.split()] if v.strip() else [], 'image_links': lambda v: [link.strip() for link in v.split()] if v.strip() else [],
'tags': lambda v: [tag.strip() for tag in v.split(',') if tag.strip()],
'id': lambda v: uuid.UUID(v) if v.strip() else None, 'id': lambda v: uuid.UUID(v) if v.strip() else None,
} }
# List of input columns # List of input columns
@ -118,6 +120,7 @@ class SheetSync(object):
'poster_moment', 'poster_moment',
'image_links', 'image_links',
'notes', 'notes',
'tags',
] ]
# List of output columns # List of output columns
self.output_columns = [ self.output_columns = [

Loading…
Cancel
Save