def getaddrspec(self):
aslist = []<EOL>self.gotonext()<EOL>while self.pos < len(self.field):<EOL><INDENT>if self.field[self.pos] == '<STR_LIT:.>':<EOL><INDENT>aslist.append('<STR_LIT:.>')<EOL>self.pos += <NUM_LIT:1><EOL><DEDENT>elif self.field[self.pos] == '<STR_LIT:">':<EOL><INDENT>aslist.append('<STR_LIT>' % self.getquote())<EOL><DEDENT>elif self.field[self.pos] in self.atomends:<EOL><INDENT>break<EOL><DEDENT>else: aslist.append(self.getatom())<EOL>self.gotonext()<EOL><DEDENT>if self.pos >= len(self.field) or self.field[self.pos] != '<STR_LIT:@>':<EOL><INDENT>return '<STR_LIT>'.join(aslist)<EOL><DEDENT>aslist.append('<STR_LIT:@>')<EOL>self.pos += <NUM_LIT:1><EOL>self.gotonext()<EOL>return '<STR_LIT>'.join(aslist) + self.getdomain()<EOL>
Parse an RFC 2822 addr-spec.