MCPcopy
hub / github.com/charlierguo/gmail / parse_labels

Method parse_labels

gmail/message.py:124–129  ·  view source on GitHub ↗
(self, headers)

Source from the content-addressed store, hash-verified

122 # flags = re.search(r'FLAGS \(([^\)]*)\)', headers).groups(1)[0].split(' ')
123
124 def parse_labels(self, headers):
125 if re.search(r'X-GM-LABELS \(([^\)]+)\)', headers):
126 labels = re.search(r'X-GM-LABELS \(([^\)]+)\)', headers).groups(1)[0].split(' ')
127 return map(lambda l: l.replace('"', '').decode("string_escape"), labels)
128 else:
129 return list()
130
131 def parse_subject(self, encoded_subject):
132 dh = decode_header(encoded_subject)

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected