From 9bd1ddd35544a3772e490494459d788ed5da62a3 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 26 Sep 2009 12:43:40 -0400 Subject: [PATCH] Prefix cache attributes in be-handle-mail with underscore (_). To conform with Python convention for "hiding" class attributes only intended for internal use. --- interfaces/email/interactive/be-handle-mail | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/interfaces/email/interactive/be-handle-mail b/interfaces/email/interactive/be-handle-mail index bcb9519..bb2cc28 100755 --- a/interfaces/email/interactive/be-handle-mail +++ b/interfaces/email/interactive/be-handle-mail @@ -165,7 +165,7 @@ class ID (object): self.command = command def extract_id(self): if hasattr(self, "cached_id"): - return self.cached_id + return self._cached_id assert self.command.ret == 0, self.command.ret if self.command.command == u"new": regexp = re.compile(u"Created bug with ID (.*)") @@ -173,8 +173,8 @@ class ID (object): raise NotImplementedError, self.command.command match = regexp.match(self.command.stdout) assert len(match.groups()) == 1, str(match.groups()) - self.cached_id = match.group(1) - return self.cached_id + self._cached_id = match.group(1) + return self._cached_id def __str__(self): if self.command.ret != 0: return "" % repr(self.command) @@ -359,9 +359,9 @@ class Message (object): (name, email) tuple. """ if not hasattr(self, "author_tuple_cache"): - self.author_tuple_cache = \ + self._author_tuple_cache = \ send_pgp_mime.source_email(self.msg, return_realname=True) - return self.author_tuple_cache + return self._author_tuple_cache def author_addr(self): return email.utils.formataddr(self.author_tuple()) def author_name(self): -- 2.26.2